Skip to main content

paper-writing

Workflow 3: Full paper writing pipeline that goes from a narrative report to a polished, submission-ready PDF. Use when user says "写论文全流程", "write paper pipeline", "从报告到PDF", "paper writing", or wants the complete paper generation workflow.

v1.0.0New

Unsigned, install at your own risk

Unverified

This skill has no cryptographic signature attached. We can't verify the contents match what the publisher intended.

Install this skill

No account required. Pick your tool, or use the command that detects it for you.

Run in your terminal. It detects your AI tool.

npx @skills-hub-ai/cli install auto-research-skills-codex-paper-writing
Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/auto-research-skills-codex-paper-writing/SKILL.md

Setup guide →
0Save

Instructions

Workflow 3: Paper Writing Pipeline

Before each reviewer slot, follow Selectable Reviewers:
resolve invocation → .aris/reviewer.json → Codex default (fresh native reviewer)
with reviewer_route.py through the canonical helper resolver, preserving this
slot's tier, fresh contexts, source/image inputs and deterministic gates.
Codex examples/pins below apply only to backend=codex; other routes use their
own first-call/reply contract. Save the route and actual returned identity;
unavailable selections are REVIEW_UNAVAILABLE. Classify acceptance from actual
families/completion/scope. Forward invocation reviewer/model/effort overrides
to reviewer-bearing children. Writer selection is separate; follow the
writing-worker guidance below when drafting or revising prose.

Review assurance: same-family semantic audits remain provisional. The
pipeline may finish with Submission-ready: provisional when its mandatory
audits pass provisionally. Use yes only when the deterministic assurance
verifier confirms accepted coverage, including completed positive reviews
with known different model families where semantic review is required.

Orchestrate a complete paper writing workflow for: $ARGUMENTS

Overview

This skill chains five sub-skills into a single automated pipeline:

/paper-plan → /paper-figure → /paper-write → /paper-compile → /auto-paper-improvement-loop
  (outline)     (plots)        (LaTeX)        (build PDF)       (review & polish ×2)

Each phase builds on the previous one's output. The final deliverable is a polished, reviewed paper/ directory with LaTeX source and compiled PDF.

In this hybrid pack, the pipeline itself is unchanged, but paper-plan and paper-write use Orchestra-adapted shared references for stronger story framing and prose guidance.

Constants

Writer choice is independent of reviewer routing. Accept user/project preferences in natural language or — writer: antigravity, writer-model: gemini-4-argon-high, writer-effort: high; follow ../shared-references/writing-principles.md for configured-worker use and executor fallback. Carry these writer options and any active writer session to /paper-write and the fix-implementation phase of /auto-paper-improvement-loop, separately from reviewer/model/effort overrides. Apply its Launch Mindset from planning through final revision.

  • VENUE = ICLR — Target venue. Options: ICLR, NeurIPS, ICML, CVPR, ACL, AAAI, ACM, IEEE_JOURNAL (IEEE Transactions / Letters), IEEE_CONF (IEEE conferences). Affects style file, page limit, citation format.
  • MAX_IMPROVEMENT_ROUNDS = 2 — Number of review→fix→recompile rounds in the improvement loop.
  • REVIEWER_MODEL = gpt-6-astra — Model used via Codex MCP for plan review, figure review, writing review, and improvement loop.
  • AUTO_PROCEED = true — Auto-continue between phases. Set false to pause and wait for user approval after each phase.
  • HUMAN_CHECKPOINT = false — When true, the improvement loop (Phase 5) pauses after each round's review to let you see the score and provide custom modification instructions. When false (default), the loop runs fully autonomously. Passed through to /auto-paper-improvement-loop.
  • ILLUSTRATION = figurespec — Architecture/illustration generator for Phase 2b: figurespec (default, deterministic JSON→SVG via /figure-spec, best for architecture/workflow/topology), gemini (AI-generated via /paper-illustration, best for qualitative method illustrations; needs GEMINI_API_KEY), mermaid (Mermaid syntax via /mermaid-diagram, free, best for flowcharts), or false (skip Phase 2b, manual only).

Override inline: /paper-writing "NARRATIVE_REPORT.md" — venue: NeurIPS, illustration: gemini, human checkpoint: true
IEEE example: /paper-writing "NARRATIVE_REPORT.md" — venue: IEEE_JOURNAL

Inputs

