@undeemed/get-shit-done-codex 1.20.8 → 1.20.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.
@@ -0,0 +1,350 @@
1
+ <purpose>
2
+ Generate unit and E2E tests for a completed phase based on its SUMMARY.md, CONTEXT.md, and implementation. Classifies each changed file into TDD (unit), E2E (browser), or Skip categories, presents a test plan for user approval, then generates tests following RED-GREEN conventions.
3
+
4
+ Users currently hand-craft `/gsd:quick` prompts for test generation after each phase. This workflow standardizes the process with proper classification, quality gates, and gap reporting.
5
+ </purpose>
6
+
7
+ <required_reading>
8
+ Read all files referenced by the invoking prompt's execution_context before starting.
9
+ </required_reading>
10
+
11
+ <process>
12
+
13
+ <step name="parse_arguments">
14
+ Parse `$ARGUMENTS` for:
15
+ - Phase number (integer, decimal, or letter-suffix) → store as `$PHASE_ARG`
16
+ - Remaining text after phase number → store as `$EXTRA_INSTRUCTIONS` (optional)
17
+
18
+ Example: `/gsd:add-tests 12 focus on edge cases` → `$PHASE_ARG=12`, `$EXTRA_INSTRUCTIONS="focus on edge cases"`
19
+
20
+ If no phase argument provided:
21
+
22
+ ```
23
+ ERROR: Phase number required
24
+ Usage: /gsd:add-tests <phase> [additional instructions]
25
+ Example: /gsd:add-tests 12
26
+ Example: /gsd:add-tests 12 focus on edge cases in the pricing module
27
+ ```
28
+
29
+ Exit.
30
+ </step>
31
+
32
+ <step name="init_context">
33
+ Load phase operation context:
34
+
35
+ ```bash
36
+ INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs init phase-op "${PHASE_ARG}")
37
+ ```
38
+
39
+ Extract from init JSON: `phase_dir`, `phase_number`, `phase_name`.
40
+
41
+ Verify the phase directory exists. If not:
42
+ ```
43
+ ERROR: Phase directory not found for phase ${PHASE_ARG}
44
+ Ensure the phase exists in .planning/phases/
45
+ ```
46
+ Exit.
47
+
48
+ Read the phase artifacts (in order of priority):
49
+ 1. `${phase_dir}/*-SUMMARY.md` — what was implemented, files changed
50
+ 2. `${phase_dir}/CONTEXT.md` — acceptance criteria, decisions
51
+ 3. `${phase_dir}/*-VERIFICATION.md` — user-verified scenarios (if UAT was done)
52
+
53
+ If no SUMMARY.md exists:
54
+ ```
55
+ ERROR: No SUMMARY.md found for phase ${PHASE_ARG}
56
+ This command works on completed phases. Run /gsd:execute-phase first.
57
+ ```
58
+ Exit.
59
+
60
+ Present banner:
61
+ ```
62
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
63
+ GSD ► ADD TESTS — Phase ${phase_number}: ${phase_name}
64
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
65
+ ```
66
+ </step>
67
+
68
+ <step name="analyze_implementation">
69
+ Extract the list of files modified by the phase from SUMMARY.md ("Files Changed" or equivalent section).
70
+
71
+ For each file, classify into one of three categories:
72
+
73
+ | Category | Criteria | Test Type |
74
+ |----------|----------|-----------|
75
+ | **TDD** | Pure functions where `expect(fn(input)).toBe(output)` is writable | Unit tests |
76
+ | **E2E** | UI behavior verifiable by browser automation | Playwright/E2E tests |
77
+ | **Skip** | Not meaningfully testable or already covered | None |
78
+
79
+ **TDD classification — apply when:**
80
+ - Business logic: calculations, pricing, tax rules, validation
81
+ - Data transformations: mapping, filtering, aggregation, formatting
82
+ - Parsers: CSV, JSON, XML, custom format parsing
83
+ - Validators: input validation, schema validation, business rules
84
+ - State machines: status transitions, workflow steps
85
+ - Utilities: string manipulation, date handling, number formatting
86
+
87
+ **E2E classification — apply when:**
88
+ - Keyboard shortcuts: key bindings, modifier keys, chord sequences
89
+ - Navigation: page transitions, routing, breadcrumbs, back/forward
90
+ - Form interactions: submit, validation errors, field focus, autocomplete
91
+ - Selection: row selection, multi-select, shift-click ranges
92
+ - Drag and drop: reordering, moving between containers
93
+ - Modal dialogs: open, close, confirm, cancel
94
+ - Data grids: sorting, filtering, inline editing, column resize
95
+
96
+ **Skip classification — apply when:**
97
+ - UI layout/styling: CSS classes, visual appearance, responsive breakpoints
98
+ - Configuration: config files, environment variables, feature flags
99
+ - Glue code: dependency injection setup, middleware registration, routing tables
100
+ - Migrations: database migrations, schema changes
101
+ - Simple CRUD: basic create/read/update/delete with no business logic
102
+ - Type definitions: records, DTOs, interfaces with no logic
103
+
104
+ Read each file to verify classification. Don't classify based on filename alone.
105
+ </step>
106
+
107
+ <step name="present_classification">
108
+ Present the classification to the user for confirmation before proceeding:
109
+
110
+ ```
111
+ AskUserQuestion(
112
+ header: "Test Classification",
113
+ question: |
114
+ ## Files classified for testing
115
+
116
+ ### TDD (Unit Tests) — {N} files
117
+ {list of files with brief reason}
118
+
119
+ ### E2E (Browser Tests) — {M} files
120
+ {list of files with brief reason}
121
+
122
+ ### Skip — {K} files
123
+ {list of files with brief reason}
124
+
125
+ {if $EXTRA_INSTRUCTIONS: "Additional instructions: ${EXTRA_INSTRUCTIONS}"}
126
+
127
+ How would you like to proceed?
128
+ options:
129
+ - "Approve and generate test plan"
130
+ - "Adjust classification (I'll specify changes)"
131
+ - "Cancel"
132
+ )
133
+ ```
134
+
135
+ If user selects "Adjust classification": apply their changes and re-present.
136
+ If user selects "Cancel": exit gracefully.
137
+ </step>
138
+
139
+ <step name="discover_test_structure">
140
+ Before generating the test plan, discover the project's existing test structure:
141
+
142
+ ```bash
143
+ # Find existing test directories
144
+ find . -type d -name "*test*" -o -name "*spec*" -o -name "*__tests__*" 2>/dev/null | head -20
145
+ # Find existing test files for convention matching
146
+ find . -type f \( -name "*.test.*" -o -name "*.spec.*" -o -name "*Tests.fs" -o -name "*Test.fs" \) 2>/dev/null | head -20
147
+ # Check for test runners
148
+ ls package.json *.sln 2>/dev/null
149
+ ```
150
+
151
+ Identify:
152
+ - Test directory structure (where unit tests live, where E2E tests live)
153
+ - Naming conventions (`.test.ts`, `.spec.ts`, `*Tests.fs`, etc.)
154
+ - Test runner commands (how to execute unit tests, how to execute E2E tests)
155
+ - Test framework (xUnit, NUnit, Jest, Playwright, etc.)
156
+
157
+ If test structure is ambiguous, ask the user:
158
+ ```
159
+ AskUserQuestion(
160
+ header: "Test Structure",
161
+ question: "I found multiple test locations. Where should I create tests?",
162
+ options: [list discovered locations]
163
+ )
164
+ ```
165
+ </step>
166
+
167
+ <step name="generate_test_plan">
168
+ For each approved file, create a detailed test plan.
169
+
170
+ **For TDD files**, plan tests following RED-GREEN-REFACTOR:
171
+ 1. Identify testable functions/methods in the file
172
+ 2. For each function: list input scenarios, expected outputs, edge cases
173
+ 3. Note: since code already exists, tests may pass immediately — that's OK, but verify they test the RIGHT behavior
174
+
175
+ **For E2E files**, plan tests following RED-GREEN gates:
176
+ 1. Identify user scenarios from CONTEXT.md/VERIFICATION.md
177
+ 2. For each scenario: describe the user action, expected outcome, assertions
178
+ 3. Note: RED gate means confirming the test would fail if the feature were broken
179
+
180
+ Present the complete test plan:
181
+
182
+ ```
183
+ AskUserQuestion(
184
+ header: "Test Plan",
185
+ question: |
186
+ ## Test Generation Plan
187
+
188
+ ### Unit Tests ({N} tests across {M} files)
189
+ {for each file: test file path, list of test cases}
190
+
191
+ ### E2E Tests ({P} tests across {Q} files)
192
+ {for each file: test file path, list of test scenarios}
193
+
194
+ ### Test Commands
195
+ - Unit: {discovered test command}
196
+ - E2E: {discovered e2e command}
197
+
198
+ Ready to generate?
199
+ options:
200
+ - "Generate all"
201
+ - "Cherry-pick (I'll specify which)"
202
+ - "Adjust plan"
203
+ )
204
+ ```
205
+
206
+ If "Cherry-pick": ask user which tests to include.
207
+ If "Adjust plan": apply changes and re-present.
208
+ </step>
209
+
210
+ <step name="execute_tdd_generation">
211
+ For each approved TDD test:
212
+
213
+ 1. **Create test file** following discovered project conventions (directory, naming, imports)
214
+
215
+ 2. **Write test** with clear arrange/act/assert structure:
216
+ ```
217
+ // Arrange — set up inputs and expected outputs
218
+ // Act — call the function under test
219
+ // Assert — verify the output matches expectations
220
+ ```
221
+
222
+ 3. **Run the test**:
223
+ ```bash
224
+ {discovered test command}
225
+ ```
226
+
227
+ 4. **Evaluate result:**
228
+ - **Test passes**: Good — the implementation satisfies the test. Verify the test checks meaningful behavior (not just that it compiles).
229
+ - **Test fails with assertion error**: This may be a genuine bug discovered by the test. Flag it:
230
+ ```
231
+ ⚠️ Potential bug found: {test name}
232
+ Expected: {expected}
233
+ Actual: {actual}
234
+ File: {implementation file}
235
+ ```
236
+ Do NOT fix the implementation — this is a test-generation command, not a fix command. Record the finding.
237
+ - **Test fails with error (import, syntax, etc.)**: This is a test error. Fix the test and re-run.
238
+ </step>
239
+
240
+ <step name="execute_e2e_generation">
241
+ For each approved E2E test:
242
+
243
+ 1. **Check for existing tests** covering the same scenario:
244
+ ```bash
245
+ grep -r "{scenario keyword}" {e2e test directory} 2>/dev/null
246
+ ```
247
+ If found, extend rather than duplicate.
248
+
249
+ 2. **Create test file** targeting the user scenario from CONTEXT.md/VERIFICATION.md
250
+
251
+ 3. **Run the E2E test**:
252
+ ```bash
253
+ {discovered e2e command}
254
+ ```
255
+
256
+ 4. **Evaluate result:**
257
+ - **GREEN (passes)**: Record success
258
+ - **RED (fails)**: Determine if it's a test issue or a genuine application bug. Flag bugs:
259
+ ```
260
+ ⚠️ E2E failure: {test name}
261
+ Scenario: {description}
262
+ Error: {error message}
263
+ ```
264
+ - **Cannot run**: Report blocker. Do NOT mark as complete.
265
+ ```
266
+ 🛑 E2E blocker: {reason tests cannot run}
267
+ ```
268
+
269
+ **No-skip rule:** If E2E tests cannot execute (missing dependencies, environment issues), report the blocker and mark the test as incomplete. Never mark success without actually running the test.
270
+ </step>
271
+
272
+ <step name="summary_and_commit">
273
+ Create a test coverage report and present to user:
274
+
275
+ ```
276
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
277
+ GSD ► TEST GENERATION COMPLETE
278
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
279
+
280
+ ## Results
281
+
282
+ | Category | Generated | Passing | Failing | Blocked |
283
+ |----------|-----------|---------|---------|---------|
284
+ | Unit | {N} | {n1} | {n2} | {n3} |
285
+ | E2E | {M} | {m1} | {m2} | {m3} |
286
+
287
+ ## Files Created/Modified
288
+ {list of test files with paths}
289
+
290
+ ## Coverage Gaps
291
+ {areas that couldn't be tested and why}
292
+
293
+ ## Bugs Discovered
294
+ {any assertion failures that indicate implementation bugs}
295
+ ```
296
+
297
+ Record test generation in project state:
298
+ ```bash
299
+ node ~/.claude/get-shit-done/bin/gsd-tools.cjs state-snapshot
300
+ ```
301
+
302
+ If there are passing tests to commit:
303
+
304
+ ```bash
305
+ git add {test files}
306
+ git commit -m "test(phase-${phase_number}): add unit and E2E tests from add-tests command"
307
+ ```
308
+
309
+ Present next steps:
310
+
311
+ ```
312
+ ---
313
+
314
+ ## ▶ Next Up
315
+
316
+ {if bugs discovered:}
317
+ **Fix discovered bugs:** `/gsd:quick fix the {N} test failures discovered in phase ${phase_number}`
318
+
319
+ {if blocked tests:}
320
+ **Resolve test blockers:** {description of what's needed}
321
+
322
+ {otherwise:}
323
+ **All tests passing!** Phase ${phase_number} is fully tested.
324
+
325
+ ---
326
+
327
+ **Also available:**
328
+ - `/gsd:add-tests {next_phase}` — test another phase
329
+ - `/gsd:verify-work {phase_number}` — run UAT verification
330
+
331
+ ---
332
+ ```
333
+ </step>
334
+
335
+ </process>
336
+
337
+ <success_criteria>
338
+ - [ ] Phase artifacts loaded (SUMMARY.md, CONTEXT.md, optionally VERIFICATION.md)
339
+ - [ ] All changed files classified into TDD/E2E/Skip categories
340
+ - [ ] Classification presented to user and approved
341
+ - [ ] Project test structure discovered (directories, conventions, runners)
342
+ - [ ] Test plan presented to user and approved
343
+ - [ ] TDD tests generated with arrange/act/assert structure
344
+ - [ ] E2E tests generated targeting user scenarios
345
+ - [ ] All tests executed — no untested tests marked as passing
346
+ - [ ] Bugs discovered by tests flagged (not fixed)
347
+ - [ ] Test files committed with proper message
348
+ - [ ] Coverage gaps documented
349
+ - [ ] Next steps presented to user
350
+ </success_criteria>
@@ -438,6 +438,67 @@ rm .planning/REQUIREMENTS.md
438
438
 
