Academic Paper Forge — Multi-Agent Paper Writing System
A six-phase pipeline that transforms a code repository into a publication-quality academic paper. Specialized agent teams analyze code, debate innovations, plan narrative strategy, and collaboratively write — all governed by a three-powers separation mechanism (Executor-Reviewer-Arbiter) that ensures rigor at every step.
Core principle: Every claim in the paper must trace back to code evidence or verified literature. Every agent output is independently reviewed before advancing.
When to Use
digraph when_to_use {
"Start" [shape=doublecircle];
"Has code repo?" [shape=diamond];
"Wants academic paper?" [shape=diamond];
"Has existing draft?" [shape=diamond];
"Use this skill" [shape=doublecircle];
"Don't use — use planning-with-discovery" [shape=box];
"Don't use — manual editing" [shape=box];
"Start" -> "Has code repo?";
"Has code repo?" -> "Wants academic paper?" [label="yes"];
"Has code repo?" -> "Don't use — use planning-with-discovery" [label="no — wants design doc"];
"Wants academic paper?" -> "Has existing draft?" [label="yes"];
"Wants academic paper?" -> "Don't use — manual editing" [label="no — just proofreading"];
"Has existing draft?" -> "Use this skill" [label="yes — revision mode"];
"Has existing draft?" -> "Use this skill" [label="no — full paper from scratch"];
}
- User wants to write an academic paper based on a code project
- User says "write paper", "论文写作", "学术论文", "paper forge", "generate paper from code"
- User wants code analysis for academic contribution extraction
- User needs structured debate on innovation positioning
Do NOT use: Proofreading without code analysis, non-CS papers, papers without a code artifact, simple formatting tasks.
Quick Reference
| Phase |
What |
Key Output |
Gate |
| 0 |
Initialization |
Language, format, venue, mode, references, drawing config |
— |
| 1 |
Code Analysis |
analysis/core-insights.md, literature-review.md, math-formulation.md, code-index.md |
User approves |
| 2 |
Analysis Debate |
Updated core-insights.md, debate-summary.md |
Consensus or forced arbitration |
| 3 |
Writing Plan Debate |
writing-plan/narrative-strategy.md, section-outline.md, reviewer-strategy.md, task-dependency.md |
User approves |
| 4 |
Paper Writing |
paper/01-introduction.md ... paper/05-conclusion.md per chapter |
Per-phase auto-review + user progress report |
| 5 |
Assembly & Output |
paper/full-paper.md, optional latex/, word/ |
User accepts final |
Output directory: {project_root}/paper-output/ — contains analysis/, writing-plan/, paper/, review-logs/, and optionally latex/, word/.
Phase 0: Initialization
Collect all configuration through structured questions. Every subsequent phase reads these settings.
Step 1: Interaction Language
Use AskUserQuestion:
- question: "What language for interaction during this session? / 本次交互使用哪种语言?"
- options:
- "中文(推荐)"
- "English"
- "中英混合 / Mixed"
- "日本語"
Store as config.interaction_lang. All agent prompts and user-facing output follow this choice.
Step 2: Paper Output Language
Use AskUserQuestion:
- question: "What language for the paper itself? / 论文的最终输出语言?"
- options:
- "English (recommended for international venues)"
- "中文"
- "中英双语版本 / Bilingual"
- "Same as interaction language"
Store as config.paper_lang.
Step 3: Output Format
Use AskUserQuestion:
- question: "Paper output format? / 论文输出格式?"
- options:
- "Markdown (recommended, convertible later)"
- "LaTeX (generate .tex files directly)"
- "Markdown + LaTeX dual version"
- "Word (.docx)"
Store as config.output_format.
Step 4: Target Venue
Use AskUserQuestion:
- question: "Target venue for submission? / 目标投稿会议/期刊?"
- options:
- "NeurIPS / ICML / ICLR (ML top-3)"
- "CVPR / ECCV / ICCV (Computer Vision)"
- "ACL / EMNLP / NAACL (NLP)"
- "AAAI / IJCAI (General AI)"
Store as config.target_venue. The tool-provided "Other" option allows users to specify KDD, WWW, SIGMOD, journals, etc.
Step 5: Writing Mode
Use AskUserQuestion:
- question: "Writing scope? / 本次写作的范围?"
- options:
- "Full paper: code analysis through complete paper"
- "Single chapter: write specific section(s) only"
- "Revision mode: improve an existing draft"
- "Analysis only: code analysis without paper writing"
Store as config.writing_mode.
If single chapter mode: follow up with AskUserQuestion asking which sections (Abstract, Introduction, Related Work, Methodology — "Other" covers Experiments, Conclusion, etc.).
If revision mode: ask user to provide the path to the existing draft.
Step 6: Reference Sources
Use AskUserQuestion:
- question: "Do you have reference papers? / 是否有自己的参考文献?"
- options:
- "No, rely entirely on web search"
- "Yes, I will provide a directory path"
- "Some core references, supplement with web search"
- "I will manually input a reference list"
Store as config.references. If user provides a path, validate it exists using Glob. If user chooses manual input, collect entries via follow-up.
Step 7: Drawing Integration
Use AskUserQuestion:
- question: "Use AI-assisted figure generation? / 是否需要 AI 辅助生成论文图表?"
- options:
- "Yes, use nano-banana-draw for figures"
- "No, I will prepare figures myself"
- "Architecture diagrams only, I handle experiment plots"
- "Decide later during writing phase"
Store as config.use_drawing.
Step 8: Project Access (Automatic)
No user question required. Execute automatically:
- Use
Glob to check for {project_path}/.claude-index/index.md
- Exists: Read it for project structure context
- Missing: Suggest running
/project-indexer first. Ask via AskUserQuestion:
- "Generate project index first? (Recommended)"
- "Skip, proceed without index"
- "I will provide project overview manually"
- "Scan only specific directories"
- Read
{project_path}/CLAUDE.md if it exists
- If the project has many modules, ask analysis scope:
- "Entire project"
- "Specific core modules/directories"
- "Let agents auto-detect key areas"
- "I will specify files to focus on"
Store as config.analysis_scope.
Phase 1: Code Analysis
Dynamic team assembly and parallel deep analysis of the code repository. Produces four structured analysis files.
1.1: Assemble Analysis Team
After reading the project index, determine team size based on project complexity:
| Indicator |
Small (2-3 agents) |
Medium (3-4 agents) |
Large (5 agents) |
| Core source files |
< 20 |
20-100 |
> 100 |
| Module count |
< 3 |
3-8 |
> 8 |
| Algorithm types |
Single |
2-3 |
> 3 |
Core roles (always present):
| Role |
Code Name |
Focus |
| Architecture Analyst |
arch-analyst |
Module structure, data flow, design patterns, system-level innovation |
| Algorithm Analyst |
algo-analyst |
Core algorithms, model architecture, training strategy, loss functions |
| Innovation Extractor |
innovation-extractor |
Novelty assessment, contribution distillation, differentiation from prior work |
Extended roles (activated by complexity):
| Role |
Code Name |
Trigger |
Focus |
| Math Modeler |
math-modeler |
Complex algorithms/models |
Formal problem definition, objective derivation, pseudocode, complexity analysis |
| Literature Comparator |
lit-comparator |
User chose web search for references |
SOTA comparison, related work retrieval via WebSearch |
1.2: Launch Analysis Agents
Spawn each agent using the Agent tool with run_in_background: true. Each agent prompt is assembled from these modules (see team-profiles.md for full templates):
- Common prefix: Google Brain/DeepMind senior researcher persona,
config.interaction_lang, config.paper_lang, config.target_venue
- Rigor constraints: $1000 penalty for inaccuracy, every claim cites file path + line number,
[UNCERTAIN] tags mandatory for uncertain conclusions, no fabrication
- Three-powers injection: Executor role awareness (output will be reviewed, disclose uncertainties proactively)
- Role specialization: From team-profiles.md per agent role
- Mandatory reading list:
.claude-index/index.md, CLAUDE.md, role-relevant source files — prefixed with "BEFORE any analysis, read ALL of these files:"
- Task assignment + output template + completion criteria: Report files read, 3-5 sentence summary,
[UNCERTAIN] items, files created
All analysis agents launch in parallel. Wait for all to complete before proceeding.
1.3: Three-Powers Review of Analysis
Apply the three-powers mechanism (see three-powers-guide.md) with rotation:
| Task |
Executor |
Reviewer |
Arbiter |
| Architecture analysis |
arch-analyst |
algo-analyst |
innovation-extractor |
| Algorithm analysis |
algo-analyst |
innovation-extractor |
arch-analyst |
| Innovation extraction |
innovation-extractor |
arch-analyst |
algo-analyst |
| Math modeling |
math-modeler |
algo-analyst |
arch-analyst |
| Literature comparison |
lit-comparator |
innovation-extractor |
algo-analyst |
For each analysis report, auto-spawn a review agent. If the reviewer finds issues, the executor revises. If disagreement persists after two review rounds, the arbiter makes a final ruling. See the Three Powers Mechanism section below for the full workflow.
1.4: Analysis Outputs
After review, consolidate into four files under paper-output/analysis/:
| File |
Content |
core-insights.md |
Project overview, core methods with code locations, ranked innovation points, contribution summary |
literature-review.md |
Related research areas, key references table (paper, year, venue, method, relation), SOTA comparison matrix, differentiation analysis |
math-formulation.md |
Formal problem definition, core method equations, algorithm pseudocode, theoretical analysis (if applicable) |
code-index.md |
Method-to-code mapping table (method, file, line range, description), file importance ranking |
Present analysis summary to user. Use AskUserQuestion:
- "Approve and proceed to debate phase"
- "Request deeper analysis on specific areas"
- "Adjust innovation point rankings"
- "Redo analysis with different scope"
Phase 2: Analysis Debate
Structured multi-round debate among analysis team members to reach consensus on core innovations and positioning. See debate-guide.md for the full protocol.
2.1: Debate Setup
Participants: All analysis team members from Phase 1.
Topics:
- What are the true core innovations? (Rank and filter)
- Which technical contributions deserve emphasis in the paper?
- How should the project be positioned relative to SOTA?
- Is the mathematical formalization accurate and complete?
2.2: Debate Execution (Max 3 Rounds)
Each round follows this structure:
Round N — Position Submission (parallel):
Spawn each participant as a background agent. Each submits a position document:
- Core judgment on the debate topics
- Supporting evidence (code references, literature)
- Proposed ranking/strategy
- Anticipated counterarguments
Round N — Cross-Examination (parallel):
Each agent reviews all other position documents and submits challenges:
- Specific points of disagreement with evidence
- Requests for additional evidence
Round N — Response and Revision:
Each agent responds to challenges and may revise their position.
Round N — Convergence Check:
The designated arbiter (rotating per round) evaluates consensus:
- Converged (>80% agreement on core points): End debate, produce consensus
- Not converged + rounds remaining: Proceed to next round
- Round 3 reached without convergence: Arbiter issues forced ruling on all disputed points. Ruling is final and binding.
2.3: Debate Outputs
- Update
analysis/core-insights.md to the consensus version
- Generate
analysis/debate-summary.md: round count, participants, key disagreements with resolutions, final ranked innovations, unified contribution positioning, agreed SOTA differentiation narrative
Phase 3: Writing Plan Debate
A new team debates the paper's narrative strategy, reviewer defense, and section structure.
3.1: Assemble Planning Team
Spawn 3 new agents (distinct from the analysis team) set as Google LLM/AI research experts. Each reads ALL Phase 1-2 outputs before participating.
3.2: Debate Execution (Max 3 Rounds)
Same debate protocol as Phase 2. Each participant submits a complete writing proposal:
- Paper title suggestion
- Narrative arc (one paragraph: problem motivation through conclusion)
- Per-section core arguments (Introduction, Related Work, Methodology, Experiments, Conclusion)
- Strategy to convince reviewers
- Anticipated reviewer objections with preemptive responses (table: objection, response, paper location)
Cross-examination focuses on: narrative weaknesses, unconvincing arguments, missing experiments, reviewer blind spots.
Convergence and forced arbitration follow the same rules as Phase 2.
3.3: Writing Plan Outputs
Generate four files under paper-output/writing-plan/:
| File |
Content |
narrative-strategy.md |
Consensus narrative arc, per-section core arguments, paper title |
section-outline.md |
Detailed outline with subsection structure, key points per subsection, target word counts |
reviewer-strategy.md |
Reviewer objection table, defense strategies, preemptive placements in paper |
task-dependency.md |
Writing task dependency graph (Phase A/B/C), per-task assignment, parallel groups |
Present writing plan to user. Use AskUserQuestion:
- "Approve and assemble writing team"
- "Adjust narrative strategy"
- "Modify section outline"
- "Return to analysis phase for additional work"
Phase 4: Paper Writing
Assemble a 5-7 person writing team, execute in dependency order (Phase A/B/C), with auto-triggered three-powers review after each chapter.
4.1: Writing Team Assembly
Fixed roles (5 members):
| # |
Role |
Code Name |
Responsibility |
Must-Read Files |
| 1 |
Chief Editor |
chief-editor |
Full-paper consistency, style coordination, Abstract + Conclusion, standing Arbiter |
All files |
| 2 |
Introduction Writer |
intro-writer |
Introduction, research motivation, contribution list |
core-insights.md, narrative-strategy.md, literature-review.md |
| 3 |
Method Writer |
method-writer |
Methodology, algorithm description, formula derivation |
math-formulation.md, code-index.md, core-insights.md |
| 4 |
Experiment Writer |
experiment-writer |
Experiments, results analysis, ablation studies |
core-insights.md, literature-review.md, code-index.md |
| 5 |
Literature Searcher |
lit-searcher |
Related Work, reference retrieval and organization |
literature-review.md, user-provided references |
Optional roles (0-2 members):
| # |
Role |
Code Name |
Activation |
Responsibility |
| 6 |
Figure Designer |
figure-designer |
config.use_drawing enabled |
Architecture diagrams, method figures, experiment plots via nano-banana-draw |
| 7 |
Internal Reviewer |
internal-reviewer |
Always active (review role) |
Simulates venue reviewer, chapter-level quality audit |
4.2: Present Team for Approval
Show the user: team composition, task assignments, dependency graph visualization, estimated chapter count and length.
Use AskUserQuestion:
- "Approve and start writing"
- "Adjust team members"
- "Adjust task assignments"
- "Return to modify writing plan"
4.3: Dependency Graph Execution
Phase A (parallel): [Related Work] [Methodology] [Figures*]
| | |
Phase B (parallel): [Introduction] [Experiments]
| |
Phase C (parallel): [Abstract] [Conclusion]
|
Final: [Chief Editor: Full Assembly]
*Figures only if figure-designer is activated.
Phase A — Launch parallel agents:
Spawn each Phase A writer using the Agent tool with run_in_background: true. Each agent prompt includes:
- Team persona from team-profiles.md
- Role-specific instructions from writing-style-guide.md
- Three-powers role assignment (Executor)
- Mandatory file reading list (all analysis + writing-plan files)
- Style constraints (see Writing Quality Rules below)
- Completion criteria and reporting requirements
- Section-specific instructions:
- lit-searcher: Use
WebSearch for latest papers, verify every citation exists, organize by research direction not chronology, bridge from related work to this project's method
- method-writer: Strictly follow
math-formulation.md, cross-check with code-index.md, include algorithm pseudocode, ensure reproducibility from this section alone
- figure-designer: Invoke
nano-banana-draw skill, unified visual style, minimum Figure 1 = system architecture overview, output to paper/figures/
Wait for all Phase A agents to complete. Auto-trigger review for each (see Section 4.4). Only after all Phase A chapters pass review, launch Phase B.
Phase B — Launch after Phase A reviewed:
- intro-writer: Read completed Related Work and Methodology, follow
narrative-strategy.md, structure as: concrete problem introduction, existing method limitations, this paper's approach, contribution list (3-4 bullets). Must not duplicate Related Work content.
- experiment-writer: Reference Related Work baselines and Methodology components, follow
reviewer-strategy.md for experiment design, include setup, main comparison, ablation, analysis. Use [PLACEHOLDER: fill with actual results] where real data is unavailable.
Wait for Phase B completion and review pass, then launch Phase C.
Phase C — Launch after Phase B reviewed:
- chief-editor writes Abstract: 150-250 words, every claim must be supported in the body. Based on all completed chapters.
- chief-editor writes Conclusion: Summarize contributions, discuss limitations honestly, propose future work. Consistent with all chapters.
4.4: Auto-Triggered Chapter Review
When any writer agent completes, immediately spawn a review agent — do NOT wait for user input.
Review agent prompt includes: senior {config.target_venue} Area Chair persona, Three Powers Reviewer injection ($1000 penalty for perfunctory review), mandatory reading (chapter file + section-outline + narrative-strategy + relevant analysis files), and a three-part review checklist:
- Content quality: Matches writing plan, clear arguments, technical accuracy vs code-index.md, real citations
- Writing quality: No AI traces (see Writing Quality Rules), professional language, paragraph thesis structure, consistent terms
- Academic standard: Meets venue standard, innovation adequately argued, sound experiment design
Output follows the review report template from three-powers-guide.md.
Review outcomes:
- Pass: Mark chapter as reviewed. If all chapters in current phase pass, launch next phase.
- Fail: Reviewer fixes minor issues directly. For major issues, spawn a fix agent with the issue list. Re-review after fix (round 2). If still failing after round 2, the executor may dispute. If disputed, Chief Editor (Arbiter) makes a final binding ruling. If not disputed, one more fix cycle is attempted (round 3 max). After 3 review rounds without pass, Chief Editor forces a final ruling.
On review failure after arbiter ruling, use AskUserQuestion:
- "Accept Chief Editor's ruling and proceed"
- "Manually review and provide guidance"
- "Reassign chapter to different writer"
- "Skip this chapter for now"
4.5: Progress Reporting
After each execution phase completes, report to user:
## Phase {X} Writing Progress
| Chapter | Writer | Status | Review | Word Count |
|---------|--------|--------|--------|------------|
| Related Work | lit-searcher | Complete | Passed | ~2,500 |
| Methodology | method-writer | Complete | Passed (round 2) | ~3,200 |
Launching Phase {X+1}...
Phase 5: Assembly & Output
5.1: Full Paper Assembly
Chief Editor agent merges all chapters into paper/full-paper.md:
- Combine chapters in order: Abstract, Introduction, Related Work, Methodology, Experiments, Conclusion, References
- Unify terminology, notation, and writing style across chapters
- Verify cross-references (figure numbers, equation numbers, citation numbers)
- Generate
paper/references.md with complete bibliography
5.2: Final Review
Spawn an independent final reviewer (Google Research Director persona, distinct from all previous agents). Reviews: logical consistency across chapters, smooth transitions, unified terminology/symbols, sequential reference/figure numbering, AI trace detection, {config.target_venue} compliance. Outputs pass/fail with issue list. If issues found, Chief Editor resolves. Max 2 rounds.
5.3: Format Conversion
Based on config.output_format:
- Markdown (default): Already produced. Standards:
$$...$$ block math, $...$ inline, , [N] references, fenced pseudocode blocks.
- LaTeX: Spawn conversion agent. Generate
latex/main.tex with venue-specific document class (see venue-profiles.md), per-chapter .tex files in latex/sections/, references.bib, copied figures/, and Makefile. Apply standard MD-to-LaTeX conversion rules.
- Word: Invoke docx skill to convert from Markdown. Output to
word/paper.docx.
5.4: Final User Options
Use AskUserQuestion:
- "Complete — I will take it from here"
- "Run an additional optimization round"
- "Convert to another format"
- "Walk through each chapter for revision feedback"
Three Powers Mechanism
The Executor-Reviewer-Arbiter separation governs ALL multi-agent collaboration steps across Phases 1-5. See three-powers-guide.md for the complete protocol.
Roles
| Role |
Responsibility |
Constraints |
| Executor |
Produce the deliverable (analysis, chapter, etc.) |
Cannot self-review, cannot mark own work as passed |
| Reviewer |
Independently audit the executor's output |
Cannot modify executor's work directly (except minor fixes), cannot serve as arbiter |
| Arbiter |
Final ruling when executor and reviewer disagree |
Intervenes only on dispute, ruling is final and unappealable |
Role Assignment Rules
- Analysis phase (1-2): Rotating assignment — each agent serves as executor, reviewer, and arbiter across different tasks
- Writing phase (4): Chief Editor is the standing Arbiter. Internal Reviewer is the standing Reviewer. Chapter writers are Executors. Reviewer role rotates for variety where possible.
- Debate phases (2-3): All participants are simultaneously executors (position submission) and reviewers (cross-examination). A dedicated convergence evaluator serves as arbiter.
Review Workflow
- Executor submits output
- Reviewer independently audits (reads source material, checks evidence)
- Pass → mark complete, proceed. Fail → Reviewer lists issues (severity-ranked)
- Executor revises → Reviewer re-audits
- Pass → mark complete. Still fails → if Executor disputes, Arbiter reviews all materials and issues binding ruling. If no dispute, Executor revises again.
Anti-Deception Measures
- Mandatory disclosure: Executors must mark uncertain items with
[UNCERTAIN]. Hiding uncertainty is a $1000 penalty offense.
- No self-review: An agent can never review its own output. Enforced by role rotation tables.
- Independent judgment: Reviewers must read source materials independently, not just echo the executor's claims.
- Audit trail: All review reports and arbitration rulings are saved to
review-logs/ with timestamps.
- Anti-collusion: Arbiter does not communicate with executor or reviewer during the review phase. Arbiter only activates upon dispute.
Prompt Injection
Every agent prompt includes a role-awareness block. Inject the appropriate variant:
- Executor: "Your output will be independently reviewed. Disclose uncertainties with
[UNCERTAIN]. Every factual claim needs evidence (file path + line number, or citation)."
- Reviewer: "Assess independently. Check every item on the review checklist — blanket 'pass' without evidence incurs a $1000 penalty. Fix minor issues directly; flag major issues."
- Arbiter: "Intervene only on dispute. Ruling is final and unappealable. Review all materials from both parties before deciding."
Writing Quality Rules
Injected into every writing agent's prompt. See writing-style-guide.md for the full guide.
Hard Constraints (Violation = $1000 Penalty)
- Maximum 1 em dash per paragraph
- Maximum 2 "however" per page
- Forbidden phrases:
- "It is worth noting/mentioning that..."
- "In recent years, X has gained..."
- "X plays a crucial/important/vital role in..."
- "To the best of our knowledge..."
- "The rest of the paper is organized as follows..." (if needed, use a natural phrasing)
- No sequential "Firstly, Secondly, Thirdly, Finally"
- Prefer active voice ("We propose X" not "X is proposed")
- Every paragraph's first sentence must be its thesis statement
- Define technical terms on first use, then abbreviate
- No more than 2 consecutive adjectives modifying one noun
- No exclamation marks
- Use "use" instead of "leverage" or "utilize"
Quality Standards
- Every factual claim must have evidence (code reference or citation)
- Mathematical formulas must be verifiable against source code
- All cited papers must actually exist (verify via
WebSearch if needed)
- Content must be adapted to
config.target_venue conventions and page limits
Common Mistakes
| Mistake |
Fix |
| Launching Phase N+1 before Phase N is complete and reviewed |
Phase-gated: all agents complete + all reviews pass before next phase |
| Skipping three-powers review to save time |
Review is mandatory and auto-triggered. Never skip. |
| Agent writes without reading mandatory files |
Every agent prompt starts with "BEFORE any work, read ALL of these files:" |
| AI writing traces in output |
Enforce style rules in every writer prompt. Reviewer checklist catches violations. |
| Fabricated citations in Related Work |
Literature searcher must verify every citation via WebSearch |
| Self-review (agent reviews own output) |
Role rotation tables prevent this. Check assignments before spawning. |
| Waiting for user before auto-review |
Chapter review is auto-triggered. Never wait for user input to start review. |
| Debate exceeding 3 rounds |
Hard cap at 3 rounds. Round 3 ends with forced arbitration. |
Not using Agent tool for subagents |
All multi-agent phases MUST use Agent tool, not just describe tasks |
| Launching debate before analysis review passes |
Phase 1 outputs must be reviewed before Phase 2 debate begins |
| Starting writing without user approval of writing plan |
User must approve team composition in Step 4.2 |
| Figures generated but not referenced in text |
Chief Editor checks all figure references during assembly |
Required Tools
Read, Write, Edit — file operations for analysis outputs, paper chapters, review logs
Glob, Grep — project code exploration, file discovery
Bash — directory creation (paper-output/, subdirectories)
AskUserQuestion — structured choices (4 options, tool adds 5th "Other")
WebSearch — literature retrieval, citation verification
Agent — spawning all subagents (analysis, debate, writing, review). Use run_in_background: true for parallel agents within the same execution phase.
Skill — invoking project-indexer (pre-flight) and nano-banana-draw (figure generation)
Phase 0-3 works in any environment. Phase 4-5 requires the Agent tool for subagent spawning.
References
- team-profiles.md — Full persona definitions for all agent roles
- debate-guide.md — Structured debate protocol and templates
- three-powers-guide.md — Executor-Reviewer-Arbiter mechanism details
- writing-style-guide.md — Anti-AI writing rules and style standards
- output-templates.md — Templates for all output files
- venue-profiles.md — Target venue formatting profiles and LaTeX templates
1---2name: academic-paper-forge3description: Multi-agent academic paper writing system that analyzes code repositories, extracts innovations through structured debate, and collaboratively writes publication-quality papers targeting top CS conferences. Use when the user wants to write an academic paper based on a code project, mentions "write paper", "论文写作", "学术论文", "paper forge", or wants to generate a research paper from code.4---56# Academic Paper Forge — Multi-Agent Paper Writing System78A six-phase pipeline that transforms a code repository into a publication-quality academic paper. Specialized agent teams analyze code, debate innovations, plan narrative strategy, and collaboratively write — all governed by a three-powers separation mechanism (Executor-Reviewer-Arbiter) that ensures rigor at every step.910**Core principle:** Every claim in the paper must trace back to code evidence or verified literature. Every agent output is independently reviewed before advancing.1112## When to Use1314```dot15digraph when_to_use {16 "Start" [shape=doublecircle];17 "Has code repo?" [shape=diamond];18 "Wants academic paper?" [shape=diamond];19 "Has existing draft?" [shape=diamond];20 "Use this skill" [shape=doublecircle];21 "Don't use — use planning-with-discovery" [shape=box];22 "Don't use — manual editing" [shape=box];2324 "Start" -> "Has code repo?";25 "Has code repo?" -> "Wants academic paper?" [label="yes"];26 "Has code repo?" -> "Don't use — use planning-with-discovery" [label="no — wants design doc"];27 "Wants academic paper?" -> "Has existing draft?" [label="yes"];28 "Wants academic paper?" -> "Don't use — manual editing" [label="no — just proofreading"];29 "Has existing draft?" -> "Use this skill" [label="yes — revision mode"];30 "Has existing draft?" -> "Use this skill" [label="no — full paper from scratch"];31}32```3334- User wants to write an academic paper based on a code project35- User says "write paper", "论文写作", "学术论文", "paper forge", "generate paper from code"36- User wants code analysis for academic contribution extraction37- User needs structured debate on innovation positioning3839**Do NOT use:** Proofreading without code analysis, non-CS papers, papers without a code artifact, simple formatting tasks.4041## Quick Reference4243| Phase | What | Key Output | Gate |44|-------|------|------------|------|45| 0 | Initialization | Language, format, venue, mode, references, drawing config | — |46| 1 | Code Analysis | `analysis/core-insights.md`, `literature-review.md`, `math-formulation.md`, `code-index.md` | User approves |47| 2 | Analysis Debate | Updated `core-insights.md`, `debate-summary.md` | Consensus or forced arbitration |48| 3 | Writing Plan Debate | `writing-plan/narrative-strategy.md`, `section-outline.md`, `reviewer-strategy.md`, `task-dependency.md` | User approves |49| 4 | Paper Writing | `paper/01-introduction.md` ... `paper/05-conclusion.md` per chapter | Per-phase auto-review + user progress report |50| 5 | Assembly & Output | `paper/full-paper.md`, optional `latex/`, `word/` | User accepts final |5152**Output directory:** `{project_root}/paper-output/` — contains `analysis/`, `writing-plan/`, `paper/`, `review-logs/`, and optionally `latex/`, `word/`.5354---5556## Phase 0: Initialization5758Collect all configuration through structured questions. Every subsequent phase reads these settings.5960### Step 1: Interaction Language6162Use `AskUserQuestion`:63- **question**: "What language for interaction during this session? / 本次交互使用哪种语言?"64- **options**:65 1. "中文(推荐)"66 2. "English"67 3. "中英混合 / Mixed"68 4. "日本語"6970Store as `config.interaction_lang`. All agent prompts and user-facing output follow this choice.7172### Step 2: Paper Output Language7374Use `AskUserQuestion`:75- **question**: "What language for the paper itself? / 论文的最终输出语言?"76- **options**:77 1. "English (recommended for international venues)"78 2. "中文"79 3. "中英双语版本 / Bilingual"80 4. "Same as interaction language"8182Store as `config.paper_lang`.8384### Step 3: Output Format8586Use `AskUserQuestion`:87- **question**: "Paper output format? / 论文输出格式?"88- **options**:89 1. "Markdown (recommended, convertible later)"90 2. "LaTeX (generate .tex files directly)"91 3. "Markdown + LaTeX dual version"92 4. "Word (.docx)"9394Store as `config.output_format`.9596### Step 4: Target Venue9798Use `AskUserQuestion`:99- **question**: "Target venue for submission? / 目标投稿会议/期刊?"100- **options**:101 1. "NeurIPS / ICML / ICLR (ML top-3)"102 2. "CVPR / ECCV / ICCV (Computer Vision)"103 3. "ACL / EMNLP / NAACL (NLP)"104 4. "AAAI / IJCAI (General AI)"105106Store as `config.target_venue`. The tool-provided "Other" option allows users to specify KDD, WWW, SIGMOD, journals, etc.107108### Step 5: Writing Mode109110Use `AskUserQuestion`:111- **question**: "Writing scope? / 本次写作的范围?"112- **options**:113 1. "Full paper: code analysis through complete paper"114 2. "Single chapter: write specific section(s) only"115 3. "Revision mode: improve an existing draft"116 4. "Analysis only: code analysis without paper writing"117118Store as `config.writing_mode`.119120**If single chapter mode:** follow up with `AskUserQuestion` asking which sections (Abstract, Introduction, Related Work, Methodology — "Other" covers Experiments, Conclusion, etc.).121122**If revision mode:** ask user to provide the path to the existing draft.123124### Step 6: Reference Sources125126Use `AskUserQuestion`:127- **question**: "Do you have reference papers? / 是否有自己的参考文献?"128- **options**:129 1. "No, rely entirely on web search"130 2. "Yes, I will provide a directory path"131 3. "Some core references, supplement with web search"132 4. "I will manually input a reference list"133134Store as `config.references`. If user provides a path, validate it exists using `Glob`. If user chooses manual input, collect entries via follow-up.135136### Step 7: Drawing Integration137138Use `AskUserQuestion`:139- **question**: "Use AI-assisted figure generation? / 是否需要 AI 辅助生成论文图表?"140- **options**:141 1. "Yes, use nano-banana-draw for figures"142 2. "No, I will prepare figures myself"143 3. "Architecture diagrams only, I handle experiment plots"144 4. "Decide later during writing phase"145146Store as `config.use_drawing`.147148### Step 8: Project Access (Automatic)149150No user question required. Execute automatically:1511521. Use `Glob` to check for `{project_path}/.claude-index/index.md`153 - **Exists**: Read it for project structure context154 - **Missing**: Suggest running `/project-indexer` first. Ask via `AskUserQuestion`:155 - "Generate project index first? (Recommended)"156 - "Skip, proceed without index"157 - "I will provide project overview manually"158 - "Scan only specific directories"1592. Read `{project_path}/CLAUDE.md` if it exists1603. If the project has many modules, ask analysis scope:161 - "Entire project"162 - "Specific core modules/directories"163 - "Let agents auto-detect key areas"164 - "I will specify files to focus on"165166Store as `config.analysis_scope`.167168---169170## Phase 1: Code Analysis171172Dynamic team assembly and parallel deep analysis of the code repository. Produces four structured analysis files.173174### 1.1: Assemble Analysis Team175176After reading the project index, determine team size based on project complexity:177178| Indicator | Small (2-3 agents) | Medium (3-4 agents) | Large (5 agents) |179|-----------|----------------------|----------------------|-------------------|180| Core source files | < 20 | 20-100 | > 100 |181| Module count | < 3 | 3-8 | > 8 |182| Algorithm types | Single | 2-3 | > 3 |183184**Core roles (always present):**185186| Role | Code Name | Focus |187|------|-----------|-------|188| Architecture Analyst | `arch-analyst` | Module structure, data flow, design patterns, system-level innovation |189| Algorithm Analyst | `algo-analyst` | Core algorithms, model architecture, training strategy, loss functions |190| Innovation Extractor | `innovation-extractor` | Novelty assessment, contribution distillation, differentiation from prior work |191192**Extended roles (activated by complexity):**193194| Role | Code Name | Trigger | Focus |195|------|-----------|---------|-------|196| Math Modeler | `math-modeler` | Complex algorithms/models | Formal problem definition, objective derivation, pseudocode, complexity analysis |197| Literature Comparator | `lit-comparator` | User chose web search for references | SOTA comparison, related work retrieval via `WebSearch` |198199### 1.2: Launch Analysis Agents200201Spawn each agent using the `Agent` tool with `run_in_background: true`. Each agent prompt is assembled from these modules (see [team-profiles.md](references/team-profiles.md) for full templates):2022031. **Common prefix:** Google Brain/DeepMind senior researcher persona, `config.interaction_lang`, `config.paper_lang`, `config.target_venue`2042. **Rigor constraints:** $1000 penalty for inaccuracy, every claim cites file path + line number, `[UNCERTAIN]` tags mandatory for uncertain conclusions, no fabrication2053. **Three-powers injection:** Executor role awareness (output will be reviewed, disclose uncertainties proactively)2064. **Role specialization:** From [team-profiles.md](references/team-profiles.md) per agent role2075. **Mandatory reading list:** `.claude-index/index.md`, `CLAUDE.md`, role-relevant source files — prefixed with "BEFORE any analysis, read ALL of these files:"2086. **Task assignment + output template + completion criteria:** Report files read, 3-5 sentence summary, `[UNCERTAIN]` items, files created209210All analysis agents launch in parallel. Wait for all to complete before proceeding.211212### 1.3: Three-Powers Review of Analysis213214Apply the three-powers mechanism (see [three-powers-guide.md](references/three-powers-guide.md)) with rotation:215216| Task | Executor | Reviewer | Arbiter |217|------|----------|----------|---------|218| Architecture analysis | arch-analyst | algo-analyst | innovation-extractor |219| Algorithm analysis | algo-analyst | innovation-extractor | arch-analyst |220| Innovation extraction | innovation-extractor | arch-analyst | algo-analyst |221| Math modeling | math-modeler | algo-analyst | arch-analyst |222| Literature comparison | lit-comparator | innovation-extractor | algo-analyst |223224For each analysis report, auto-spawn a review agent. If the reviewer finds issues, the executor revises. If disagreement persists after two review rounds, the arbiter makes a final ruling. See the Three Powers Mechanism section below for the full workflow.225226### 1.4: Analysis Outputs227228After review, consolidate into four files under `paper-output/analysis/`:229230| File | Content |231|------|---------|232| `core-insights.md` | Project overview, core methods with code locations, ranked innovation points, contribution summary |233| `literature-review.md` | Related research areas, key references table (paper, year, venue, method, relation), SOTA comparison matrix, differentiation analysis |234| `math-formulation.md` | Formal problem definition, core method equations, algorithm pseudocode, theoretical analysis (if applicable) |235| `code-index.md` | Method-to-code mapping table (method, file, line range, description), file importance ranking |236237Present analysis summary to user. Use `AskUserQuestion`:238- "Approve and proceed to debate phase"239- "Request deeper analysis on specific areas"240- "Adjust innovation point rankings"241- "Redo analysis with different scope"242243---244245## Phase 2: Analysis Debate246247Structured multi-round debate among analysis team members to reach consensus on core innovations and positioning. See [debate-guide.md](references/debate-guide.md) for the full protocol.248249### 2.1: Debate Setup250251**Participants:** All analysis team members from Phase 1.252**Topics:**2531. What are the true core innovations? (Rank and filter)2542. Which technical contributions deserve emphasis in the paper?2553. How should the project be positioned relative to SOTA?2564. Is the mathematical formalization accurate and complete?257258### 2.2: Debate Execution (Max 3 Rounds)259260Each round follows this structure:261262**Round N — Position Submission (parallel):**263Spawn each participant as a background agent. Each submits a position document:264- Core judgment on the debate topics265- Supporting evidence (code references, literature)266- Proposed ranking/strategy267- Anticipated counterarguments268269**Round N — Cross-Examination (parallel):**270Each agent reviews all other position documents and submits challenges:271- Specific points of disagreement with evidence272- Requests for additional evidence273274**Round N — Response and Revision:**275Each agent responds to challenges and may revise their position.276277**Round N — Convergence Check:**278The designated arbiter (rotating per round) evaluates consensus:279- **Converged** (>80% agreement on core points): End debate, produce consensus280- **Not converged** + rounds remaining: Proceed to next round281- **Round 3 reached without convergence**: Arbiter issues forced ruling on all disputed points. Ruling is final and binding.282283### 2.3: Debate Outputs284285- Update `analysis/core-insights.md` to the consensus version286- Generate `analysis/debate-summary.md`: round count, participants, key disagreements with resolutions, final ranked innovations, unified contribution positioning, agreed SOTA differentiation narrative287288---289290## Phase 3: Writing Plan Debate291292A new team debates the paper's narrative strategy, reviewer defense, and section structure.293294### 3.1: Assemble Planning Team295296Spawn 3 new agents (distinct from the analysis team) set as Google LLM/AI research experts. Each reads ALL Phase 1-2 outputs before participating.297298### 3.2: Debate Execution (Max 3 Rounds)299300Same debate protocol as Phase 2. Each participant submits a complete writing proposal:301- Paper title suggestion302- Narrative arc (one paragraph: problem motivation through conclusion)303- Per-section core arguments (Introduction, Related Work, Methodology, Experiments, Conclusion)304- Strategy to convince reviewers305- Anticipated reviewer objections with preemptive responses (table: objection, response, paper location)306307Cross-examination focuses on: narrative weaknesses, unconvincing arguments, missing experiments, reviewer blind spots.308309Convergence and forced arbitration follow the same rules as Phase 2.310311### 3.3: Writing Plan Outputs312313Generate four files under `paper-output/writing-plan/`:314315| File | Content |316|------|---------|317| `narrative-strategy.md` | Consensus narrative arc, per-section core arguments, paper title |318| `section-outline.md` | Detailed outline with subsection structure, key points per subsection, target word counts |319| `reviewer-strategy.md` | Reviewer objection table, defense strategies, preemptive placements in paper |320| `task-dependency.md` | Writing task dependency graph (Phase A/B/C), per-task assignment, parallel groups |321322Present writing plan to user. Use `AskUserQuestion`:323- "Approve and assemble writing team"324- "Adjust narrative strategy"325- "Modify section outline"326- "Return to analysis phase for additional work"327328---329330## Phase 4: Paper Writing331332Assemble a 5-7 person writing team, execute in dependency order (Phase A/B/C), with auto-triggered three-powers review after each chapter.333334### 4.1: Writing Team Assembly335336**Fixed roles (5 members):**337338| # | Role | Code Name | Responsibility | Must-Read Files |339|---|------|-----------|----------------|-----------------|340| 1 | Chief Editor | `chief-editor` | Full-paper consistency, style coordination, Abstract + Conclusion, standing Arbiter | All files |341| 2 | Introduction Writer | `intro-writer` | Introduction, research motivation, contribution list | core-insights.md, narrative-strategy.md, literature-review.md |342| 3 | Method Writer | `method-writer` | Methodology, algorithm description, formula derivation | math-formulation.md, code-index.md, core-insights.md |343| 4 | Experiment Writer | `experiment-writer` | Experiments, results analysis, ablation studies | core-insights.md, literature-review.md, code-index.md |344| 5 | Literature Searcher | `lit-searcher` | Related Work, reference retrieval and organization | literature-review.md, user-provided references |345346**Optional roles (0-2 members):**347348| # | Role | Code Name | Activation | Responsibility |349|---|------|-----------|------------|----------------|350| 6 | Figure Designer | `figure-designer` | `config.use_drawing` enabled | Architecture diagrams, method figures, experiment plots via nano-banana-draw |351| 7 | Internal Reviewer | `internal-reviewer` | Always active (review role) | Simulates venue reviewer, chapter-level quality audit |352353### 4.2: Present Team for Approval354355Show the user: team composition, task assignments, dependency graph visualization, estimated chapter count and length.356357Use `AskUserQuestion`:358- "Approve and start writing"359- "Adjust team members"360- "Adjust task assignments"361- "Return to modify writing plan"362363### 4.3: Dependency Graph Execution364365```366Phase A (parallel): [Related Work] [Methodology] [Figures*]367 | | |368Phase B (parallel): [Introduction] [Experiments]369 | |370Phase C (parallel): [Abstract] [Conclusion]371 |372Final: [Chief Editor: Full Assembly]373```374375*Figures only if figure-designer is activated.376377**Phase A — Launch parallel agents:**378379Spawn each Phase A writer using the `Agent` tool with `run_in_background: true`. Each agent prompt includes:3803811. Team persona from [team-profiles.md](references/team-profiles.md)3822. Role-specific instructions from [writing-style-guide.md](references/writing-style-guide.md)3833. Three-powers role assignment (Executor)3844. Mandatory file reading list (all analysis + writing-plan files)3855. Style constraints (see Writing Quality Rules below)3866. Completion criteria and reporting requirements3877. Section-specific instructions:388 - **lit-searcher**: Use `WebSearch` for latest papers, verify every citation exists, organize by research direction not chronology, bridge from related work to this project's method389 - **method-writer**: Strictly follow `math-formulation.md`, cross-check with `code-index.md`, include algorithm pseudocode, ensure reproducibility from this section alone390 - **figure-designer**: Invoke `nano-banana-draw` skill, unified visual style, minimum Figure 1 = system architecture overview, output to `paper/figures/`391392Wait for all Phase A agents to complete. Auto-trigger review for each (see Section 4.4). Only after all Phase A chapters pass review, launch Phase B.393394**Phase B — Launch after Phase A reviewed:**395396- **intro-writer**: Read completed Related Work and Methodology, follow `narrative-strategy.md`, structure as: concrete problem introduction, existing method limitations, this paper's approach, contribution list (3-4 bullets). Must not duplicate Related Work content.397- **experiment-writer**: Reference Related Work baselines and Methodology components, follow `reviewer-strategy.md` for experiment design, include setup, main comparison, ablation, analysis. Use `[PLACEHOLDER: fill with actual results]` where real data is unavailable.398399Wait for Phase B completion and review pass, then launch Phase C.400401**Phase C — Launch after Phase B reviewed:**402403- **chief-editor writes Abstract**: 150-250 words, every claim must be supported in the body. Based on all completed chapters.404- **chief-editor writes Conclusion**: Summarize contributions, discuss limitations honestly, propose future work. Consistent with all chapters.405406### 4.4: Auto-Triggered Chapter Review407408When any writer agent completes, **immediately** spawn a review agent — do NOT wait for user input.409410**Review agent prompt** includes: senior `{config.target_venue}` Area Chair persona, Three Powers Reviewer injection ($1000 penalty for perfunctory review), mandatory reading (chapter file + section-outline + narrative-strategy + relevant analysis files), and a three-part review checklist:411412- **Content quality:** Matches writing plan, clear arguments, technical accuracy vs code-index.md, real citations413- **Writing quality:** No AI traces (see Writing Quality Rules), professional language, paragraph thesis structure, consistent terms414- **Academic standard:** Meets venue standard, innovation adequately argued, sound experiment design415416Output follows the review report template from [three-powers-guide.md](references/three-powers-guide.md).417418**Review outcomes:**419- **Pass**: Mark chapter as reviewed. If all chapters in current phase pass, launch next phase.420- **Fail**: Reviewer fixes minor issues directly. For major issues, spawn a fix agent with the issue list. Re-review after fix (round 2). If still failing after round 2, the executor may dispute. If disputed, Chief Editor (Arbiter) makes a final binding ruling. If not disputed, one more fix cycle is attempted (round 3 max). After 3 review rounds without pass, Chief Editor forces a final ruling.421422**On review failure after arbiter ruling**, use `AskUserQuestion`:423- "Accept Chief Editor's ruling and proceed"424- "Manually review and provide guidance"425- "Reassign chapter to different writer"426- "Skip this chapter for now"427428### 4.5: Progress Reporting429430After each execution phase completes, report to user:431432```433## Phase {X} Writing Progress434435| Chapter | Writer | Status | Review | Word Count |436|---------|--------|--------|--------|------------|437| Related Work | lit-searcher | Complete | Passed | ~2,500 |438| Methodology | method-writer | Complete | Passed (round 2) | ~3,200 |439440Launching Phase {X+1}...441```442443---444445## Phase 5: Assembly & Output446447### 5.1: Full Paper Assembly448449Chief Editor agent merges all chapters into `paper/full-paper.md`:4501. Combine chapters in order: Abstract, Introduction, Related Work, Methodology, Experiments, Conclusion, References4512. Unify terminology, notation, and writing style across chapters4523. Verify cross-references (figure numbers, equation numbers, citation numbers)4534. Generate `paper/references.md` with complete bibliography454455### 5.2: Final Review456457Spawn an independent final reviewer (Google Research Director persona, distinct from all previous agents). Reviews: logical consistency across chapters, smooth transitions, unified terminology/symbols, sequential reference/figure numbering, AI trace detection, `{config.target_venue}` compliance. Outputs pass/fail with issue list. If issues found, Chief Editor resolves. Max 2 rounds.458459### 5.3: Format Conversion460461Based on `config.output_format`:462463- **Markdown (default):** Already produced. Standards: `$$...$$` block math, `$...$` inline, ``, `[N]` references, fenced pseudocode blocks.464- **LaTeX:** Spawn conversion agent. Generate `latex/main.tex` with venue-specific document class (see [venue-profiles.md](references/venue-profiles.md)), per-chapter `.tex` files in `latex/sections/`, `references.bib`, copied `figures/`, and `Makefile`. Apply standard MD-to-LaTeX conversion rules.465- **Word:** Invoke docx skill to convert from Markdown. Output to `word/paper.docx`.466467### 5.4: Final User Options468469Use `AskUserQuestion`:470- "Complete — I will take it from here"471- "Run an additional optimization round"472- "Convert to another format"473- "Walk through each chapter for revision feedback"474475---476477## Three Powers Mechanism478479The Executor-Reviewer-Arbiter separation governs ALL multi-agent collaboration steps across Phases 1-5. See [three-powers-guide.md](references/three-powers-guide.md) for the complete protocol.480481### Roles482483| Role | Responsibility | Constraints |484|------|----------------|-------------|485| **Executor** | Produce the deliverable (analysis, chapter, etc.) | Cannot self-review, cannot mark own work as passed |486| **Reviewer** | Independently audit the executor's output | Cannot modify executor's work directly (except minor fixes), cannot serve as arbiter |487| **Arbiter** | Final ruling when executor and reviewer disagree | Intervenes only on dispute, ruling is final and unappealable |488489### Role Assignment Rules490491- **Analysis phase (1-2):** Rotating assignment — each agent serves as executor, reviewer, and arbiter across different tasks492- **Writing phase (4):** Chief Editor is the standing Arbiter. Internal Reviewer is the standing Reviewer. Chapter writers are Executors. Reviewer role rotates for variety where possible.493- **Debate phases (2-3):** All participants are simultaneously executors (position submission) and reviewers (cross-examination). A dedicated convergence evaluator serves as arbiter.494495### Review Workflow4964971. Executor submits output4982. Reviewer independently audits (reads source material, checks evidence)4993. **Pass** → mark complete, proceed. **Fail** → Reviewer lists issues (severity-ranked)5004. Executor revises → Reviewer re-audits5015. **Pass** → mark complete. **Still fails** → if Executor disputes, Arbiter reviews all materials and issues binding ruling. If no dispute, Executor revises again.502503### Anti-Deception Measures5045051. **Mandatory disclosure:** Executors must mark uncertain items with `[UNCERTAIN]`. Hiding uncertainty is a $1000 penalty offense.5062. **No self-review:** An agent can never review its own output. Enforced by role rotation tables.5073. **Independent judgment:** Reviewers must read source materials independently, not just echo the executor's claims.5084. **Audit trail:** All review reports and arbitration rulings are saved to `review-logs/` with timestamps.5095. **Anti-collusion:** Arbiter does not communicate with executor or reviewer during the review phase. Arbiter only activates upon dispute.510511### Prompt Injection512513Every agent prompt includes a role-awareness block. Inject the appropriate variant:514515- **Executor:** "Your output will be independently reviewed. Disclose uncertainties with `[UNCERTAIN]`. Every factual claim needs evidence (file path + line number, or citation)."516- **Reviewer:** "Assess independently. Check every item on the review checklist — blanket 'pass' without evidence incurs a $1000 penalty. Fix minor issues directly; flag major issues."517- **Arbiter:** "Intervene only on dispute. Ruling is final and unappealable. Review all materials from both parties before deciding."518519---520521## Writing Quality Rules522523Injected into every writing agent's prompt. See [writing-style-guide.md](references/writing-style-guide.md) for the full guide.524525### Hard Constraints (Violation = $1000 Penalty)5265271. Maximum 1 em dash per paragraph5282. Maximum 2 "however" per page5293. **Forbidden phrases:**530 - "It is worth noting/mentioning that..."531 - "In recent years, X has gained..."532 - "X plays a crucial/important/vital role in..."533 - "To the best of our knowledge..."534 - "The rest of the paper is organized as follows..." (if needed, use a natural phrasing)5354. No sequential "Firstly, Secondly, Thirdly, Finally"5365. Prefer active voice ("We propose X" not "X is proposed")5376. Every paragraph's first sentence must be its thesis statement5387. Define technical terms on first use, then abbreviate5398. No more than 2 consecutive adjectives modifying one noun5409. No exclamation marks54110. Use "use" instead of "leverage" or "utilize"542543### Quality Standards544545- Every factual claim must have evidence (code reference or citation)546- Mathematical formulas must be verifiable against source code547- All cited papers must actually exist (verify via `WebSearch` if needed)548- Content must be adapted to `config.target_venue` conventions and page limits549550---551552## Common Mistakes553554| Mistake | Fix |555|---------|-----|556| Launching Phase N+1 before Phase N is complete and reviewed | Phase-gated: all agents complete + all reviews pass before next phase |557| Skipping three-powers review to save time | Review is mandatory and auto-triggered. Never skip. |558| Agent writes without reading mandatory files | Every agent prompt starts with "BEFORE any work, read ALL of these files:" |559| AI writing traces in output | Enforce style rules in every writer prompt. Reviewer checklist catches violations. |560| Fabricated citations in Related Work | Literature searcher must verify every citation via WebSearch |561| Self-review (agent reviews own output) | Role rotation tables prevent this. Check assignments before spawning. |562| Waiting for user before auto-review | Chapter review is auto-triggered. Never wait for user input to start review. |563| Debate exceeding 3 rounds | Hard cap at 3 rounds. Round 3 ends with forced arbitration. |564| Not using `Agent` tool for subagents | All multi-agent phases MUST use `Agent` tool, not just describe tasks |565| Launching debate before analysis review passes | Phase 1 outputs must be reviewed before Phase 2 debate begins |566| Starting writing without user approval of writing plan | User must approve team composition in Step 4.2 |567| Figures generated but not referenced in text | Chief Editor checks all figure references during assembly |568569---570571## Required Tools572573- `Read`, `Write`, `Edit` — file operations for analysis outputs, paper chapters, review logs574- `Glob`, `Grep` — project code exploration, file discovery575- `Bash` — directory creation (`paper-output/`, subdirectories)576- `AskUserQuestion` — structured choices (4 options, tool adds 5th "Other")577- `WebSearch` — literature retrieval, citation verification578- **`Agent`** — spawning all subagents (analysis, debate, writing, review). Use `run_in_background: true` for parallel agents within the same execution phase.579- `Skill` — invoking `project-indexer` (pre-flight) and `nano-banana-draw` (figure generation)580581Phase 0-3 works in any environment. Phase 4-5 requires the `Agent` tool for subagent spawning.582583---584585## References586587- [team-profiles.md](references/team-profiles.md) — Full persona definitions for all agent roles588- [debate-guide.md](references/debate-guide.md) — Structured debate protocol and templates589- [three-powers-guide.md](references/three-powers-guide.md) — Executor-Reviewer-Arbiter mechanism details590- [writing-style-guide.md](references/writing-style-guide.md) — Anti-AI writing rules and style standards591- [output-templates.md](references/output-templates.md) — Templates for all output files592- [venue-profiles.md](references/venue-profiles.md) — Target venue formatting profiles and LaTeX templates