Find relevant research and guide implementation based on it. Use when implementing features, fixing bugs, or exploring techniques where existing research in docs/research/ may provide guidance. Trigger phrases include "apply research", "use research", "based on the research", "implement from paper", or "find relevant research for [task]".
Installation
Details
Usage
After installing, this skill will be available to your AI coding assistant.
Verify installation:
npx agent-skills-cli listSkill Instructions
name: use-research description: Find relevant research and guide implementation based on it. Use when implementing features, fixing bugs, or exploring techniques where existing research in docs/research/ may provide guidance. Trigger phrases include "apply research", "use research", "based on the research", "implement from paper", or "find relevant research for [task]".
Use Research Knowledge
Apply knowledge from research documents in docs/research/ to guide implementation of current tasks.
Workflow
Phase 1: Discovery
Find research documents relevant to the current task.
-
List available research
Glob: docs/research/*.md -
Quick scan each document by reading the title (first H1) and overview/abstract section to build an index of available research:
Document Topic type-inference.mdHM type inference, Algorithm W/J/M, unification grokking-the-sequent-calculus.mdλμμΜ-calculus, producers/consumers, IR design malgo.md,anma.mdRelated language implementations thesis_2024.mdProject background and design decisions etc. -
Match to current task by identifying keywords:
- Type system tasks β
type-inference.md,ziku-type-inference-design.md - IR/evaluation tasks β
grokking-the-sequent-calculus.md - Parser/syntax tasks β
arrow-syntax-alternatives.md - Testing tasks β
golden-test.md,lake-test.md
- Type system tasks β
-
If no relevant research exists:
- Inform user no prior research was found for this task
- Ask if they want to proceed without research or run
/researchfirst - If proceeding, consider creating research doc post-implementation
Phase 2: Analysis
Deep-read the relevant research document(s).
-
Read the full document
Read: docs/research/<relevant-doc>.md -
Extract key sections:
- Key Contributions / Features - What this research provides
- Implementation Details - Code patterns, algorithms, data structures
- Core Concepts - Definitions and terminology
- Examples - Code snippets showing usage
-
Identify applicable patterns:
- Translation rules (e.g., Surface β IR mappings)
- Evaluation rules (e.g., ΞΌ/ΞΌΜ-reduction)
- Type rules (e.g., inference algorithms)
- Design patterns (e.g., data/codata duality)
Phase 3: Application
Apply research patterns to the current task.
-
Map concepts to codebase:
Research Concept β Ziku Implementation ββββββββββββββββββββββββββββββββββββββ Producer β Ziku/IR/Syntax.lean (Producer type) Consumer β Ziku/IR/Syntax.lean (Consumer type) ΞΌ-reduction β Ziku/IR/Eval.lean (eval function) Translation β¦ββ§ β Ziku/Translate.lean Type inference β Ziku/Infer.lean -
Provide implementation guidance:
- Reference specific research sections for context
- Show how patterns translate to Lean 4 code
- Note any adaptations needed for Ziku's design
-
Cite sources when referencing research:
- Link to specific sections in research docs
- Quote relevant rules or definitions
Example Usage
Task: "Implement let-polymorphism"
Discovery: Match "polymorphism" β type-inference.md
Analysis: From docs/research/type-inference.md:
- Section "Let-Polymorphism" explains the restriction
- Section "Key Operations" covers
gen()andinst() - Code pattern:
W(Ξ, let x = eβ in eβ) = let (Sβ, Οβ) = W(Ξ, eβ) Ο = gen(Sβ(Ξ), Οβ) (Sβ, Οβ) = W(Sβ(Ξ)[xβ¦Ο], eβ) in (Sβ β Sβ, Οβ)
Application: Apply to Ziku/Infer.lean:
- Implement
generalizefunction - Add
Schemetype for polymorphic types - Update
inferforlet_case
Task: "Add label/goto control flow"
Discovery: Match "label", "goto", "control" β grokking-the-sequent-calculus.md
Analysis: From docs/research/grokking-the-sequent-calculus.md:
- Section "Translation from Fun to Core" shows:
β¦label Ξ± {t}β§ = ΞΌΞ±.β¨β¦tβ§ | Ξ±β© β¦goto(t; Ξ±)β§ = ΞΌΞ².β¨β¦tβ§ | Ξ±β© (Ξ² fresh) - Section "Key Insights" explains let/label duality
Application: Apply to Ziku/Translate.lean:
- Add
labelcase usingProducer.mu - Add
gotocase with fresh continuation
Tips
- Research documents contain both theory and implementation details
- The "Implementation" or "Implementation in Ziku" sections are most directly applicable
- Cross-reference multiple research docs when tasks span areas
- The "Sources" section in each doc links to original papers for deeper understanding
- If implementation diverges from research, note why and consider updating the research doc
More by takoeight0821
View allSearch for Lean 4 and Mathlib theorems, lemmas, and definitions by type signature, name, or subexpression pattern. Use when the user asks to find a theorem, look up a Lean definition, search for lemmas, or needs help discovering Mathlib functions.
Surface β IR translation rules and IR reduction semantics for Ziku's λμμΜ-calculus based intermediate representation. Use when implementing translation, IR evaluation, or understanding the core semantics.
This skill should be used when the user asks to "refactor", "extract function", "rename", "improve code quality", "reduce duplication", or "remove code smell". Supports Lean 4 and general refactoring patterns.
This skill should be used when the user asks to "create a commit", "commit changes", "write a commit message", "make a commit", needs help with "conventional commits", or wants to understand commit message format and best practices.
