# paper-to-code

Turns an ML research paper into a runnable code repository. Useful when reproducing published experiments and models without manual scaffolding.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1600 installs · ★ 433
- Author: lingzhi227
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/lingzhi227/agent-research-skills/tree/HEAD/skills/paper-to-code/SKILL.md
- Updated: 2026-02-27
- HTML: https://affpapa.org/en/nevibecode/skills/paper-to-code

## What it does

The skill implements the Paper2Code pipeline to reconstruct ML projects through planning, per-file analysis, and dependency-ordered coding. During the planning turn, the agent extracts methodology and training details into `config.yaml`, then sets up Mermaid diagrams. These diagrams act as strict interface contracts across every subsequent step.

Generation follows a strict order, starting with `dataset_loader.py` and proceeding to `model.py`, `trainer.py`, `evaluation.py`, and `main.py`. It produces a complete implementation with zero placeholders or fabricated hyperparameter values. If execution fails, an iterative debugging step applies SEARCH/REPLACE diffs until the code runs cleanly.

It requires a PDF path, raw paper text, or URL as input. Any ambiguity in the published methodology is flagged explicitly instead of being masked by improvised code fixes.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add lingzhi227/agent-research-skills --skill paper-to-code -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/paper-to-code/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/paper-to-code/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add lingzhi227/agent-research-skills --skill paper-to-code -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/paper-to-code/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add lingzhi227/agent-research-skills --skill paper-to-code -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/paper-to-code/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install lingzhi227/agent-research-skills paper-to-code
```

2. **Manually: put the files in place**
- File: `.github/skills/paper-to-code/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add lingzhi227/agent-research-skills --skill paper-to-code -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/lingzhi227/agent-research-skills --path skills/paper-to-code
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/paper-to-code/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add lingzhi227/agent-research-skills --skill paper-to-code -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/lingzhi227/agent-research-skills/tree/HEAD/skills/paper-to-code/SKILL.md

## When to use it
- extract architecture and hyperparameters from an ML paper
- generate class and sequence diagrams from research text
- build a complete runnable repository in dependency order
- fix runtime errors using minimal diff replacements

## Example prompts
- Reproduce the methodology from paper.pdf into a runnable project
- Extract the model architecture and training configuration from paper.txt
- Generate reproduced code and a reproduce.sh script from the research paper

## Similar
- [research-paper-writing](https://affpapa.org/en/nevibecode/skills/orchestra-research-research-paper-writing.md) — skill · 493 installs
- [implement-paper](https://affpapa.org/en/nevibecode/skills/implement-paper.md) — skill · 2700 installs
- [huggingface-paper-publisher](https://affpapa.org/en/nevibecode/skills/huggingface-paper-publisher.md) — skill · 1700 installs
- [daily-paper-generator](https://affpapa.org/en/nevibecode/skills/daily-paper-generator.md) — skill · 410 installs
- [shap](https://affpapa.org/en/nevibecode/skills/shap.md) — skill · 2000 installs
- [pytorch-lightning](https://affpapa.org/en/nevibecode/skills/k-dense-ai-pytorch-lightning.md) — skill · 2000 installs

From the same set: [lingzhi227/agent-research-skills](https://affpapa.org/en/nevibecode/by/lingzhi227/agent-research-skills.md) — 30 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
