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. Draft a LaTeX paper from PAPER_PLAN — write each section from wiki sources + generate figures/tables + BibTeX verification + de-AI polish

How to use this skill

Skill file

/paper-draft

Draft a complete LaTeX paper from the PAPER_PLAN.md generated by /paper-plan.

Write section by section: each section draws material from wiki claims/experiments/papers/concepts,

generates LaTeX + figures + tables. BibTeX is fetched from DBLP/CrossRef (following citation-verification).

Apply de-AI polish after completion (following academic-writing).

Optional per-section Review LLM review. Output a compilable paper/ directory.

Inputs

Outputs

Wiki Interaction

Reads

Writes

Graph edges created

Workflow

Precondition: confirm the working directory is the wiki project root (the directory containing wiki/, raw/, tools/).

Step 1: Initialize Paper Directory

  1. Read PAPER_PLAN.md; extract venue, title, section list
  2. If paper/ directory already exists:
  1. Create directory structure:

```

paper/

├── main.tex

├── math_commands.tex

├── references.bib

├── sections/

└── figures/

```

  1. Copy venue template from templates/ if it exists:
  1. Generate math_commands.tex:
  1. Generate main.tex skeleton:

```latex

\documentclass{article} % replace with venue template

\input{math_commands}

% packages

\usepackage{booktabs,graphicx,amsmath,hyperref}

\title{<title>}

\author{} % leave empty for anonymous submission

\begin{document}

\maketitle

\begin{abstract}

% generated in Step 3

\end{abstract}

\input{sections/introduction}

\input{sections/related_work}

\input{sections/method}

\input{sections/experiments}

\input{sections/conclusion}

\bibliography{references}

\bibliographystyle{plain} % replace with venue-required style

% \input{sections/appendix} % uncomment if needed

\end{document}

```

Step 2: Generate Figures and Tables

For each entry in the Figure Plan from PAPER_PLAN:

  1. Diagram type (architecture diagrams, etc.):
  1. Plot type (experimental result charts):

```bash

python3 paper/figures/plot_{name}.py

```

  1. Table type:

Step 3: Write Sections

For each section (in the outline order from PAPER_PLAN); if --sections is specified, write only those sections:

3a. Collect Material

From the section definition in PAPER_PLAN, extract:

Read the relevant portions of all related wiki pages:

3b. Write LaTeX

Following shared-references/academic-writing.md:

3c. De-AI Polish

Apply de-AI polish to each written section (per academic-writing.md):

  1. Scan and replace AI-signature vocabulary (delve, leverage, utilize, comprehensive...)
  2. Remove excessive hedging
  3. Vary sentence openings (avoid consecutive identical sentence structures)
  4. Remove filler sentences (sentences that add no information)
  5. Ensure active voice predominates
  6. Check notation consistency

3d. Optional Review LLM Review (--review)

If --review is enabled, for each 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?

Revise the section based on Review LLM feedback (inline edits; do not rewrite the entire section).

Step 4: Build Bibliography

Following shared-references/citation-verification.md:

  1. Collect all \cite{key} citations used across sections
  2. For each citation, retrieve BibTeX from the PAPER_PLAN's citation plan:
  1. Exclude unused entries (do not use \nocite{*})
  2. Validate BibTeX format correctness (each entry has title, author, year)
  3. Output bibliography statistics:

```

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

```

Step 5: Full-Paper Cross-Review

After all sections are complete:

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)?

Make final adjustments based on Review LLM feedback.

Step 6: Finalize Output

  1. Confirm all files are written to the paper/ directory
  2. Verify basic integrity:
  1. Append log:

```bash

python3 tools/research_wiki.py log wiki/ \

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

```

  1. Print to terminal:

```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.