# akashreya/manuscript_workflow architecture

> Architecture diagram of the GitHub repository akashreya/manuscript_workflow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akashreya/manuscript_workflow
- Repository: https://github.com/akashreya/manuscript_workflow

## Overview

Manuscript Workflow is a Claude plugin for editing existing novels and drafting new chapters through scoped review, skeptical refutation, controlled edits, and verification. Its principal editing loop runs FIND → REFUTE → FIX → GATE → VERIFY until two dry rounds; the writing workflow drafts chapters sequentially and converges each before advancing. Separate workflows verify touched chapters and census a whole manuscript. The repository also supplies reusable review skills, agent roles, story-specific template seeds, and mechanical checks. Arrows follow excerpts or README statements; unsampled subsystem internals are represented at their existing directories.

Main entry points: [`workflows/sweep.js`](https://github.com/akashreya/manuscript_workflow/blob/master/workflows/sweep.js) (Editing sweep), [`workflows/verify.js`](https://github.com/akashreya/manuscript_workflow/blob/master/workflows/verify.js) (Tiered verification), [`workflows/compose.js`](https://github.com/akashreya/manuscript_workflow/blob/master/workflows/compose.js) (Chapter composition), [`workflows/audit.js`](https://github.com/akashreya/manuscript_workflow/blob/master/workflows/audit.js) (Whole-book audit)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflows["Workflow orchestration"]
  node_sweep["Editing sweep<br/>[sweep.js]"]
  node_compose["Chapter composition<br/>[compose.js]"]
  node_verify["Tiered verification<br/>[verify.js]"]
  node_audit["Whole-book audit<br/>[audit.js]"]
end

subgraph group_method["Review method"]
  node_skills["Review skills"]
  node_agents["Agent roles"]
  node_chronology["Chronology review"]
  node_continuity["Continuity review"]
  node_census["Census method"]
  node_cold_read["Cold reading<br/>[cold-reader.md]"]
end

subgraph group_verification["Verification and measurement"]
  node_edit_gate["Edit legitimacy gate<br/>[check_edits.py]"]
  node_invariants["Manuscript invariants<br/>[check.py]"]
  node_post_hook["Post-edit checks<br/>[post_edit_hook.py]"]
end

subgraph group_story_state["Story configuration"]
  node_story_config["Story templates"]
  node_story_repo["Story repository"]
end

node_author(("Author"))
node_chapters["Manuscript chapters"]
node_claude(("Claude agent runtime"))

node_author -->|"starts pass"| node_sweep
node_chapters -->|"sweeps files"| node_sweep
node_sweep -->|"dispatches reviewers"| node_agents
node_sweep -->|"gates edits"| node_edit_gate
node_sweep -->|"checks chapters"| node_invariants
node_sweep -->|"edits and verifies"| node_chapters
node_author -->|"provides beats"| node_compose
node_compose -->|"dispatches roles"| node_agents
node_compose -->|"gates revisions"| node_edit_gate
node_compose -->|"drafts chapters"| node_chapters
node_chapters -->|"informs next chapter"| node_compose
node_author -->|"requests checks"| node_verify
node_verify -->|"runs tier zero"| node_invariants
node_verify -->|"dispatches seam walk"| node_chronology
node_verify -->|"dispatches registry sweep"| node_continuity
node_verify -->|"dispatches rebuilt reads"| node_cold_read
node_author -->|"requests census"| node_audit
node_audit -->|"uses measurement method"| node_census
node_audit -->|"scores corpus"| node_chapters
node_sweep -->|"loads pass method"| node_skills
node_agents -->|"loads shared method"| node_skills
node_claude -->|"runs workflow"| node_sweep
node_claude -->|"runs workflow"| node_compose
node_claude -->|"runs workflow"| node_verify
node_claude -->|"runs workflow"| node_audit
node_story_config -->|"seeds configuration"| node_story_repo
node_story_repo -->|"provides check config"| node_invariants
node_post_hook -->|"runs fast checks"| node_invariants

click node_sweep "https://github.com/akashreya/manuscript_workflow/blob/master/workflows/sweep.js"
click node_compose "https://github.com/akashreya/manuscript_workflow/blob/master/workflows/compose.js"
click node_verify "https://github.com/akashreya/manuscript_workflow/blob/master/workflows/verify.js"
click node_audit "https://github.com/akashreya/manuscript_workflow/blob/master/workflows/audit.js"
click node_skills "https://github.com/akashreya/manuscript_workflow/tree/master/skills"
click node_agents "https://github.com/akashreya/manuscript_workflow/tree/master/agents"
click node_edit_gate "https://github.com/akashreya/manuscript_workflow/blob/master/scripts/check_edits.py"
click node_invariants "https://github.com/akashreya/manuscript_workflow/blob/master/scripts/check.py"
click node_post_hook "https://github.com/akashreya/manuscript_workflow/blob/master/scripts/post_edit_hook.py"
click node_chronology "https://github.com/akashreya/manuscript_workflow/tree/master/skills/chronology"
click node_continuity "https://github.com/akashreya/manuscript_workflow/tree/master/skills/continuity"
click node_census "https://github.com/akashreya/manuscript_workflow/tree/master/skills/census"
click node_cold_read "https://github.com/akashreya/manuscript_workflow/blob/master/agents/cold-reader.md"
click node_story_config "https://github.com/akashreya/manuscript_workflow/tree/master/templates"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sweep,node_compose,node_verify,node_audit toneBlue
class node_skills,node_agents,node_chronology,node_continuity,node_census,node_cold_read toneAmber
class node_edit_gate,node_invariants,node_post_hook toneMint
class node_story_config,node_story_repo toneRose
class node_author,node_chapters,node_claude toneIndigo
```

## Components

### Workflow orchestration

- [Editing sweep](https://github.com/akashreya/manuscript_workflow/blob/master/workflows/sweep.js): `workflows/sweep.js`
- [Chapter composition](https://github.com/akashreya/manuscript_workflow/blob/master/workflows/compose.js): `workflows/compose.js`
- [Tiered verification](https://github.com/akashreya/manuscript_workflow/blob/master/workflows/verify.js): `workflows/verify.js`
- [Whole-book audit](https://github.com/akashreya/manuscript_workflow/blob/master/workflows/audit.js): `workflows/audit.js`

### Review method

- [Review skills](https://github.com/akashreya/manuscript_workflow/tree/master/skills): `skills`
- [Agent roles](https://github.com/akashreya/manuscript_workflow/tree/master/agents): `agents`
- [Chronology review](https://github.com/akashreya/manuscript_workflow/tree/master/skills/chronology): `skills/chronology`
- [Continuity review](https://github.com/akashreya/manuscript_workflow/tree/master/skills/continuity): `skills/continuity`
- [Census method](https://github.com/akashreya/manuscript_workflow/tree/master/skills/census): `skills/census`
- [Cold reading](https://github.com/akashreya/manuscript_workflow/blob/master/agents/cold-reader.md): `agents/cold-reader.md`

### Verification and measurement

- [Edit legitimacy gate](https://github.com/akashreya/manuscript_workflow/blob/master/scripts/check_edits.py): `scripts/check_edits.py`
- [Manuscript invariants](https://github.com/akashreya/manuscript_workflow/blob/master/scripts/check.py): `scripts/check.py`
- [Post-edit checks](https://github.com/akashreya/manuscript_workflow/blob/master/scripts/post_edit_hook.py): `scripts/post_edit_hook.py`

### Story configuration

- [Story templates](https://github.com/akashreya/manuscript_workflow/tree/master/templates): `templates`
- **Story repository**

### Other components

- **Author**
- **Manuscript chapters**
- **Claude agent runtime**

## Connections

- Author → Editing sweep: starts pass (evidence: `README.md`)
- Manuscript chapters → Editing sweep: sweeps files (evidence: `README.md`)
- Editing sweep → Agent roles: dispatches reviewers (evidence: `workflows/sweep.js`)
- Editing sweep → Edit legitimacy gate: gates edits (evidence: `workflows/sweep.js`)
- Editing sweep → Manuscript invariants: checks chapters (evidence: `workflows/sweep.js`)
- Editing sweep → Manuscript chapters: edits and verifies (evidence: `README.md`)
- Author → Chapter composition: provides beats (evidence: `README.md`)
- Chapter composition → Agent roles: dispatches roles (evidence: `workflows/compose.js`)
- Chapter composition → Edit legitimacy gate: gates revisions (evidence: `workflows/compose.js`)
- Chapter composition → Manuscript chapters: drafts chapters (evidence: `workflows/compose.js`)
- Manuscript chapters → Chapter composition: informs next chapter (evidence: `README.md`)
- Author → Tiered verification: requests checks (evidence: `README.md`)
- Tiered verification → Manuscript invariants: runs tier zero (evidence: `workflows/verify.js`)
- Tiered verification → Chronology review: dispatches seam walk (evidence: `workflows/verify.js`)
- Tiered verification → Continuity review: dispatches registry sweep (evidence: `workflows/verify.js`)
- Tiered verification → Cold reading: dispatches rebuilt reads (evidence: `workflows/verify.js`)
- Author → Whole-book audit: requests census (evidence: `README.md`)
- Whole-book audit → Census method: uses measurement method (evidence: `README.md`)
- Whole-book audit → Manuscript chapters: scores corpus (evidence: `workflows/audit.js`)
- Editing sweep → Review skills: loads pass method (evidence: `workflows/sweep.js`)
- Agent roles → Review skills: loads shared method (evidence: `README.md`)
- Claude agent runtime → Editing sweep: runs workflow (evidence: `README.md`)
- Claude agent runtime → Chapter composition: runs workflow (evidence: `README.md`)
- Claude agent runtime → Tiered verification: runs workflow (evidence: `README.md`)
- Claude agent runtime → Whole-book audit: runs workflow (evidence: `README.md`)
- Story templates → Story repository: seeds configuration (evidence: `README.md`)
- Story repository → Manuscript invariants: provides check config (evidence: `scripts/check.py`)
- Post-edit checks → Manuscript invariants: runs fast checks (evidence: `scripts/post_edit_hook.py`)
