/paper-to-code
Convert an ML research paper into a complete, runnable code repository. 3-stage pipeline from Paper2Code — Planning (UML + dependency graph) → Analysis (per-file logic) → Coding (dependency-ordered generation). Use for reproducing paper methods.
$ npx -y skills add lingzhi227/agent-research-skills --skill paper-to-code --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/paper-to-code
Context preview
The summary Claude sees to decide when to auto-load this skill.
Convert an ML research paper into a complete, runnable code repository. 3-stage pipeline from Paper2Code — Planning (UML + dependency graph) → Analysis (per-file logic) → Coding (dependency-ordered generation). Use for reproducing paper methods.
SKILL.md
paper-to-code.SKILL.mdname: paper-to-code
description: Convert an ML research paper into a complete, runnable code repository. 3-stage pipeline from Paper2Code — Planning (UML + dependency graph) → Analysis (per-file logic) → Coding (dependency-ordered generation). Use for reproducing paper methods.
argument-hint: [paper-pdf-or-text]
Paper to Code
Convert a research paper into a complete, runnable code repository.
Input
- `$0` — Paper PDF path, paper text, or paper URL
References
- Paper2Code prompts (planning, analysis, coding stages): `~/.claude/skills/paper-to-code/references/paper-to-code-prompts.md`
Workflow (from Paper2Code)
Stage 1: Planning
Four-turn conversation to create a comprehensive plan:
1. **Overall Plan**: Extract methodology, experiments, datasets, hyperparameters, evaluation metrics 2. **Architecture Design**: Generate file list, Mermaid classDiagram, sequenceDiagram 3. **Task Breakdown**: Logic analysis per file, dependency-ordered task list, required packages 4. **Configuration**: Extract training details into `config.yaml`
Stage 2: Analysis
For each file in the task list (dependency order): 1. Conduct detailed logic analysis 2. Map paper methodology to code structure 3. Reference the config.yaml for all settings 4. Follow the UML class diagram interfaces strictly
Stage 3: Coding
For each file in dependency order: 1. Generate code with access to all previously generated files 2. Follow the design's data structures and interfaces exactly 3. Reference config.yaml — never fabricate configuration values 4. Write complete code — no TODOs or placeholders
Stage 4: Debugging (if needed)
If execution fails: 1. Collect error messages 2. Identify root cause using SEARCH/REPLACE diff format 3. Apply minimal fixes preserving original intent 4. Re-run until successful
Output Structure
reproduced_code/
├── config.yaml # Training configuration
├── main.py # Entry point
├── model.py # Model architecture
├── dataset_loader.py # Data loading
├── trainer.py # Training loop
├── evaluation.py # Metrics and evaluation
├── reproduce.sh # Run script
└── requirements.txt # Dependencies
Key Constraints
- **Dependency order**: Each file is generated with access to all previously generated files
- **Interface contracts**: Mermaid diagrams serve as rigid interface definitions across all stages
- **No fabrication**: Only use configurations explicitly stated in the paper
- **Complete code**: Every function must be fully implemented
Rules
- Follow the paper's methodology exactly — do not invent improvements
- Generate code in dependency order (data loading → model → training → evaluation → main)
- Use config.yaml for all hyperparameters and settings
- Every class/method in UML diagram must exist in code
- Generate a reproduce.sh script for one-command execution
- If paper details are ambiguous, note them explicitly
Related Skills
- Upstream: [literature-search](../literature-search/)
- Downstream: [experiment-code](../experiment-code/)
- See also: [code-debugging](../code-debugging/), [algorithm-design](../algorithm-design/)
Read more
name: paper-to-code description: Convert an ML research paper into a complete, runnable code repository. 3-stage pipeline from Paper2Code — Planning (UML + dependency graph) → Analysis (per-file logic) → Coding (dependency-ordered generation). Use for reproducing paper methods. argument-hint: [paper-pdf-or-text]
Paper to Code
Convert a research paper into a complete, runnable code repository.
Input
- `$0` — Paper PDF path, paper text, or paper URL
References
- Paper2Code prompts (planning, analysis, coding stages): `~/.claude/skills/paper-to-code/references/paper-to-code-prompts.md`
Workflow (from Paper2Code)
Stage 1: Planning
Four-turn conversation to create a comprehensive plan:
1. **Overall Plan**: Extract methodology, experiments, datasets, hyperparameters, evaluation metrics 2. **Architecture Design**: Generate file list, Mermaid classDiagram, sequenceDiagram 3. **Task Breakdown**: Logic analysis per file, dependency-ordered task list, required packages 4. **Configuration**: Extract training details into `config.yaml`
Stage 2: Analysis
For each file in the task list (dependency order): 1. Conduct detailed logic analysis 2. Map paper methodology to code structure 3. Reference the config.yaml for all settings 4. Follow the UML class diagram interfaces strictly
Stage 3: Coding
For each file in dependency order: 1. Generate code with access to all previously generated files 2. Follow the design's data structures and interfaces exactly 3. Reference config.yaml — never fabricate configuration values 4. Write complete code — no TODOs or placeholders
Stage 4: Debugging (if needed)
If execution fails: 1. Collect error messages 2. Identify root cause using SEARCH/REPLACE diff format 3. Apply minimal fixes preserving original intent 4. Re-run until successful
Output Structure
reproduced_code/ ├── config.yaml # Training configuration ├── main.py # Entry point ├── model.py # Model architecture ├── dataset_loader.py # Data loading ├── trainer.py # Training loop ├── evaluation.py # Metrics and evaluation ├── reproduce.sh # Run script └── requirements.txt # Dependencies
Key Constraints
- **Dependency order**: Each file is generated with access to all previously generated files
- **Interface contracts**: Mermaid diagrams serve as rigid interface definitions across all stages
- **No fabrication**: Only use configurations explicitly stated in the paper
- **Complete code**: Every function must be fully implemented
Rules
- Follow the paper's methodology exactly — do not invent improvements
- Generate code in dependency order (data loading → model → training → evaluation → main)
- Use config.yaml for all hyperparameters and settings
- Every class/method in UML diagram must exist in code
- Generate a reproduce.sh script for one-command execution
- If paper details are ambiguous, note them explicitly
Related Skills
- Upstream: [literature-search](../literature-search/)
- Downstream: [experiment-code](../experiment-code/)
- See also: [code-debugging](../code-debugging/), [algorithm-design](../algorithm-design/)
31 skills for Claude Code covering the full academic research paper lifecycle — from literature search to slide generation — plus GitHub repository analysis for research topics. Extracted from 17 GitHub repos studying LLM-agent-driven research automation.
Other skills on agent-research-skills.
- /algorithm-design
Design algorithms with LaTeX pseudocode and UML diagrams. Generate algorithmic environments, Mermaid class/sequence diagrams, and ensure consistency between pseudocode and implementation. Use when formalizing methods for a paper.
Open skill - /atomic-decomposition
Decompose research ideas into atomic, self-contained concepts with bidirectional math-code mapping. For each concept, extract the math formula from papers and find code implementations. Use for complex system papers requiring formal grounding.
Open skill - /backward-traceability
Make every number in the final PDF traceable to the exact code line that produced it. Uses \hypertarget/\hyperlink LaTeX commands and \num{formula} evaluated at compile time. Use for reproducibility and data integrity verification.
Open skill - /citation-management
Manage BibTeX citations for LaTeX papers. Harvest missing citations from a draft using Semantic Scholar, validate cite keys against .bib files, deduplicate entries, and format bibliography. Use when working with references, BibTeX, or citations.
Open skill - /code-debugging
Debug experiment code with structured error analysis. Categorize errors, apply targeted fixes with retry logic, and use reflection to prevent recurring issues. Use when experiment code fails or produces incorrect results.
Open skill - /data-analysis
Generate statistical analysis code with 4-round review. Select appropriate statistical tests, interpret results, and produce analysis reports with p-values, effect sizes, and confidence intervals. Use when analyzing experimental data for a paper.
Open skill

