docs(work): refresh stale JSDoc headers in cli + prd-ship

Two stale-comment fixes surfaced after the dispatch handoff fix:

cli.mjs: the top-of-file JSDoc listed only 3 of 8 subcommands
(rebuild-state, status, next) and missed ready / blocked /
dispatch / decompose / prd-ship. Rewrote the header to describe
all 8 subcommands + their flags + the explicit-runCli routing
pattern that replaces the older side-effect-on-import approach
(established when the dispatch handoff broke and got fixed in
bb643b8).

prd-ship.mjs: the JSDoc claimed allowed transitions were
"<approved|in-review|draft> -> shipped", but the code refuses
draft (throws "still draft — flip to approved (human review)
before shipping"). Corrected the doc to "<approved|in-review>
-> shipped" + clarified that draft -> approved is the human step
deliberately kept outside the command's scope.

No behaviour change — comments only.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-13 18:18:42 +02:00
parent bb643b8635
commit 52b4409d94
2 changed files with 21 additions and 6 deletions

View File

@@ -1,11 +1,25 @@
#!/usr/bin/env node
/**
* pnpm work — CLI for the local work-system.
* pnpm work — CLI for the local work-system. Routes subcommands to their
* respective modules (state-builder, dispatch, decompose, prd-ship). Each
* subcommand module also exposes a `runCli(args)` entry point that this
* file calls directly; the sibling modules NEVER run as a side effect of
* being imported.
*
* Subcommands:
* rebuild-state Rewrites docs/work/_state.json from the current markdown
* status Prints a tree of all epics + their stories
* next Prints the first non-done story in the first non-done epic
* rebuild-state Rewrites docs/work/_state.json from the current markdown
* status Prints a tree of all epics + their stories
* next Prints the first ready story (or "All done" / "Blocked: ...")
* ready Prints every ready story
* blocked Prints every blocked story + what each is waiting on
* dispatch Print the next dispatch plan; with --execute invokes
* sandcastle to run the implementer + reviewer pair
* decompose <id> Validate an approved PRD + print the decompose plan;
* with --execute invokes sandcastle's decomposer agent
* to write the epic folder + per-story files
* prd-ship <id> Flip a PRD's status to `shipped` (run after its
* seed epic completes); --commits / --auto-commits
* optional; idempotent on already-shipped
*/
import fs from "node:fs";
import path from "node:path";