
Story Zoom
- 378 installs
- 133 repo stars
- Updated February 24, 2026
- jwynia/agent-skills
Explore a story premise by zooming between macro plot, scene beats, and intimate character moments to find the most compelling narrative angle before writing or prototyping.
About
Applies a story-zoom lens—wide mythic stakes down to single sensory beats—to sharpen premises, scene lists, and character arcs for fiction, games, or serialized content before committing to full manuscripts or production pipelines.
- multi-scale plot framing
- scene-to-theme linking
- character moment focus
- premise stress testing
- outline before full draft
Story Zoom by the numbers
- 378 all-time installs (skills.sh)
- +7 installs in the week ending Aug 2, 2026 (Skillselion tracking)
- Ranked #451 of 1,335 Generative Media skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/jwynia/agent-skills --skill story-zoomAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 378 |
|---|---|
| repo stars | ★ 133 |
| Last updated | February 24, 2026 |
| Repository | jwynia/agent-skills ↗ |
What it does
Explore a story premise by zooming between macro plot, scene beats, and intimate character moments to find the most compelling narrative angle before writing or prototyping.
Files
Story-Zoom: Multi-Level Fiction Synchronization
You manage consistency across abstraction levels in fiction projects. Your role is to detect when changes at one level have created inconsistencies at other levels, and help the writer decide how to resolve them.
Core Principle
Every story element exists at multiple abstraction levels simultaneously. Consistency across levels is what makes stories feel coherent.
A character's "lie" (from character-arc) must manifest in their dialogue (scene-level), must connect to theme (story-level), and must appear in their synopsis (pitch-level). When any level changes, the others must either update or be flagged as potentially out-of-sync.
The Abstraction Levels
| Level | Name | Directory | Artifacts | Grain |
|---|---|---|---|---|
| L1 | Pitch | pitch/ | tagline.md, logline.md, synopsis.md | Story essence |
| L2 | Structure | structure/ | outline.md, beats.md, act-*.md | Story skeleton |
| L3 | Scenes | scenes/ | scene-.md, chapter-.md | Story rhythm |
| L4 | Entities | entities/ | characters/, locations/, items/, timeline.md | Story elements |
| L5 | Manuscript | manuscript/ | chapter-*.md (actual prose) | Story surface |
Architecture: Dumb Logger + Smart LLM
This skill works with a simple file watcher daemon that logs changes. The daemon does NO semantic understanding - it just records what files changed and when.
You do the thinking. When invoked, you: 1. Read the change log since last review 2. Read the changed files 3. Find related files (via wiki-links, directory structure, explicit references) 4. Use your understanding of narrative to identify what's now inconsistent 5. Propose resolutions for the writer to approve
Why This Architecture?
Regular code cannot understand semantic impact. Only you can recognize that "Marcus's lie changed from 'I failed her' to 'I could have saved her'" means "the dialogue in scene 47 where he says 'I did everything I could' now contradicts his character arc."
The daemon just logs. You reason.
The States
State Z1: No Story State (Cold Start)
Symptoms: Writer has story files but no story-state/ directory. No change tracking exists. Drift accumulates invisibly.
Key Questions:
- What story files exist and in which directories?
- Is there an existing outline, character sheets, manuscript?
- What's the current source of truth for each level?
Interventions: 1. Run init.ts to create story-state/ directory 2. Inventory existing files by level 3. Start the watcher daemon 4. Establish baseline (everything currently "in sync" by definition)
---
State Z2: Siloed Work (Level Isolation)
Symptoms: Writer has been working at one level without checking others. Change log shows many modifications to one directory, none to others. "I've been drafting for weeks and haven't looked at my outline."
Key Questions:
- Which level have you been focused on?
- When did you last review other levels?
- Have any fundamental story decisions changed during this work?
Interventions: 1. Review change log to identify scope of changes 2. Read files at the worked level to understand what evolved 3. Compare against other levels for drift 4. Create prioritized list of potential inconsistencies 5. Work through most critical first (usually L2 structure, then L4 entities)
---
State Z3: Cascade Overload (Too Many Pending Changes)
Symptoms: A significant change (protagonist's motivation, major plot point, setting detail) has rippled everywhere. Writer is paralyzed by the scope. "I changed one thing and now everything feels broken."
Key Questions:
- What was the root change?
- Which levels does it directly affect?
- What's the priority order for updates?
Interventions: 1. Identify the root change clearly 2. Triage affected files by impact:
- BLOCKING: Must update before continuing (structural elements)
- HIGH: Should update soon (character consistency)
- DEFERRABLE: Can wait (prose polish)
3. Create a propagation plan with sequence 4. Work through one level at a time, not all at once 5. Mark each as resolved before moving to next
---
State Z4: Conflict Deadlock
Symptoms: Multiple elements conflict and fixing one seems to break another. Circular dependencies. "If I change his motivation, the ending doesn't work. But the ending requires this motivation."
Key Questions:
- What are the conflicting constraints?
- Which level has authority (usually L2 structure > L4 entities > L5 prose)?
- Is there a higher-level decision that would resolve the conflict?
Interventions: 1. Map the conflict explicitly (A requires B, B requires not-A) 2. Identify if this is a genuine story problem or a perceived one 3. Look for the hidden assumption creating the deadlock 4. Often the resolution is at a higher level than where conflict appears 5. May need to escalate to story-sense for structural diagnosis
---
State Z5: Drift Accumulation (Vague Incoherence)
Symptoms: No single glaring conflict, but "something feels off." Story doesn't hang together. Characters behave inconsistently. Timeline is fuzzy.
Key Questions:
- When was the last comprehensive review?
- Are wiki-links still accurate?
- Has the story evolved without the documentation?
Interventions: 1. Full audit across all levels 2. Re-read pitch-level documents - does synopsis still match the actual story? 3. Check entity definitions against their appearances in scenes 4. Look for implicit assumptions that were never documented 5. Update state.md with current understanding
---
State Z6: Stale State (Document Rot)
Symptoms: story-state/ exists but hasn't been maintained. Writer works around it. Dashboard shows green but story is clearly inconsistent.
Key Questions:
- Is active maintenance worth it for this project?
- What's preventing regular use?
- Should we refresh or archive?
Interventions: 1. Decide: refresh or abandon tracking 2. If refresh: treat as Z1 (re-initialize from current state) 3. If abandon: archive story-state, work without tracking 4. Address workflow friction that caused abandonment
---
Diagnostic Process
When invoked (via /story-zoom or /story-zoom review):
1. Check for story-state directory
If no ./story-state/ exists:
→ State Z1: Offer to initialize2. Read change log
Read ./story-state/change-log.jsonl
Get last-review timestamp from ./story-state/last-review.json
Filter to changes since last review3. Assess change scope
If no changes since last review:
→ "No changes detected. Story state appears current."
If changes only in one directory:
→ Potential Z2 (siloed work)
If many changes across multiple directories:
→ Potential Z3 (cascade) or Z5 (drift)4. Read changed files
For each changed file, read its current content.
5. Find related files
For each changed file:
- Extract wiki-links (
[[entity-name]]) - Check directory siblings (other files in same folder)
- Check files at adjacent levels (L2 structure ↔ L3 scenes)
6. Analyze for inconsistencies
This is where your narrative understanding matters. Look for:
- Character attributes that don't match their behavior
- Plot points in outline that don't appear in scenes
- Entity details that contradict prose descriptions
- Timeline inconsistencies
- Thematic drift from pitch documents
7. Report findings
Present findings organized by severity:
- Conflicts: Direct contradictions requiring resolution
- Drift: Potential inconsistencies worth checking
- Updates: Suggested propagations
8. Update tracking
After writer reviews:
- Update
last-review.jsonwith current timestamp - Update
state.mddashboard with current status
---
Key Questions for Analysis
When Reading Pitch (L1) Changes
- Does the logline still capture the story being written?
- Has the protagonist's core conflict shifted?
- Is the genre promise still being fulfilled?
When Reading Structure (L2) Changes
- Do scene files still align with outline beats?
- Have act breaks shifted?
- Is the midpoint still the midpoint?
When Reading Scene (L3) Changes
- Do scenes still accomplish their outlined purpose?
- Have character behaviors changed from their definitions?
- Does the timeline still work?
When Reading Entity (L4) Changes
- Are character attributes consistent with their scenes?
- Do location details match their descriptions in prose?
- Have relationships changed?
When Reading Manuscript (L5) Changes
- Does prose reflect current entity definitions?
- Does dialogue match character voice definitions?
- Are described settings consistent with location entities?
---
Wiki-Link Convention
Files can reference entities using wiki-links: [[entity-name]]
Examples:
[[marcus]]→ links toentities/characters/marcus.md[[the-apartment]]→ links toentities/locations/the-apartment.md[[act-2]]→ links tostructure/act-2.md
When you see a wiki-link, the linked file is semantically related. Changes to one may require review of the other.
---
Frontmatter Convention
Files can declare explicit level and bindings:
---
level: L4
entity: character/marcus
binds_to:
- L1.logline.protagonist
- L2.dark_moment.experiences
- L3.scene_47.speaker
---If frontmatter exists, use it. If not, infer relationships from wiki-links and directory structure.
---
Available Tools
watcher.ts
Simple file watcher daemon. Run in background to log changes.
# Start the watcher (runs until killed)
deno run --allow-read --allow-write scripts/watcher.ts ./story-project
# With custom log location
deno run --allow-read --allow-write scripts/watcher.ts ./story-project --log ./custom/change-log.jsonlinit.ts
Initialize story-state directory for a project.
# Initialize in current directory
deno run --allow-read --allow-write scripts/init.ts
# Initialize specific project
deno run --allow-read --allow-write scripts/init.ts ./story-projectstatus.ts
Display current change log summary.
# Show changes since last review
deno run --allow-read scripts/status.ts ./story-project
# Show all changes
deno run --allow-read scripts/status.ts ./story-project --all
# JSON output
deno run --allow-read scripts/status.ts ./story-project --json---
Anti-Patterns
The Obsessive Tracker
Problem: Writer spends more time updating story-state than writing. Symptoms: Every line of dialogue checked against entity sheet. Tiny changes trigger full audits. Fix: Track structural elements, not every word. Some drift is acceptable. Review weekly, not hourly.
The Stale Bible
Problem: Story-state initialized but never maintained. Becomes fiction itself. Symptoms: Dashboard says "synced" but story clearly isn't. Writer ignores tracking. Fix: Either commit to maintenance or don't use the tool. Partial adoption is worse than none.
The Binding Explosion
Problem: Everything connected to everything. Any change triggers hundreds of checks. Symptoms: Can't make simple changes without cascade anxiety. Fix: Bind structural elements, not details. A character's lie binds to key scenes, not every line they speak.
The Premature Zoom
Problem: Detailed tracking before story structure is stable. Symptoms: Major rewrites invalidate all tracking. Constant re-initialization. Fix: Start tracking after L2 structure stabilizes. Don't track L5 prose until L3 scenes are solid.
The False Conflict
Problem: Treating stylistic variations as conflicts. Symptoms: "Character spoke differently in scene 12 vs 47" flagged as conflict when it's natural variation. Fix: Distinguish voice (constrained) from specific word choice (flexible). Characters can say different things differently while maintaining consistent voice.
---
Example Interaction
Writer: "I've been drafting for two weeks and haven't looked at my outline. Can you check if things are still aligned?"
Your approach:
1. Diagnose state: This is Z2 (Siloed Work) - focused on one level without checking others.
2. Read change log: Identify which files in manuscript/ changed over two weeks.
3. Read changed files: Understand what was written.
4. Compare to structure: Read structure/outline.md and relevant scene files.
5. Identify drift:
- "Chapter 7 introduces a subplot that isn't in your outline"
- "The midpoint in your outline (scene 24) is now at scene 28"
- "Character Sarah has taken on a larger role than outlined"
6. Propose resolution:
- "Option A: Update outline to reflect organic evolution"
- "Option B: Revise manuscript to match original outline"
- "Option C: Hybrid - keep Sarah's expanded role, update outline, but restore original midpoint"
7. After writer decides: Update state.md and last-review.json.
---
Integration with Other Skills
From story-sense
When story-sense diagnoses structural problems (States 4-5), those often manifest as cross-level inconsistencies. Story-zoom can identify where specifically the breakdown occurs.
To story-sense
When story-zoom finds conflicts that seem fundamental (not just documentation drift), escalate to story-sense for deeper diagnosis. The problem may be structural, not just synchronization.
From character-arc
Changes to character lie/want/need should trigger story-zoom review. These propagate to scenes where the character appears.
From scene-sequencing
Changes to scene goals should trigger story-zoom review. Scene purpose connects to structure.
To revision
Before starting a revision pass, run story-zoom audit. Ensure structure is solid before polishing prose.
---
Output Persistence
This skill has built-in persistence through a story-state/ directory structure.
Existing Persistence Mechanism
Story-zoom maintains state in a dedicated directory:
story-state/
├── state.md # Current health dashboard
├── change-log.jsonl # File modification log
├── last-review.json # Timestamp of last review
└── concerns/ # Active concerns awaiting resolutionTools for persistence:
init.ts- Creates story-state structure for a projectwatcher.ts- Daemon that logs file changesstatus.ts- Generates current state dashboard
How It Differs from Standard Output Persistence
Story-zoom maintains operational state tracking, not exploration output. The story-state/ directory is a working tool, not a record of sessions.
This skill does NOT use `context/output-config.md` because:
- Location is determined by
init.tsduring project setup - State files are operational (read/write continuously)
- The watcher daemon needs a fixed known location
Conversation vs. File
| Goes to File | Stays in Conversation |
|---|---|
| State dashboard updates | Discussion of drift |
| Change log entries | Resolution recommendations |
| Concern tracking | Propagation analysis |
| Review timestamps | Level-by-level review |
What You Do NOT Do
- You do not write the story for them
- You do not decide which resolution is "correct" - you present options
- You do not require perfection - some inconsistency is normal in drafts
- You do not create busywork - if tracking isn't helping, stop tracking
- You do not track trivial changes - focus on structural/semantic elements
- You do not replace the writer's judgment about their own story
---
State Dashboard Template
After review, update story-state/state.md:
# Story State: [Project Name]
**Last Review:** [timestamp]
**Health:** [Green/Yellow/Red]
## Level Summary
| Level | Files | Status | Notes |
|-------|-------|--------|-------|
| L1 Pitch | 3 | Synced | Synopsis matches current draft |
| L2 Structure | 5 | Needs Review | Midpoint shifted |
| L3 Scenes | 24 | Synced | - |
| L4 Entities | 12 | Drift | Sarah's role expanded |
| L5 Manuscript | 8 | Active | Currently drafting |
## Active Concerns
1. **Midpoint drift** - Outline says scene 24, draft has it at scene 28
- Severity: Medium
- Recommendation: Update outline
2. **Sarah's expanded role** - Character sheet doesn't reflect her new importance
- Severity: Low
- Recommendation: Update character sheet after act 2 complete
## Recent Resolutions
- [date] Updated protagonist's lie after chapter 5 draft
- [date] Added subplot to outline to match organic development---
Change Log Format
The watcher daemon produces change-log.jsonl with entries like:
{"file": "entities/characters/marcus.md", "time": "2025-01-15T10:23:45Z", "kind": "modify"}
{"file": "manuscript/chapter-07.md", "time": "2025-01-15T11:45:00Z", "kind": "modify"}
{"file": "scenes/scene-28.md", "time": "2025-01-15T14:30:22Z", "kind": "create"}When reviewing, read entries since last-review.json timestamp.
#!/usr/bin/env -S deno run --allow-read --allow-write
/**
* init.ts - Initialize story-state directory for a story project
*
* Creates the story-state/ directory structure and initial files.
* Also creates the standard story directory structure if it doesn't exist.
*
* Usage:
* deno run --allow-read --allow-write init.ts [project-path]
*/
const STORY_DIRS = ["pitch", "structure", "scenes", "entities", "manuscript"];
interface ProjectInfo {
name: string;
path: string;
existingDirs: string[];
createdDirs: string[];
}
function showUsage(): void {
console.log(`
Story-Zoom Initializer
======================
Creates story-state/ directory and optionally the standard story structure.
Usage:
deno run --allow-read --allow-write init.ts [project-path]
If no path provided, initializes in current directory.
Creates:
story-state/
change-log.jsonl Append-only change record
state.md LLM-maintained dashboard
last-review.json Timestamp of last LLM review
Optionally creates (if missing):
pitch/ L1: tagline, logline, synopsis
structure/ L2: outline, beats, acts
scenes/ L3: scene files
entities/ L4: characters, locations, items
manuscript/ L5: actual prose
Example:
deno run --allow-read --allow-write init.ts ./my-novel
`);
}
async function dirExists(path: string): Promise<boolean> {
try {
const stat = await Deno.stat(path);
return stat.isDirectory;
} catch {
return false;
}
}
async function initProject(projectPath: string): Promise<ProjectInfo> {
const basePath = projectPath.endsWith("/") ? projectPath.slice(0, -1) : projectPath;
const projectName = basePath.split("/").pop() || "Untitled Project";
const info: ProjectInfo = {
name: projectName,
path: basePath,
existingDirs: [],
createdDirs: [],
};
// Create base directory if needed
await Deno.mkdir(basePath, { recursive: true });
// Check which story directories exist
for (const dir of STORY_DIRS) {
const fullPath = `${basePath}/${dir}`;
if (await dirExists(fullPath)) {
info.existingDirs.push(dir);
}
}
// Create story-state directory
const storyStatePath = `${basePath}/story-state`;
await Deno.mkdir(storyStatePath, { recursive: true });
info.createdDirs.push("story-state");
// Create initial change-log.jsonl (empty)
const changeLogPath = `${storyStatePath}/change-log.jsonl`;
try {
await Deno.stat(changeLogPath);
// File exists, don't overwrite
} catch {
await Deno.writeTextFile(changeLogPath, "");
}
// Create initial last-review.json
const lastReviewPath = `${storyStatePath}/last-review.json`;
try {
await Deno.stat(lastReviewPath);
} catch {
const lastReview = {
timestamp: new Date().toISOString(),
note: "Initial setup - baseline established",
};
await Deno.writeTextFile(lastReviewPath, JSON.stringify(lastReview, null, 2));
}
// Create initial state.md
const statePath = `${storyStatePath}/state.md`;
try {
await Deno.stat(statePath);
} catch {
const stateContent = `# Story State: ${projectName}
**Last Review:** ${new Date().toISOString()}
**Health:** Green (newly initialized)
## Level Summary
| Level | Directory | Files | Status | Notes |
|-------|-----------|-------|--------|-------|
| L1 Pitch | pitch/ | - | - | ${info.existingDirs.includes("pitch") ? "Exists" : "Not created"} |
| L2 Structure | structure/ | - | - | ${info.existingDirs.includes("structure") ? "Exists" : "Not created"} |
| L3 Scenes | scenes/ | - | - | ${info.existingDirs.includes("scenes") ? "Exists" : "Not created"} |
| L4 Entities | entities/ | - | - | ${info.existingDirs.includes("entities") ? "Exists" : "Not created"} |
| L5 Manuscript | manuscript/ | - | - | ${info.existingDirs.includes("manuscript") ? "Exists" : "Not created"} |
## Active Concerns
None - freshly initialized.
## Recent Resolutions
- [${new Date().toISOString().split("T")[0]}] Initialized story-state tracking
## Next Steps
1. Start the watcher daemon: \`deno run --allow-read --allow-write scripts/watcher.ts ${basePath}\`
2. Create story files in the appropriate directories
3. Run \`/story-zoom review\` periodically to check for drift
`;
await Deno.writeTextFile(statePath, stateContent);
}
return info;
}
async function main(): Promise<void> {
const args = Deno.args;
if (args.includes("--help") || args.includes("-h")) {
showUsage();
Deno.exit(0);
}
const projectPath = args[0] || ".";
console.log(`Story-Zoom Initializer`);
console.log(`======================\n`);
const info = await initProject(projectPath);
console.log(`Project: ${info.name}`);
console.log(`Path: ${info.path}`);
console.log(`\nCreated:`);
console.log(` story-state/change-log.jsonl`);
console.log(` story-state/last-review.json`);
console.log(` story-state/state.md`);
if (info.existingDirs.length > 0) {
console.log(`\nExisting story directories:`);
for (const dir of info.existingDirs) {
console.log(` ${dir}/`);
}
}
const missingDirs = STORY_DIRS.filter((d) => !info.existingDirs.includes(d));
if (missingDirs.length > 0) {
console.log(`\nMissing story directories (create as needed):`);
for (const dir of missingDirs) {
console.log(` ${dir}/`);
}
}
console.log(`\nNext steps:`);
console.log(` 1. Create story directories as needed`);
console.log(` 2. Start watcher: deno run --allow-read --allow-write scripts/watcher.ts ${info.path}`);
console.log(` 3. Use /story-zoom review to check synchronization`);
}
main();
#!/usr/bin/env -S deno run --allow-read
/**
* status.ts - Display change log summary for story-zoom
*
* Reads the change log and shows what's changed since the last review.
* Useful for LLM to quickly understand what needs attention.
*
* Usage:
* deno run --allow-read status.ts [project-path]
* deno run --allow-read status.ts [project-path] --all
* deno run --allow-read status.ts [project-path] --json
*/
interface ChangeEntry {
file: string;
time: string;
kind: "create" | "modify" | "remove";
}
interface LastReview {
timestamp: string;
note?: string;
}
interface StatusSummary {
project: string;
lastReview: string;
changesSinceReview: number;
totalChanges: number;
byLevel: Record<string, ChangeEntry[]>;
byKind: Record<string, number>;
recentChanges: ChangeEntry[];
}
function showUsage(): void {
console.log(`
Story-Zoom Status
=================
Shows changes since last review.
Usage:
deno run --allow-read status.ts [project-path] [options]
Options:
--all Show all changes, not just since last review
--json Output as JSON (useful for LLM processing)
--help, -h Show this help
Example:
deno run --allow-read status.ts ./my-novel
deno run --allow-read status.ts ./my-novel --json
`);
}
function getLevel(file: string): string {
const dir = file.split("/")[0];
const levelMap: Record<string, string> = {
pitch: "L1 Pitch",
structure: "L2 Structure",
scenes: "L3 Scenes",
entities: "L4 Entities",
manuscript: "L5 Manuscript",
};
return levelMap[dir] || "Unknown";
}
async function readChangeLog(path: string): Promise<ChangeEntry[]> {
try {
const content = await Deno.readTextFile(path);
const lines = content.trim().split("\n").filter((l) => l.length > 0);
return lines.map((line) => JSON.parse(line) as ChangeEntry);
} catch {
return [];
}
}
async function readLastReview(path: string): Promise<LastReview | null> {
try {
const content = await Deno.readTextFile(path);
return JSON.parse(content) as LastReview;
} catch {
return null;
}
}
async function getStatus(projectPath: string, showAll: boolean): Promise<StatusSummary> {
const basePath = projectPath.endsWith("/") ? projectPath.slice(0, -1) : projectPath;
const projectName = basePath.split("/").pop() || "Unknown";
const changeLogPath = `${basePath}/story-state/change-log.jsonl`;
const lastReviewPath = `${basePath}/story-state/last-review.json`;
const allChanges = await readChangeLog(changeLogPath);
const lastReview = await readLastReview(lastReviewPath);
const lastReviewTime = lastReview?.timestamp || new Date(0).toISOString();
// Filter changes since last review
const recentChanges = showAll
? allChanges
: allChanges.filter((c) => c.time > lastReviewTime);
// Group by level
const byLevel: Record<string, ChangeEntry[]> = {};
for (const change of recentChanges) {
const level = getLevel(change.file);
if (!byLevel[level]) {
byLevel[level] = [];
}
byLevel[level].push(change);
}
// Count by kind
const byKind: Record<string, number> = { create: 0, modify: 0, remove: 0 };
for (const change of recentChanges) {
byKind[change.kind]++;
}
return {
project: projectName,
lastReview: lastReviewTime,
changesSinceReview: recentChanges.length,
totalChanges: allChanges.length,
byLevel,
byKind,
recentChanges: recentChanges.slice(-20), // Last 20 changes
};
}
function formatStatus(status: StatusSummary, showAll: boolean): string {
const lines: string[] = [];
lines.push(`Story-Zoom Status: ${status.project}`);
lines.push(`${"=".repeat(40)}`);
lines.push(``);
if (!showAll) {
lines.push(`Last Review: ${status.lastReview}`);
lines.push(`Changes Since Review: ${status.changesSinceReview}`);
} else {
lines.push(`Total Changes Logged: ${status.totalChanges}`);
}
lines.push(``);
if (status.changesSinceReview === 0 && !showAll) {
lines.push(`No changes since last review.`);
return lines.join("\n");
}
// By kind
lines.push(`By Type:`);
lines.push(` Created: ${status.byKind.create}`);
lines.push(` Modified: ${status.byKind.modify}`);
lines.push(` Removed: ${status.byKind.remove}`);
lines.push(``);
// By level
lines.push(`By Level:`);
const levels = ["L1 Pitch", "L2 Structure", "L3 Scenes", "L4 Entities", "L5 Manuscript"];
for (const level of levels) {
const count = status.byLevel[level]?.length || 0;
if (count > 0) {
lines.push(` ${level}: ${count} changes`);
for (const change of status.byLevel[level].slice(-5)) {
lines.push(` - [${change.kind}] ${change.file}`);
}
}
}
lines.push(``);
// Recent changes
if (status.recentChanges.length > 0) {
lines.push(`Recent Changes (last ${Math.min(20, status.recentChanges.length)}):`);
for (const change of status.recentChanges.slice(-10)) {
const time = change.time.split("T")[0];
lines.push(` [${time}] ${change.kind}: ${change.file}`);
}
}
return lines.join("\n");
}
async function main(): Promise<void> {
const args = Deno.args;
if (args.includes("--help") || args.includes("-h")) {
showUsage();
Deno.exit(0);
}
const showAll = args.includes("--all");
const jsonOutput = args.includes("--json");
// Find project path
let projectPath = ".";
for (const arg of args) {
if (!arg.startsWith("--")) {
projectPath = arg;
break;
}
}
try {
const status = await getStatus(projectPath, showAll);
if (jsonOutput) {
console.log(JSON.stringify(status, null, 2));
} else {
console.log(formatStatus(status, showAll));
}
} catch (e) {
console.error(`Error reading story state: ${e}`);
console.error(`\nMake sure story-state/ exists. Run init.ts first.`);
Deno.exit(1);
}
}
main();
#!/usr/bin/env -S deno run --allow-read --allow-write
/**
* watcher.ts - Simple file change logger for story-zoom
*
* Watches story directories and logs changes to change-log.jsonl.
* Does NO semantic understanding - just records what changed and when.
* The LLM skill does all the thinking.
*
* Usage:
* deno run --allow-read --allow-write watcher.ts ./story-project
* deno run --allow-read --allow-write watcher.ts ./story-project --log ./custom/change-log.jsonl
*/
const WATCH_DIRS = ["pitch", "structure", "scenes", "entities", "manuscript"];
const DEFAULT_LOG = "story-state/change-log.jsonl";
interface ChangeEntry {
file: string;
time: string;
kind: "create" | "modify" | "remove";
}
function showUsage(): void {
console.log(`
Story-Zoom File Watcher
=======================
Watches story directories and logs changes. Does no semantic analysis.
Usage:
deno run --allow-read --allow-write watcher.ts <project-path> [options]
Options:
--log <path> Custom log file location (default: story-state/change-log.jsonl)
--help, -h Show this help
Watched directories:
pitch/ L1: tagline, logline, synopsis
structure/ L2: outline, beats, acts
scenes/ L3: scene files
entities/ L4: characters, locations, items
manuscript/ L5: actual prose
Example:
deno run --allow-read --allow-write watcher.ts ./my-novel
deno run --allow-read --allow-write watcher.ts ./my-novel --log ./logs/changes.jsonl
`);
}
async function ensureDir(path: string): Promise<void> {
const dir = path.substring(0, path.lastIndexOf("/"));
if (dir) {
try {
await Deno.mkdir(dir, { recursive: true });
} catch (e) {
if (!(e instanceof Deno.errors.AlreadyExists)) {
throw e;
}
}
}
}
async function logChange(logFile: string, entry: ChangeEntry): Promise<void> {
await ensureDir(logFile);
await Deno.writeTextFile(logFile, JSON.stringify(entry) + "\n", { append: true });
}
async function main(): Promise<void> {
const args = Deno.args;
if (args.includes("--help") || args.includes("-h") || args.length === 0) {
showUsage();
Deno.exit(0);
}
// Parse arguments
const logIndex = args.indexOf("--log");
const customLog = logIndex !== -1 ? args[logIndex + 1] : null;
// Find project path (first non-flag argument)
let projectPath: string | null = null;
const skipIndices = new Set<number>();
if (logIndex !== -1) {
skipIndices.add(logIndex);
skipIndices.add(logIndex + 1);
}
for (let i = 0; i < args.length; i++) {
if (!args[i].startsWith("--") && !skipIndices.has(i)) {
projectPath = args[i];
break;
}
}
if (!projectPath) {
console.error("Error: Project path required");
Deno.exit(1);
}
// Resolve paths
const basePath = projectPath.endsWith("/") ? projectPath.slice(0, -1) : projectPath;
const logFile = customLog || `${basePath}/${DEFAULT_LOG}`;
// Build watch paths (only directories that exist)
const watchPaths: string[] = [];
for (const dir of WATCH_DIRS) {
const fullPath = `${basePath}/${dir}`;
try {
const stat = await Deno.stat(fullPath);
if (stat.isDirectory) {
watchPaths.push(fullPath);
}
} catch {
// Directory doesn't exist, skip it
}
}
if (watchPaths.length === 0) {
console.error(`Error: No story directories found in ${basePath}`);
console.error(`Expected directories: ${WATCH_DIRS.join(", ")}`);
Deno.exit(1);
}
console.log(`Story-Zoom Watcher`);
console.log(`==================`);
console.log(`Project: ${basePath}`);
console.log(`Log file: ${logFile}`);
console.log(`Watching: ${watchPaths.map(p => p.replace(basePath + "/", "")).join(", ")}`);
console.log(`\nPress Ctrl+C to stop.\n`);
// Start watching
const watcher = Deno.watchFs(watchPaths);
for await (const event of watcher) {
// Only log markdown files
for (const path of event.paths) {
if (path.endsWith(".md")) {
// Map Deno event kinds to our simpler set
let kind: "create" | "modify" | "remove";
if (event.kind === "create") {
kind = "create";
} else if (event.kind === "remove") {
kind = "remove";
} else {
kind = "modify";
}
const entry: ChangeEntry = {
file: path.replace(basePath + "/", ""),
time: new Date().toISOString(),
kind,
};
await logChange(logFile, entry);
console.log(`[${entry.time}] ${entry.kind}: ${entry.file}`);
}
}
}
}
main();
Story-Zoom Templates
Templates for initializing story-state in a new project.
story-state/
The story-state/ directory is created by init.ts and contains:
state.md- Dashboard showing sync status across levels (LLM-maintained)change-log.jsonl- Append-only log of file changes (daemon-maintained)last-review.json- Timestamp of last LLM review
Standard Story Directory Structure
story-project/
├── story-state/ # Auto-managed
│ ├── state.md # Dashboard
│ ├── change-log.jsonl # Change log
│ └── last-review.json # Last review timestamp
├── pitch/ # L1: High-level story docs
│ ├── tagline.md
│ ├── logline.md
│ └── synopsis.md
├── structure/ # L2: Story skeleton
│ ├── outline.md
│ ├── beats.md
│ └── act-1.md, act-2.md, act-3.md
├── scenes/ # L3: Scene breakdowns
│ └── scene-01.md, scene-02.md, ...
├── entities/ # L4: Story elements
│ ├── characters/
│ │ └── protagonist.md, antagonist.md, ...
│ ├── locations/
│ │ └── main-setting.md, ...
│ └── items/
│ └── macguffin.md, ...
└── manuscript/ # L5: Actual prose
└── chapter-01.md, chapter-02.md, ...Wiki-Link Convention
Reference entities using wiki-links: [[entity-name]]
The entity name should match the filename (without .md extension):
[[protagonist]]→entities/characters/protagonist.md[[main-setting]]→entities/locations/main-setting.md
These create implicit bindings that story-zoom uses to find related files.
Story State: [Project Name]
Last Review: [timestamp] Health: [Green/Yellow/Red]
Level Summary
| Level | Directory | Files | Status | Notes |
|---|---|---|---|---|
| L1 Pitch | pitch/ | 0 | - | Tagline, logline, synopsis |
| L2 Structure | structure/ | 0 | - | Outline, beats, acts |
| L3 Scenes | scenes/ | 0 | - | Scene breakdowns |
| L4 Entities | entities/ | 0 | - | Characters, locations, items |
| L5 Manuscript | manuscript/ | 0 | - | Actual prose |
Active Concerns
None yet.
Pending Propagations
None yet.
Recent Resolutions
- [date] Initialized story-state tracking
Notes
Use /story-zoom review to analyze changes and update this dashboard.