
use-research
by takoeight0821
SKILL.md
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
Score
Total Score
Based on repository quality metrics
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
Reviews
Reviews coming soon