agentic-paper2code
AGENTS.md0 starsChanged 2 months agoApache-2.0View on GitHub
A pipeline for reproducing a research paper as a working code repository. It is written for coding agents: there is no orchestration code, no API keys and no service to run. Every stage is a Markdown instruction file that you, the agent, read and execute using the tools you already have. If you are an agent reading this file because it is in the user's project, this is your operating manual for any request of the form "reproduce this paper",…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- docs/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- paper2codeSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
15 rules. About 0 are common, 7 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 8
If you are an agent reading this file because it is in the user's project, this is your operating manual for any request of the form …
- Very specific: line 26
Read prompts/shared/rules.md — the reproduction contract — and prompts/shared/workspace.md.
- Very specific: line 31
Never invent a number. Every value is annotated with where it came from, or explicitly marked UNSPECIFIED.
- Distinctive: line 33
No stubs, no placeholders, no fake computations.
- Very specific: line 34
Write state to STATE.md after every step, so the work survives a lost context window.
- Very specific: line 39
Run them in order. Each reads the artifacts of the previous ones and writes its own into .p2c/<slug>/.
- Distinctive: line 55
Do not skip stages, and do not merge them.
- Very specific: line 61
Read STATE.md in the workspace, if one exists, to find where you are.
- Distinctive: line 62
Read the stage prompt in full.
- Distinctive: line 63
Read the artifacts the stage declares under Reads.
- Distinctive: line 64
Do the work. Write the artifacts it declares under Writes.
- Very specific: line 65
Update STATE.md, including the Next action line.
- Very specific: line 77
After stage 4 (config): If a large share of the hyperparameters are UNSPECIFIED, the user should decide whether to continue, look for the …
- Distinctive: line 89
Never parallelise stage 6.
- Very specific: line 94
Read .p2c/<slug>/STATE.md, read the artifacts of the completed stages, and execute the stage named under Next action.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
agentic-paper2code
A pipeline for reproducing a research paper as a working code repository. It is written for coding agents: there is no orchestration code, no API keys and no service to run. Every stage is a Markdown instruction file that you, the agent, read and execute using the tools you already have.
If you are an agent reading this file because it is in the user's project, this is your operating manual for any request of the form "reproduce this paper", "implement this arXiv paper", or "turn this PDF into code".
Finding the toolkit
Stage prompts live in a prompts/ directory. Resolve its location in this
order and use the first that exists:
${CLAUDE_PLUGIN_ROOT}/prompts/— installed as a Claude Code plugin..p2c/toolkit/prompts/— installed into this project byinstall.sh.prompts/at the repository root — you are working inside this repository.~/.paper2code/prompts/— installed globally.
Everything below refers to files under that directory.
Before anything else
Read prompts/shared/rules.md — the reproduction contract — and
prompts/shared/workspace.md. The contract governs every stage and overrides
any stage instruction it contradicts. The most important rules:
- Implement the paper as written, not as you would improve it.
- Never invent a number. Every value is annotated with where it came from, or
explicitly marked
UNSPECIFIED. - No stubs, no placeholders, no fake computations.
- Write state to
STATE.mdafter every step, so the work survives a lost context window.
The stages
Run them in order. Each reads the artifacts of the previous ones and writes its
own into .p2c/<slug>/.
| # | Stage | Prompt | Produces |
| 0 | Ingest | prompts/00-ingest.md | paper/paper.md, paper/meta.json |
| 1 | Plan | prompts/01-plan.md | plan.md |
| 2 | Design | prompts/02-design.md | design.md |
| 3 | Tasks | prompts/03-tasks.md | tasks.md |
| 4 | Config | prompts/04-config.md | config.yaml, configs/smoke.yaml |
| 5 | Analyze | prompts/05-analyze.md | analysis/<file>.md |
| 6 | Implement | prompts/06-implement.md | the repository |
| 7 | Verify | prompts/07-verify.md | verify.md, a repository that runs |
| 8 | Review | prompts/08-review.md | review.md |
| 9 | Package | prompts/09-package.md | README, REPRODUCTION.md |
Do not skip stages, and do not merge them. Stage 5 exists as a separate step because reasoning about an algorithm while also managing syntax is how subtle errors get in; stage 7 exists because code that has never run is a hypothesis.
Running a stage
- Read
STATE.mdin the workspace, if one exists, to find where you are. - Read the stage prompt in full.
- Read the artifacts the stage declares under Reads.
- Do the work. Write the artifacts it declares under Writes.
- Update
STATE.md, including the Next action line. - Report to the user what you found — especially anything the paper leaves ambiguous.
Between stages, check in with the user if a decision would change the shape of the result: which experiment to target, whether a dataset is worth downloading, whether a full training run is in scope.
Checkpoints worth pausing at
- After stage 1 (plan). The reproduction targets decide what the rest of the work is aimed at. Getting them wrong wastes everything downstream.
- After stage 4 (config). If a large share of the hyperparameters are
UNSPECIFIED, the user should decide whether to continue, look for the authors' code, or narrow the scope. - After stage 7 (verify). The user learns here whether the implementation actually runs and learns.
Parallelism
Stage 5 analyses files independently and parallelises safely — dispatch one subagent per file if you have them. Stage 6 is strictly sequential: each file is written against code that already exists and has been checked.
Never parallelise stage 6. Two agents writing interdependent files at once produce a repository whose parts individually look right and do not fit.
Resuming
Read .p2c/<slug>/STATE.md, read the artifacts of the completed stages, and
execute the stage named under Next action. A fresh agent with no history
should be able to do this. If an artifact contradicts STATE.md, trust the
artifact and fix the state file.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

