feat: markdown → scenario-data generator (tools/)

Add a deterministic authoring tool that turns a structured scenario
markdown file into a validated scenario-data module:
- tools/scenario-md.js: pure parseScenarioMarkdown + emitScenarioModule
  (frontmatter → meta; ## Timeline/## Clues/## Cast lists → the arrays;
  auto-slugged ids; validated via validateScenario before emit).
- tools/md-to-scenario.mjs: CLI (npm run gen:scenario), file or stdout.
- tools/example-scenario.md: documented format example.

Parses a defined format, not freeform con prose. tools/ is dev-only and
never bundled. tests/tools/scenario-md.test.js round-trips + validates.
187 tests pass; build clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
slaguru666
2026-07-20 23:33:28 +01:00
co-authored by Claude Opus 4.8
parent 6d529c9799
commit 7c6ee3eecc
7 changed files with 390 additions and 3 deletions
@@ -85,6 +85,12 @@ jsdom. No new dependencies. Fully offline.
chip that lights when active. Tests: `parking-lot.test.js`, `wake-lock.test.js`, `gm-shell-parking.test.js`,
`gm-shell-wake.test.js`. This completes every design §5 tray tool.
- **Markdown → scenario-data generator built.** `tools/scenario-md.js` (pure parse + emit) +
`tools/md-to-scenario.mjs` (CLI, `npm run gen:scenario`) turn a structured scenario markdown file
into a validated scenario module. Deterministic parser over a defined format (frontmatter + Timeline
/ Clues / Cast lists) — not freeform-prose scraping. `tests/tools/scenario-md.test.js` (round-trip
+ validation); `tools/` is dev-only, never bundled.
## Still deferred (backlog)
- Online art "Generate"; markdown → scenario-data generator; native iPad wrapper.
- Online art "Generate" (needs wifi + a gen backend); native iPad wrapper.