| name | write |
| description | Autonomously execute paper writing cycles. Specify the cycle limit as an argument (e.g., /write 3). Default: 5. |
| user-invocable | true |
Paper Writing PI
Draft research findings as an academic paper. The responsibility is to shape the knowledge accumulated through research (/auto) into draft paper form, then promote only meeting-authorized material into the human-authorized manuscript surface.
Constraints
- Write PI-authored prose in japanese. Scope: session records (
.logs/{timestamp}_write.md, .logs/last_write_session.md), agenda.md, and the final report. Paper-draft artifacts live under draft/** and use the paper's publication language. Use an explicit project declaration if one exists; otherwise infer it from existing manuscript/**, then draft/outline.md, then existing draft sections, and keep all paper surfaces consistent. If the evidence conflicts, record the inconsistency instead of letting the latest worker output set the language by accident. manuscript/** is also written in the paper's publication language, but only from meeting authorization snapshots. Reason: japanese is for internal project communication; the paper is an external artifact with its own audience. Exceptions for body-prose rule: technical terms, proper nouns, LaTeX, slugs, frontmatter keys, and the structural ## headings shown in English throughout this document (e.g., ## Accomplished, ## Section Status, ## Issues) may stay English. Treat English example templates in this SKILL as structural illustrations, not language directives
- Do not promote unapproved research facts into
manuscript/. research/**/note.md is draft fact material. It may be used for draft/**, but it becomes manuscript authority only through manuscript/authorizations/*.md snapshots created by /meeting. This preserves the human approval boundary even when /write runs autonomously
AskUserQuestion is prohibited. Users are often away, and asking questions interrupts the session and wastes time. Text output is limited to the final report only. Work silently
- However, you may respond if the user initiates communication
- Do not conduct new research. If a research gap is discovered during writing, record it in
agenda.md and leave it to /auto. Do not launch researcher or scout yourself
Bash("sleep ...") is prohibited. Polling is prohibited. For waiting on agent completion, use only Pattern A / B
Arguments
/write {N} — Set the cycle limit to N (default: 5). Hereafter referred to as MAX_CYCLES.
Terminology
| Term | Definition |
|---|
| Session | An entire /write execution |
| Cycle | One iteration of judgment → task execution → result collection |
| Task | A single agent invocation |
Directory Structure
research/ # Read-only — research tree
note.md # Root: thesis, background
story.md # Paper narrative structure
principles.md # Constraints
conventions.md # Project-wide notation and convention ledger
{branch}/note.md # Draft fact layer — what the node established, with derivation/scope/limits
{branch}/conventions.md # Subtree-local notation / convention ledger when needed
{branch}/state.md # Research process (ladder — kind/status in frontmatter)
{branch}/report_*.md # Clean self-contained analyses
concepts/ # Read-only — concept definitions
agenda.md # Writable — destination for reporting research gaps
draft/ # Paper-draft workspace, not human-authorized manuscript authority
outline.md # Paper outline (generated by outliner)
conventions.md # Terminology and notation conventions
sections/{N}_{slug}.md # Per-section drafts (generated by writer)
versions/v{N}.md # Integrated paper drafts (generated by finalizer)
manuscript/ # Human-authorized manuscript authority
authorizations/{timestamp}_{slug}.md # Meeting snapshots of approved note.md artifacts
outline.md # Authorized outline, if promoted
sections/{N}_{slug}.md # Authorized manuscript sections, if promoted
versions/v{N}.md # Authorized integrated manuscript versions, if promoted
.logs/
{timestamp}_review_{slug}.md # reviewer output
{timestamp}_audit.md # reference-auditor output
{timestamp}_write.md # Permanent session record
last_write_session.md # Session handoff (overwrite each session)
Agent dispatches Used
| Agent | Role |
|---|
| outliner | Design the overall paper structure from the narrative structure and research tree |
| writer | Draft a specified section as an academic paper |
| reviewer | Verify the logical consistency of a section |
| finalizer | Integrate all sections and produce the final version |
| reference-auditor | Verify the mechanical accuracy of references and citations |
Session Start
- Capture session timestamp:
Bash("date '+%Y-%m-%dT%H:%M'"). At session end, obtain the log path via bash .scripts/log-path.sh write and use the captured start timestamp in the log heading
- Read
.logs/last_write_session.md (if it exists)
- Read
research/note.md (thesis, background) + research/story.md (narrative structure) + research/principles.md + research/conventions.md (if exists)
- Navigate the tree:
ls research/ → read children's note.md (draft facts) + conventions.md (if exists) for established knowledge and notation, and state.md frontmatter for kind/status
- Browse
concepts/ for relevant concept definitions as needed
- Read
draft/outline.md (if it exists)
- Check existing section drafts (Glob
draft/sections/*.md)
- Check
manuscript/authorizations/*.md (if any) to determine what content is approved for manuscript promotion
Writing readiness check:
- Navigate the tree and check the status of core nodes. If too many are open/active, writing will require major rewrites later. In that case, write "Writing deferred due to insufficient research. The following nodes need resolution first: ..." in
agenda.md, report to the user in the final report, and exit
- This is a judgment criterion, not a rigid rule. If the policy is to write active items honestly as gaps, proceed with writing
Narrative authority check: research/story.md is a paper-narrative surface owned by /launch, /meeting, and /write, not by /auto. During /write, update it only when drafting exposes a better manuscript order, storyline, or section positioning that should persist beyond the draft outline. Do not use story.md to record facts, research state, worker tasks, or child-routing conditions; those belong in findings.md, state.md, plan.md, or map.md.
Authorization check:
- If no
manuscript/authorizations/*.md exists, work only in draft/**. Do not create or update manuscript/ prose from unapproved note.md
- If authorization snapshots exist, treat them as the exact approved source material for manuscript promotion. Read their scope, exclusions, and copied artifact body. Do not silently substitute a newer
research/**/note.md unless a later meeting authorization covers that newer text
- If a draft section contains both authorized and unauthorized material, split the result without crossing authority boundaries: promote only authorized claims and neutral editorial transitions that add no factual content. Leave unapproved claims, framing, bridges, or scope expansions in
draft/**, or report the missing approval
Cycles (Repeat up to MAX_CYCLES times)
1. Writing Judgment
Decide the next action based on the current state:
Phase flow:
- Draft outline not yet created → Launch outliner for
draft/outline.md
- Unwritten draft sections exist → Launch writer for
draft/sections/ (multiple sections in parallel)
- Unreviewed draft sections exist → Launch reviewer (multiple in parallel)
- Draft sections with review FAIL → Fix with writer → re-review
- All draft sections PASS → Launch finalizer for
draft/versions/
- Draft integrated version complete → Launch reference-auditor
- Audit complete → Final fixes with finalizer
- Meeting authorizations match a ready draft unit → Promote that authorized content into
manuscript/**, preserving scope and exclusions from the authorization snapshots. Do not wait for unrelated sections to finish
Phases are guidelines; judge flexibly. If a review reveals insufficient content, record the research gap in agenda.md, put that section on hold, and proceed with others.
Manuscript Promotion Rule
manuscript/ is not a more polished draft folder. It is the human-authorized paper surface. Promotion means rewriting the authorized snapshot content into paper prose while preserving its mathematical scope, caveats, and source/project boundaries.
Before writing any manuscript/** file:
- Identify the exact
manuscript/authorizations/*.md snapshot(s) that authorize the content
- Check whether the target manuscript section already exists; if it conflicts with the authorization, flag the conflict in the final report rather than silently reconciling it
- Write only the authorized content, with citations and narrative integration as needed
- Add a short provenance note in the write session log listing the authorization snapshot paths used for each manuscript file
Promotion may occur whenever a relevant draft unit is ready and matching authorization exists; it is not blocked by unrelated unfinished sections. If manuscript promotion would require unapproved bridging claims, new research, or scope expansion beyond the snapshot, do not promote that part. Record the missing approval or missing research in agenda.md and report it.
2. Task Execution
Maximize parallelization. Always launch independent tasks together.
Launch method: Use the same Pattern A / Pattern B as /auto.
Prompt template:
Each agent is defined in .claude/agents/{agent}.md.
Invoke it with subagent_type="{name}". Write only task-specific information:
## Task
{specific instructions}
Dynamic data by agent:
- outliner: (no additional data — reads research/ tree and concepts/ on its own)
- writer:
Assigned section: #{N} {title} (slug: {slug}) / Related nodes: {paths} / Evidence: {paths} / Authorization snapshots: {paths, if promoting to manuscript} / For revisions: Review report: {path}
- reviewer:
Target section: draft/sections/{N}_{slug}.md / Related nodes: {paths}
- finalizer:
Audit report: {path} (if available)
- reference-auditor:
Target deliverable: {path}
3. Result Collection
Retrieve deliverable paths from task return values and Read as needed:
- Reviewer results: Check PASS / FAIL. For FAIL, decide the fix approach and relaunch writer
- Research gap discovery: If writer or reviewer reports insufficient evidence, record specifically in
agenda.md (which node is lacking what)
- Update TodoWrite
4. Next Cycle (Return to Step 1)
Session End
- Write a session summary to
.logs/last_write_session.md (overwrite):
- Completed sections, review results, remaining tasks
- What to do in the next session
- Write session log: obtain the path via
bash .scripts/log-path.sh write (returns .logs/{YYMMDD_HHMM}_write.md); write to that path (permanent record — never overwrite):
# Write YYYY-MM-DD HH:MM
## Accomplished
- {sections drafted, reviewed, finalized}
## Section Status
- {per-section status: not started / drafted / review PASS / FAIL}
## Issues
- {research gaps reported, blockers}
## Manuscript Promotion
- {manuscript files changed and authorization snapshots used, or "none"}
Use the timestamp captured at session start (step 1).
- Confirm that research gaps have been recorded in
agenda.md if any
- Git commit:
git add {changed draft/manuscript/log/agenda paths} && git commit -m "write: {concise summary of achievements}"
- Display the final report to the user:
- Writing and review results
- Per-section status (not started / drafted / review PASS / FAIL)
- Manuscript promotion status and authorization snapshots used
- If research gaps exist, report them ("Please resolve the following via /auto before running /write again")
- Deliverable paths