Build an Interactive Story
Create an interactive educational story using $ARGUMENTS.
Follow the full conventions in stories/CLAUDE.md. The story must be self-contained HTML with inline CSS/JS, 10-15 scenes, 3-5 branching points, 2-3 endings, and keyboard navigation (1-9 keys).
Phase 0 — Plan (interactive)
- Parse the argument: first word is the style name, optional remaining words hint at the topic.
- Read the Style Guide Catalog table in
README.mdto confirm the style is available (empty Story column) and see what's already taken. - Read the chosen style's HTML file from
styles/{name}.htmlto extract the design system. - Read
stories/CLAUDE.mdfor the template and conventions. - Read 1 existing story to match structure — skim for the STORY data format, engine pattern, and component mapping.
- If no topic was given:
- Research the style's cultural/historical period
- Propose 2-3 story concepts that thematically match the aesthetic
- Ask the user to pick one
- Propose the story arc: title, setting, 10-15 scene outline with branching diagram, key historical facts, and how style components map to narrative functions (e.g., "cards = case files", "alerts = discoveries").
- Discuss with the user before proceeding.
Phase 1 — Research (parallel Sonnet subagents)
Launch 2-3 sonnet subagents in parallel to research:
- Historical facts: Real names, dates, numbers, events for the chosen topic. Need 8-12 concrete facts.
- Cultural context: Period details, atmosphere, vocabulary appropriate to the era.
- Style component mapping: How to repurpose the style guide's CSS classes for narrative elements.
Each subagent returns structured research notes.
Phase 2 — Build (sequential Opus subagents)
Use 3-4 sequential opus subagents:
- First agent: Create the full HTML file with adapted CSS, title screen with back-to-stories link, scene wrapper structure, and the story engine JavaScript. Write the first 5 scenes of the STORY object. Include CSS for scene types (narration, investigation, confrontation, ending).
- Second agent: Read the file, add scenes 6-10 (or remaining scenes). Ensure branching points connect correctly.
- Third agent: Read the file, add remaining scenes and endings. Verify all
nextvalues point to defined scenes. Ensure every scene has afactproperty. Test that no orphan scenes exist. - Fourth agent (polish): Read complete file. Verify scene graph integrity (no dead ends, no orphans), keyboard navigation works, clue tracker collects facts, all historical content is accurate.
Critical rules for build agents:
- Each agent MUST read the current file before writing
- All
nextvalues in choices must reference existing scene IDs in the STORY object - Every scene needs:
year,era,content,fact,choices - Endings should offer "Play Again" (next: 'intro') and "Back to Stories" (next: '_exit')
- Back-to-stories link on title screen:
<a href="index.html">
Phase 3 — Brief & Index
- Write a research brief to
stories/briefs/{style-name}-brief.mddocumenting the historical facts, story arc, and component mapping. - Read
stories/index.htmlto understand the card format. - Add a card for the new story with: scene count, ending count, style name, title, description.
- Update the Style Guide Catalog table in
README.md— add the story title in the Story column for the chosen style. - Commit with message:
Add {title} interactive story ({style-name} style) - Push using:
git config --global credential.helper store && echo "https://GGPrompts:$(gh auth token --user GGPrompts)@github.com" > ~/.git-credentials && git push origin main