Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
prathamlearnstocode avatar

Paper2code

  • 643 installs
  • 1.5k repo stars
  • Updated April 3, 2026
  • prathamlearnstocode/paper2code

paper2code is an agent skill that systematically converts research papers into traceable, accurate code implementations for developers who must reproduce ML or systems research without silent guessing.

About

paper2code is an agent skill from prathamlearnstocode/paper2code that walks developers through turning academic papers into code with explicit provenance. When a detail appears in the paper, the skill cites the section; when it is partial, a partial-specification protocol applies; when absent, the workflow checks official GitHub code or surfaces ambiguity instead of guessing silently. The guardrail file encodes a decision tree for vague hyperparameter tables and inconsistent notation common in page-limited publications. Developers reach for paper2code when implementing novel architectures, reproducing benchmark numbers, or auditing whether an agent-generated port matches the source paper.

  • Decision tree for resolving ambiguity in academic papers
  • Partial specification protocol with concrete examples like "We use Adam"
  • Official code, well-known reimplementations, and standard field choices prioritized
  • Produces explicit citations, REPRODUCTION_NOTES.md, and detailed docstrings for every unspecified element
  • Prevents hallucinated implementations by enforcing [FROM_OFFICIAL_CODE], [UNSPECIFIED], and stub protocols

Paper2code by the numbers

  • 643 all-time installs (skills.sh)
  • +7 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #1,503 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/prathamlearnstocode/paper2code --skill paper2code

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs643
repo stars1.5k
Security audit2 / 3 scanners passed
Last updatedApril 3, 2026
Repositoryprathamlearnstocode/paper2code

How do you implement a research paper without guessing?

Systematically convert research papers into accurate, traceable code implementations without silent guessing.

Who is it for?

ML and systems engineers reproducing published methods who need auditable paper-to-code translation with explicit uncertainty handling.

Skip if: Developers who only need a high-level paper summary or literature review without producing runnable implementation code.

When should I use this skill?

A user asks to implement, reproduce, or port a research paper and wants citations instead of silent assumptions.

What you get

Traceable source code with section citations, documented ambiguity resolutions, and a gap log for unspecified hyperparameters or architecture details.

  • Section-cited implementation code
  • Ambiguity and gap resolution log
  • Hyperparameter provenance notes

Files

SKILL.mdMarkdownGitHub ↗

paper2code — Orchestration

You are executing the paper2code skill. This file governs the high-level flow. Each stage dispatches to a detailed reasoning protocol in pipeline/. Do NOT skip stages. Do NOT combine stages. Execute them in order.

Parse arguments

Extract from the user's input:

  • ARXIV_ID: the arxiv paper ID (e.g., 2106.09685). Strip any URL prefix.
  • MODE: one of minimal (default), full, educational.
  • FRAMEWORK: one of pytorch (default), jax, numpy.

If the user provided a full URL like https://arxiv.org/abs/2106.09685, extract the ID 2106.09685. If the user provided a versioned ID like 2106.09685v2, keep the version.

Set up working directory

Create a temporary working directory: .paper2code_work/{ARXIV_ID}/ This is where intermediate artifacts go. The final output goes in the current directory under {paper_slug}/.

Install dependencies

Run via Bash:

pip install pymupdf4llm pdfplumber requests pyyaml

Execute pipeline

Stage 1 — Paper Acquisition and Parsing

Read and follow: pipeline/01_paper_acquisition.md

Run the helper script to fetch and parse the paper:

python skills/paper2code/scripts/fetch_paper.py {ARXIV_ID} .paper2code_work/{ARXIV_ID}/

Then run structure extraction:

python skills/paper2code/scripts/extract_structure.py .paper2code_work/{ARXIV_ID}/paper_text.md .paper2code_work/{ARXIV_ID}/

Verify the outputs exist before proceeding. If extraction failed, follow the fallback protocol in pipeline/01_paper_acquisition.md.

