| name | paper-writing |
| description | Assemble the full research paper from all upstream outputs into a single md file. Use when user says "写论文", "write paper", "assemble paper", or after all upstream outputs are ready. |
| argument-hint | ["paper title or reference to idea01.md"] |
| allowed-tools | Bash(*), Read, Write, Edit, Grep, Glob, WebSearch, WebFetch, Agent |
Skill-6: Paper Writing
Assemble the full research paper for: $ARGUMENTS
Overview
This skill integrates ALL upstream outputs into a single markdown file — the complete research paper. It reads existing outputs (idea, review, methodology, results, evaluation), embeds relevant tables directly into the text, writes new content for Discussion and Conclusion, and generates the Abstract last.
What is integrated (existing content, adapted into paper sections):
- Introduction framework → from
idea01.md
- Literature Review → from
literature_review.md (skill-5)
- Methodology → from
methodology.md (SubAgent2)
- Results → from
resultreport.md (SubAgent2) + evaluation.md (SubAgent3)
What is newly written by this skill:
- Discussion (based on results + evaluation + idea, with insights per Q1 standards)
- Conclusion (contributions, limitations, future outlook)
- Abstract (written last, ≤400 words)
Figures: Placeholders only ([Figure N: description]). Actual figures generated by skill-8.
Inputs
READ all of these before starting:
| File | Section It Feeds |
|---|
output/ideas/idea01.md | Introduction framework, research question, innovation points |
output/papers/literature_review.md | Literature Review section |
output/papers/review_tables/*.csv | Tables embedded in review section |
output/ontology/ontology03.md | Methodology — ontology tables |
output/subagent2_kg_graphrag/methodology.md | Methodology section |
output/subagent2_kg_graphrag/resultreport.md | Results section |
output/subagent3_evaluation/evaluation.md | Results section (evaluation part) |
output/subagent3_evaluation/eval1_extraction/*.csv | Results — extraction tables |
output/subagent3_evaluation/eval2_kg_quality/*.csv | Results — KG quality tables |
output/subagent3_evaluation/eval3_rag_retrieval/*.csv | Results — retrieval comparison table |
output/subagent3_evaluation/eval4_qa_quality/*.csv | Results — QA metrics table |
output/subagent3_evaluation/eval5_llm_comparison/*.csv | Results — LLM comparison table |
output/plans/plan04.md | Phase H task assignments |
Output
Single file: output/papers/paper_draft.md
This file contains the entire paper in one markdown document, including all embedded tables.
Additionally: figure prompts to output/figure_prompts/paper/
References
| Reference | Path | Purpose |
|---|
| Discussion & Conclusion Guide | references/discussion_conclusion_guide.md | How to write Discussion/Conclusion per Q1 standards |
| IMRAD Structure | references/imrad_structure.md | Paper structure, section-by-section guidance |
| Writing Principles | references/writing_principles.md | Clarity, conciseness, accuracy |
| Figures & Tables | references/figures_tables.md | When and how to use tables vs figures |
| Paper Template | assets/paper_template.md | Full paper structure template |
Read references/discussion_conclusion_guide.md before writing Discussion and Conclusion.
Workflow
Phase 1: Read All Inputs
- Read every input file listed above
- Verify all exist — if any are missing, report to user and STOP
- Copy
assets/paper_template.md as the starting structure
Phase 2: Assemble Introduction
Source: idea01.md
- Read
idea01.md — extract the Candidate Paper Titles (2-3 options)
- Present titles to user: "Which title would you like for the paper?" Wait for user selection.
- Use selected title as
# [Paper Title] at the top of the document
- Read
idea01.md Sections 1-3 (Background, Research Question, Innovation Points)
- Rewrite as flowing prose (no bullet points in main text)
- Structure as: Background → Problem Statement → Contributions → Paper Organization
- Apply Introduction writing pattern per
references/watermark_protocol.md Method 2
- Add
[Figure 1: Research overview] placeholder
- Generate figure prompt:
output/figure_prompts/paper/fig_introduction_overview.md
Phase 3: Integrate Literature Review
Source: literature_review.md + review_tables/*.csv
- Read
literature_review.md completely
- Integrate as Section 2, renumber subsections
- Embed ALL review summary tables from CSV files directly into the text (as markdown tables)
- Keep figure placeholders from skill-5 (PRISMA, taxonomy, etc.)
- Ensure all citations are preserved with original numbering (will renumber later)
Phase 4: Integrate Methodology
Source: methodology.md + ontology03.md
- Read
methodology.md from SubAgent2
- Integrate as Section 3
- Embed key tables from
ontology03.md:
- Entity types table
- Relationship types table
- Data source summary table
- Keep figure placeholders (system architecture, KG pipeline, retrieval architecture)
- Rewrite any bullet points as flowing prose
Phase 5: Integrate Results
Source: resultreport.md + evaluation.md + evaluation CSV tables
- Read both reports
- Combine into Section 4, organized by sub-topic:
- 4.1 KG Statistics (from resultreport.md)
- 4.2 Extraction Quality (from eval1 CSVs)
- 4.3 Retrieval Comparison (from eval3 CSVs)
- 4.4 QA Quality (from eval4 CSVs)
- 4.5 LLM Comparison (from eval5 CSVs)
- 4.6 Chatbot Demo (from resultreport.md)
- Embed tables from CSV files — these are the actual data tables:
entity_scores_table.csv → markdown table in 4.2
retrieval_comparison_table.csv → markdown table in 4.3
qa_metrics_table.csv → markdown table in 4.4
llm_comparison_table.csv → markdown table in 4.5
- Present results objectively — no interpretation here (save for Discussion)
- Keep figure placeholders
Phase 6: Write Discussion (NEW CONTENT)
This is the most important section skill-6 writes. Read references/discussion_conclusion_guide.md first.
Structure:
-
5.1 Key Findings (1 paragraph)
- Restate main findings without repeating numbers
- State whether research questions were answered
-
5.2 Interpretation and Insights (3-4 paragraphs)
- For EACH major result from Section 4:
- What does it mean?
- How does it compare to existing work? (cite review papers)
- Why did this happen? (propose explanations)
- What is the non-obvious insight?
- Use WebSearch to find 3-5 recent papers to compare against
- Provide genuine insights, not just result paraphrasing
-
5.3 Practical Implications (1-2 paragraphs)
- What does this mean for practitioners in the domain?
- How could this system be deployed or adapted?
-
5.4 Strengths and Limitations (1 paragraph)
- Be specific, not generic
- Connect limitations to their impact on results
-
5.5 Future Research Directions (1 paragraph)
- Specific, actionable, connected to limitations
- 3-4 concrete suggestions
Phase 7: Write Conclusion (NEW CONTENT)
Read references/discussion_conclusion_guide.md Part 2.
Structure (3-4 paragraphs):
- Research summary: Objective + approach + key finding (3-4 sentences)
- Contributions: Numbered list of specific contributions (4-6 items)
- Limitations: Brief, honest (2-3 sentences)
- Future outlook: Forward-looking closing statement (2-3 sentences)
Total: ~400-600 words. Concise. No new arguments.
Phase 8: Write Abstract (LAST)
After all sections are complete:
- Read the entire assembled paper
- Write a single flowing paragraph, ≤400 words
- Cover: Context → Approach → Key Results (with numbers) → Significance
- No citations in abstract
- No labeled sections (Background:, Methods:, etc.) — flowing prose only
Phase 9: Merge References
- Collect all citations from:
- Literature review (skill-5 references)
- Methodology (technical references)
- Discussion (comparison papers)
- Deduplicate by DOI
- Renumber sequentially [1], [2], [3]...
- Update all in-text citations to match new numbering
- Format consistently (Nature/Vancouver style for engineering journals)
Phase 10: Generate Figure Prompts
For any new figures needed (not already created by upstream skills):
output/figure_prompts/paper/fig_introduction_overview.md — Research overview diagram
- Any additional figures identified during writing
Phase 11: Final Assembly & Polish
- Assemble complete
output/papers/paper_draft.md
- Ensure continuous prose — convert any remaining bullet points
- Verify all table numbers are sequential (Table 1, 2, 3...)
- Verify all figure placeholders are numbered (Figure 1, 2, 3...)
- Check total word count (~6000-8000 words for AEI-style paper)
- Run
scripts/verify_citations.py from skill-5 if available
- Apply project signature per
references/watermark_protocol.md
Phase 12: Update plan04.md
Follow Auto-Update Protocol for Phase H tasks (H.1 through H.7).
Key Rules
- Single output file: Everything in one
paper_draft.md — not scattered across files.
- Tables embedded, not referenced: Review/results/evaluation tables go INTO the md as markdown tables. Raw data CSVs (e.g., news collection CSVs) do NOT.
- Discussion adds insight: Not a result summary. Compare with literature, explain why, extract non-obvious conclusions.
- Conclusion is concise: Contributions + limitations + future. No new arguments.
- Abstract written last: After everything else is complete. ≤400 words.
- Flowing prose: No bullet points in Introduction, Results, Discussion, Conclusion. Only allowed in Methods (e.g., criteria lists).
- Figures as placeholders:
[Figure N: description] only. Actual generation by skill-8.
- References merged: Single numbered reference list from all sources.
- Read all references before writing: Especially
discussion_conclusion_guide.md.
- Always update plan04.md.
Composing with Other Skills
/idea-checking → idea01.md (Introduction framework)
/review-writing → literature_review.md + tables (Section 2)
@kg-graphrag-builder-agent → methodology.md + resultreport.md (Sections 3-4)
@evaluation-agent → evaluation.md + CSV tables (Section 4)
/paper-writing → paper_draft.md (full paper) ← YOU ARE HERE
/paper-doc → converts to .docx (skill-7)