This pipeline accepts one of:

  1. NARRATIVE_REPORT.md (best) — structured research narrative with claims, experiments, results, figures
  2. Research direction + experiment results — the skill will help draft the narrative first
  3. Existing PAPER_PLAN.md — skip Phase 1, start from Phase 1.5 (the contract negotiation still runs; only resuming a genuine pre-1.5 legacy run may skip it, and then Phase 6.0's row 0 records "no contract")

The more detailed the input (especially figure descriptions and quantitative results), the better the output.

Pipeline

Phase 0: Assurance Setup

Resolve the active assurance level and persist it so Phase 6's external
verifier reads the same value. Run once at pipeline start, before Phase 1.

Resolution order (first match wins):

  1. Explicit — assurance: draft | submission in $ARGUMENTS
  2. Derived from — effort:
    • lite / balanced → draft (default, zero change from current behavior)
    • max / beast → submission
  3. Default: draft

Action:

mkdir -p paper/.aris
echo "<resolved-level>" > paper/.aris/assurance.txt   # draft or submission

What each level does downstream:

  • draft — Existing behavior. Audits run only when their content detector
    matches (Phase 4.5 / 4.7 / 5.5 / 5.8). Missing artifacts are non-blocking.
    Silent-skip allowed.
  • submission — The four mandatory audits (proof-checker,
    paper-claim-audit, citation-audit, kill-argument) are treated as load-bearing gates. Each
    sub-audit must emit its JSON artifact (PASS / WARN / FAIL / NOT_APPLICABLE /
    BLOCKED / ERROR) — never silent-skip. Phase 6 runs
    verify_paper_audits.sh (canonical name; resolved per
    shared-references/integration-contract.md §2); a non-zero exit blocks the Final Report.

Escape hatch: a user wanting the old "beast = depth-only, no audit gate"
can pass — effort: beast, assurance: draft explicitly. Legal but
discouraged for actual submissions. See
shared-references/assurance-contract.md for the full contract.

Announce the resolved level in-line before Phase 1:

📋 Assurance: <level> (derived from effort: <effort>)
   <either "current behavior, no audit gate" OR "mandatory audits gated by verify_paper_audits.sh (resolved per integration-contract §2)">

Phase 1: Paper Plan

Invoke /paper-plan to create the structural outline:

/paper-plan "$ARGUMENTS"

What this does:

  • Parse NARRATIVE_REPORT.md for claims, evidence, and figure descriptions
  • Build a Claims-Evidence Matrix — every claim maps to evidence, every experiment supports a claim
  • Design section structure (5-8 sections depending on paper type)
  • Plan figure/table placement with data sources
  • Scaffold citation structure
  • GPT-6-Astra reviews the plan for completeness

Output: PAPER_PLAN.md with section plan, figure plan, citation scaffolding.

Checkpoint: Present the plan summary to the user.

📐 Paper plan complete:
- Title: [proposed title]
- Sections: [N] ([list])
- Figures: [N] auto-generated + [M] manual
- Target: [VENUE], [PAGE_LIMIT] pages

Shall I proceed with figure generation?
  • User approves (or AUTO_PROCEED=true) → proceed to Phase 1.5.
  • User requests changes → adjust plan and re-present.

Phase 1.5: Negotiated Acceptance Contract (before any writing)

The plan says what the paper will contain; the CONTRACT says what "done" means
— a checklist of testable assertions, negotiated ADVERSARIALLY before the first
section is written, and graded at the end. (The plan is the boundary; the
contract is what gets graded.)

  1. Executor proposes. From PAPER_PLAN.md + NARRATIVE_REPORT.md, draft
    PAPER_ACCEPTANCE_CONTRACT.md: 10–20 testable assertions — every
    headline claim has a named evidence source; every abstract number traces to
    a results file; scope qualifiers the title/abstract must carry; figures
    that must exist and what each must show; section-level completeness; venue
    constraints. Each assertion must be CHECKABLE by reading the final PDF +
    results files — no vibes ("writing is clear" is not an assertion; "every
    acronym is defined at first use" is). Fewer than ~10 rubber-stamps; beyond
    ~20 stalls on trivia.

  2. Reviewer pushes back. Spawn a FRESH reviewer agent (xhigh reasoning)
    pointed at PAPER_PLAN.md, PAPER_ACCEPTANCE_CONTRACT.md, and the evidence
    inventory (NARRATIVE_REPORT.md + results paths). Its brief: push back on
    the contract, not the plan — (a) untestable/vibes assertions → demand a
    checkable rewrite; (b) missing assertions (uncovered claims, untraced
    numbers, foreseeable overclaims with no scope assertion); (c) assertions
    the evidence cannot possibly satisfy — flag now, not after writing. It must
    end with exactly one line: CONTRACT_ACCEPTED: yes or
    CONTRACT_ACCEPTED: no plus numbered revision demands. A reply with a
    missing or malformed verdict line is treated as no; request a corrected
    verdict as a follow-up — the correction exchange does not consume a round.
    Include the scope-limits block from
    review-scope-limits.md in the
    brief.

  3. Iterate. On no, revise per the demands and resubmit as a follow-up in
    the SAME reviewer thread (the negotiation is one conversation). Max 3
    rounds.

  4. Fallback — never stall the pipeline. Round 3 still no → record the
    unresolved demands verbatim in a "## Disputed" section and mark
    status: contested. A contested contract is precisely the "insert a human
    when the CONTRACT is wrong" trigger, so it OVERRIDES AUTO_PROCEED for this
    one decision: pause and present the dispute for a human tie-break. If no
    human responds (unattended run), proceed — but a contested contract caps the
    outcome: Phase 6 gates on the UNDISPUTED assertions and the Final Report
    must set Submission-ready: no with the dispute reproduced verbatim; the
    tie-break happens when the human returns.

Output: PAPER_ACCEPTANCE_CONTRACT.md (status: accepted | contested,
round count, reviewer thread/agent id). FROZEN once accepted — Phases 2–5
implement against it, never edit it; a genuinely-wrong assertion is a contract
question for a checkpoint, not a silent rewrite.

Boundary: the claim audit (Phases 4.7 / 5.5) stays zero-context — the
contract is a WRITER-side gate, never passed to the claim auditor (two
different nets by design).

Phase 2: Figure Generation

Invoke /paper-figure to generate data-driven plots and tables:

/paper-figure "PAPER_PLAN.md"

What this does:

  • Read figure plan from PAPER_PLAN.md
  • Generate matplotlib/seaborn plots from JSON/CSV data
  • Generate LaTeX comparison tables
  • Create figures/latex_includes.tex for easy insertion
  • GPT-6-Astra reviews figure quality and captions

Output: figures/ directory with PDFs, generation scripts, and LaTeX snippets.

Scope: paper-figure covers data plots and comparison tables. Architecture diagrams, pipeline figures, and method illustrations are handled in Phase 2b below.

Phase 2b: Architecture & Illustration Generation

Skip this step entirely if illustration: false.

If the paper plan includes architecture diagrams, pipeline figures, audit cascades, or method illustrations, invoke the appropriate generator based on the illustration parameter:

When illustration: figurespec (default) — invoke /figure-spec:

/figure-spec "[architecture/workflow description from PAPER_PLAN.md]"
  • Deterministic JSON → SVG vector rendering (editable, reproducible)
  • Best for: system architecture, workflow pipelines, audit cascades, layered topology
  • Output: figures/*.svg + figures/*.pdf (via rsvg-convert) + figures/specs/*.json
  • No external API, runs fully local

When illustration: gemini — invoke /paper-illustration:

/paper-illustration "[method description from PAPER_PLAN.md or NARRATIVE_REPORT.md]"
  • Claude plans → Gemini optimizes → Nano Banana Pro renders → Claude reviews (score ≥ 9)
  • Best for: qualitative method illustrations, natural-style diagrams, result grids
  • Output: figures/ai_generated/*.png
  • Requires GEMINI_API_KEY environment variable

When illustration: mermaid — invoke /mermaid-diagram:

/mermaid-diagram "[method description from PAPER_PLAN.md]"
  • Generates Mermaid syntax diagrams (flowchart, sequence, class, state, etc.)
  • Best for: lightweight flowcharts, state machines, simple sequence diagrams
  • Output: figures/*.mmd + figures/*.png
  • Free, no API key needed

When illustration: false — skip entirely. All non-data figures must be created manually (draw.io, Figma, TikZ) and placed in figures/ before Phase 3.

Choosing the right mode:

  • Formal architecture / workflow / topology figures → figurespec (default)
  • Method concept illustrations with natural style → gemini
  • Quick flowchart / state machine → mermaid
  • Full manual control → false

These are complementary, not mutually exclusive: you can run multiple generators for different figures in the same paper by re-invoking with different illustration overrides.

Checkpoint: List generated vs manual figures.

📊 Figures complete:
- Data plots (auto, Phase 2): [list]
- Architecture/illustrations (auto, Phase 2b, mode=<illustration>): [list]
- Manual (need your input): [list]
- LaTeX snippets: figures/latex_includes.tex

[If manual figures needed]: Please add them to figures/ before I proceed.
[If all auto]: Shall I proceed with LaTeX writing?

Writing invariant (every drafting and revision step): calibrate each
claim to its evidence and state it directly; generic caveats live in the
Limitations section only; writing instructions are never manuscript content
("do not mention X" means omit X, not "we do not address X"); tone edits
never change what the paper knows; the paper is a launch, not a progress
report — organize around the strongest advantage, give every experiment an
argumentative duty, keep unfavorable numbers in the tables and explain them
as tradeoffs only where the evidence supports that, never narrating
defeats. /paper-write carries the full CONFIDENT PROSE, HONEST LIMITS
contract.

Phase 3: LaTeX Writing

Invoke /paper-write to generate section-by-section LaTeX, forwarding any writer options:

/paper-write "PAPER_PLAN.md"

What this does:

  • Write each section following the plan, with proper LaTeX formatting
  • Insert figure/table references from figures/latex_includes.tex
  • Build references.bib from citation scaffolding
  • Clean stale files from previous section structures
  • Automated bib cleaning (remove uncited entries)
  • De-AI polish (remove "delve", "pivotal", "landscape"...)
  • GPT-6-Astra reviews each section for quality

Output: paper/ directory with main.tex, sections/*.tex, references.bib, math_commands.tex.

Checkpoint: Report section completion.

✍️ LaTeX writing complete:
- Sections: [N] written ([list])
- Citations: [N] unique keys in references.bib
- Stale files cleaned: [list, if any]

Shall I proceed with compilation?

Phase 4: Compilation

Invoke /paper-compile to build the PDF:

/paper-compile "paper/"

What this does:

  • latexmk -pdf with automatic multi-pass compilation
  • Auto-fix common errors (missing packages, undefined refs, BibTeX syntax)
  • Up to 3 compilation attempts
  • Post-compilation checks: undefined refs, page count, font embedding
  • Precise page verification via pdftotext
  • Stale file detection

Output: paper/main.pdf

Checkpoint: Report compilation results.

🔨 Compilation complete:
- Status: SUCCESS
- Pages: [X] (main body) + [Y] (references) + [Z] (appendix)
- Within page limit: YES/NO
- Undefined references: 0
- Undefined citations: 0

Shall I proceed with the improvement loop?

Phase 4.5: Proof Verification (theory papers only)

Skip this phase if the paper contains no theorems, lemmas, or proofs.

if paper contains \begin{theorem} or \begin{lemma} or \begin{proof}:
    Run /proof-checker "paper/"
    This invokes GPT-6-Astra xhigh to:
    - Verify all proof steps (hypothesis discharge, interchange justification, etc.)
    - Check for logic gaps, quantifier errors, missing domination conditions
    - Attempt counterexamples on key lemmas
    - Generate PROOF_AUDIT.md with issue list + severity

    If FATAL or CRITICAL issues found:
        Fix before proceeding to improvement loop
    If only MAJOR/MINOR:
        Proceed, improvement loop may address remaining issues
else:
    skip — no proofs, no action

Phase 4.7: Paper Claim Audit

Skip if no result files exist (e.g., survey/position papers with no experiments).

if results/*.json or results/*.csv or outputs/*.json exist:
    Run /paper-claim-audit "paper/"
    Fresh zero-context reviewer compares every number in the paper
    against raw result files. Catches rounding inflation, best-seed
    cherry-pick, config mismatch, delta errors.

    If FAIL:
        Fix mismatched numbers before improvement loop
    If WARN:
        Proceed, but flag for manual verification
else:
    skip — no experimental results to verify

Phase 5: Auto Improvement Loop

Invoke /auto-paper-improvement-loop to polish the paper, forwarding the same writer options and available writer session for prose fixes:

/auto-paper-improvement-loop "paper/"

What this does (2 rounds):

Round 1: GPT-6-Astra xhigh reviews the full paper → identifies CRITICAL/MAJOR/MINOR issues → Claude Code implements fixes → recompile → save main_round1.pdf

Round 2: GPT-6-Astra xhigh re-reviews the recompiled draft cold (fresh review — no fix summaries, no conversation carry-over) → identifies remaining issues → Claude Code implements fixes → recompile → save main_round2.pdf

Typical improvements (calibration cuts both ways):

  • Fix assumption-model mismatches
  • Narrow genuine overclaims to the supported scope — and state supported claims
    directly, removing redundant hedges
  • Consolidate scattered generic caveats into Limitations
  • Add missing interpretations and notation
  • Make Limitations more specific (only when a material limit is missing — never pad)
  • Add theory-aligned experiments if needed

Output: Three PDFs for comparison + PAPER_IMPROVEMENT_LOG.md.

Format check (included in improvement loop Step 8): After final recompilation, auto-detect and fix overfull hboxes (content exceeding margins), verify page count vs venue limit, and ensure compact formatting. Location-aware thresholds: any main-body overfull blocks completion regardless of size; appendix overfulls block only if >10pt; bibliography overfulls block only if >20pt.

Phase 5.5: Final Paper Claim Audit (MANDATORY submission gate)

After /auto-paper-improvement-loop finishes, rerun /paper-claim-audit before the final report whenever the paper contains numeric claims and machine-readable raw result files exist.

Use the same detectors as Phase 4.7:

  • numeric-claim regex over paper/main.tex and paper/sections/*.tex
  • raw-evidence file search in results/, outputs/, experiments/, and figures/ for .json, .jsonl, .csv, .tsv, .yaml, or .yml

This phase is mandatory if both detectors are positive. It blocks the final report.
If numeric claims exist but no raw result files are found, stop and warn the user before declaring the paper complete.
If no numeric claims exist, skip.

NUMERIC_CLAIMS=$(rg -n -e '[0-9]+(\.[0-9]+)?\s*(%|\\%|±|\\pm|x|×)' \
  -e '(accuracy|BLEU|F1|AUC|mAP|top-1|top-5|error|loss|perplexity|speedup|improvement)' \
  paper/main.tex paper/sections 2>/dev/null || true)

RAW_RESULT_FILES=$(find results outputs experiments figures -type f \
  \( -name '*.json' -o -name '*.jsonl' -o -name '*.csv' -o -name '*.tsv' -o -name '*.yaml' -o -name '*.yml' \) 2>/dev/null | head -200)

if [ -n "$NUMERIC_CLAIMS" ] && [ -n "$RAW_RESULT_FILES" ]; then
    Run /paper-claim-audit "paper/"
    If FAIL:
        Fix mismatched numbers before the final report
elif [ -n "$NUMERIC_CLAIMS" ]; then
    Stop and warn: the paper contains numeric claims but no raw evidence files were found
fi

Empirical motivation: in a real submission run, the final paper claimed a narrower experiment grid than the raw JSON actually contained, and a tolerance value was rounded down past the actual relative error. Both were caught only after manual paper-claim-audit invocation in the final round; the improvement loop did not detect them.

Phase 5.8: Citation Audit (submission gate)

After the final paper-claim-audit passes, run /citation-audit to verify every \cite{...} along three axes: existence, metadata correctness, and context appropriateness. This is the fourth and final layer of the evidence-and-claim assurance stack (experiment-audit → result-to-claim → paper-claim-audit → citation-audit).

if paper/references.bib (or paper.bib) exists and contains entries cited from sec/*.tex:
    Run /citation-audit "paper/"
    Fresh selected reviewer with web/DBLP/arXiv lookup (same-family stays provisional)
    verifies each entry:
      (i)   EXISTENCE — paper resolves at claimed arXiv ID / DOI / venue
      (ii)  METADATA — author names, year, venue, title match canonical sources
      (iii) CONTEXT — cited paper actually establishes the claim it supports

    Output:
      - CITATION_AUDIT.md (human-readable per-entry verdict report)
      - CITATION_AUDIT.json (machine-readable verdict ledger)
      - Per-entry verdicts: KEEP / FIX / REPLACE / REMOVE

    If any REPLACE or REMOVE verdicts:
        Surface to user for human approval — never auto-modify content claims
    If only FIX verdicts (metadata corrections):
        Apply with user confirmation, then recompile
    If all KEEP:
        Pass — bibliography clean for submission
else:
    skip — no bib file or no citations

Why this is the most diagnostic of the four audit layers: wildly fake citations are easy to spot. The dangerous failure mode is a real paper used to support a claim it does not actually establish (wrong-context citations) — these slip past metadata-only checks and damage submission credibility. Run cost is wall-clock heavy (web lookup per entry); run once per submission, not per save.

Empirical motivation: in a real submission run, several real papers were cited in contexts they did not actually support, and at least one bib entry shipped with author = "Anonymous" because the metadata had not been resolved. None were caught by the improvement loop or numeric claim audit; only fresh web-lookup review surfaced them.

Phase 5.9: Integrity Forensics (optional here — see Codex-native note)

The mainline pipeline defaults to a pre-submission Anti-Autoresearch sweep
(/integrity-forensics launcher: SHA-pinned clone, evidence ledger, nine
auditor dimensions, deterministic adjudication, typed BLOCK/WARN/NO_NEW_BLOCKER
gate + append-only obligations). In a Codex-native session this is OFF by
default
: upstream ships no Codex-native pack, so only its deterministic-only
mode is runnable here (numeric core + adjudicator with an all-unavailable
coverage map — it can flag, it can never say CLEAN; translating upstream's
reviewer calls into spawn_agent would rewrite an upstream contract and is
forbidden). Run it with — self_forensics: true for the deterministic slice,
or run the full sweep from a Claude Code session. If it runs: gate BLOCK
refuses the Final Report; the gate records same-family proposal provenance
for a Codex executor — informational, since this gate only raises flags and
grants nothing. An opted-in run (— self_forensics: true in $ARGUMENTS —
re-check $ARGUMENTS at Phase 6.0, not conversation memory) that reaches the
Final Report without paper/.aris/forensics/gate.json is incomplete, not
skippable
: run the slice before reporting.

Phase 6: Final Report

Phase 6.0 — Submission Gate

Before writing the Final Report, resolve the active assurance level. This
uses the same derivation rule as Phase 0 so a run where Phase 0 was
skipped or its write failed cannot silently downgrade a beast / max /
— assurance: submission invocation back to draft.

Resolution at the gate (re-derive; do not trust .aris/assurance.txt
alone):

  1. Parse $ARGUMENTS for an explicit — assurance: draft | submission or
    an — effort: lite | balanced | max | beast directive.
  2. Derive the expected level:
    • explicit assurance: wins
    • else lite / balanced → draft, max / beast → submission
    • else draft
  3. Read paper/.aris/assurance.txt. If the file is missing, write it now
    with the derived level.
  4. If the file's value disagrees with the derived level (e.g. file
    says draft but $ARGUMENTS says beast), overwrite the file
    with the derived level and surface a one-line warning in-chat:
    ⚠️ .aris/assurance.txt was draft but $ARGUMENTS says submission; overriding.
  5. Use the re-derived level as authoritative for the rest of Phase 6.
# Final authoritative value, written and read from the same source
ASSURANCE=<derived-from-$ARGUMENTS>        # draft | submission
mkdir -p paper/.aris
echo "$ASSURANCE" > paper/.aris/assurance.txt

If ASSURANCE=draft, skip directly to the Final Report template below —
current behavior, no change for the default balanced user.

If ASSURANCE=submission, run the pre-flight checklist below, then the
verifier. The verifier's exit code is the source of truth — do NOT
self-declare "audits complete" based on conversation memory.

Submission pre-flight checklist

Print this checklist verbatim at the start of Phase 6.0 and confirm each row
before proceeding. This resists the common failure mode of the model
skipping audits while claiming to have run them.

📋 Submission audits required before Final Report:
   [ ] 0. PAPER_ACCEPTANCE_CONTRACT.md (Phase 1.5): re-read every assertion
          against the final PDF + results files; each → satisfied / violated /
          disputed-at-negotiation. ANY violated undisputed assertion blocks the
          Final Report until fixed or the human explicitly waives it (waivers
          recorded in the contract file). Contract absent (pre-1.5 run) → mark
          "no contract" and continue.
   [ ] 1. /proof-checker        → paper/PROOF_AUDIT.json
   [ ] 2. /paper-claim-audit    → paper/PAPER_CLAIM_AUDIT.json
   [ ] 3. /citation-audit       → paper/CITATION_AUDIT.json
   [ ] 4. Resolve $AUDIT_VERIFIER per integration-contract §2 (Policy A),
          then: bash "$AUDIT_VERIFIER" paper/ --assurance submission
   [ ] 5. Integrity forensics (Phase 5.9 — OPT-IN here): re-parse the CURRENT
          $ARGUMENTS. If it contains `— self_forensics: true`, require
          `python3 "$GATE_HELPER" fresh --paper-dir paper/ --anti-ar-commit
          "$ANTI_AR_COMMIT"` exit 0 (produced at the current pin; gate
          exists ∧ paper unchanged since ∧ ledger-bound ∧ decision
          pass-capable). Exit 1 → the deterministic slice never saw this
          text: run Phase 5.9 NOW. Not opted in → mark "n/a (opt-in)".
   [ ] 6. Block Final Report iff verifier exit code != 0 OR row 0 found a
          violated undisputed assertion OR row 5 is red. (THREE separate
          gates: row 0 is graded by instruction against the contract; the
          verifier checks audit JSONs only — verify_paper_audits.sh does NOT
          read the contract; row 5 reads the forensics gate artifact.)

<ARIS_REPO> placeholder — replace with the absolute path to your ARIS
clone (e.g. ~/Desktop/Auto-claude-code-research-in-sleep). In a Codex
project install, derive it from .aris/installed-skills-codex.txt:
ARIS_REPO="$(awk -F '\t' '$1=="repo_root"{print $2; exit}' .aris/installed-skills-codex.txt)".
For an unmanaged flat symlink install, use the skill directory symlink:
ARIS_REPO="$(cd "$(readlink .agents/skills/paper-writing)/../../.." && pwd)".
The path is stable across runs; store it in a shell variable if you prefer.

Invoking the four audits

Each sub-audit runs in a fresh Codex thread (never a continuation reply,
never pass prior audit output as context — this preserves reviewer
independence per shared-references/reviewer-independence.md).

Each sub-audit always emits its JSON artifact, even when the content
detector is negative. A detector-negative run emits verdict
NOT_APPLICABLE; a silent skip is forbidden. See the "Submission artifact
emission" section of each audit's SKILL.md.

Order:

  1. /proof-checker "paper/" → writes paper/PROOF_AUDIT.json (emits
    NOT_APPLICABLE if the paper contains no theorems / lemmas / proofs)
  2. /paper-claim-audit "paper/" → writes paper/PAPER_CLAIM_AUDIT.json
    (emits NOT_APPLICABLE if the paper has no numeric claims; emits
    BLOCKED if numeric claims exist but raw result files are missing)
  3. /citation-audit "paper/" → writes paper/CITATION_AUDIT.json
    (emits NOT_APPLICABLE if no .bib file or no \cite{...} usage)

Running the verifier

Resolve $AUDIT_VERIFIER via the canonical strict-safe chain (see
shared-references/integration-contract.md §2,
Policy A — gate). Under assurance: submission the verifier is
load-bearing: if the helper is unresolved the SKILL aborts the Final
Report rather than producing an unverified submission-ready claim.

# Resolve the audit verifier (Policy A — gate; Codex-side chain).
if [ -z "${ARIS_REPO:-}" ] && [ -f .aris/installed-skills-codex.txt ]; then
    ARIS_REPO=$(awk -F'\t' '$1=="repo_root"{print $2; exit}' .aris/installed-skills-codex.txt 2>/dev/null) || true
fi
AUDIT_VERIFIER=""
[ -n "${ARIS_REPO:-}" ] && [ -f "$ARIS_REPO/tools/verify_paper_audits.sh" ] && AUDIT_VERIFIER="$ARIS_REPO/tools/verify_paper_audits.sh"
[ -z "$AUDIT_VERIFIER" ] && {
  echo "ERROR: verify_paper_audits.sh not resolved at \$ARIS_REPO/tools/." >&2
  echo "       assurance=submission requires the verifier; aborting Final Report." >&2
  exit 1
}

bash "$AUDIT_VERIFIER" paper/ --assurance submission
OVERALL_ASSURANCE=$(python3 -c 'import json; print(json.load(open("paper/.aris/audit-verifier-report.json"))["overall_assurance"])')
  • Exit 0 — All mandatory audits present, JSON schema-valid, hashes fresh,
    no blocking verdicts. Proceed to the Final Report below. If
    OVERALL_ASSURANCE=provisional, the report MUST say
    Submission-ready: provisional; only accepted may say yes.
  • Exit 1 — Surface paper/.aris/audit-verifier-report.json to the user
    verbatim, refuse to generate the Final Report, and list the specific
    remediation for each failing row:
    • MISSING → rerun that audit
    • STALE → paper files edited after the audit ran; rerun the affected audit
    • BLOCKING_VERDICT (FAIL / BLOCKED / ERROR) → fix the underlying issue,
      then rerun the audit
    • SCHEMA_INVALID → audit artifact malformed; rerun the audit

The verifier is cheap to rerun (< 1 s). After fixing any issue, rerun it
before claiming green.

Optional hardening (not default)

Teams that want hook-level enforcement — i.e., the harness physically
prevents a Stop event while the verifier is red — can register an equivalent
Codex stop hook if their local Codex runtime supports hooks:

{
  "hooks": {
    "Stop": [
      {"command": "bash <ARIS_REPO>/tools/verify_paper_audits.sh paper/ --assurance submission"}
    ]
  }
}

This is documented here, not required. Phase 6.0's verifier-as-truth
pattern is the default repo behavior.


Phase 6.1 — Final Report (runs only after the submission gate is green,
or directly if assurance=draft)

# Paper Writing Pipeline Report

**Input**: [NARRATIVE_REPORT.md or topic]
**Venue**: [ICLR/NeurIPS/ICML/CVPR/ACL/AAAI/ACM/IEEE_JOURNAL/IEEE_CONF]
**Assurance**: [draft | submission]
**Submission-ready**: [yes | provisional | no]   <!-- yes iff overall_assurance=accepted; provisional iff same-family review passed -->
**Forensics**: [NO_NEW_BLOCKER | WARN: <n> open obligations | BLOCK | n/a (opt-in, not requested)]   <!-- deterministic slice only; from .aris/forensics/gate.json — a WARN's open obligations MUST be listed in this report, never silently passed -->
**Date**: [today]

## Pipeline Summary

| Phase | Status | Output |
|-------|--------|--------|
| 0. Assurance Setup | ✅ | paper/.aris/assurance.txt = [draft\|submission] |
| 1. Paper Plan | ✅ | PAPER_PLAN.md |
| 1.5 Acceptance Contract | [accepted\|contested\|no contract] ([N] rounds) | PAPER_ACCEPTANCE_CONTRACT.md |
| 2. Figures | ✅ | figures/ ([N] auto + [M] manual) |
| 3. LaTeX Writing | ✅ | paper/sections/*.tex ([N] sections, [M] citations) |
| 4. Compilation | ✅ | paper/main.pdf ([X] pages) |
| 5. Improvement | ✅ | [score0]/10 → [score2]/10 |
| 4.5 Proof Audit | [PASS\|WARN\|FAIL\|NOT_APPLICABLE\|BLOCKED\|ERROR] | PROOF_AUDIT.{md,json} |
| 5.5 Paper Claim Audit | [PASS\|WARN\|FAIL\|NOT_APPLICABLE\|BLOCKED\|ERROR] | PAPER_CLAIM_AUDIT.{md,json} |
| 5.8 Citation Audit | [PASS\|WARN\|FAIL\|NOT_APPLICABLE\|BLOCKED\|ERROR] | CITATION_AUDIT.{md,json} |
| 6.0 Assurance Verifier | [accepted\|provisional\|blocked]; exit [0\|1] overall (N/A if draft) | .aris/audit-verifier-report.json |

## Improvement Scores
| Round | Score | Key Changes |
|-------|-------|-------------|
| Round 0 | X/10 | Baseline |
| Round 1 | Y/10 | [summary] |
| Round 2 | Z/10 | [summary] |

## Deliverables
- paper/main.pdf — Final polished paper
- paper/main_round0_original.pdf — Before improvement
- paper/main_round1.pdf — After round 1
- paper/main_round2.pdf — After round 2
- paper/PAPER_IMPROVEMENT_LOG.md — Full review log
- paper/PROOF_AUDIT.{md,json} — Proof-obligation verification (always emitted at `assurance=submission`; `NOT_APPLICABLE` when no theorems)
- paper/PAPER_CLAIM_AUDIT.{md,json} — Numerical claim verification (always emitted at `assurance=submission`; `NOT_APPLICABLE` when no numeric claims; omitted in `draft` mode if Phase 5.5 detector was negative)
- paper/CITATION_AUDIT.{md,json} — Bibliography verification (always emitted at `assurance=submission`; `NOT_APPLICABLE` when no `.bib` or no `\cite{...}`; omitted in `draft` mode if Phase 5.8 detector was negative)
- paper/.aris/audit-verifier-report.json — External verifier report (submission only)

## Remaining Issues (if any)
- [items from final review that weren't addressed]

## Next Steps
- [ ] Visual inspection of PDF
- [ ] Add any missing manual figures
- [ ] Submit to [venue] via OpenReview / CMT / HotCRP

Output Protocols

Follow these shared protocols for all output files:

  • Output Versioning Protocol — write timestamped file first, then copy to fixed name
  • Output Manifest Protocol — log every output to MANIFEST.md
  • Output Language Protocol — note: paper-writing always outputs English LaTeX for venue submission

Key Rules

  • Large file handling: If the Write tool fails due to file size, immediately retry using Bash (cat << 'EOF' > file) to write in chunks. Do NOT ask the user for permission — just do it silently.
  • Don't skip phases. Each phase builds on the previous one — skipping leads to errors.
  • Checkpoint between phases when AUTO_PROCEED=false. Present results and wait for approval.
  • Manual figures first. If the paper needs architecture diagrams or qualitative results, the user must provide them before Phase 3.
  • Compilation must succeed before entering the improvement loop. Fix all errors first.
  • Preserve all PDFs. The user needs round0/round1/round2 for comparison.
  • Document everything. The pipeline report should be self-contained.
  • Respect page limits. If the paper exceeds the venue limit, suggest specific cuts before the improvement loop.

Composing with Other Workflows

/idea-discovery "direction"         ← Workflow 1: find ideas
implement                           ← write code
/run-experiment                     ← deploy experiments
/auto-review-loop "paper topic"     ← Workflow 2: iterate research
/paper-writing "NARRATIVE_REPORT.md"  ← Workflow 3: you are here
                                         submit! 🎉

Or use /research-pipeline for the Workflow 1+2 end-to-end flow,
then /paper-writing for the final writing step.

Typical Timeline

PhaseDurationCan sleep?
1. Paper Plan5-10 minNo
2. Figures5-15 minNo
3. LaTeX Writing15-30 minYes ✅
4. Compilation2-5 minNo
5. Improvement15-30 minYes ✅

Total: ~45-90 min for a full paper from narrative report to polished PDF.

This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →
specification-writingWrite the full patent specification from claims and invention disclosure. Use when user says "撰写说明书", "write specification", "写说明书", "patent description", or wants to draft the complete patent specification.1 installspatent-pipelineFull patent drafting pipeline from invention description to jurisdiction-formatted filing documents. Supports CN (CNIPA), US (USPTO), EP (EPO). Supports invention patents and utility models. Use when user says "写专利", "patent pipeline", "专利申请", "draft patent", "写权利要求书", or wants to draft a complete patent application.1 installslean-formalizeDevelop and verify a mathematical proof in Lean, continue an incomplete Lean project, or audit whether it proves the original statement. Connect actual inputs to intermediate lemmas, assemble the target theorem, check its transitive axioms, and provide a reproducible handoff. Use when Lean is requested or a specific proof obligation benefits from formal verification; use proof-writer for ordinary mathematical drafting.1 installsfeishu-notifySend notifications to Feishu/Lark. Internal utility used by other skills, or manually via /feishu-notify. Use when user says "发飞书", "notify feishu", or other skills need to send status updates.1 installsauto-review-loop-llmAutonomous research review loop using any OpenAI-compatible LLM API. Configure via llm-chat MCP server or environment variables. Trigger with "auto review loop llm" or "llm review".0 installsinterview-cheatsheetGenerate a long-form Chinese interview-prep cheat sheet on a specific ML/LLM topic — formulas with derivations, from-scratch PyTorch code, comparison tables, and 高频面试题 (L1 必会 / L2 进阶 / L3 顶级 lab). Use when the user says '写面试 cheat sheet', '写一份 X 教程', '帮我准备 Y 面试题', '出一份 X 速查', or wants a detailed Chinese tutorial on a specific ML topic.0 installs

More from Auto Research

View source →
pixel-artGenerate pixel art SVG illustrations for READMEs, docs, or slides. Use when user says "画像素图", "pixel art", "make an SVG illustration", "README hero image", or wants a cute visual.9 installsmermaid-diagramGenerate Mermaid diagrams from user requirements. Supports flowcharts, sequence diagrams, class diagrams, ER diagrams, Gantt charts, and 18 more diagram types.4 installspaper-writingWorkflow 3: Full paper writing pipeline that goes from a narrative report to a polished, submission-ready PDF. Use when user says "写论文全流程", "write paper pipeline", "从报告到PDF", "paper writing", or wants the complete paper generation workflow.4 installspatent-reviewGet an external patent examiner review of a patent application. Use when user says "专利审查", "patent review", "审查意见", "examiner review", or wants critical feedback on patent claims and specification.2 installsexperiment-planTurn a refined research proposal or method idea into a detailed, claim-driven experiment roadmap. Use after `research-refine`, or when the user asks for a detailed experiment plan, ablation matrix, evaluation protocol, run order, compute budget, or paper-ready validation that supports the core problem, novelty, simplicity, and any LLM / VLM / Diffusion / RL-based contribution.2 installscitation-auditZero-context verification that every bibliographic entry in the paper is real, correctly attributed, and used in a context the cited paper actually supports — catching hallucinated authors, wrong years, fabricated venues, version mismatches, and wrong-context citations. Use when user says "审查引用", "check citations", "citation audit", "verify references", "引用核对", or before submission to ensure bibliography integrity.2 installs

More Build skills

Browse category →
senior-frontendBuild and review React, Next.js, TypeScript or Tailwind frontends: components, scaffolding, performance and bundle size. Use whenever the user wants a new component or app, a page feels slow, the bundle is too big, or asks for a frontend code review.635 installsui-design-systemUse when building a design system: tokens, component docs, responsive scales or developer handoff. Generates tokens with design_token_generator.py.535 installsfrontend-designGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.346 installssenior-backendBuild and fix backend services: REST or GraphQL APIs, auth, microservices, PostgreSQL queries, migrations and load tests. Use whenever the user's API is slow or broken, needs login or auth added, a schema change, or a new endpoint or service scaffolded.246 installsself-improving-agentCurate what the agent has learned into durable project knowledge. Reviews Claude Code auto-memory (MEMORY.md and its topic files) for learnings worth keeping, promotes proven ones into CLAUDE.md or .claude/rules/, records a correction as a lesson that persists across sessions, prunes stale or duplicate entries, and turns a recurring fix into a reusable skill. Use whenever the user asks what you have learned or saved about the project, which memories should become permanent rules, to remember a lesson or stop repeating a mistake, or to clean up, audit or check memory health.173 installsusing-superpowersUse when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions145 installs

Frequently asked questions about paper-writing

What does the paper-writing skill do?

Workflow 3: Full paper writing pipeline that goes from a narrative report to a polished, submission-ready PDF. Use when user says "写论文全流程", "write paper pipeline", "从报告到PDF", "paper writing", or wants the complete paper generation workflow. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the paper-writing skill?

Run `npx @skills-hub-ai/cli install auto-research-skills-codex-paper-writing` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/auto-research-skills-codex-paper-writing/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does paper-writing work with?

paper-writing runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the paper-writing skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use paper-writing after installing it?

In Claude Code, type `/auto-research-skills-codex-paper-writing` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the paper-writing skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.