Paper draft

From Chanw-research/claude-code-paper-writing · View interactive version

Paper draft is an AI agent skill from the GitHub repository Chanw-research/claude-code-paper-writing. 从 PAPER_PLAN 起草 LaTeX 论文:逐 section 从 wiki 取材撰写 + 生成 figures/tables + BibTeX 验证 + de-AI polish

How to use this skill

Skill file

/paper-draft

从 /paper-plan 生成的 PAPER_PLAN.md 起草完整 LaTeX 论文。

逐 section 撰写:每个 section 从 wiki 读取 claims/experiments/papers/concepts 取材,

生成 LaTeX + figures + tables。BibTeX 从 DBLP/CrossRef 获取(遵循 citation-verification),

完成后执行 de-AI polish(遵循 academic-writing)。

可选逐 section Review LLM review。输出可编译的 paper/ 目录。

Inputs

Outputs

Wiki Interaction

Reads

Writes

Graph edges created

Workflow

前置:确认工作目录为 wiki 项目根(包含 wiki/、raw/、tools/ 的目录)。

Step 1: 初始化 Paper 目录

  1. 读取 PAPER_PLAN.md,提取 venue、title、section 列表
  2. 若 paper/ 目录已存在:
  1. 创建目录结构:

```

paper/

├── main.tex

├── math_commands.tex

├── references.bib

├── sections/

└── figures/

```

  1. 从 templates/ 复制 venue 模板(若存在):
  1. 生成 math_commands.tex:
  1. 生成 main.tex 骨架:

```latex

\documentclass{article} % 替换为 venue template

\input{math_commands}

% packages

\usepackage{booktabs,graphicx,amsmath,hyperref}

\title{<title>}

\author{} % 匿名提交时留空

\begin{document}

\maketitle

\begin{abstract}

% Step 3 生成

\end{abstract}

\input{sections/introduction}

\input{sections/related_work}

\input{sections/method}

\input{sections/experiments}

\input{sections/conclusion}

\bibliography{references}

\bibliographystyle{plain} % 替换为 venue 要求的 style

% \input{sections/appendix} % 取消注释如需要

\end{document}

```

Step 2: 生成 Figures 和 Tables

对 PAPER_PLAN 中 Figure Plan 的每个条目:

  1. Diagram 类型(架构图等):
  1. Plot 类型(实验结果图):

```bash

python3 paper/figures/plot_{name}.py

```

  1. Table 类型:

Step 3: 逐 Section 撰写

对每个 section(按 PAPER_PLAN 的大纲顺序),若 --sections 指定则只写指定 section:

3a. 收集素材

从 PAPER_PLAN 的 section 定义中提取:

读取所有相关 wiki 页面的对应 section:

3b. 撰写 LaTeX

遵循 shared-references/academic-writing.md:

3c. De-AI Polish

对每个撰写的 section 执行 de-AI polish(参照 academic-writing.md):

  1. 扫描并替换 AI 特征词汇(delve, leverage, utilize, comprehensive...)
  2. 移除 excessive hedging
  3. 变化 sentence openings(避免连续相同句式)
  4. 移除 filler sentences(不增加信息的句子)
  5. 确保 active voice 为主
  6. 检查 notation consistency

3d. 可选 Review LLM Review(--review)

若启用 --review,对每个 section:

mcp__llm-review__chat:
  system: "You are a senior ML researcher reviewing one section of a paper draft.
           Focus on: clarity, logical flow, claim-evidence alignment, notation consistency.
           Point out any remaining AI-sounding language patterns.
           Suggest specific rewrites for unclear passages."
  message: |
    ## Section: {section name}
    {LaTeX content}

    ## Claims this section should support
    {claims from matrix}

    ## Review this section for:
    1. Does it clearly support its target claims?
    2. Is the writing clear and precise?
    3. Any AI-generated language patterns remaining?
    4. Is the notation consistent with other sections?
    5. Missing content that reviewers will expect?

根据 Review LLM 反馈修改 section(行内修改,不重写整个 section)。

Step 4: 构建 Bibliography

遵循 shared-references/citation-verification.md:

  1. 收集所有 section 中使用的 \cite{key} 引用
  2. 对每个引用,从 PAPER_PLAN 的 citation plan 获取 BibTeX:
  1. 排除未引用的条目(不使用 \nocite{*})
  2. 验证 BibTeX 格式正确性(每条有 title, author, year)
  3. 输出 bibliography 统计:

```

references.bib: {N} entries, {M} verified, {K} [UNCONFIRMED]

```

Step 5: 全文 Cross-Review

完成所有 section 后:

mcp__llm-review__chat:
  system: "You are a senior ML researcher performing a final review of a complete paper draft.
           Focus on: cross-section coherence, claim-evidence thread (does the paper prove what it claims?),
           narrative flow, notation consistency across sections, figure/table referencing.
           This is NOT a line-by-line review — focus on structural and argumentative issues."
  message: |
    ## Full Paper Draft
    {concatenated LaTeX of all sections}

    ## Evidence Map
    {from PAPER_PLAN}

    ## Review Focus
    1. Does the paper tell a coherent story from Introduction to Conclusion?
    2. Are all claims from the matrix adequately supported in the text?
    3. Is there notation inconsistency between sections?
    4. Are all figures/tables referenced and discussed?
    5. Any redundancy between sections?
    6. Overall readiness for submission (1-10)?

根据 Review LLM 反馈做最终调整。

Step 6: 完成输出

  1. 确认所有文件已写入 paper/ 目录
  2. 验证基本完整性:
  1. 追加日志:

```bash

python3 tools/research_wiki.py log wiki/ \

"paper-draft | drafted {venue} paper '{title}' | {N} sections, {M} figures, {K} citations ({V} verified)"

```

  1. 输出到终端:

```markdown

# Paper Write Complete

## Files

## Status

## Next Steps

```

Constraints

Error Handling

Dependencies

Tools(via Bash)

MCP Servers

Claude Code Native

Shared References

Called by

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.