439
439
  </step>
440
440
 
441
+ <step name="write_retrospective">
442
+
443
+ **Append to living retrospective:**
444
+
445
+ Check for existing retrospective:
446
+ ```bash
447
+ ls .planning/RETROSPECTIVE.md 2>/dev/null
448
+ ```
449
+
450
+ **If exists:** Read the file, append new milestone section before the "## Cross-Milestone Trends" section.
451
+
452
+ **If doesn't exist:** Create from template at `~/.claude/get-shit-done/templates/retrospective.md`.
453
+
454
+ **Gather retrospective data:**
455
+
456
+ 1. From SUMMARY.md files: Extract key deliverables, one-liners, tech decisions
457
+ 2. From VERIFICATION.md files: Extract verification scores, gaps found
458
+ 3. From UAT.md files: Extract test results, issues found
459
+ 4. From git log: Count commits, calculate timeline
460
+ 5. From the milestone work: Reflect on what worked and what didn't
461
+
462
+ **Write the milestone section:**
463
+
464
+ ```markdown
465
+ ## Milestone: v{version} — {name}
466
+
467
+ **Shipped:** {date}
468
+ **Phases:** {phase_count} | **Plans:** {plan_count}
469
+
470
+ ### What Was Built
471
+ {Extract from SUMMARY.md one-liners}
472
+
473
+ ### What Worked
474
+ {Patterns that led to smooth execution}
475
+
476
+ ### What Was Inefficient
477
+ {Missed opportunities, rework, bottlenecks}
478
+
479
+ ### Patterns Established
480
+ {New conventions discovered during this milestone}
481
+
482
+ ### Key Lessons
483
+ {Specific, actionable takeaways}
484
+
485
+ ### Cost Observations
486
+ - Model mix: {X}% opus, {Y}% sonnet, {Z}% haiku
487
+ - Sessions: {count}
488
+ - Notable: {efficiency observation}
489
+ ```
490
+
491
+ **Update cross-milestone trends:**
492
+
493
+ If the "## Cross-Milestone Trends" section exists, update the tables with new data from this milestone.
494
+
495
+ **Commit:**
496
+ ```bash
497
+ node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "docs: update retrospective for v${VERSION}" --files .planning/RETROSPECTIVE.md
498
+ ```
499
+
500
+ </step>
501
+
441
502
  <step name="update_state">
