@tekyzinc/gsd-t 2.20.7 → 2.22.0

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.
@@ -1,414 +1,433 @@
1
- # Prime Directives
2
-
3
- 1. SIMPLICITY ABOVE ALL. Every change should be minimal and impact as little code as possible. No massive refactors.
4
- 2. ALWAYS check for unwanted downstream effects before writing any new code or changing existing code.
5
- 3. ALWAYS check for completeness that any code creation/change/deletion is implemented thoroughly in every relevant file.
6
- 4. ALWAYS work autonomously. ONLY ask for user input when truly blocked.
7
-
8
-
9
- # GSD-T: Contract-Driven Development
10
-
11
- ## Work Hierarchy
12
-
13
- ```
14
- PROJECT or FEATURE or SCAN
15
- └── MILESTONE (major deliverable)
16
- └── PARTITION → DISCUSS → PLAN → IMPACT → EXECUTE → TEST-SYNC → INTEGRATE → VERIFY → COMPLETE
17
- ```
18
-
19
- - **Project**: Full greenfield project → decomposed into milestones
20
- - **Feature**: Major new feature for existing codebase → impact analysis → milestones
21
- - **Scan**: Deep codebase analysis → techdebt.md → promotable to milestones
22
- - **Milestone**: A significant deliverable (e.g., "User Authentication Complete")
23
- - **Domain**: An independent area of responsibility within a milestone, with its own scope, tasks, and file boundaries
24
- - **Contract**: The documented interface between domains — API shapes, schemas, component props
25
-
26
- ## Commands Reference
27
-
28
- | Command | Purpose |
29
- |---------|---------|
30
- | `/user:gsd` | Smart router — describe what you need, auto-routes to the right command |
31
- | `/user:gsd-t-help` | List all commands or get detailed help |
32
- | `/user:gsd-t-prompt` | Help formulate your idea before committing |
33
- | `/user:gsd-t-brainstorm` | Creative exploration and idea generation |
34
- | `/user:gsd-t-project` | Full project → milestone roadmap |
35
- | `/user:gsd-t-feature` | Major feature → impact analysis + milestones |
36
- | `/user:gsd-t-scan` | Deep codebase analysis → techdebt.md |
37
- | `/user:gsd-t-gap-analysis` | Requirements gap analysis — spec vs. existing code |
38
- | `/user:gsd-t-promote-debt` | Convert debt items to milestones |
39
- | `/user:gsd-t-setup` | Generate or restructure project CLAUDE.md |
40
- | `/user:gsd-t-init` | Initialize project structure |
41
- | `/user:gsd-t-init-scan-setup` | Full onboarding: git + init + scan + setup in one |
42
- | `/user:gsd-t-milestone` | Define new milestone |
43
- | `/user:gsd-t-partition` | Decompose into domains + contracts |
44
- | `/user:gsd-t-discuss` | Multi-perspective design exploration |
45
- | `/user:gsd-t-plan` | Create atomic task lists per domain |
46
- | `/user:gsd-t-impact` | Analyze downstream effects before execution |
47
- | `/user:gsd-t-execute` | Run tasks (solo or team) |
48
- | `/user:gsd-t-test-sync` | Keep tests aligned with code changes |
49
- | `/user:gsd-t-integrate` | Wire domains together |
50
- | `/user:gsd-t-verify` | Run quality gates |
51
- | `/user:gsd-t-complete-milestone` | Archive milestone + git tag |
52
- | `/user:gsd-t-wave` | Full cycle (auto-advances all phases) |
53
- | `/user:gsd-t-status` | Cross-domain progress view |
54
- | `/user:gsd-t-debug` | Systematic debugging |
55
- | `/user:gsd-t-quick` | Fast task, respects contracts |
56
- | `/user:gsd-t-populate` | Auto-populate docs from existing codebase |
57
- | `/user:gsd-t-log` | Sync progress Decision Log with recent git activity |
58
- | `/user:gsd-t-resume` | Restore context, continue |
59
- | `/user:gsd-t-version-update` | Update GSD-T to latest version |
60
- | `/user:gsd-t-version-update-all` | Update GSD-T + all registered projects |
61
- | `/user:gsd-t-backlog-add` | Capture item, auto-categorize, append to backlog |
62
- | `/user:gsd-t-backlog-list` | Filtered, ordered view of backlog items |
63
- | `/user:gsd-t-backlog-move` | Reorder items by position (priority) |
64
- | `/user:gsd-t-backlog-edit` | Modify backlog entry fields |
65
- | `/user:gsd-t-backlog-remove` | Drop item with optional reason |
66
- | `/user:gsd-t-backlog-promote` | Refine, classify, launch GSD-T workflow |
67
- | `/user:gsd-t-backlog-settings` | Manage types, apps, categories, defaults |
68
- | `/user:branch` | Create and switch to a new git branch |
69
- | `/user:checkin` | Auto-bump version, stage, commit, and push |
70
- | `/user:Claude-md` | Reload and apply CLAUDE.md directives |
71
-
72
-
73
- # Living Documents
74
-
75
- These documents MUST be maintained and referenced throughout development:
76
-
77
- | Document | Location | Purpose |
78
- |----------|----------|---------|
79
- | **Requirements** | `docs/requirements.md` | Functional and technical requirements |
80
- | **Architecture** | `docs/architecture.md` | System design, components, data flow, decisions |
81
- | **Workflows** | `docs/workflows.md` | User journeys and technical process flows |
82
- | **Infrastructure** | `docs/infrastructure.md` | Commands, DB setup, server access, creds |
83
- | **README** | `README.md` | Project overview, setup, features |
84
- | **Progress** | `.gsd-t/progress.md` | Current milestone/phase state + version |
85
- | **Contracts** | `.gsd-t/contracts/` | Interfaces between domains |
86
- | **Tech Debt** | `.gsd-t/techdebt.md` | Debt register from scans |
87
-
88
- ## The "No Re-Research" Rule
89
-
90
- **BEFORE researching how something works, CHECK THE DOCS FIRST.**
91
-
92
- ```
93
- NEED TO UNDERSTAND SOMETHING?
94
- ├── Is it about system structure/components? → Read docs/architecture.md
95
- ├── Is it about how a process flows? → Read docs/workflows.md
96
- ├── Is it about what to build? → Read docs/requirements.md
97
- ├── Is it about how to deploy/operate? → Read docs/infrastructure.md
98
- ├── Is it about domain interfaces? → Read .gsd-t/contracts/
99
- └── Not documented? → Research, then DOCUMENT IT
100
- ```
101
-
102
-
103
- # Versioning
104
-
105
- GSD-T tracks project version in `.gsd-t/progress.md` using semantic versioning: `Major.Minor.Patch`
106
-
107
- | Segment | Bumped When | Example |
108
- |---------|-------------|---------|
109
- | **Major** | Breaking changes, major rework, v1 launch | 1.0.0 → 2.0.0 |
110
- | **Minor** | New features, completed feature milestones | 1.1.0 → 1.2.0 |
111
- | **Patch** | Bug fixes, minor improvements, cleanup | 1.1.11.1.2 |
112
-
113
- - Version is set during `gsd-t-init` (starts at `0.1.0`)
114
- - Version is bumped during `gsd-t-complete-milestone` based on milestone scope
115
- - Version is reflected in: `progress.md`, `README.md`, package manifest (if any), and git tags (`v{version}`)
116
-
117
-
118
- # Destructive Action Guard (MANDATORY)
119
-
120
- **NEVER perform destructive or structural changes without explicit user approval.** This applies at ALL autonomy levels, including Level 3.
121
-
122
- ```
123
- BEFORE any of these actions, STOP and ask the user:
124
- ├── DROP TABLE, DROP COLUMN, DROP INDEX, TRUNCATE, DELETE without WHERE
125
- ├── Renaming or removing database tables or columns
126
- ├── Schema migrations that lose data or break existing queries
127
- ├── Replacing an existing architecture pattern (e.g., normalized → denormalized)
128
- ├── Removing or replacing existing files/modules that contain working functionality
129
- ├── Changing ORM models in ways that conflict with the existing database schema
130
- ├── Removing API endpoints or changing response shapes that existing clients depend on
131
- ├── Replacing a dependency or framework with a different one
132
- └── Any change that would require other parts of the system to be rewritten
133
- ```
134
-
135
- ### How to handle schema/architecture mismatches:
136
- 1. **READ the existing schema/code first** — understand what exists before proposing changes
137
- 2. **Adapt new code to match existing structures** — not the other way around
138
- 3. **If restructuring is truly needed**, present the case to the user with:
139
- - What exists today and why it might have been designed that way
140
- - What you want to change and why
141
- - What will break if you make the change
142
- - What data or functionality will be lost
143
- - A migration path that preserves existing data
144
- 4. **Wait for explicit approval** before proceeding
145
-
146
- ### Why this matters:
147
- Even in development, the user may have:
148
- - Working functionality they've tested and rely on
149
- - Data they've carefully set up (seed data, test accounts, configuration)
150
- - Other code that depends on the current structure
151
- - Design decisions made for reasons not documented
152
-
153
- **"Adapt to what exists" is always safer than "replace what exists."**
154
-
155
-
156
- # Autonomous Execution Rules
157
-
158
- ## Update Notices
159
-
160
- On session start, a version check hook outputs one of two messages. Show the result to the user at the **beginning** of your first response:
161
-
162
- - If `[GSD-T UPDATE]` appears update is available. Show:
163
- ```
164
- ⬆️ GSD-T update available: {installed} → {latest}
165
- Run: /user:gsd-t-version-update-all
166
- Changelog: https://github.com/Tekyz-Inc/get-stuff-done-teams/blob/main/CHANGELOG.md
167
- ```
168
- Also repeat at the **end** of your first response.
169
-
170
- - If `[GSD-T]` appears up to date. Show:
171
- ```
172
- GSD-T v{version} up to date
173
- ```
174
-
175
- ## Conversation vs. Work
176
-
177
- Only execute GSD-T workflow behavior when a `/gsd-t-*` command is invoked or when actively mid-phase (resumed via `/gsd-t-resume`). **Plain text messages — especially questions — should be answered conversationally.** Do not launch into workflow execution, file reading, or phase advancement from a question or comment. If the user wants work done, they will invoke a command.
178
-
179
- ## Auto-Init Guard
180
-
181
- Before executing any GSD-T workflow command, check if **any** of these files are missing in the current project:
182
- - `.gsd-t/progress.md`, `.gsd-t/backlog.md`, `.gsd-t/backlog-settings.md`
183
- - `.gsd-t/contracts/`, `.gsd-t/domains/`
184
- - `.claude/settings.local.json` (if `~/.claude/settings.local` exists)
185
- - `CLAUDE.md`, `README.md`
186
- - `docs/requirements.md`, `docs/architecture.md`, `docs/workflows.md`, `docs/infrastructure.md`
187
-
188
- If any are missing:
189
- 1. Run `gsd-t-init` automatically (it skips files that already exist)
190
- 2. Then continue with the originally requested command
191
-
192
- **Exempt commands** (do not trigger auto-init): `gsd-t-init`, `gsd-t-init-scan-setup`, `gsd-t-help`, `gsd-t-version-update`, `gsd-t-version-update-all`, `gsd-t-prompt`, `gsd-t-brainstorm`.
193
-
194
- ## Playwright Readiness Guard
195
-
196
- Before any command that involves testing (`gsd-t-execute`, `gsd-t-test-sync`, `gsd-t-verify`, `gsd-t-quick`, `gsd-t-wave`, `gsd-t-milestone`, `gsd-t-complete-milestone`, `gsd-t-debug`), check if `playwright.config.*` exists in the project. If it does not:
197
- 1. Detect the package manager and install Playwright (`@playwright/test` + chromium)
198
- 2. Create a basic `playwright.config.ts` with sensible defaults
199
- 3. Create the E2E test directory with a placeholder spec
200
- 4. Then continue with the original command
201
-
202
- Playwright must always be ready before any testing occurs. Do not skip this check. Do not defer setup to "later."
203
-
204
- ### Playwright Cleanup
205
-
206
- After Playwright tests finish (pass or fail), **kill any app/server processes that were started for the tests**. Playwright often launches a dev server (via `webServer` config or manually). These processes must not be left running:
207
- 1. Check for any dev server processes spawned during the test run
208
- 2. Kill them (e.g., `npx kill-port`, or terminate the process directly)
209
- 3. Verify the port is free before proceeding
210
-
211
- This applies everywhere Playwright tests are executed: execute, test-sync, verify, quick, wave, debug, complete-milestone, and integrate.
212
-
213
- ## API Documentation Guard (Swagger/OpenAPI)
214
-
215
- **Every API endpoint MUST be documented in a Swagger/OpenAPI spec. No exceptions.**
216
-
217
- When any GSD-T command creates or modifies an API endpoint:
218
- 1. **If no Swagger/OpenAPI spec exists**: Set one up immediately
219
- - Detect the framework (Express, Fastify, Hono, Django, FastAPI, etc.)
220
- - Install the appropriate Swagger integration (e.g., `swagger-jsdoc` + `swagger-ui-express`, `@fastify/swagger`, FastAPI's built-in OpenAPI)
221
- - Create the OpenAPI spec file or configure auto-generation from code
222
- - Add a `/docs` or `/api-docs` route serving the Swagger UI
223
- 2. **Update the spec**: Every new or changed endpoint must be reflected in the Swagger/OpenAPI spec — routes, request/response schemas, auth requirements, error responses
224
- 3. **Publish the Swagger URL**: The Swagger/API docs URL MUST appear in:
225
- - `CLAUDE.md` under Documentation or Infrastructure section
226
- - `README.md` under API section or Getting Started
227
- - `docs/infrastructure.md` under API documentation
228
- 4. **Verify**: After any API change, confirm the Swagger UI loads and reflects the current endpoints
229
-
230
- This applies during: `gsd-t-execute`, `gsd-t-quick`, `gsd-t-integrate`, `gsd-t-wave`, and any command that touches API code.
231
-
232
- ## Prime Rule
233
- KEEP GOING. Only stop for:
234
- 1. Unrecoverable errors after 2 fix attempts
235
- 2. Ambiguity that fundamentally changes project direction
236
- 3. Milestone completion (checkpoint for user review)
237
- 4. Destructive actions (see Destructive Action Guard above ALWAYS stop)
238
-
239
- ## Pre-Commit Gate (MANDATORY)
240
-
241
- NEVER commit code without running this checklist. This is not optional.
242
-
243
- ```
244
- BEFORE EVERY COMMIT:
245
- ├── Am I on the correct branch?
246
- │ CHECK Run `git branch --show-current`
247
- │ Compare against "Expected branch" in project CLAUDE.md
248
- │ WRONG BRANCH → STOP. Do NOT commit. Switch to the correct branch first.
249
- │ No guard set Proceed (but warn user to set one)
250
- ├── Did I create or change an API endpoint or response shape?
251
- │ YES Update .gsd-t/contracts/api-contract.md
252
- │ YES Update Swagger/OpenAPI spec (see API Documentation Guard below)
253
- │ YES Verify Swagger URL is in CLAUDE.md and README.md
254
- ├── Did I change the database schema?
255
- │ YES Update .gsd-t/contracts/schema-contract.md AND docs/schema.md
256
- ├── Did I add/change a UI component interface?
257
- │ YES → Update .gsd-t/contracts/component-contract.md
258
- ├── Did I add new files or directories?
259
- │ YES → Update the owning domain's scope.md
260
- ├── Did I implement or change a requirement?
261
- │ YES → Update docs/requirements.md (mark complete or revise)
262
- ├── Did I add/change/remove a component or change data flow?
263
- │ YES Update docs/architecture.md
264
- ├── Did I modify any document, script, or code file?
265
- YESAdd timestamped entry to .gsd-t/progress.md Decision Log
266
- Format: `- YYYY-MM-DD HH:MM: {what was done} — {brief context or result}`
267
- This includes ALL file-modifying activities:
268
- project, feature, scan, gap-analysis, milestone, partition, discuss,
269
- │ plan, impact, execute, test-sync, integrate, verify, complete-milestone,
270
- wave, quick, debug, promote-debt, populate, setup, init, init-scan-setup,
271
- backlog-add/edit/move/remove/promote/settings, and any manual code changes
272
- ├── Did I make an architectural or design decision?
273
- │ YES Also include decision rationale in the progress.md entry
274
- ├── Did I discover or fix tech debt?
275
- │ YES Update .gsd-t/techdebt.md
276
- ├── Did I establish a pattern future work should follow?
277
- │ YES Update CLAUDE.md or domain constraints.md
278
- ├── Did I add/change tests?
279
- │ YES Verify test names and paths are referenced in requirements
280
- ├── Did I change UI, routes, or user flows?
281
- │ YES Update affected E2E test specs (Playwright/Cypress)
282
- └── Did I run the affected tests?
283
- YES Verify they pass. NO Run them now.
284
- ```
285
-
286
- If ANY answer is YES and the doc is NOT updated, update it BEFORE committing. No exceptions.
287
-
288
- ## Execution Behavior
289
- - ALWAYS check docs/architecture.md before adding or modifying components.
290
- - ALWAYS check docs/workflows.md before changing any multi-step process.
291
- - ALWAYS update docs as part of completing work — not as an afterthought.
292
- - ALWAYS self-verify work by running tests and verification commands.
293
- - NEVER re-research how something works if you built it — it should be documented.
294
- - NEVER pause to show verification steps — execute them.
295
- - NEVER ask "should I continue?" just continue.
296
- - NEVER summarize what you're "about to do" — just do it.
297
- - IF a test fails, fix it immediately (up to 2 attempts) before reporting.
298
-
299
- ## Autonomy Levels
300
-
301
- Projects can specify an autonomy level in their project CLAUDE.md:
302
-
303
- | Level | Behavior |
304
- |-------|----------|
305
- | **Level 1: Supervised** | Pause at each phase for confirmation |
306
- | **Level 2: Standard** | Pause only at milestones |
307
- | **Level 3: Full Auto** | Only pause for blockers or project completion (default) |
308
-
309
- If not specified, use Level 3.
310
-
311
- ## Workflow Preferences (Defaults override in project CLAUDE.md)
312
-
313
- ### Research Policy
314
- Before planning a phase, evaluate whether research is needed:
315
-
316
- **Run research when:**
317
- - Phase involves unfamiliar libraries, APIs, or services
318
- - Architectural decisions are required
319
- - Integrating external systems
320
- - Phase scope is ambiguous or complex
321
-
322
- **Skip research when:**
323
- - Patterns are already established from earlier phases
324
- - Straightforward CRUD, UI, or config work
325
- - Domain is well understood
326
- - Phase builds directly on existing code patterns
327
-
328
- If in doubt, skip research and proceed — research if execution reveals gaps.
329
-
330
- ### Phase Flow
331
- - Upon completing a phase, automatically proceed to the next phase
332
- - ONLY run Discussion phase if truly required (clear path → skip to Plan)
333
- - ALWAYS self-verify work by running verification commands
334
- - NEVER pause to show verification steps — execute them
335
-
336
- ### Next Command Hint
337
-
338
- When a GSD-T command completes (and does NOT auto-advance to the next phase), display a hint showing the recommended next command. Format:
339
-
340
- ```
341
- Next /user:gsd-t-{command}
342
- ```
343
-
344
- Successor mapping:
345
- | Completed | Next |
346
- |-----------|------|
347
- | `project` | `gsd-t-milestone` |
348
- | `feature` | `gsd-t-milestone` |
349
- | `milestone` | `gsd-t-partition` |
350
- | `partition` | `gsd-t-plan` (or `gsd-t-discuss` if complex) |
351
- | `discuss` | `gsd-t-plan` |
352
- | `plan` | `gsd-t-execute` (or `gsd-t-impact` if risky) |
353
- | `impact` | `gsd-t-execute` |
354
- | `execute` | `gsd-t-test-sync` |
355
- | `test-sync` | `gsd-t-verify` (or `gsd-t-integrate` if multi-domain) |
356
- | `integrate` | `gsd-t-verify` |
357
- | `verify` | `gsd-t-complete-milestone` |
358
- | `complete-milestone` | `gsd-t-status` |
359
- | `scan` | `gsd-t-promote-debt` or `gsd-t-milestone` |
360
- | `init` | `gsd-t-scan` or `gsd-t-milestone` |
361
- | `init-scan-setup` | `gsd-t-milestone` |
362
- | `gap-analysis` | `gsd-t-milestone` or `gsd-t-feature` |
363
- | `populate` | `gsd-t-status` |
364
- | `setup` | `gsd-t-status` |
365
-
366
- Commands with no successor (standalone): `quick`, `debug`, `brainstorm`, `status`, `help`, `resume`, `prompt`, `log`, backlog commands.
367
-
368
- Skip the hint if auto-advancing (Level 3 mid-wave) — only show when the user needs to manually invoke the next step.
369
-
370
-
371
- # Don't Do These Things
372
-
373
- - NEVER perform destructive or structural changes without explicit user approval (see Destructive Action Guard above).
374
- - NEVER drop database tables, remove columns, or run destructive SQL on an existing database — adapt new code to the existing schema.
375
- - NEVER replace existing architecture patterns (e.g., normalized → denormalized) without user approval — even if you think the new way is better.
376
- - NEVER commit code without running the Pre-Commit Gate checklist. EVERY commit.
377
- - NEVER batch doc updates for later — update docs as part of the same commit as the code change.
378
- - NEVER start a phase without reading contracts and relevant docs first.
379
- - NEVER complete a phase without running document ripple on affected docs.
380
- - NEVER re-research how a component works — read architecture.md and contracts.
381
- - NEVER let code and contract disagree — fix one or the other immediately.
382
- - NEVER make changes that touch more than 3 files without pausing to confirm approach.
383
-
384
-
385
- # Code Standards (Defaults override in project CLAUDE.md)
386
-
387
- ## Patterns
388
- - Type hints required on all function signatures
389
- - Dataclasses/interfaces for data models, not raw dicts
390
- - Functions under 30 lines — split if longer
391
- - Files under 200 lines — create new modules if needed
392
- - Enums for state management and fixed option sets
393
-
394
- ## Naming
395
- ```
396
- files: snake_case (user_service.py)
397
- classes: PascalCase (UserService)
398
- functions: snake_case (get_user)
399
- constants: UPPER_SNAKE_CASE (MAX_RETRIES)
400
- private: _underscore (_internal_method)
401
- ```
402
-
403
-
404
- # Recovery After Interruption
405
-
406
- When resuming work (new session or after /clear):
407
- 1. Read `.gsd-t/progress.md` for current state
408
- 2. Read `docs/requirements.md` for what's left to build
409
- 3. Read `docs/architecture.md` for how the system is structured
410
- 4. Read `.gsd-t/contracts/` for domain interfaces
411
- 5. Verify last task's work is intact (files exist, tests pass)
412
- 6. Continue from current task — don't restart the phase
413
-
414
- **CRITICAL: Do NOT research how the system works. The docs tell you. Read them.**
1
+ # Prime Directives
2
+
3
+ 1. SIMPLICITY ABOVE ALL. Every change should be minimal and impact as little code as possible. No massive refactors.
4
+ 2. ALWAYS check for unwanted downstream effects before writing any new code or changing existing code.
5
+ 3. ALWAYS check for completeness that any code creation/change/deletion is implemented thoroughly in every relevant file.
6
+ 4. ALWAYS work autonomously. ONLY ask for user input when truly blocked.
7
+
8
+
9
+ # GSD-T: Contract-Driven Development
10
+
11
+ ## Work Hierarchy
12
+
13
+ ```
14
+ PROJECT or FEATURE or SCAN
15
+ └── MILESTONE (major deliverable)
16
+ └── PARTITION → DISCUSS → PLAN → IMPACT → EXECUTE → TEST-SYNC → INTEGRATE → VERIFY → COMPLETE
17
+ ```
18
+
19
+ - **Project**: Full greenfield project → decomposed into milestones
20
+ - **Feature**: Major new feature for existing codebase → impact analysis → milestones
21
+ - **Scan**: Deep codebase analysis → techdebt.md → promotable to milestones
22
+ - **Milestone**: A significant deliverable (e.g., "User Authentication Complete")
23
+ - **Domain**: An independent area of responsibility within a milestone, with its own scope, tasks, and file boundaries
24
+ - **Contract**: The documented interface between domains — API shapes, schemas, component props
25
+
26
+ ## Commands Reference
27
+
28
+ | Command | Purpose |
29
+ |---------|---------|
30
+ | `/user:gsd` | Smart router — describe what you need, auto-routes to the right command |
31
+ | `/user:gsd-t-help` | List all commands or get detailed help |
32
+ | `/user:gsd-t-prompt` | Help formulate your idea before committing |
33
+ | `/user:gsd-t-brainstorm` | Creative exploration and idea generation |
34
+ | `/user:gsd-t-project` | Full project → milestone roadmap |
35
+ | `/user:gsd-t-feature` | Major feature → impact analysis + milestones |
36
+ | `/user:gsd-t-scan` | Deep codebase analysis → techdebt.md |
37
+ | `/user:gsd-t-gap-analysis` | Requirements gap analysis — spec vs. existing code |
38
+ | `/user:gsd-t-promote-debt` | Convert debt items to milestones |
39
+ | `/user:gsd-t-setup` | Generate or restructure project CLAUDE.md |
40
+ | `/user:gsd-t-init` | Initialize project structure |
41
+ | `/user:gsd-t-init-scan-setup` | Full onboarding: git + init + scan + setup in one |
42
+ | `/user:gsd-t-milestone` | Define new milestone |
43
+ | `/user:gsd-t-partition` | Decompose into domains + contracts |
44
+ | `/user:gsd-t-discuss` | Multi-perspective design exploration |
45
+ | `/user:gsd-t-plan` | Create atomic task lists per domain |
46
+ | `/user:gsd-t-impact` | Analyze downstream effects before execution |
47
+ | `/user:gsd-t-execute` | Run tasks (solo or team) |
48
+ | `/user:gsd-t-test-sync` | Keep tests aligned with code changes |
49
+ | `/user:gsd-t-qa` | QA agent test generation, execution, gap reporting |
50
+ | `/user:gsd-t-integrate` | Wire domains together |
51
+ | `/user:gsd-t-verify` | Run quality gates |
52
+ | `/user:gsd-t-complete-milestone` | Archive milestone + git tag |
53
+ | `/user:gsd-t-wave` | Full cycle (auto-advances all phases) |
54
+ | `/user:gsd-t-status` | Cross-domain progress view |
55
+ | `/user:gsd-t-debug` | Systematic debugging |
56
+ | `/user:gsd-t-quick` | Fast task, respects contracts |
57
+ | `/user:gsd-t-populate` | Auto-populate docs from existing codebase |
58
+ | `/user:gsd-t-log` | Sync progress Decision Log with recent git activity |
59
+ | `/user:gsd-t-resume` | Restore context, continue |
60
+ | `/user:gsd-t-version-update` | Update GSD-T to latest version |
61
+ | `/user:gsd-t-version-update-all` | Update GSD-T + all registered projects |
62
+ | `/user:gsd-t-triage-and-merge` | Auto-review, merge, and publish GitHub branches |
63
+ | `/user:gsd-t-backlog-add` | Capture item, auto-categorize, append to backlog |
64
+ | `/user:gsd-t-backlog-list` | Filtered, ordered view of backlog items |
65
+ | `/user:gsd-t-backlog-move` | Reorder items by position (priority) |
66
+ | `/user:gsd-t-backlog-edit` | Modify backlog entry fields |
67
+ | `/user:gsd-t-backlog-remove` | Drop item with optional reason |
68
+ | `/user:gsd-t-backlog-promote` | Refine, classify, launch GSD-T workflow |
69
+ | `/user:gsd-t-backlog-settings` | Manage types, apps, categories, defaults |
70
+ | `/user:branch` | Create and switch to a new git branch |
71
+ | `/user:checkin` | Auto-bump version, stage, commit, and push |
72
+ | `/user:Claude-md` | Reload and apply CLAUDE.md directives |
73
+
74
+
75
+ # Living Documents
76
+
77
+ These documents MUST be maintained and referenced throughout development:
78
+
79
+ | Document | Location | Purpose |
80
+ |----------|----------|---------|
81
+ | **Requirements** | `docs/requirements.md` | Functional and technical requirements |
82
+ | **Architecture** | `docs/architecture.md` | System design, components, data flow, decisions |
83
+ | **Workflows** | `docs/workflows.md` | User journeys and technical process flows |
84
+ | **Infrastructure** | `docs/infrastructure.md` | Commands, DB setup, server access, creds |
85
+ | **README** | `README.md` | Project overview, setup, features |
86
+ | **Progress** | `.gsd-t/progress.md` | Current milestone/phase state + version |
87
+ | **Contracts** | `.gsd-t/contracts/` | Interfaces between domains |
88
+ | **Tech Debt** | `.gsd-t/techdebt.md` | Debt register from scans |
89
+
90
+ ## The "No Re-Research" Rule
91
+
92
+ **BEFORE researching how something works, CHECK THE DOCS FIRST.**
93
+
94
+ ```
95
+ NEED TO UNDERSTAND SOMETHING?
96
+ ├── Is it about system structure/components? → Read docs/architecture.md
97
+ ├── Is it about how a process flows? → Read docs/workflows.md
98
+ ├── Is it about what to build? → Read docs/requirements.md
99
+ ├── Is it about how to deploy/operate? → Read docs/infrastructure.md
100
+ ├── Is it about domain interfaces? → Read .gsd-t/contracts/
101
+ └── Not documented? → Research, then DOCUMENT IT
102
+ ```
103
+
104
+
105
+ # Versioning
106
+
107
+ GSD-T tracks project version in `.gsd-t/progress.md` using semantic versioning: `Major.Minor.Patch`
108
+
109
+ | Segment | Bumped When | Example |
110
+ |---------|-------------|---------|
111
+ | **Major** | Breaking changes, major rework, v1 launch | 1.0.02.0.0 |
112
+ | **Minor** | New features, completed feature milestones | 1.1.0 → 1.2.0 |
113
+ | **Patch** | Bug fixes, minor improvements, cleanup | 1.1.1 → 1.1.2 |
114
+
115
+ - Version is set during `gsd-t-init` (starts at `0.1.0`)
116
+ - Version is bumped during `gsd-t-complete-milestone` based on milestone scope
117
+ - Version is reflected in: `progress.md`, `README.md`, package manifest (if any), and git tags (`v{version}`)
118
+
119
+
120
+ # Destructive Action Guard (MANDATORY)
121
+
122
+ **NEVER perform destructive or structural changes without explicit user approval.** This applies at ALL autonomy levels, including Level 3.
123
+
124
+ ```
125
+ BEFORE any of these actions, STOP and ask the user:
126
+ ├── DROP TABLE, DROP COLUMN, DROP INDEX, TRUNCATE, DELETE without WHERE
127
+ ├── Renaming or removing database tables or columns
128
+ ├── Schema migrations that lose data or break existing queries
129
+ ├── Replacing an existing architecture pattern (e.g., normalized denormalized)
130
+ ├── Removing or replacing existing files/modules that contain working functionality
131
+ ├── Changing ORM models in ways that conflict with the existing database schema
132
+ ├── Removing API endpoints or changing response shapes that existing clients depend on
133
+ ├── Replacing a dependency or framework with a different one
134
+ └── Any change that would require other parts of the system to be rewritten
135
+ ```
136
+
137
+ ### How to handle schema/architecture mismatches:
138
+ 1. **READ the existing schema/code first** understand what exists before proposing changes
139
+ 2. **Adapt new code to match existing structures** not the other way around
140
+ 3. **If restructuring is truly needed**, present the case to the user with:
141
+ - What exists today and why it might have been designed that way
142
+ - What you want to change and why
143
+ - What will break if you make the change
144
+ - What data or functionality will be lost
145
+ - A migration path that preserves existing data
146
+ 4. **Wait for explicit approval** before proceeding
147
+
148
+ ### Why this matters:
149
+ Even in development, the user may have:
150
+ - Working functionality they've tested and rely on
151
+ - Data they've carefully set up (seed data, test accounts, configuration)
152
+ - Other code that depends on the current structure
153
+ - Design decisions made for reasons not documented
154
+
155
+ **"Adapt to what exists" is always safer than "replace what exists."**
156
+
157
+
158
+ # Autonomous Execution Rules
159
+
160
+ ## Update Notices
161
+
162
+ On session start, a version check hook outputs one of two messages. Show the result to the user at the **beginning** of your first response:
163
+
164
+ - If `[GSD-T UPDATE]` appears → update is available. Show:
165
+ ```
166
+ ⬆️ GSD-T update available: {installed} → {latest}
167
+ Run: /user:gsd-t-version-update-all
168
+ Changelog: https://github.com/Tekyz-Inc/get-stuff-done-teams/blob/main/CHANGELOG.md
169
+ ```
170
+ Also repeat at the **end** of your first response.
171
+
172
+ - If `[GSD-T]` appears up to date. Show:
173
+ ```
174
+ GSD-T v{version} — up to date
175
+ ```
176
+
177
+ ## Conversation vs. Work
178
+
179
+ Only execute GSD-T workflow behavior when a `/gsd-t-*` command is invoked or when actively mid-phase (resumed via `/gsd-t-resume`). **Plain text messages — especially questions — should be answered conversationally.** Do not launch into workflow execution, file reading, or phase advancement from a question or comment. If the user wants work done, they will invoke a command.
180
+
181
+ ## Auto-Init Guard
182
+
183
+ Before executing any GSD-T workflow command, check if **any** of these files are missing in the current project:
184
+ - `.gsd-t/progress.md`, `.gsd-t/backlog.md`, `.gsd-t/backlog-settings.md`
185
+ - `.gsd-t/contracts/`, `.gsd-t/domains/`
186
+ - `.claude/settings.local.json` (if `~/.claude/settings.local` exists)
187
+ - `CLAUDE.md`, `README.md`
188
+ - `docs/requirements.md`, `docs/architecture.md`, `docs/workflows.md`, `docs/infrastructure.md`
189
+
190
+ If any are missing:
191
+ 1. Run `gsd-t-init` automatically (it skips files that already exist)
192
+ 2. Then continue with the originally requested command
193
+
194
+ **Exempt commands** (do not trigger auto-init): `gsd-t-init`, `gsd-t-init-scan-setup`, `gsd-t-help`, `gsd-t-version-update`, `gsd-t-version-update-all`, `gsd-t-prompt`, `gsd-t-brainstorm`.
195
+
196
+ ## Playwright Readiness Guard
197
+
198
+ Before any command that involves testing (`gsd-t-execute`, `gsd-t-test-sync`, `gsd-t-verify`, `gsd-t-quick`, `gsd-t-wave`, `gsd-t-milestone`, `gsd-t-complete-milestone`, `gsd-t-debug`), check if `playwright.config.*` exists in the project. If it does not:
199
+ 1. Detect the package manager and install Playwright (`@playwright/test` + chromium)
200
+ 2. Create a basic `playwright.config.ts` with sensible defaults
201
+ 3. Create the E2E test directory with a placeholder spec
202
+ 4. Then continue with the original command
203
+
204
+ Playwright must always be ready before any testing occurs. Do not skip this check. Do not defer setup to "later."
205
+
206
+ ### Playwright Cleanup
207
+
208
+ After Playwright tests finish (pass or fail), **kill any app/server processes that were started for the tests**. Playwright often launches a dev server (via `webServer` config or manually). These processes must not be left running:
209
+ 1. Check for any dev server processes spawned during the test run
210
+ 2. Kill them (e.g., `npx kill-port`, or terminate the process directly)
211
+ 3. Verify the port is free before proceeding
212
+
213
+ This applies everywhere Playwright tests are executed: execute, test-sync, verify, quick, wave, debug, complete-milestone, and integrate.
214
+
215
+ ## QA Agent (Mandatory)
216
+
217
+ Any GSD-T phase that produces or validates code **MUST spawn a QA teammate**. The QA agent's sole job is test generation, execution, and gap reporting. It never writes feature code.
218
+
219
+ **Commands that must spawn QA agent:**
220
+ `partition`, `plan`, `execute`, `verify`, `complete-milestone`, `quick`, `debug`, `integrate`, `test-sync`, `wave`
221
+
222
+ **Spawn instruction:**
223
+ ```
224
+ Teammate "qa": Read commands/gsd-t-qa.md for your full instructions.
225
+ Phase context: {current phase}. Read .gsd-t/contracts/ for contract definitions.
226
+ Your job: generate contract tests, run all tests, report gaps.
227
+ You do NOT write feature code.
228
+ ```
229
+
230
+ **QA agent failure blocks phase completion.** Lead cannot proceed until QA reports PASS or user explicitly overrides.
231
+
232
+ ## API Documentation Guard (Swagger/OpenAPI)
233
+
234
+ **Every API endpoint MUST be documented in a Swagger/OpenAPI spec. No exceptions.**
235
+
236
+ When any GSD-T command creates or modifies an API endpoint:
237
+ 1. **If no Swagger/OpenAPI spec exists**: Set one up immediately
238
+ - Detect the framework (Express, Fastify, Hono, Django, FastAPI, etc.)
239
+ - Install the appropriate Swagger integration (e.g., `swagger-jsdoc` + `swagger-ui-express`, `@fastify/swagger`, FastAPI's built-in OpenAPI)
240
+ - Create the OpenAPI spec file or configure auto-generation from code
241
+ - Add a `/docs` or `/api-docs` route serving the Swagger UI
242
+ 2. **Update the spec**: Every new or changed endpoint must be reflected in the Swagger/OpenAPI spec — routes, request/response schemas, auth requirements, error responses
243
+ 3. **Publish the Swagger URL**: The Swagger/API docs URL MUST appear in:
244
+ - `CLAUDE.md` — under Documentation or Infrastructure section
245
+ - `README.md` under API section or Getting Started
246
+ - `docs/infrastructure.md` under API documentation
247
+ 4. **Verify**: After any API change, confirm the Swagger UI loads and reflects the current endpoints
248
+
249
+ This applies during: `gsd-t-execute`, `gsd-t-quick`, `gsd-t-integrate`, `gsd-t-wave`, and any command that touches API code.
250
+
251
+ ## Prime Rule
252
+ KEEP GOING. Only stop for:
253
+ 1. Unrecoverable errors after 2 fix attempts
254
+ 2. Ambiguity that fundamentally changes project direction
255
+ 3. Milestone completion (checkpoint for user review)
256
+ 4. Destructive actions (see Destructive Action Guard above — ALWAYS stop)
257
+
258
+ ## Pre-Commit Gate (MANDATORY)
259
+
260
+ NEVER commit code without running this checklist. This is not optional.
261
+
262
+ ```
263
+ BEFORE EVERY COMMIT:
264
+ ├── Am I on the correct branch?
265
+ CHECKRun `git branch --show-current`
266
+ Compare against "Expected branch" in project CLAUDE.md
267
+ WRONG BRANCH STOP. Do NOT commit. Switch to the correct branch first.
268
+ No guard set Proceed (but warn user to set one)
269
+ ├── Did I create or change an API endpoint or response shape?
270
+ YES Update .gsd-t/contracts/api-contract.md
271
+ YES → Update Swagger/OpenAPI spec (see API Documentation Guard below)
272
+ │ YES Verify Swagger URL is in CLAUDE.md and README.md
273
+ ├── Did I change the database schema?
274
+ │ YES Update .gsd-t/contracts/schema-contract.md AND docs/schema.md
275
+ ├── Did I add/change a UI component interface?
276
+ │ YES Update .gsd-t/contracts/component-contract.md
277
+ ├── Did I add new files or directories?
278
+ │ YES Update the owning domain's scope.md
279
+ ├── Did I implement or change a requirement?
280
+ │ YES Update docs/requirements.md (mark complete or revise)
281
+ ├── Did I add/change/remove a component or change data flow?
282
+ │ YES Update docs/architecture.md
283
+ ├── Did I modify any document, script, or code file?
284
+ │ YES → Add timestamped entry to .gsd-t/progress.md Decision Log
285
+ │ Format: `- YYYY-MM-DD HH:MM: {what was done} — {brief context or result}`
286
+ │ This includes ALL file-modifying activities:
287
+ │ project, feature, scan, gap-analysis, milestone, partition, discuss,
288
+ │ plan, impact, execute, test-sync, integrate, verify, complete-milestone,
289
+ │ wave, quick, debug, promote-debt, populate, setup, init, init-scan-setup,
290
+ │ backlog-add/edit/move/remove/promote/settings, and any manual code changes
291
+ ├── Did I make an architectural or design decision?
292
+ │ YES Also include decision rationale in the progress.md entry
293
+ ├── Did I discover or fix tech debt?
294
+ │ YES Update .gsd-t/techdebt.md
295
+ ├── Did I establish a pattern future work should follow?
296
+ │ YES Update CLAUDE.md or domain constraints.md
297
+ ├── Did I add/change tests?
298
+ │ YES → Verify test names and paths are referenced in requirements
299
+ ├── Did I change UI, routes, or user flows?
300
+ │ YES → Update affected E2E test specs (Playwright/Cypress)
301
+ └── Did I run the affected tests?
302
+ YES → Verify they pass. NO → Run them now.
303
+ ```
304
+
305
+ If ANY answer is YES and the doc is NOT updated, update it BEFORE committing. No exceptions.
306
+
307
+ ## Execution Behavior
308
+ - ALWAYS check docs/architecture.md before adding or modifying components.
309
+ - ALWAYS check docs/workflows.md before changing any multi-step process.
310
+ - ALWAYS update docs as part of completing work — not as an afterthought.
311
+ - ALWAYS self-verify work by running tests and verification commands.
312
+ - NEVER re-research how something works if you built it — it should be documented.
313
+ - NEVER pause to show verification steps — execute them.
314
+ - NEVER ask "should I continue?" just continue.
315
+ - NEVER summarize what you're "about to do" — just do it.
316
+ - IF a test fails, fix it immediately (up to 2 attempts) before reporting.
317
+
318
+ ## Autonomy Levels
319
+
320
+ Projects can specify an autonomy level in their project CLAUDE.md:
321
+
322
+ | Level | Behavior |
323
+ |-------|----------|
324
+ | **Level 1: Supervised** | Pause at each phase for confirmation |
325
+ | **Level 2: Standard** | Pause only at milestones |
326
+ | **Level 3: Full Auto** | Only pause for blockers or project completion (default) |
327
+
328
+ If not specified, use Level 3.
329
+
330
+ ## Workflow Preferences (Defaults — override in project CLAUDE.md)
331
+
332
+ ### Research Policy
333
+ Before planning a phase, evaluate whether research is needed:
334
+
335
+ **Run research when:**
336
+ - Phase involves unfamiliar libraries, APIs, or services
337
+ - Architectural decisions are required
338
+ - Integrating external systems
339
+ - Phase scope is ambiguous or complex
340
+
341
+ **Skip research when:**
342
+ - Patterns are already established from earlier phases
343
+ - Straightforward CRUD, UI, or config work
344
+ - Domain is well understood
345
+ - Phase builds directly on existing code patterns
346
+
347
+ If in doubt, skip research and proceed — research if execution reveals gaps.
348
+
349
+ ### Phase Flow
350
+ - Upon completing a phase, automatically proceed to the next phase
351
+ - ONLY run Discussion phase if truly required (clear path → skip to Plan)
352
+ - ALWAYS self-verify work by running verification commands
353
+ - NEVER pause to show verification steps — execute them
354
+
355
+ ### Next Command Hint
356
+
357
+ When a GSD-T command completes (and does NOT auto-advance to the next phase), display a hint showing the recommended next command. Format:
358
+
359
+ ```
360
+ Next /user:gsd-t-{command}
361
+ ```
362
+
363
+ Successor mapping:
364
+ | Completed | Next |
365
+ |-----------|------|
366
+ | `project` | `gsd-t-milestone` |
367
+ | `feature` | `gsd-t-milestone` |
368
+ | `milestone` | `gsd-t-partition` |
369
+ | `partition` | `gsd-t-plan` (or `gsd-t-discuss` if complex) |
370
+ | `discuss` | `gsd-t-plan` |
371
+ | `plan` | `gsd-t-execute` (or `gsd-t-impact` if risky) |
372
+ | `impact` | `gsd-t-execute` |
373
+ | `execute` | `gsd-t-test-sync` |
374
+ | `test-sync` | `gsd-t-verify` (or `gsd-t-integrate` if multi-domain) |
375
+ | `integrate` | `gsd-t-verify` |
376
+ | `verify` | `gsd-t-complete-milestone` |
377
+ | `complete-milestone` | `gsd-t-status` |
378
+ | `scan` | `gsd-t-promote-debt` or `gsd-t-milestone` |
379
+ | `init` | `gsd-t-scan` or `gsd-t-milestone` |
380
+ | `init-scan-setup` | `gsd-t-milestone` |
381
+ | `gap-analysis` | `gsd-t-milestone` or `gsd-t-feature` |
382
+ | `populate` | `gsd-t-status` |
383
+ | `setup` | `gsd-t-status` |
384
+
385
+ Commands with no successor (standalone): `quick`, `debug`, `brainstorm`, `status`, `help`, `resume`, `prompt`, `log`, backlog commands.
386
+
387
+ Skip the hint if auto-advancing (Level 3 mid-wave) — only show when the user needs to manually invoke the next step.
388
+
389
+
390
+ # Don't Do These Things
391
+
392
+ - NEVER perform destructive or structural changes without explicit user approval (see Destructive Action Guard above).
393
+ - NEVER drop database tables, remove columns, or run destructive SQL on an existing database — adapt new code to the existing schema.
394
+ - NEVER replace existing architecture patterns (e.g., normalized → denormalized) without user approval — even if you think the new way is better.
395
+ - NEVER commit code without running the Pre-Commit Gate checklist. EVERY commit.
396
+ - NEVER batch doc updates for later — update docs as part of the same commit as the code change.
397
+ - NEVER start a phase without reading contracts and relevant docs first.
398
+ - NEVER complete a phase without running document ripple on affected docs.
399
+ - NEVER re-research how a component works — read architecture.md and contracts.
400
+ - NEVER let code and contract disagree — fix one or the other immediately.
401
+ - NEVER make changes that touch more than 3 files without pausing to confirm approach.
402
+
403
+
404
+ # Code Standards (Defaults — override in project CLAUDE.md)
405
+
406
+ ## Patterns
407
+ - Type hints required on all function signatures
408
+ - Dataclasses/interfaces for data models, not raw dicts
409
+ - Functions under 30 lines split if longer
410
+ - Files under 200 lines — create new modules if needed
411
+ - Enums for state management and fixed option sets
412
+
413
+ ## Naming
414
+ ```
415
+ files: snake_case (user_service.py)
416
+ classes: PascalCase (UserService)
417
+ functions: snake_case (get_user)
418
+ constants: UPPER_SNAKE_CASE (MAX_RETRIES)
419
+ private: _underscore (_internal_method)
420
+ ```
421
+
422
+
423
+ # Recovery After Interruption
424
+
425
+ When resuming work (new session or after /clear):
426
+ 1. Read `.gsd-t/progress.md` for current state
427
+ 2. Read `docs/requirements.md` for what's left to build
428
+ 3. Read `docs/architecture.md` for how the system is structured
429
+ 4. Read `.gsd-t/contracts/` for domain interfaces
430
+ 5. Verify last task's work is intact (files exist, tests pass)
431
+ 6. Continue from current task — don't restart the phase
432
+
433
+ **CRITICAL: Do NOT research how the system works. The docs tell you. Read them.**