SuperAPI AI Directory

paper-formal-writer

Writing & research

View repository

Updated 10-16 09:17

About this skill

Formal paper paradigm writer

Global workflow collaboration constraints (long-conversation drift prevention)

  • This skill must not be used as an isolated entry point. When the user requests a complete paper, generation of Word, continuation of the workflow, or is unsure of the stage, first return to paper-workflow-orchestrator to determine the current S0-S8 stage.
  • Before starting or continuing a formal task of this skill, you must run:
    python .claude/skills/paper-workflow-orchestrator/scripts/workflow_guard.py --skill paper-formal-writer
    
  • If the output is [WORKFLOW FAIL] or reports status != "PASS", stop this skill, and backfill the prerequisite stages according to the failed items in paper_output/qa/workflow_guard_report.json ; do not continue from memory.
  • This skill only writes paper_output/ artifacts within the scope of its own contract; after completion, you must return to paper-workflow-orchestrator to determine the next step, and use context-memory-keeper to record completed artifacts, blockers, and the next step.
  • In a long conversation, if the context becomes long, the stage is uncertain, or the user invokes skills separately, first run:
    python .claude/skills/paper-workflow-orchestrator/scripts/workflow_guard.py --status
    
    then read paper_output/qa/workflow_guard_report.json、paper_output/preflight_report.json、paper_output/input_manifest.json、paper_output/results/run_manifest.json and the upstream JSON contract of this skill, and continue according to the recommended_skill and next_action in the report.
  • Before continuing the workflow, you must treat paper_output/context/workflow_memory.json as a long-term breakpoint record; if its current_step、next_step、recommended_skill and workflow_guard.py --status are inconsistent, the guard report shall prevail.
  • After completing the artifacts of this skill each time, first return to paper-workflow-orchestrator or run workflow_guard.py --status, then update workflow memory:
    python .claude/skills/context-memory-keeper/scripts/update_workflow_memory.py
    
    After updating, read paper_output/context/workflow_memory.json / .mdto confirm that the next step and recommended skill have been recorded.

Execution contract

  • Upstream input: you must preferentially read paper_output/plan/model_route.json、paper_output/results/、paper_output/tables/table_index.json、paper_output/figure_index.json and the evidence gate report.
  • Core output:paper_output/plan/paper_outline.json、paper_output/final_paper_source.md、paper_output/final_paper.docx、paper_output/format_check_report.md。
  • Downstream handoff: after the format check passes, return to quality-assurance-auditor for the final consistency check; if it does not pass, continue to supplement the body text, figure and table explanations, or evidence citations.
  • Failure fallback: if the evidence gate does not pass, you must not call the Word document the final draft; you may generate only the outline and the to-be-written checklist.

Objective

  • This skill is responsible for the formal paper paradigm, chapter numbering, writing constraints, Word typesetting, and format checking.
  • The formal paper must be written globally by the Agent based on a complete evidence chain, and must not be mechanically assembled from quickstart drafts or micro-unit drafts.
  • Heading numbering is fixed to use 1 / 1.1 / 1.1.1。
  • The default target for the formal draft is 18000-25000 Chinese characters; below 18000 it fails the formal format check.

When to use

  • quality-assurance-auditor/scripts/evidence_gate.py official mode has already passed and it is time to move to the formal manuscript.
  • The user requests "in national competition paper format", "formal Word", "expand to competition paper workload", "insert figures and tables with explanations", or "check paper formatting".
  • There is already final_paper_source.md or final_paper.md, and it is necessary to unify the Word style, figure and table captions, and heading hierarchy.

References

  • Overall formal format specification:references/cumcm-paper-standard.md
  • Full-text template that can be given directly to the Agent:references/formal-paper-template.md
  • Expansion rules for each chapter:references/section-expansion-rules.md
  • Rules for explanations of figures, tables, formulas, algorithms, and results:references/figure-table-writing-rules.md

Script list

  • scripts/build_paper_outline.py
    • Read the problem statement, model route, results, metrics, conclusions, and the index of figures and tables.
    • Output paper_output/plan/paper_outline.json。
  • scripts/format_formal_docx.py
    • Input paper_output/final_paper_source.md。
    • Output paper_output/final_paper.docx and paper_output/format_check_report.md。
    • Use python-docx, without depending on LibreOffice.
  • scripts/check_paper_format.py
    • Check word count, chapters, three-level headings, figure/table references, references, appendices, placeholders, evidence coverage, and Word visual structure.
    • Word visual QA must at least check whether the docx can be opened and whether the number of paragraphs, heading styles, images, and tables roughly match the index.
    • Output paper_output/format_check_report.md and paper_output/format_check_report.json。

formal workflow

  1. Confirm that the evidence gate has passed; if not, first fill in paper_output/code/、results/、tables/ and figures/。
  2. Run:
    python .claude/skills/paper-formal-writer/scripts/build_paper_outline.py
    
  3. The Agent reads paper_outline.json and references, and writes globally based on the complete evidence chain:
    paper_output/final_paper_source.md
    
  4. Run:
    python .claude/skills/paper-formal-writer/scripts/format_formal_docx.py
    python .claude/skills/paper-formal-writer/scripts/check_paper_format.py
    
  5. If the format check fails, supplement the main text, figure/table explanations, references, appendices, or missing chapters according to the report.

A formal paper must satisfy

  • The abstract is expanded according to sub-questions, including methods, models, algorithms, and key results.
  • 1 问题重述、2 问题分析、3 模型假设、4 符号说明、5 模型的建立与求解、6 模型检验与灵敏度分析、7 模型评价与推广、8 参考文献、附录 complete structure.
  • Each question must include at least in Chapter 5 5.x.1 建模思路、5.x.2 变量定义与公式推导、5.x.3 求解算法、5.x.4 结果分析、5.x.5 模型检验或灵敏度分析。
  • Every figure and table must be cited and explained in the main text; figures and tables cannot be inserted without analysis.
  • Each formula must first define the variables, then present the formula, then explain the formula's meaning and purpose.
  • Algorithms must use Step 1、Step 2 and other forms for explanation.

Relationship with other skills

  • paper-workflow-orchestrator: the main entry point; after the evidence gate passes, route to this skill.
  • paper-micro-unit-generator: a prompt asset library and fallback draft tool, no longer the main writer for formal papers.
  • quality-assurance-auditor: responsible for the evidence gate; this skill is responsible for the format gate, and only after both pass can it be called a formal draft.