442
503
 
443
504
  Most STATE.md updates were handled by `milestone complete`, but verify and update remaining fields:
@@ -695,6 +756,8 @@ Milestone completion is successful when:
695
756
  - [ ] Requirements completion checked against REQUIREMENTS.md traceability table
696
757
  - [ ] Incomplete requirements surfaced with proceed/audit/abort options
697
758
  - [ ] Known gaps recorded in MILESTONES.md if user proceeded with incomplete requirements
759
+ - [ ] RETROSPECTIVE.md updated with milestone section
760
+ - [ ] Cross-milestone trends updated
698
761
  - [ ] User knows next step (/gsd:new-milestone)
699
762
 
700
763
  </success_criteria>
@@ -107,6 +107,8 @@ Phase: "API documentation"
107
107
 
108
108
  <process>
109
109
 
110
+ **Express path available:** If you already have a PRD or acceptance criteria document, use `/gsd:plan-phase {phase} --prd path/to/prd.md` to skip this discussion and go straight to planning.
111
+
110
112
  <step name="initialize" priority="first">
111
113
  Phase number from argument (required).
112
114
 
@@ -99,6 +99,8 @@ Create detailed execution plan for a specific phase.
99
99
  Usage: `/gsd:plan-phase 1`
100
100
  Result: Creates `.planning/phases/01-foundation/01-01-PLAN.md`
