use-research
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]".
When & Why to Use This Skill
This Claude skill bridges the gap between theoretical research and technical implementation by analyzing internal documentation to guide feature development, bug fixes, and architectural decisions. It streamlines research-driven development by indexing local research papers and design docs to provide actionable implementation patterns and ensure code consistency with project specifications.
Use Cases
- Implementing complex algorithms: Automatically retrieve and apply specific algorithmic patterns (e.g., type inference or evaluation rules) from internal research documents to guide new feature development.
- Architectural alignment: Ensure new code follows established design principles by mapping theoretical concepts from research docs to the actual codebase structure (e.g., mapping 'Producer/Consumer' concepts to specific IR files).
- Technical context retrieval: Quickly find and summarize the 'why' behind existing implementations when fixing bugs or exploring techniques, using the project's historical research as a guide.
| 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/*.mdQuick 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>.mdExtract 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.leanProvide 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