How the WRITE Stage of the ARS Pipeline Functions: Inside the 12-Agent Paper Authoring System
The WRITE stage (Stage 2) of the Academic Research Skills (ARS) pipeline orchestrates 12+ specialized agents to transform research concepts into complete, style-calibrated academic manuscripts through a tightly coordinated, multi-phase workflow.
The WRITE stage serves as the core paper-authoring engine within the Imbad0202/academic-research-skills repository. When triggered by the academic-pipeline orchestrator, this stage executes the academic-paper skill to manage everything from literature intake and structural outlining to draft generation and final formatting.
What Triggers the WRITE Stage in the ARS Pipeline
The WRITE stage activates when the academic-pipeline orchestrator detects a user intent to "write a paper," typically invoked via the /ars-plan command followed by a write request. According to academic-pipeline/SKILL.md, the orchestrator dispatches the academic-paper skill in either plan or full mode, depending on whether the user requires only an outline or a complete manuscript.
This stage operates as a decision-heavy checkpoint: the pipeline pauses after generating the section outline to await user approval before the draft_writer_agent begins composing the actual text. Machine checks—including anti-leakage protocols, VLM figure verification, and style-calibration—run automatically in the background but do not block progress without explicit user intervention.
The 12 Agents That Power the WRITE Stage
The WRITE stage relies on a coordinated team of agents defined in docs/ARCHITECTURE.md, each specialized for a specific authoring task. These agents execute sequentially and in parallel across four distinct phases.
Configuration and Literature Phase
intake_agent gathers the Paper Configuration Record immediately upon stage entry, capturing target journal specifications, word-count caps, citation style requirements, and formatting preferences.
literature_strategist_agent (denoted as 📚 literature_strategist_agent in the architecture) processes any user-provided Literature Corpus during Phase 1, identifying research gaps and extracting relevant sources to inform the argument structure.
Structure and Argument Design
structure_architect_agent generates a detailed section outline during Phase 2, allocating specific word-count budgets to each section to ensure the final manuscript meets journal constraints.
argument_builder_agent constructs the Argument Blueprint in Phase 3, establishing the thesis statement and mapping claim-evidence-reasoning (CER) chains that guide the draft writer's logical flow.
Core Drafting Phase
draft_writer_agent serves as the heart of the WRITE stage during Phase 4, composing the manuscript section-by-section while strictly enforcing the outline's word-count allocations and incorporating citation markers.
visualization_agent operates on-demand during Phase 4, generating figures and captions based on data supplied in the Material Passport when the draft_writer_agent encounters visual content requirements.
Quality Assurance and Finalization
citation_compliance_agent verifies that every in-text citation adheres to the selected citation style (e.g., APA 7) and inserts hidden reference-code markers immediately after the draft is produced.
abstract_bilingual_agent produces a bilingual abstract (English and Chinese) after the main text completion, ensuring it respects the target journal's word-count limits for abstracts.
peer_reviewer_agent performs a self-review of the draft during Phase 4a/b loops, checking for quality compliance and style adherence while generating revision instructions for optional improvement cycles.
formatter_agent applies final formatting during the exit phase, converting markdown to PDF or DOCX while performing a hard gate check to ensure no unresolved citation markers remain in the output.
Advisory and Revision Support
socratic_mentor_agent runs continuously as an advisory observer, offering interactive guidance (such as explaining specific paragraphs) when users request clarification during the writing process.
revision_coach_agent translates reviewer comments into actionable edit items for the draft_writer_agent when users opt for revision loops, effectively bridging Stage 4 (REVISE) with the core WRITE flow.
The WRITE Stage Execution Flow: From Configuration to Final Manuscript
The orchestrator documented in academic-pipeline/agents/pipeline_orchestrator_agent.md manages the WRITE stage through a six-step pipeline that registers a "WRITE" state-tracker entry for downstream stages to reference.
- Collect configuration and literature: The
intake_agentcaptures journal requirements while theliterature_strategist_agentprocesses the corpus. - Architect the paper structure: The
structure_architect_agentproduces the outline and word-count allocation. - Map the argument: The
argument_builder_agentcreates the CER chains and thesis blueprint. - Generate the manuscript: The
draft_writer_agentcomposes the draft section-by-section, leveraging thevisualization_agentfor figures and tracking word counts against the outline limits. - Execute self-review and formatting: The
peer_reviewer_agentquality-checks the draft, followed by theformatter_agentapplying style-calibrated output formats. - Output the final manuscript: The stage emits a complete, citation-compliant document ready for the Stage 2.5 integrity gate and subsequent peer review.
Code Example: Triggering the WRITE Stage via CLI
You can exercise the WRITE stage through the ARS CLI or interactive chat interface. The following commands demonstrate the complete flow from initiation to final export:
# Start the ARS pipeline and trigger the WRITE stage
/ars-plan
"Write a research paper on AI-assisted education assessment"
# Approve the outline to proceed to drafting
"Proceed with the outline I propose"
# Direct the draft_writer_agent to compose specific sections
"Write the Introduction section (≈ 500 words)"
# Generate bilingual abstract after main text completion
"Generate a bilingual abstract (English + Traditional Chinese)"
# Run the peer_reviewer_agent quality check
"Run the writing quality check"
# Apply suggested revisions (optional loop)
"Apply the first three revision items"
# Export the final manuscript via the formatter_agent
/export paper.pdf
The same workflow executes via command-line aliases (e.g., ars-write --topic "..."), with the academic-pipeline orchestrator invoking the exact agent sequence defined in the architecture documentation.
Key Source Files and Agent Implementations
The WRITE stage implementation spans multiple directories within the repository:
docs/ARCHITECTURE.md: Defines the complete stage-by-stage matrix, including the WRITE row listing all 12+ agents and decision checkpoints.academic-pipeline/SKILL.md: Specifies the Stage 2 dispatch contract foracademic-paperskill modes (plan vs. full).academic-pipeline/agents/pipeline_orchestrator_agent.md: Orchestrates agent sequencing, state registration, and cite-time provenance finalization.academic-paper/agents/draft_writer_agent.md: Implements the core Phase 4 drafting logic with word-count enforcement and citation marker emission.academic-paper/agents/structure_architect_agent.md: Generates outlines consumed by the draft writer.academic-paper/agents/argument_builder_agent.md: Supplies CER chains for argumentation structure.academic-paper/agents/citation_compliance_agent.md: Handles style verification and hidden marker insertion.academic-paper/agents/abstract_bilingual_agent.md: Creates dual-language abstracts with journal-specific constraints.academic-paper/agents/peer_reviewer_agent.md: Performs automated self-review before formatting.academic-paper/agents/formatter_agent.md: Executes final format conversion and unresolved citation gate checks.academic-paper/agents/revision_coach_agent.md: Mediates between reviewer feedback and draft rewrites.academic-paper/agents/visualization_agent.md: Generates figures and captions from Material Passport data.academic-paper/agents/socratic_mentor_agent.md: Provides on-demand explanatory guidance.shared/style_calibration_protocol.md: Supplies voice-matching profiles for thedraft_writer_agent.shared/ground_truth_isolation_pattern.md: Documents the partial-inversion discipline preventing front-matter leakage during citation emission.
Summary
- The WRITE stage (Stage 2) is the core authoring phase of the ARS pipeline, triggered by the
academic-pipelineorchestrator when users request paper generation. - 12+ specialized agents execute across four phases: configuration (
intake_agent,literature_strategist_agent), structure (structure_architect_agent), argumentation (argument_builder_agent), and drafting/quality assurance (draft_writer_agent,peer_reviewer_agent,formatter_agent). - The
draft_writer_agentserves as the heart of the stage during Phase 4, composing section-by-section while thevisualization_agenthandles figure generation. - Decision checkpoints require user approval of the outline before drafting begins, while automated machine checks run non-blocking verification protocols.
- The stage outputs a style-calibrated, citation-compliant manuscript ready for the Stage 2.5 integrity gate and subsequent review cycles.
Frequently Asked Questions
What is the difference between plan mode and full mode in the WRITE stage?
According to academic-pipeline/SKILL.md, plan mode generates only the section outline and argument blueprint for user review, while full mode executes the complete WRITE workflow including Phase 4 drafting, citation compliance checks, and final formatter output. The orchestrator selects the mode based on whether the user requests an outline preview or immediate full manuscript generation.
Which agent is responsible for generating the actual manuscript draft?
The draft_writer_agent defined in academic-paper/agents/draft_writer_agent.md handles the core manuscript composition during Phase 4. It writes content section-by-section, strictly adhering to the word-count allocations set by the structure_architect_agent and incorporating argument blueprints from the argument_builder_agent while emitting citation markers for the citation_compliance_agent to verify.
How does the ARS pipeline ensure citation compliance during the WRITE stage?
The citation_compliance_agent verifies that all in-text citations follow the configured style guide (such as APA 7) and inserts hidden reference-code markers immediately after the draft_writer_agent produces the draft. Subsequently, the formatter_agent performs a hard gate check to ensure no unresolved citation markers remain before final PDF or DOCX generation, as documented in the respective agent files.
Can the user intervene during the WRITE stage to modify the paper structure?
Yes. The WRITE stage operates as a decision-heavy checkpoint where the orchestrator pauses after the structure_architect_agent generates the outline, requiring explicit user approval before the draft_writer_agent begins composition. Users can modify the outline, adjust word-count allocations, or request structural changes at this checkpoint, and the socratic_mentor_agent remains available throughout the stage to provide interactive guidance on specific paragraphs or sections.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →