content/skills/research-learning-knowledge/paper2code/SKILL.md
Citation-anchored paper-to-code workflow for turning research papers into a minimal, honest Python implementation. Use this whenever the user wants to implement a paper from an arXiv ID, arXiv URL, local PDF, OpenReview forum page, or OpenReview PDF URL. Trigger even when the user says things like “implement this paper”, “复现这篇”, or “把这篇论文写成代码” without naming the source type explicitly. Reject DOI-only requests and unsupported landing pages instead of pretending the paper can be fetched.
npx skillsauth add bahayonghang/my-claude-code-settings paper2codeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Repo-native successor to the arXiv-only reference workflow. Keep the original paper2code discipline:
Accept exactly these inputs:
.pdfReject these explicitly:
If the user already has a paper PDF locally, prefer the local PDF path over network retrieval.
Extract:
PAPER_SOURCE — the paper input supplied by the userMODE — minimal (default), full, or educationalFRAMEWORK — pytorch (default), jax, or numpyNormalize the source into one of these internal source kinds:
arxiv_idarxiv_urllocal_pdfopenreview_pageopenreview_pdfIf the source is unsupported, fail fast with a clear reason. Do not silently fall back to unrelated fetch logic.
This workflow depends on the bundled Python scripts and their parser packages. Before running the pipeline:
scripts/, pipeline/, guardrails/,
knowledge/, and scaffolds/ existIf dependencies are missing, report the missing packages and the install command needed. Do not silently install new dependencies unless the user explicitly asked for environment setup.
Suggested command when setup is approved:
python -m pip install pymupdf4llm pdfplumber pymupdf requests pyyaml
Run the acquisition script first so it can determine the PAPER_KEY. Use a
temporary directory of the form:
.paper2code_work/{PAPER_KEY}/
All intermediate artifacts live there. The final generated project goes in the
current directory under {paper_slug}/.
Read and follow: pipeline/01_paper_acquisition.md
Run:
python "$SKILL_DIR/scripts/fetch_paper.py" "$PAPER_SOURCE" ".paper2code_work"
The script should:
.paper2code_work/{PAPER_KEY}/paper_text.md, paper_metadata.json, and paper.pdf when a PDF
exists locallyThen run structure extraction:
python "$SKILL_DIR/scripts/extract_structure.py" \
".paper2code_work/{PAPER_KEY}/paper_text.md" \
".paper2code_work/{PAPER_KEY}"
Stop here if acquisition artifacts are missing. Do not continue into codegen with partial paper text unless the pipeline document explicitly allows it.
Read and follow: pipeline/02_contribution_identification.md
Write:
.paper2code_work/{PAPER_KEY}/contribution.md
The output must isolate the single core contribution that will define scope.
Read and follow: pipeline/03_ambiguity_audit.md
Before that stage, also read:
guardrails/hallucination_prevention.mdWrite:
.paper2code_work/{PAPER_KEY}/ambiguity_audit.md
If the ambiguity audit says a detail is unspecified, preserve that uncertainty. Do not "fill the gap" with a confident guess.
Read and follow: pipeline/04_code_generation.md
Before writing code, also read:
guardrails/scope_enforcement.mdguardrails/badly_written_papers.mdknowledge/scaffolds/Generate the project under {paper_slug}/ in the current working directory.
Read and follow: pipeline/05_walkthrough_notebook.md
Generate:
{paper_slug}/notebooks/walkthrough.ipynb
minimal
full
educational
minimal, but add extra teaching comments and a richer
walkthrough notebookRemove .paper2code_work/ only after successful completion. If the workflow
fails midstream, keep the work directory so the user can inspect artifacts.
Print:
✓ paper2code complete for: {paper_title}
Source kind: {source_kind}
Output directory: {paper_slug}/
Files generated: {list of files}
Unspecified choices: {count} (see REPRODUCTION_NOTES.md)
Mode: {MODE} | Framework: {FRAMEWORK}
If the run stopped early, replace the success marker with a failure summary that names the exact failing stage and the artifact or dependency that blocked it.
Always apply:
guardrails/hallucination_prevention.mdguardrails/scope_enforcement.mdguardrails/badly_written_papers.mdConsult the relevant knowledge files before implementing:
knowledge/transformer_components.mdknowledge/training_recipes.mdknowledge/loss_functions.mdknowledge/paper_to_code_mistakes.mdtools
文献深度解读助手,像研究生导师一样交互式解读 Zotero 库中的学术论文,面向计算机科学、深度学习、自动化等方向(个人向)。当用户提供文献题目、DOI、PDF 或要求解读某篇论文时触发,通过 Zotero MCP 优先获取全文,并根据用户意图自动选择快速筛选、导师深读或研究复盘模式。完整深读时先完成叙事类型判断、阅读前预检、novelty 校准和作者思考路径重建,再整体概览,并基于图例、正文和表格逐图详细解读(Zotero MCP 无法提取 PDF 图片,解读基于文字信息,必要时提醒上传图片)。适用于:(1)快速判断文献是否值得深读 (2)深入理解某篇论文 (3)学习文章中的方法和技术 (4)批判性分析研究设计 (5)寻找研究灵感。需要多篇论文综合、对比或找研究空白,或 arXiv/DOI 批量规范化时,改用 paper-workbench。
development
Review Codex, Claude, OpenAI, or other agent skill directories as reusable capability packages. Use when asked to audit, review, improve, score, rewrite, debrand, package, or document a SKILL.md, skill package, marketplace skill, or agent skill directory, especially when the user wants a comprehensive findings-first report with concrete patch recommendations and validation steps.
development
Turn vague or complex Codex tasks into strong `/goal` commands with outcome, verification, constraints, boundaries, iteration policy, completion evidence, and pause/block conditions. Use when the user asks for Codex goal instructions, Goal 指令, 目标指令, `/goal` prompts, 中文 Goal 模板, plan-to-goal interviews, success criteria, verification commands, or bounded agent work definitions.
tools
Write, debug, and validate ast-grep structural code search rules. Use this skill when the user needs syntax-aware code search, AST pattern matching, structural refactor discovery, language-construct queries, or searches that plain text tools like rg can miss, such as finding functions with particular descendants, calls inside specific contexts, missing error handling, React hook shapes, decorators, or other Tree-sitter-backed code structures.