101
101
 
102
+ **PRD Express Path:** Pass `--prd path/to/requirements.md` to skip discuss-phase entirely. Your PRD becomes locked decisions in CONTEXT.md. Useful when you already have clear acceptance criteria.
103
+
102
104
  ### Execution
103
105
 
104
106
  **`/gsd:execute-phase <phase-number>`**
@@ -351,6 +353,7 @@ Usage: `/gsd:join-discord`
351
353
  ├── PROJECT.md # Project vision
352
354
  ├── ROADMAP.md # Current phase breakdown
353
355
  ├── STATE.md # Project memory & context
356
+ ├── RETROSPECTIVE.md # Living retrospective (updated per milestone)
354
357
  ├── config.json # Workflow mode & gates
355
358
  ├── todos/ # Captured ideas and tasks
356
359
  │ ├── pending/ # Todos waiting to be worked on
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@undeemed/get-shit-done-codex",
3
- "version": "1.20.8",
3
+ "version": "1.20.10",
4
4
  "description": "A meta-prompting, context engineering and spec-driven development system for OpenAI Codex (CLI and Desktop). Fork of get-shit-done by TÂCHES, adapted for Codex by undeemed.",
5
5
  "bin": {
6
6
  "get-shit-done-codex": "bin/install.js"
@@ -9,6 +9,7 @@
9
9
  "access": "public"
10
10
  },
11
11
  "files": [
12
+ "README.md",
12
13
  "bin",
13
14
  "commands",
14
15
  "get-shit-done",