The script also searches for official code repositories (in the paper text and on the arxiv page) and saves any found links to paper_metadata.json under the official_code key. Verify these links before relying on them — see Step 8 in pipeline/01_paper_acquisition.md.

Stage 2 — Contribution Identification

Read and follow: pipeline/02_contribution_identification.md

Read the parsed paper sections. Identify the single core contribution. Classify the paper type. Write the contribution statement. Save it to .paper2code_work/{ARXIV_ID}/contribution.md.

Stage 3 — Ambiguity Audit

Read and follow: pipeline/03_ambiguity_audit.md

Before reading this stage, also read: guardrails/hallucination_prevention.md

Go through every implementation-relevant detail. Classify each as SPECIFIED, PARTIALLY_SPECIFIED, or UNSPECIFIED. Save the audit to .paper2code_work/{ARXIV_ID}/ambiguity_audit.md.

Stage 4 — Code Generation

Read and follow: pipeline/04_code_generation.md

Before writing code, read:

  • guardrails/scope_enforcement.md — to determine what's in and out of scope
  • guardrails/badly_written_papers.md — if the paper is vague or inconsistent
  • The relevant knowledge files in knowledge/ for the paper's domain
  • The scaffold templates in scaffolds/ for the expected file structure

Determine the paper_slug from the paper title (lowercase, underscores, no special chars). Generate all files under {paper_slug}/ in the current working directory.

Stage 5 — Walkthrough Notebook

Read and follow: pipeline/05_walkthrough_notebook.md

Generate the walkthrough notebook that connects paper sections to code with runnable sanity checks. Save to {paper_slug}/notebooks/walkthrough.ipynb.

Cleanup

Remove the .paper2code_work/ directory after successful completion.

Final output

Print a summary:

✓ paper2code complete for: {paper_title}
  Output directory: {paper_slug}/
  Files generated: {list of files}
  Unspecified choices: {count} (see REPRODUCTION_NOTES.md)
  Mode: {MODE} | Framework: {FRAMEWORK}

Mode-specific behavior

  • minimal (default): Core contribution only. Training loop only if contribution involves training. No data pipeline beyond Dataset skeleton.
  • full: Core contribution + full training loop + data pipeline + evaluation pipeline. More code, same citation rigor.
  • educational: Same as minimal but with extra inline comments explaining ML concepts, expanded walkthrough notebook with theory sections, and a PAPER_GUIDE.md that walks through the paper section by section.

Guardrails — always active

These apply at ALL stages. Read them if you haven't already:

  • guardrails/hallucination_prevention.md — the most important file in this skill
  • guardrails/scope_enforcement.md — what to implement and what to skip
  • guardrails/badly_written_papers.md — what to do when the paper is unclear

Knowledge base — consult as needed

Before implementing any of these components, read the corresponding knowledge file:

  • Transformer layers, attention, positional encoding → knowledge/transformer_components.md
  • Optimizers, LR schedules, batch size semantics → knowledge/training_recipes.md
  • Cross-entropy, contrastive loss, diffusion loss, ELBO → knowledge/loss_functions.md
  • Framework-specific pitfalls, notation mismatches → knowledge/paper_to_code_mistakes.md

Related skills

How it compares

Pick paper2code when implementation traceability and ambiguity protocols matter more than a quick undocumented prototype.

FAQ

What does paper2code do when a paper omits hyperparameters?

paper2code follows a decision tree: use explicit values with section citations, apply the partial-specification protocol for incomplete tables, or check official GitHub code. The skill never guesses silently when the text alone is insufficient.

Why use paper2code instead of asking an LLM to write the code?

paper2code enforces traceability—each implementation choice links to a paper section or documented ambiguity resolution. That audit trail matters when reproducing benchmarks or reviewing agent-generated ports.

When is paper2code the right skill to invoke?

paper2code fits when converting PDF research into runnable ML or systems code and reviewers need provenance. Invoke it for reproduction tasks, not for summarizing literature without code deliverables.

Is Paper2code safe to install?

skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

AI & Agent Buildingresearchautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.