# taosiuman/storyforge-writing architecture

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

- Interactive diagram: https://gitdiagram.com/taosiuman/storyforge-writing
- Repository: https://github.com/taosiuman/storyforge-writing

## Overview

storyforge-writing is an agent-executable writing skill: it routes a task to one or more product contracts, applies shared data-envelope rules, and guides framework creation and continued writing. Its ten contracts cover distinct writing and media domains; reference tables support schema-aware work. Two runtime scripts validate the skill package and generated framework artifacts. The workflow and validator dependencies below are supported by README statements or the shown script excerpts; unsampled contract internals are not inferred.

Main entry points: [`SKILL.md`](https://github.com/taosiuman/storyforge-writing/blob/main/SKILL.md) (Task routing), [`scripts/check_framework_artifact.py`](https://github.com/taosiuman/storyforge-writing/blob/main/scripts/check_framework_artifact.py) (Artifact validation), [`scripts/check_consistency.py`](https://github.com/taosiuman/storyforge-writing/blob/main/scripts/check_consistency.py) (Package consistency), [`contracts/S-data-envelope.md`](https://github.com/taosiuman/storyforge-writing/blob/main/contracts/S-data-envelope.md) (Data envelope)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Writing workflow"]
  node_skill["Task routing<br/>[SKILL.md]"]
  node_framework["Framework corpus"]
end

subgraph group_contracts["Product contracts"]
  node_characters["Characters<br/>[A-characters.md]"]
  node_interactive["Interactive<br/>[A-interactive.md]"]
  node_longform["Longform<br/>[A-longform.md]"]
  node_world["World engine<br/>[A-world-engine.md]"]
  node_comic["Comic<br/>[B-comic.md]"]
  node_motion["Motion drama<br/>[B-motion-drama.md]"]
  node_post["Post production<br/>[C-post.md]"]
  node_screenplay["Screenplay<br/>[C-screenplay.md]"]
  node_envelope["Data envelope<br/>[S-data-envelope.md]"]
end

subgraph group_references["Schema references"]
  node_schema["Schema tables<br/>[schema-tables.md]"]
  node_fields["Field registry<br/>[field-registry.md]"]
end

subgraph group_validation["Validation"]
  node_consistency["Package consistency"]
  node_artifact["Artifact validation"]
end

node_writer(("Agent or writer"))

node_writer -->|"classifies task"| node_skill
node_skill -->|"routes to"| node_characters
node_skill -->|"routes to"| node_interactive
node_skill -->|"routes to"| node_longform
node_skill -->|"routes to"| node_world
node_skill -->|"routes to"| node_comic
node_skill -->|"routes to"| node_motion
node_skill -->|"routes to"| node_post
node_skill -->|"routes to"| node_screenplay
node_skill -->|"applies across"| node_envelope
node_skill -->|"guides generation"| node_framework
node_writer -->|"continues writing"| node_framework
node_consistency -->|"reads"| node_schema
node_consistency -->|"checks consistency"| node_fields
node_artifact -->|"parses rules"| node_fields
node_artifact -->|"checks tables"| node_schema
node_artifact -->|"uses contract"| node_envelope
node_artifact -->|"validates"| node_framework

click node_skill "https://github.com/taosiuman/storyforge-writing/blob/main/SKILL.md"
click node_characters "https://github.com/taosiuman/storyforge-writing/blob/main/contracts/A-characters.md"
click node_interactive "https://github.com/taosiuman/storyforge-writing/blob/main/contracts/A-interactive.md"
click node_longform "https://github.com/taosiuman/storyforge-writing/blob/main/contracts/A-longform.md"
click node_world "https://github.com/taosiuman/storyforge-writing/blob/main/contracts/A-world-engine.md"
click node_comic "https://github.com/taosiuman/storyforge-writing/blob/main/contracts/B-comic.md"
click node_motion "https://github.com/taosiuman/storyforge-writing/blob/main/contracts/B-motion-drama.md"
click node_post "https://github.com/taosiuman/storyforge-writing/blob/main/contracts/C-post.md"
click node_screenplay "https://github.com/taosiuman/storyforge-writing/blob/main/contracts/C-screenplay.md"
click node_envelope "https://github.com/taosiuman/storyforge-writing/blob/main/contracts/S-data-envelope.md"
click node_schema "https://github.com/taosiuman/storyforge-writing/blob/main/references/schema-tables.md"
click node_fields "https://github.com/taosiuman/storyforge-writing/blob/main/references/field-registry.md"
click node_consistency "https://github.com/taosiuman/storyforge-writing/blob/main/scripts/check_consistency.py"
click node_artifact "https://github.com/taosiuman/storyforge-writing/blob/main/scripts/check_framework_artifact.py"

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_skill,node_framework toneBlue
class node_characters,node_interactive,node_longform,node_world,node_comic,node_motion,node_post,node_screenplay,node_envelope toneAmber
class node_schema,node_fields toneMint
class node_consistency,node_artifact toneRose
class node_writer toneIndigo
```

## Components

### Writing workflow

- [Task routing](https://github.com/taosiuman/storyforge-writing/blob/main/SKILL.md): `SKILL.md`
- **Framework corpus**

### Product contracts

- [Characters](https://github.com/taosiuman/storyforge-writing/blob/main/contracts/A-characters.md): `contracts/A-characters.md`
- [Interactive](https://github.com/taosiuman/storyforge-writing/blob/main/contracts/A-interactive.md): `contracts/A-interactive.md`
- [Longform](https://github.com/taosiuman/storyforge-writing/blob/main/contracts/A-longform.md): `contracts/A-longform.md`
- [World engine](https://github.com/taosiuman/storyforge-writing/blob/main/contracts/A-world-engine.md): `contracts/A-world-engine.md`
- [Comic](https://github.com/taosiuman/storyforge-writing/blob/main/contracts/B-comic.md): `contracts/B-comic.md`
- [Motion drama](https://github.com/taosiuman/storyforge-writing/blob/main/contracts/B-motion-drama.md): `contracts/B-motion-drama.md`
- [Post production](https://github.com/taosiuman/storyforge-writing/blob/main/contracts/C-post.md): `contracts/C-post.md`
- [Screenplay](https://github.com/taosiuman/storyforge-writing/blob/main/contracts/C-screenplay.md): `contracts/C-screenplay.md`
- [Data envelope](https://github.com/taosiuman/storyforge-writing/blob/main/contracts/S-data-envelope.md): `contracts/S-data-envelope.md`

### Schema references

- [Schema tables](https://github.com/taosiuman/storyforge-writing/blob/main/references/schema-tables.md): `references/schema-tables.md`
- [Field registry](https://github.com/taosiuman/storyforge-writing/blob/main/references/field-registry.md): `references/field-registry.md`

### Validation

- [Package consistency](https://github.com/taosiuman/storyforge-writing/blob/main/scripts/check_consistency.py): `scripts/check_consistency.py`
- [Artifact validation](https://github.com/taosiuman/storyforge-writing/blob/main/scripts/check_framework_artifact.py): `scripts/check_framework_artifact.py`

### Other components

- **Agent or writer**

## Connections

- Agent or writer → Task routing: classifies task (evidence: `README.md`)
- Task routing → Characters: routes to (evidence: `README.md`)
- Task routing → Interactive: routes to (evidence: `README.md`)
- Task routing → Longform: routes to (evidence: `README.md`)
- Task routing → World engine: routes to (evidence: `README.md`)
- Task routing → Comic: routes to (evidence: `README.md`)
- Task routing → Motion drama: routes to (evidence: `README.md`)
- Task routing → Post production: routes to (evidence: `README.md`)
- Task routing → Screenplay: routes to (evidence: `README.md`)
- Task routing → Data envelope: applies across (evidence: `README.md`)
- Task routing → Framework corpus: guides generation (evidence: `README.md`)
- Agent or writer → Framework corpus: continues writing (evidence: `README.md`)
- Package consistency → Schema tables: reads (evidence: `scripts/check_consistency.py`)
- Package consistency → Field registry: checks consistency (evidence: `scripts/check_consistency.py`)
- Artifact validation → Field registry: parses rules (evidence: `scripts/check_framework_artifact.py`)
- Artifact validation → Schema tables: checks tables (evidence: `scripts/check_framework_artifact.py`)
- Artifact validation → Data envelope: uses contract (evidence: `scripts/check_framework_artifact.py`)
- Artifact validation → Framework corpus: validates (evidence: `README.md`)
