@m3hti/commit-genie 3.3.0 → 3.3.1
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/.claude/agents/gsd-codebase-mapper.md +764 -0
- package/.claude/agents/gsd-debugger.md +1246 -0
- package/.claude/agents/gsd-executor.md +469 -0
- package/.claude/agents/gsd-integration-checker.md +443 -0
- package/.claude/agents/gsd-phase-researcher.md +546 -0
- package/.claude/agents/gsd-plan-checker.md +690 -0
- package/.claude/agents/gsd-planner.md +1275 -0
- package/.claude/agents/gsd-project-researcher.md +621 -0
- package/.claude/agents/gsd-research-synthesizer.md +239 -0
- package/.claude/agents/gsd-roadmapper.md +642 -0
- package/.claude/agents/gsd-verifier.md +573 -0
- package/.claude/commands/gsd/add-phase.md +43 -0
- package/.claude/commands/gsd/add-tests.md +41 -0
- package/.claude/commands/gsd/add-todo.md +47 -0
- package/.claude/commands/gsd/audit-milestone.md +36 -0
- package/.claude/commands/gsd/check-todos.md +45 -0
- package/.claude/commands/gsd/cleanup.md +18 -0
- package/.claude/commands/gsd/complete-milestone.md +136 -0
- package/.claude/commands/gsd/debug.md +167 -0
- package/.claude/commands/gsd/discuss-phase.md +83 -0
- package/.claude/commands/gsd/execute-phase.md +41 -0
- package/.claude/commands/gsd/health.md +22 -0
- package/.claude/commands/gsd/help.md +22 -0
- package/.claude/commands/gsd/insert-phase.md +32 -0
- package/.claude/commands/gsd/join-discord.md +18 -0
- package/.claude/commands/gsd/list-phase-assumptions.md +46 -0
- package/.claude/commands/gsd/map-codebase.md +71 -0
- package/.claude/commands/gsd/new-milestone.md +44 -0
- package/.claude/commands/gsd/new-project.md +42 -0
- package/.claude/commands/gsd/new-project.md.bak +1041 -0
- package/.claude/commands/gsd/pause-work.md +38 -0
- package/.claude/commands/gsd/plan-milestone-gaps.md +34 -0
- package/.claude/commands/gsd/plan-phase.md +45 -0
- package/.claude/commands/gsd/progress.md +24 -0
- package/.claude/commands/gsd/quick.md +41 -0
- package/.claude/commands/gsd/reapply-patches.md +110 -0
- package/.claude/commands/gsd/remove-phase.md +31 -0
- package/.claude/commands/gsd/research-phase.md +189 -0
- package/.claude/commands/gsd/resume-work.md +40 -0
- package/.claude/commands/gsd/set-profile.md +34 -0
- package/.claude/commands/gsd/settings.md +36 -0
- package/.claude/commands/gsd/update.md +37 -0
- package/.claude/commands/gsd/verify-work.md +38 -0
- package/.claude/get-shit-done/VERSION +1 -0
- package/.claude/get-shit-done/bin/gsd-tools.cjs +588 -0
- package/.claude/get-shit-done/bin/lib/commands.cjs +553 -0
- package/.claude/get-shit-done/bin/lib/config.cjs +162 -0
- package/.claude/get-shit-done/bin/lib/core.cjs +411 -0
- package/.claude/get-shit-done/bin/lib/frontmatter.cjs +299 -0
- package/.claude/get-shit-done/bin/lib/init.cjs +710 -0
- package/.claude/get-shit-done/bin/lib/milestone.cjs +216 -0
- package/.claude/get-shit-done/bin/lib/phase.cjs +871 -0
- package/.claude/get-shit-done/bin/lib/roadmap.cjs +298 -0
- package/.claude/get-shit-done/bin/lib/state.cjs +679 -0
- package/.claude/get-shit-done/bin/lib/template.cjs +222 -0
- package/.claude/get-shit-done/bin/lib/verify.cjs +773 -0
- package/.claude/get-shit-done/references/checkpoints.md +776 -0
- package/.claude/get-shit-done/references/continuation-format.md +249 -0
- package/.claude/get-shit-done/references/decimal-phase-calculation.md +65 -0
- package/.claude/get-shit-done/references/git-integration.md +248 -0
- package/.claude/get-shit-done/references/git-planning-commit.md +38 -0
- package/.claude/get-shit-done/references/model-profile-resolution.md +34 -0
- package/.claude/get-shit-done/references/model-profiles.md +92 -0
- package/.claude/get-shit-done/references/phase-argument-parsing.md +61 -0
- package/.claude/get-shit-done/references/planning-config.md +196 -0
- package/.claude/get-shit-done/references/questioning.md +145 -0
- package/.claude/get-shit-done/references/tdd.md +263 -0
- package/.claude/get-shit-done/references/ui-brand.md +160 -0
- package/.claude/get-shit-done/references/verification-patterns.md +612 -0
- package/.claude/get-shit-done/templates/DEBUG.md +164 -0
- package/.claude/get-shit-done/templates/UAT.md +247 -0
- package/.claude/get-shit-done/templates/VALIDATION.md +76 -0
- package/.claude/get-shit-done/templates/codebase/architecture.md +255 -0
- package/.claude/get-shit-done/templates/codebase/concerns.md +310 -0
- package/.claude/get-shit-done/templates/codebase/conventions.md +307 -0
- package/.claude/get-shit-done/templates/codebase/integrations.md +280 -0
- package/.claude/get-shit-done/templates/codebase/stack.md +186 -0
- package/.claude/get-shit-done/templates/codebase/structure.md +285 -0
- package/.claude/get-shit-done/templates/codebase/testing.md +480 -0
- package/.claude/get-shit-done/templates/config.json +37 -0
- package/.claude/get-shit-done/templates/context.md +283 -0
- package/.claude/get-shit-done/templates/continue-here.md +78 -0
- package/.claude/get-shit-done/templates/debug-subagent-prompt.md +91 -0
- package/.claude/get-shit-done/templates/discovery.md +146 -0
- package/.claude/get-shit-done/templates/milestone-archive.md +123 -0
- package/.claude/get-shit-done/templates/milestone.md +115 -0
- package/.claude/get-shit-done/templates/phase-prompt.md +569 -0
- package/.claude/get-shit-done/templates/planner-subagent-prompt.md +117 -0
- package/.claude/get-shit-done/templates/project.md +184 -0
- package/.claude/get-shit-done/templates/requirements.md +231 -0
- package/.claude/get-shit-done/templates/research-project/ARCHITECTURE.md +204 -0
- package/.claude/get-shit-done/templates/research-project/FEATURES.md +147 -0
- package/.claude/get-shit-done/templates/research-project/PITFALLS.md +200 -0
- package/.claude/get-shit-done/templates/research-project/STACK.md +120 -0
- package/.claude/get-shit-done/templates/research-project/SUMMARY.md +170 -0
- package/.claude/get-shit-done/templates/research.md +552 -0
- package/.claude/get-shit-done/templates/retrospective.md +54 -0
- package/.claude/get-shit-done/templates/roadmap.md +202 -0
- package/.claude/get-shit-done/templates/state.md +176 -0
- package/.claude/get-shit-done/templates/summary-complex.md +59 -0
- package/.claude/get-shit-done/templates/summary-minimal.md +41 -0
- package/.claude/get-shit-done/templates/summary-standard.md +48 -0
- package/.claude/get-shit-done/templates/summary.md +248 -0
- package/.claude/get-shit-done/templates/user-setup.md +311 -0
- package/.claude/get-shit-done/templates/verification-report.md +322 -0
- package/.claude/get-shit-done/workflows/add-phase.md +111 -0
- package/.claude/get-shit-done/workflows/add-tests.md +350 -0
- package/.claude/get-shit-done/workflows/add-todo.md +157 -0
- package/.claude/get-shit-done/workflows/audit-milestone.md +297 -0
- package/.claude/get-shit-done/workflows/check-todos.md +176 -0
- package/.claude/get-shit-done/workflows/cleanup.md +152 -0
- package/.claude/get-shit-done/workflows/complete-milestone.md +763 -0
- package/.claude/get-shit-done/workflows/diagnose-issues.md +219 -0
- package/.claude/get-shit-done/workflows/discovery-phase.md +289 -0
- package/.claude/get-shit-done/workflows/discuss-phase.md +542 -0
- package/.claude/get-shit-done/workflows/execute-phase.md +449 -0
- package/.claude/get-shit-done/workflows/execute-plan.md +448 -0
- package/.claude/get-shit-done/workflows/health.md +156 -0
- package/.claude/get-shit-done/workflows/help.md +489 -0
- package/.claude/get-shit-done/workflows/insert-phase.md +129 -0
- package/.claude/get-shit-done/workflows/list-phase-assumptions.md +178 -0
- package/.claude/get-shit-done/workflows/map-codebase.md +315 -0
- package/.claude/get-shit-done/workflows/new-milestone.md +382 -0
- package/.claude/get-shit-done/workflows/new-project.md +1116 -0
- package/.claude/get-shit-done/workflows/pause-work.md +122 -0
- package/.claude/get-shit-done/workflows/plan-milestone-gaps.md +274 -0
- package/.claude/get-shit-done/workflows/plan-phase.md +569 -0
- package/.claude/get-shit-done/workflows/progress.md +381 -0
- package/.claude/get-shit-done/workflows/quick.md +453 -0
- package/.claude/get-shit-done/workflows/remove-phase.md +154 -0
- package/.claude/get-shit-done/workflows/research-phase.md +73 -0
- package/.claude/get-shit-done/workflows/resume-project.md +306 -0
- package/.claude/get-shit-done/workflows/set-profile.md +80 -0
- package/.claude/get-shit-done/workflows/settings.md +213 -0
- package/.claude/get-shit-done/workflows/transition.md +544 -0
- package/.claude/get-shit-done/workflows/update.md +219 -0
- package/.claude/get-shit-done/workflows/verify-phase.md +242 -0
- package/.claude/get-shit-done/workflows/verify-work.md +569 -0
- package/.claude/gsd-file-manifest.json +144 -0
- package/.claude/hooks/gsd-check-update.js +62 -0
- package/.claude/hooks/gsd-context-monitor.js +122 -0
- package/.claude/hooks/gsd-statusline.js +108 -0
- package/.claude/package.json +1 -0
- package/.claude/settings.json +49 -0
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +18 -8
- package/dist/commands/generate.js.map +1 -1
- package/dist/services/analyzerService.d.ts.map +1 -1
- package/dist/services/analyzerService.js +10 -0
- package/dist/services/analyzerService.js.map +1 -1
- package/package.json +1 -1
|
@@ -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>
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Capture an idea, task, or issue that surfaces during a GSD session as a structured todo for later work. Enables "thought → capture → continue" flow without losing context.
|
|
3
|
+
</purpose>
|
|
4
|
+
|
|
5
|
+
<required_reading>
|
|
6
|
+
Read all files referenced by the invoking prompt's execution_context before starting.
|
|
7
|
+
</required_reading>
|
|
8
|
+
|
|
9
|
+
<process>
|
|
10
|
+
|
|
11
|
+
<step name="init_context">
|
|
12
|
+
Load todo context:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
INIT=$(node ./.claude/get-shit-done/bin/gsd-tools.cjs init todos)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Extract from init JSON: `commit_docs`, `date`, `timestamp`, `todo_count`, `todos`, `pending_dir`, `todos_dir_exists`.
|
|
19
|
+
|
|
20
|
+
Ensure directories exist:
|
|
21
|
+
```bash
|
|
22
|
+
mkdir -p .planning/todos/pending .planning/todos/done
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Note existing areas from the todos array for consistency in infer_area step.
|
|
26
|
+
</step>
|
|
27
|
+
|
|
28
|
+
<step name="extract_content">
|
|
29
|
+
**With arguments:** Use as the title/focus.
|
|
30
|
+
- `/gsd:add-todo Add auth token refresh` → title = "Add auth token refresh"
|
|
31
|
+
|
|
32
|
+
**Without arguments:** Analyze recent conversation to extract:
|
|
33
|
+
- The specific problem, idea, or task discussed
|
|
34
|
+
- Relevant file paths mentioned
|
|
35
|
+
- Technical details (error messages, line numbers, constraints)
|
|
36
|
+
|
|
37
|
+
Formulate:
|
|
38
|
+
- `title`: 3-10 word descriptive title (action verb preferred)
|
|
39
|
+
- `problem`: What's wrong or why this is needed
|
|
40
|
+
- `solution`: Approach hints or "TBD" if just an idea
|
|
41
|
+
- `files`: Relevant paths with line numbers from conversation
|
|
42
|
+
</step>
|
|
43
|
+
|
|
44
|
+
<step name="infer_area">
|
|
45
|
+
Infer area from file paths:
|
|
46
|
+
|
|
47
|
+
| Path pattern | Area |
|
|
48
|
+
|--------------|------|
|
|
49
|
+
| `src/api/*`, `api/*` | `api` |
|
|
50
|
+
| `src/components/*`, `src/ui/*` | `ui` |
|
|
51
|
+
| `src/auth/*`, `auth/*` | `auth` |
|
|
52
|
+
| `src/db/*`, `database/*` | `database` |
|
|
53
|
+
| `tests/*`, `__tests__/*` | `testing` |
|
|
54
|
+
| `docs/*` | `docs` |
|
|
55
|
+
| `.planning/*` | `planning` |
|
|
56
|
+
| `scripts/*`, `bin/*` | `tooling` |
|
|
57
|
+
| No files or unclear | `general` |
|
|
58
|
+
|
|
59
|
+
Use existing area from step 2 if similar match exists.
|
|
60
|
+
</step>
|
|
61
|
+
|
|
62
|
+
<step name="check_duplicates">
|
|
63
|
+
```bash
|
|
64
|
+
# Search for key words from title in existing todos
|
|
65
|
+
grep -l -i "[key words from title]" .planning/todos/pending/*.md 2>/dev/null
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
If potential duplicate found:
|
|
69
|
+
1. Read the existing todo
|
|
70
|
+
2. Compare scope
|
|
71
|
+
|
|
72
|
+
If overlapping, use AskUserQuestion:
|
|
73
|
+
- header: "Duplicate?"
|
|
74
|
+
- question: "Similar todo exists: [title]. What would you like to do?"
|
|
75
|
+
- options:
|
|
76
|
+
- "Skip" — keep existing todo
|
|
77
|
+
- "Replace" — update existing with new context
|
|
78
|
+
- "Add anyway" — create as separate todo
|
|
79
|
+
</step>
|
|
80
|
+
|
|
81
|
+
<step name="create_file">
|
|
82
|
+
Use values from init context: `timestamp` and `date` are already available.
|
|
83
|
+
|
|
84
|
+
Generate slug for the title:
|
|
85
|
+
```bash
|
|
86
|
+
slug=$(node ./.claude/get-shit-done/bin/gsd-tools.cjs generate-slug "$title" --raw)
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Write to `.planning/todos/pending/${date}-${slug}.md`:
|
|
90
|
+
|
|
91
|
+
```markdown
|
|
92
|
+
---
|
|
93
|
+
created: [timestamp]
|
|
94
|
+
title: [title]
|
|
95
|
+
area: [area]
|
|
96
|
+
files:
|
|
97
|
+
- [file:lines]
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Problem
|
|
101
|
+
|
|
102
|
+
[problem description - enough context for future Claude to understand weeks later]
|
|
103
|
+
|
|
104
|
+
## Solution
|
|
105
|
+
|
|
106
|
+
[approach hints or "TBD"]
|
|
107
|
+
```
|
|
108
|
+
</step>
|
|
109
|
+
|
|
110
|
+
<step name="update_state">
|
|
111
|
+
If `.planning/STATE.md` exists:
|
|
112
|
+
|
|
113
|
+
1. Use `todo_count` from init context (or re-run `init todos` if count changed)
|
|
114
|
+
2. Update "### Pending Todos" under "## Accumulated Context"
|
|
115
|
+
</step>
|
|
116
|
+
|
|
117
|
+
<step name="git_commit">
|
|
118
|
+
Commit the todo and any updated state:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
node ./.claude/get-shit-done/bin/gsd-tools.cjs commit "docs: capture todo - [title]" --files .planning/todos/pending/[filename] .planning/STATE.md
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Tool respects `commit_docs` config and gitignore automatically.
|
|
125
|
+
|
|
126
|
+
Confirm: "Committed: docs: capture todo - [title]"
|
|
127
|
+
</step>
|
|
128
|
+
|
|
129
|
+
<step name="confirm">
|
|
130
|
+
```
|
|
131
|
+
Todo saved: .planning/todos/pending/[filename]
|
|
132
|
+
|
|
133
|
+
[title]
|
|
134
|
+
Area: [area]
|
|
135
|
+
Files: [count] referenced
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
Would you like to:
|
|
140
|
+
|
|
141
|
+
1. Continue with current work
|
|
142
|
+
2. Add another todo
|
|
143
|
+
3. View all todos (/gsd:check-todos)
|
|
144
|
+
```
|
|
145
|
+
</step>
|
|
146
|
+
|
|
147
|
+
</process>
|
|
148
|
+
|
|
149
|
+
<success_criteria>
|
|
150
|
+
- [ ] Directory structure exists
|
|
151
|
+
- [ ] Todo file created with valid frontmatter
|
|
152
|
+
- [ ] Problem section has enough context for future Claude
|
|
153
|
+
- [ ] No duplicates (checked and resolved)
|
|
154
|
+
- [ ] Area consistent with existing todos
|
|
155
|
+
- [ ] STATE.md updated if exists
|
|
156
|
+
- [ ] Todo and state committed to git
|
|
157
|
+
</success_criteria>
|