PluginBench
Skill
Review
Audit score 70

paper-to-code

lingzhi227/agent-research-skills

Convert ML research papers into complete, runnable code repositories via structured planning, analysis, and generation.

What is paper-to-code?

Automates reproduction of machine learning research by converting papers into executable code through a 3-stage pipeline: Planning (architecture & dependencies), Analysis (per-file logic mapping), and Coding (dependency-ordered generation). Use this when you need to implement a paper's methodology as working code.

  • Extracts methodology, experiments, datasets, hyperparameters, and metrics from research papers
  • Generates UML class diagrams and dependency graphs to define code architecture
  • Creates dependency-ordered task lists and configuration files (config.yaml)
  • Produces complete, runnable code files with no placeholders or TODOs
  • Generates reproduce.sh scripts for one-command execution
  • Includes debugging stage to fix execution errors while preserving original design intent

How to install paper-to-code

npx skills add https://github.com/lingzhi227/agent-research-skills --skill paper-to-code
Claude Code
Cursor
Windsurf
Cline

How to use paper-to-code

  1. 1.Provide the paper as a PDF path, text content, or URL to the skill
  2. 2.Review the generated Overall Plan and Architecture Design in Stage 1
  3. 3.Confirm the file list, UML diagrams, and dependency order
  4. 4.Allow Stage 2 to analyze logic per file and map paper methodology to code structure
  5. 5.Let Stage 3 generate code files in dependency order (data loading → model → training → evaluation → main)
  6. 6.Run the generated reproduce.sh script to execute the implementation
  7. 7.If errors occur, the skill will apply minimal fixes in Stage 4 and re-run

Use cases

Good for
  • Reproducing novel ML architectures described in academic papers
  • Converting theoretical paper methods into production-ready code
  • Automating boilerplate generation for paper implementations
  • Creating baseline implementations for research comparisons
  • Extracting and organizing hyperparameters from papers into config files
Who it's for
  • ML researchers implementing published methods
  • PhD students reproducing papers for validation
  • Engineers building on academic work
  • Teams standardizing paper-to-code workflows

paper-to-code FAQ

What paper formats does this accept?

PDF files, plain text content, or URLs pointing to papers.

Does it generate perfect code on the first try?

It generates complete, dependency-ordered code following the paper's methodology. A debugging stage handles execution errors if needed.

Can I modify the generated code?

Yes, the skill generates a full repository you can edit. The config.yaml centralizes hyperparameters for easy adjustment.

What if the paper is ambiguous about implementation details?

The skill notes ambiguities explicitly and makes conservative choices based on the paper's stated methodology rather than inventing improvements.

How does it handle dependencies between files?

It generates files in strict dependency order (data loading first, then model, training, evaluation, main) so each file can reference previously generated ones.

Full instructions (SKILL.md)

Source of truth, from lingzhi227/agent-research-skills.


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
  • Downstream: experiment-code
  • See also: code-debugging, algorithm-design