@tekyzinc/gsd-t 4.18.10 → 4.19.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  All notable changes to GSD-T are documented here. Updated with each release.
4
4
 
5
+ ## [4.19.10] - 2026-07-07
6
+
7
+ ### Added — `/gsd-t-stories`: dev-team handoff user stories in the Tekyz format
8
+
9
+ New standalone command that generates a development-team handoff document in the Tekyz user-stories format from any source — a scan register, a requirements doc, a design contract, or a reverse-engineered codebase. Reverse-engineered from the Tekyz Compass sample PRD: front matter → Application Flow Overview → User Stories grouped under Epics (id, story, workflow, grouped acceptance criteria, per-story flow diagram, mapped test-case table) → Scope Summary. Diagrams are authored as Mermaid but embedded as rendered PNGs (matching the sample's embedded-image flow charts), via `@mermaid-js/mermaid-cli`; output to `share/<Repo>-user-stories.md` (+ optional `.docx` via pandoc).
10
+
11
+ - `commands/gsd-t-stories.md`: the new command (input classification, epic/story decomposition, Mermaid→PNG→embed pipeline, markdown + optional docx output).
12
+ - `templates/playbooks/tekyz-user-stories-format.md`: bundled format reference (the exact structure + wording conventions).
13
+ - `commands/gsd-t-help.md`, `README.md`, `templates/CLAUDE-global.md`: command reference + standalone-list ripple.
14
+ - `test/filesystem.test.js`: command counts 52→53, gsdt 46→47.
15
+
16
+ Distinct from `/gsd-t-prd` (which writes the internal `docs/prd.md`) — this is an external client/dev deliverable. Suite 2631/2631.
17
+
5
18
  ## [4.18.10] - 2026-07-03
6
19
 
7
20
  ### Added — Scan Consolidation Opportunities + type-grouped register; init-scan-setup repo adoption
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # GSD-T: Contract-Driven Development for Claude Code
2
2
 
3
- **v4.18.10** - A methodology for reliable, parallelizable development using Claude Code with optional Agent Teams support.
3
+ **v4.19.10** - A methodology for reliable, parallelizable development using Claude Code with optional Agent Teams support.
4
4
 
5
5
  **Eliminates context rot** — task-level fresh dispatch (one subagent per task, ~10-20% context each) means compaction never triggers.
6
6
  **Compaction-proof debug loops** — `gsd-t headless --debug-loop` runs test-fix-retest cycles as separate `claude -p` sessions. A JSONL debug ledger persists all hypothesis/fix/learning history across fresh sessions. Anti-repetition preamble injection prevents retrying failed hypotheses. Escalation tiers (sonnet → opus → human) and a hard iteration ceiling enforced externally.
@@ -187,6 +187,7 @@ This will replace changed command files, back up your CLAUDE.md if customized, a
187
187
  | `/gsd-t-gap-analysis` | Requirements gap analysis — spec vs. existing code | Manual |
188
188
  | `/gsd-t-promote-debt` | Convert techdebt items to milestones | Manual |
189
189
  | `/gsd-t-estimate` | Turn any work doc (scan, requirements, feature/app spec) into a Tekyz client estimate (Google Sheet: T-Shirt Size + Team Mix) + matching PRD — supervised, with an operator-arbitrated Estimate Red Team | Manual |
190
+ | `/gsd-t-stories` | Generate a dev-team handoff doc in the Tekyz user-stories format (stories + workflows + acceptance criteria + Mermaid flow diagrams + mapped test cases) from any source | Manual |
190
191
  | `/gsd-t-populate` | Auto-populate docs from existing codebase | Manual |
191
192
  | `/gsd-t-design-decompose` | Decompose design into element/widget/page contracts | Manual |
192
193
 
@@ -364,6 +364,12 @@ Use these when user asks for help on a specific command:
364
364
  - **Updates**: the Tekyz estimate Google Sheet + `share/<Repo>-PRD-*.md` (and, if renumbered, the source doc/docs/scan files) + optional `share/<Repo>-estimate-redteam-notes.md`
365
365
  - **Use when**: You need a client-facing paid estimate + PRD (T-shirt sizing, dollar range, sign-off) from a scan OR a requirements/feature/app spec. **SUPERVISED** — judgment phases (sizing, adjustments, PRD, Red Team) pause for your review; **you are the final arbiter** of an Estimate Red Team that challenges the numbers. Rate + sheet template + factors are parameterized (default Tekyz). Encodes the Tekyz playbook (`~/.claude/playbooks/tekyz-estimation-and-prd-playbook.md`)
366
366
 
367
+ ### stories
368
+ - **Summary**: Generate a dev-team handoff document in the Tekyz user-stories format — discrete user stories with workflows, grouped acceptance criteria, per-story flow diagrams (Mermaid rendered to embedded images), and mapped test-case tables — from any source (scan register, requirements doc, design contract, or a reverse-engineered codebase)
369
+ - **Auto-invoked**: No
370
+ - **Updates**: new deliverable `share/<Repo>-user-stories.md` (+ optional `.docx` via pandoc) + `share/media/*.png` (rendered diagrams) + `.gsd-t/user-stories/diagrams/*.mmd`
371
+ - **Use when**: You need to hand a development team discrete, testable user stories in the Tekyz handoff style. Distinct from `/gsd-t-prd` (which writes the INTERNAL `docs/prd.md`) — this is an EXTERNAL client/dev deliverable. Diagrams are authored as Mermaid but embedded as rendered images (needs `@mermaid-js/mermaid-cli`). Format reference: `~/.claude/playbooks/tekyz-user-stories-format.md`
372
+
367
373
  ### populate
368
374
  - **Summary**: Auto-populate all living docs from existing codebase analysis
369
375
  - **Auto-invoked**: No
@@ -0,0 +1,68 @@
1
+ # GSD-T: Stories — Dev-Handoff User Stories (Tekyz format) from any source
2
+
3
+ You are generating a **development-team handoff document** in the Tekyz user-stories format: discrete user stories with workflows, grouped acceptance criteria, per-story flow diagrams (Mermaid rendered to embedded images), and mapped test cases. Input can be a GSD-T **scan register**, a **requirements doc**, a **design contract**, or an **existing codebase** (reverse-engineered). `$ARGUMENTS` may carry `--input <path>`, `--source <scan|requirements|design|code>`, `--prefix <PREFIX>`, `--phase-filter <MVP|...>`, `--docx`.
4
+
5
+ **Canonical format reference (READ FIRST):** `~/.claude/playbooks/tekyz-user-stories-format.md` if present, else the bundled `templates/playbooks/tekyz-user-stories-format.md` in the GSD-T package. It encodes the exact structure + wording conventions reverse-engineered from the Tekyz sample (`Compass_Sample_PRD_2.docx`). This command FILLS that format from the real input.
6
+
7
+ > **Client/dev-team deliverable — distinct from `/gsd-t-prd`.** `/gsd-t-prd` writes the INTERNAL `docs/prd.md` that feeds the GSD-T pipeline. THIS command emits an EXTERNAL, dev-ready handoff doc in the Tekyz user-story style, saved to `share/`.
8
+
9
+ ## Step 0: Inputs + Source Classification
10
+
11
+ 1. **Resolve the input** (from `$ARGUMENTS --input`, else auto-detect in priority order): `.gsd-t/techdebt.md` (scan) → `docs/requirements.md` → `.gsd-t/contracts/design-contract.md` / `.gsd-t/contracts/design/` → the codebase itself. If none usable → ask the user what to document.
12
+ 2. **Classify the source** so the extraction method matches:
13
+ - **scan register** → stories derive from the functional gaps/features implied by findings (each cluster of related TDs → a story; Reqs cross-ref the TD-N ids).
14
+ - **requirements doc** → each requirement / requirement-group → a story (Reqs cross-ref R-N/FR-N).
15
+ - **design contract** → each screen/widget/flow → a story.
16
+ - **codebase (reverse-engineer)** → walk real features (routes, pages, flows) and reverse-engineer the discrete user stories + test cases from what's built. **Use the code graph** (`gsd-t graph cluster` / `who-imports` / `who-calls`) to find feature clusters and real interaction paths — do NOT grep-guess the architecture.
17
+ 3. **Derive the story-id `PREFIX`** from the product name (Compass→`CMPS`, NiceNote→`NN`, Newman Avatar→`NAV`) unless `--prefix` is given. Confirm with the user.
18
+ 4. **Confirm scope** — which phases/epics to include — before generating.
19
+
20
+ ## Step 1: Application Flow Overview (§1)
21
+
22
+ Produce the numbered end-to-end user journey (1..N major steps, plain language). Then author the **app-flow chart** as a single Mermaid flowchart of the whole journey and render+embed it (Step 4). This is the reader's map before the story detail.
23
+
24
+ ## Step 2: Decompose into Epics + Stories (§2)
25
+
26
+ Group functionality into **Epics** (`EP-NN: <name>`), each with a `Phase:`. Under each epic, emit discrete stories. **A story is ONE coherent capability a user exercises** — not a whole feature area, not a single UI control. Right granularity = the sample's (e.g. "Avatar renders full-screen with state indicators" is one story; "Session controls: pause/resume/end" is another).
27
+
28
+ For EACH story, author in EXACTLY this order (per the format reference):
29
+
30
+ 1. **`<PREFIX>-NNN — <Story Title>`** (sequential, zero-padded).
31
+ 2. **Meta line** — `*Phase: … | Reqs: <source ids> | Test Cases: <N>*`. `Reqs:` cross-references the source (TD-N / R-N / FR-N); `Test Cases:` = row count of this story's table.
32
+ 3. **Story:** `*As a <role>, I want <capability>, so that <benefit>.*` (strict template, one sentence.)
33
+ 4. **Workflow:** numbered concrete interaction steps (user action → system response), present tense.
34
+ 5. **Acceptance Criteria:** bulleted, **grouped by sub-area** with a bold sub-heading per group; include error/edge/recovery groups. Each bullet one testable assertion.
35
+ 6. **Flow Diagram:** a per-story Mermaid flowchart of THIS story's workflow → rendered PNG → embedded (Step 4).
36
+ 7. **Mapped Test Cases:** table `TC ID | Type | Test Title | Expected Result`. `TC-NNN` sequential across the whole doc; `Type` ∈ {Positive, Negative, Edge}; cover happy-path + failure + boundary; every acceptance-criteria group represented by ≥1 test case.
37
+
38
+ **No confabulation** (`feedback_no_confabulated_examples`): every story, workflow step, and test case must trace to something in the actual input source. If the source is silent on a needed detail, mark it a `[TODO: confirm with client]` — never invent product specifics.
39
+
40
+ ## Step 3: Scope Summary (§3)
41
+
42
+ A table mapping every story → phase → epic: `| Story ID | Title | Phase | Epic |`. Gives the team the MVP-vs-later-phase picture at a glance.
43
+
44
+ ## Step 4: Diagrams — Mermaid rendered to EMBEDDED images (MANDATORY method)
45
+
46
+ Per the standing directive, diagrams are authored as Mermaid but **embedded as rendered images** (matching the sample's `<img>` flow charts) — NOT left as raw Mermaid text.
47
+
48
+ 1. Write each diagram's Mermaid source to `.gsd-t/user-stories/diagrams/<name>.mmd` (app-flow = `app-flow`, per-story = `<PREFIX>-NNN-flow`).
49
+ 2. Render each to PNG beside the deliverable: `mmdc -i <src>.mmd -o share/media/<name>.png` (Mermaid CLI `@mermaid-js/mermaid-cli`; fall back to `npx @mermaid-js/mermaid-cli -i … -o …`).
50
+ 3. **If `mmdc` is unavailable → HALT** and tell the user to install it (`npm i -g @mermaid-js/mermaid-cli`). Do NOT silently ship raw Mermaid where an embedded image is expected (`feedback_no_silent_degradation`).
51
+ 4. Embed each rendered PNG in the markdown at its `Flow Diagram:` / §1 position: `![Flow Diagram](media/<name>.png)`.
52
+ 5. Keep the `.mmd` source (editable, version-controllable) alongside the PNG.
53
+
54
+ ## Step 5: Assemble + Deliver
55
+
56
+ 1. Assemble front matter (product, "Prepared by Tekyz Inc.", version, source-of-truth note; SAMPLE disclaimer only if illustrative) + §1 + §2 + §3.
57
+ 2. **Write the markdown** to `share/<Repo>-user-stories.md`, with rendered diagram PNGs in `share/media/`.
58
+ 3. **If `--docx`** (or the user wants Word): convert with `pandoc share/<Repo>-user-stories.md -o share/<Repo>-user-stories.docx` — pandoc embeds the PNGs as real Word images, matching the handoff sample. Report if pandoc is missing (don't fail the markdown).
59
+ 4. **Report:** story count, epic count, total test cases, diagram count, and the output paths.
60
+
61
+ ## Document Ripple
62
+
63
+ - New deliverable(s): `share/<Repo>-user-stories.md` (+ `.docx` if requested) + `share/media/*.png` + `.gsd-t/user-stories/diagrams/*.mmd`.
64
+ - No living-doc changes (this is an external handoff artifact) — but log a `.gsd-t/progress.md` Decision Log entry noting the deliverable + source.
65
+
66
+ ## ▶ Next Up
67
+
68
+ Standalone command — no auto-successor. After generating, hand the `share/<Repo>-user-stories.md` (or `.docx`) to the development team.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekyzinc/gsd-t",
3
- "version": "4.18.10",
3
+ "version": "4.19.10",
4
4
  "description": "GSD-T: Contract-Driven Development for Claude Code — 54 slash commands with headless-by-default workflow spawning, unattended supervisor relay with event stream, graph-powered code analysis, real-time agent dashboard, task telemetry, doc-ripple enforcement, backlog management, impact analysis, test sync, milestone archival, and PRD generation",
5
5
  "author": "Tekyz, Inc.",
6
6
  "license": "MIT",
@@ -460,7 +460,7 @@ Add `**Also available:**` with `- /gsd-t-{alt} — {desc}` lines if alternatives
460
460
  | `setup` | `status` | |
461
461
  | `design-decompose` | `design-build` | `partition` (if domains needed first) |
462
462
 
463
- Commands with no successor (standalone): `quick`, `debug`, `brainstorm`, `status`, `help`, `resume`, `prompt`, `log`, `health`, `pause`, `estimate`, backlog commands.
463
+ Commands with no successor (standalone): `quick`, `debug`, `brainstorm`, `status`, `help`, `resume`, `prompt`, `log`, `health`, `pause`, `estimate`, `stories`, backlog commands.
464
464
 
465
465
  Skip the hint if auto-advancing (Level 3 mid-wave) — only show when the user needs to manually invoke the next step.
466
466
 
@@ -0,0 +1,127 @@
1
+ # Tekyz User-Stories / Dev-Handoff PRD Format
2
+
3
+ > The canonical format for a Tekyz **development-team handoff** document: discrete user
4
+ > stories with workflows, grouped acceptance criteria, per-story flow diagrams, and mapped
5
+ > test cases. Reverse-engineered from `Compass_Sample_PRD_2.docx` (the sample Tekyz uses to
6
+ > illustrate its requirements-documentation process). `/gsd-t-user-stories` emits THIS format.
7
+ >
8
+ > This is a REFERENCE for structure + exact wording conventions — not the content. The
9
+ > command fills it from the actual input source (scan / requirements / design / codebase).
10
+
11
+ ---
12
+
13
+ ## Document skeleton (in order)
14
+
15
+ ```
16
+ FRONT MATTER
17
+ 1. Application Flow Overview (numbered end-to-end journey + app-flow chart)
18
+ 2. User Stories — Detailed Requirements
19
+ EP-NN: <Epic Name> (epic grouping)
20
+ Phase: <MVP | Phase 1 | ...>
21
+ <PREFIX>-NNN — <Story Title>
22
+ meta line
23
+ Story: (As a … I want … so that …)
24
+ Workflow: (numbered steps)
25
+ Acceptance Criteria: (grouped by sub-area, bulleted)
26
+ Flow Diagram: (rendered Mermaid PNG, embedded as <img>)
27
+ Mapped Test Cases: (table)
28
+ 3. <Phase> vs <Phase> Scope Summary (story→phase→epic table)
29
+ ```
30
+
31
+ ---
32
+
33
+ ## FRONT MATTER (verbatim conventions)
34
+
35
+ ```
36
+ **<PRODUCT NAME>**
37
+
38
+ <one-line product descriptor>
39
+
40
+ Product Requirements Document
41
+
42
+ **Prepared by Tekyz Inc.**
43
+
44
+ Version <X.Y> — <source-of-truth note, e.g. "Design file v2.x as source of truth">
45
+ ```
46
+
47
+ If the doc is illustrative/sample, include the italic SAMPLE DOCUMENT disclaimer block.
48
+
49
+ ---
50
+
51
+ ## §1 — Application Flow Overview
52
+
53
+ A numbered list (1..N) naming each major step of the end-to-end user journey in plain
54
+ language (e.g. "First-Time User Launch: App opens directly into … onboarding"). Follow with:
55
+ - an **app-flow chart** — a single Mermaid flowchart of the whole journey, rendered to PNG
56
+ and embedded (`![Application Flow](media/app-flow.png)`), matching the sample's companion chart.
57
+ - the italic note that a complete flow chart accompanies the document.
58
+
59
+ ---
60
+
61
+ ## §2 — User Stories (the core; repeat per story)
62
+
63
+ Group stories under **Epics**: `**EP-01: <Epic Name>**` then `**Phase: <phase>**`.
64
+
65
+ Each story, in EXACTLY this order:
66
+
67
+ **Story ID + title:** `**<PREFIX>-NNN — <Story Title>**`
68
+ - `<PREFIX>` is a per-project story-id prefix (Compass used `CMPS`). Derive from the product
69
+ name (e.g. NiceNote → `NN`, Newman Avatar → `NAV`). Sequential, zero-padded to 3.
70
+
71
+ **Meta line** (italic, pipe-separated):
72
+ `*Phase: <phase> | Reqs: <R-… list> | Test Cases: <N>*`
73
+ - `Reqs:` cross-references source requirement ids (from a scan register's TD-N, a requirements
74
+ doc's R-N/FR-N, or synthesized ids). `Test Cases:` = count of rows in the Mapped Test Cases table.
75
+
76
+ **Story:** one sentence, italic, strict template:
77
+ `*As a <role>, I want <capability>, so that <benefit>.*`
78
+
79
+ **Workflow:** numbered steps (1..N) describing the concrete interaction sequence — what the
80
+ user does and what the system does in response. Present tense, specific.
81
+
82
+ **Acceptance Criteria:** bulleted, **grouped by sub-area** with a bold sub-heading per group
83
+ (e.g. `**Talking State:**`, `**Error and Recovery:**`). Each bullet is a single testable
84
+ assertion (state changed / content shown / constraint met). Include error/edge/recovery groups.
85
+
86
+ **Flow Diagram:** a per-story Mermaid flowchart of THIS story's workflow, rendered to PNG and
87
+ embedded (`![Flow Diagram](media/<PREFIX>-NNN-flow.png)`) — matching the sample's per-story `<img>`.
88
+
89
+ **Mapped Test Cases:** a markdown table with columns **TC ID | Type | Test Title | Expected Result**.
90
+ - `TC ID`: `TC-NNN` sequential across the whole document.
91
+ - `Type`: one of **Positive | Negative | Edge**.
92
+ - Cover the happy path (Positive), failure modes (Negative), and boundaries (Edge). Every
93
+ acceptance-criteria group should be represented by at least one test case.
94
+
95
+ ---
96
+
97
+ ## §3 — Scope Summary
98
+
99
+ A table mapping every story to its phase + epic, so a team sees MVP vs later-phase scope at a glance:
100
+
101
+ `| Story ID | Title | Phase | Epic |`
102
+
103
+ ---
104
+
105
+ ## Diagram pipeline (Mermaid → embedded image)
106
+
107
+ Per the user directive, diagrams are **authored as Mermaid but EMBEDDED as rendered images**
108
+ (like the sample's `<img>` flow charts) — not left as raw Mermaid text.
109
+
110
+ 1. Write each diagram's Mermaid source to `.gsd-t/user-stories/diagrams/<name>.mmd`.
111
+ 2. Render to PNG with the Mermaid CLI: `mmdc -i <name>.mmd -o media/<name>.png` (installed:
112
+ `@mermaid-js/mermaid-cli`; fall back to `npx @mermaid-js/mermaid-cli`). If `mmdc` is
113
+ unavailable, HALT and tell the user to install it — do NOT silently ship raw Mermaid where
114
+ an embedded image is expected (no-silent-degradation).
115
+ 3. Embed the PNG in the markdown: `![Flow Diagram](media/<name>.png)`.
116
+ 4. On `.docx` conversion, pandoc embeds these PNGs as real Word images — matching the sample.
117
+
118
+ Keep the `.mmd` source (version-controllable, editable) alongside the rendered PNG.
119
+
120
+ ---
121
+
122
+ ## Output
123
+
124
+ - Markdown deliverable → `share/<Repo>-user-stories.md` (GSD-T share convention), with a
125
+ `media/` dir of rendered diagram PNGs beside it.
126
+ - Optional `.docx` (matching the handoff sample) via `pandoc share/<Repo>-user-stories.md
127
+ -o share/<Repo>-user-stories.docx` — embeds the PNGs as Word images.