@tekyzinc/gsd-t 2.5.0 → 2.8.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.
package/README.md CHANGED
@@ -6,6 +6,7 @@ A methodology for reliable, parallelizable development using Claude Code with op
6
6
  **Enables parallel execution** — contract-driven domains can be worked on simultaneously.
7
7
  **Maintains test coverage** — automatically keeps tests aligned with code changes.
8
8
  **Catches downstream effects** — analyzes impact before changes break things.
9
+ **Protects existing work** — destructive action guard prevents schema drops, architecture replacements, and data loss without explicit approval.
9
10
 
10
11
  ---
11
12
 
@@ -17,7 +18,7 @@ A methodology for reliable, parallelizable development using Claude Code with op
17
18
  npx @tekyzinc/gsd-t install
18
19
  ```
19
20
 
20
- This installs 24 GSD-T commands + 3 utility commands to `~/.claude/commands/` and the global CLAUDE.md to `~/.claude/CLAUDE.md`. Works on Windows, Mac, and Linux.
21
+ This installs 31 GSD-T commands + 3 utility commands to `~/.claude/commands/` and the global CLAUDE.md to `~/.claude/CLAUDE.md`. Works on Windows, Mac, and Linux.
21
22
 
22
23
  ### Start Using It
23
24
 
@@ -65,8 +66,10 @@ GSD-T reads all state files and tells you exactly where you left off.
65
66
 
66
67
  ```bash
67
68
  npx @tekyzinc/gsd-t install # Install commands + global CLAUDE.md
68
- npx @tekyzinc/gsd-t update # Update to latest (backs up customizations)
69
- npx @tekyzinc/gsd-t init [name] # Scaffold GSD-T project in current directory
69
+ npx @tekyzinc/gsd-t update # Update global commands + CLAUDE.md
70
+ npx @tekyzinc/gsd-t update-all # Update globally + all registered project CLAUDE.md files
71
+ npx @tekyzinc/gsd-t init [name] # Scaffold GSD-T project (auto-registers)
72
+ npx @tekyzinc/gsd-t register # Register current directory as a GSD-T project
70
73
  npx @tekyzinc/gsd-t status # Check installation + version
71
74
  npx @tekyzinc/gsd-t doctor # Diagnose common issues
72
75
  npx @tekyzinc/gsd-t uninstall # Remove commands (keeps project files)
@@ -130,6 +133,18 @@ This will replace changed command files, back up your CLAUDE.md if customized, a
130
133
  | `/user:gsd-t-quick` | Fast task with GSD-T guarantees |
131
134
  | `/user:gsd-t-debug` | Systematic debugging with state |
132
135
 
136
+ ### Backlog Management
137
+
138
+ | Command | Purpose |
139
+ |---------|---------|
140
+ | `/user:gsd-t-backlog-add` | Capture item, auto-categorize, append to backlog |
141
+ | `/user:gsd-t-backlog-list` | Filtered, ordered view of backlog items |
142
+ | `/user:gsd-t-backlog-move` | Reorder items by position (priority) |
143
+ | `/user:gsd-t-backlog-edit` | Modify backlog entry fields |
144
+ | `/user:gsd-t-backlog-remove` | Drop item with optional reason |
145
+ | `/user:gsd-t-backlog-promote` | Refine, classify, launch GSD-T workflow |
146
+ | `/user:gsd-t-backlog-settings` | Manage types, apps, categories, defaults |
147
+
133
148
  ### Git Helpers
134
149
 
135
150
  | Command | Purpose |
@@ -179,6 +194,8 @@ your-project/
179
194
  │ └── infrastructure.md # Dev setup, DB, cloud, deployment
180
195
  ├── .gsd-t/
181
196
  │ ├── progress.md # Master state file
197
+ │ ├── backlog.md # Captured backlog items (priority ordered)
198
+ │ ├── backlog-settings.md # Types, apps, categories, defaults
182
199
  │ ├── roadmap.md # Milestone roadmap
183
200
  │ ├── techdebt.md # Technical debt register
184
201
  │ ├── verify-report.md # Latest verification results
@@ -251,8 +268,8 @@ get-stuff-done-teams/
251
268
  ├── LICENSE
252
269
  ├── bin/
253
270
  │ └── gsd-t.js # CLI installer
254
- ├── commands/ # 27 slash commands
255
- │ ├── gsd-t-*.md # 24 GSD-T workflow commands
271
+ ├── commands/ # 34 slash commands
272
+ │ ├── gsd-t-*.md # 31 GSD-T workflow commands
256
273
  │ ├── branch.md # Git branch helper
257
274
  │ ├── checkin.md # Auto-version + commit/push helper
258
275
  │ └── Claude-md.md # Reload CLAUDE.md directives
@@ -263,7 +280,9 @@ get-stuff-done-teams/
263
280
  │ ├── architecture.md
264
281
  │ ├── workflows.md
265
282
  │ ├── infrastructure.md
266
- └── progress.md
283
+ ├── progress.md
284
+ │ ├── backlog.md
285
+ │ └── backlog-settings.md
267
286
  ├── examples/
268
287
  │ ├── settings.json
269
288
  │ └── .gsd-t/
package/bin/gsd-t.js CHANGED
@@ -6,7 +6,9 @@
6
6
  * Usage:
7
7
  * npx @tekyzinc/gsd-t install — Install commands + global CLAUDE.md
8
8
  * npx @tekyzinc/gsd-t update — Update commands + global CLAUDE.md (preserves customizations)
9
- * npx @tekyzinc/gsd-t init [name] Initialize a new project with GSD-T structure
9
+ * npx @tekyzinc/gsd-t update-all — Update globally + all registered project CLAUDE.md files
10
+ * npx @tekyzinc/gsd-t init [name] — Initialize a new project with GSD-T structure (auto-registers)
11
+ * npx @tekyzinc/gsd-t register — Register current directory as a GSD-T project
10
12
  * npx @tekyzinc/gsd-t status — Show what's installed and check for updates
11
13
  * npx @tekyzinc/gsd-t uninstall — Remove GSD-T commands (leaves project files alone)
12
14
  * npx @tekyzinc/gsd-t doctor — Diagnose common issues
@@ -23,6 +25,7 @@ const COMMANDS_DIR = path.join(CLAUDE_DIR, "commands");
23
25
  const GLOBAL_CLAUDE_MD = path.join(CLAUDE_DIR, "CLAUDE.md");
24
26
  const SETTINGS_JSON = path.join(CLAUDE_DIR, "settings.json");
25
27
  const VERSION_FILE = path.join(CLAUDE_DIR, ".gsd-t-version");
28
+ const PROJECTS_FILE = path.join(CLAUDE_DIR, ".gsd-t-projects");
26
29
 
27
30
  // Where our package files live (relative to this script)
28
31
  const PKG_ROOT = path.resolve(__dirname, "..");
@@ -87,6 +90,25 @@ function saveInstalledVersion() {
87
90
  fs.writeFileSync(VERSION_FILE, PKG_VERSION);
88
91
  }
89
92
 
93
+ function getRegisteredProjects() {
94
+ try {
95
+ const content = fs.readFileSync(PROJECTS_FILE, "utf8").trim();
96
+ if (!content) return [];
97
+ return content.split("\n").map((l) => l.trim()).filter((l) => l && !l.startsWith("#"));
98
+ } catch {
99
+ return [];
100
+ }
101
+ }
102
+
103
+ function registerProject(projectDir) {
104
+ const resolved = path.resolve(projectDir);
105
+ const projects = getRegisteredProjects();
106
+ if (projects.includes(resolved)) return false;
107
+ projects.push(resolved);
108
+ fs.writeFileSync(PROJECTS_FILE, projects.join("\n") + "\n");
109
+ return true;
110
+ }
111
+
90
112
  function getCommandFiles() {
91
113
  // All .md files in our commands/ directory (gsd-t-* plus utilities like branch, checkin, Claude-md)
92
114
  return fs
@@ -315,7 +337,12 @@ function doInit(projectName) {
315
337
  success(".gsd-t/progress.md");
316
338
  }
317
339
 
318
- // 4. Summary
340
+ // 4. Register in project index
341
+ if (registerProject(projectDir)) {
342
+ success("Registered in ~/.claude/.gsd-t-projects");
343
+ }
344
+
345
+ // 5. Summary
319
346
  heading("Project Initialized!");
320
347
  log("");
321
348
  log(` ${projectDir}/`);
@@ -469,6 +496,122 @@ function doUninstall() {
469
496
  log("");
470
497
  }
471
498
 
499
+ function doUpdateAll() {
500
+ // First, run the normal global update
501
+ const installedVersion = getInstalledVersion();
502
+ if (installedVersion !== PKG_VERSION) {
503
+ doInstall({ update: true });
504
+ } else {
505
+ heading(`GSD-T v${PKG_VERSION}`);
506
+ success("Global commands already up to date");
507
+ }
508
+
509
+ // Read project registry
510
+ heading("Updating registered projects...");
511
+ log("");
512
+
513
+ const projects = getRegisteredProjects();
514
+
515
+ if (projects.length === 0) {
516
+ info("No projects registered");
517
+ log("");
518
+ log(" Projects are registered automatically when you run:");
519
+ log(` ${DIM}$${RESET} npx @tekyzinc/gsd-t init`);
520
+ log("");
521
+ log(" Or register an existing project manually:");
522
+ log(` ${DIM}$${RESET} npx @tekyzinc/gsd-t register`);
523
+ log("");
524
+ return;
525
+ }
526
+
527
+ let updated = 0;
528
+ let skipped = 0;
529
+ let missing = 0;
530
+
531
+ for (const projectDir of projects) {
532
+ const projectName = path.basename(projectDir);
533
+ const claudeMd = path.join(projectDir, "CLAUDE.md");
534
+
535
+ // Check project still exists
536
+ if (!fs.existsSync(projectDir)) {
537
+ warn(`${projectName} — directory not found (${projectDir})`);
538
+ missing++;
539
+ continue;
540
+ }
541
+
542
+ if (!fs.existsSync(claudeMd)) {
543
+ warn(`${projectName} — no CLAUDE.md found`);
544
+ skipped++;
545
+ continue;
546
+ }
547
+
548
+ const content = fs.readFileSync(claudeMd, "utf8");
549
+
550
+ // Check if the project CLAUDE.md needs the Destructive Action Guard
551
+ if (content.includes("Destructive Action Guard")) {
552
+ info(`${projectName} — already up to date`);
553
+ skipped++;
554
+ continue;
555
+ }
556
+
557
+ // Add the Destructive Action Guard section
558
+ const guardSection = [
559
+ "",
560
+ "",
561
+ "# Destructive Action Guard (MANDATORY)",
562
+ "",
563
+ "**NEVER perform destructive or structural changes without explicit user approval.** This applies at ALL autonomy levels.",
564
+ "",
565
+ "Before any of these actions, STOP and ask the user:",
566
+ "- DROP TABLE, DROP COLUMN, DROP INDEX, TRUNCATE, DELETE without WHERE",
567
+ "- Renaming or removing database tables or columns",
568
+ "- Schema migrations that lose data or break existing queries",
569
+ "- Replacing an existing architecture pattern (e.g., normalized → denormalized)",
570
+ "- Removing or replacing existing files/modules that contain working functionality",
571
+ "- Changing ORM models in ways that conflict with the existing database schema",
572
+ "- Removing API endpoints or changing response shapes that existing clients depend on",
573
+ "- Any change that would require other parts of the system to be rewritten",
574
+ "",
575
+ '**Rule: "Adapt new code to existing structures, not the other way around."**',
576
+ "",
577
+ ].join("\n");
578
+
579
+ let newContent;
580
+ // Match headings at any level (# or ## or ###)
581
+ const preCommitMatch = content.match(/\n(#{1,3} Pre-Commit Gate)/);
582
+ const dontDoMatch = content.match(/\n(#{1,3} Don't Do These Things)/);
583
+
584
+ if (preCommitMatch) {
585
+ newContent = content.replace(
586
+ "\n" + preCommitMatch[1],
587
+ guardSection + "\n" + preCommitMatch[1]
588
+ );
589
+ } else if (dontDoMatch) {
590
+ newContent = content.replace(
591
+ "\n" + dontDoMatch[1],
592
+ guardSection + "\n" + dontDoMatch[1]
593
+ );
594
+ } else {
595
+ newContent = content + guardSection;
596
+ }
597
+
598
+ fs.writeFileSync(claudeMd, newContent);
599
+ success(`${projectName} — updated CLAUDE.md`);
600
+ updated++;
601
+ }
602
+
603
+ // Summary
604
+ log("");
605
+ heading("Update All Complete");
606
+ log(` Projects registered: ${projects.length}`);
607
+ log(` Updated: ${updated}`);
608
+ log(` Already current: ${skipped}`);
609
+ if (missing > 0) {
610
+ log(` Not found: ${missing}`);
611
+ }
612
+ log("");
613
+ }
614
+
472
615
  function doDoctor() {
473
616
  heading("GSD-T Doctor");
474
617
  log("");
@@ -572,6 +715,37 @@ function doDoctor() {
572
715
  log("");
573
716
  }
574
717
 
718
+ function doRegister() {
719
+ const projectDir = process.cwd();
720
+ const gsdtDir = path.join(projectDir, ".gsd-t");
721
+
722
+ if (!fs.existsSync(gsdtDir)) {
723
+ error("Not a GSD-T project (no .gsd-t/ directory found)");
724
+ info("Run 'npx @tekyzinc/gsd-t init' to initialize this project first");
725
+ return;
726
+ }
727
+
728
+ if (registerProject(projectDir)) {
729
+ success(`Registered: ${projectDir}`);
730
+ } else {
731
+ info("Already registered");
732
+ }
733
+
734
+ // Show all registered projects
735
+ const projects = getRegisteredProjects();
736
+ log("");
737
+ heading("Registered Projects");
738
+ for (const p of projects) {
739
+ const exists = fs.existsSync(p);
740
+ if (exists) {
741
+ log(` ${GREEN}✓${RESET} ${p}`);
742
+ } else {
743
+ log(` ${RED}✗${RESET} ${p} ${DIM}(not found)${RESET}`);
744
+ }
745
+ }
746
+ log("");
747
+ }
748
+
575
749
  function showHelp() {
576
750
  log("");
577
751
  log(`${BOLD}GSD-T${RESET} — Contract-Driven Development for Claude Code`);
@@ -581,8 +755,10 @@ function showHelp() {
581
755
  log("");
582
756
  log(`${BOLD}Commands:${RESET}`);
583
757
  log(` ${CYAN}install${RESET} Install slash commands + global CLAUDE.md`);
584
- log(` ${CYAN}update${RESET} Update to latest (backs up customizations)`);
585
- log(` ${CYAN}init${RESET} [name] Scaffold GSD-T project in current directory`);
758
+ log(` ${CYAN}update${RESET} Update global commands + CLAUDE.md`);
759
+ log(` ${CYAN}update-all${RESET} Update globally + all registered project CLAUDE.md files`);
760
+ log(` ${CYAN}init${RESET} [name] Scaffold GSD-T project (auto-registers)`);
761
+ log(` ${CYAN}register${RESET} Register current directory as a GSD-T project`);
586
762
  log(` ${CYAN}status${RESET} Show installation status + check for updates`);
587
763
  log(` ${CYAN}uninstall${RESET} Remove GSD-T commands (keeps project files)`);
588
764
  log(` ${CYAN}doctor${RESET} Diagnose common issues`);
@@ -613,9 +789,15 @@ switch (command) {
613
789
  case "update":
614
790
  doUpdate();
615
791
  break;
792
+ case "update-all":
793
+ doUpdateAll();
794
+ break;
616
795
  case "init":
617
796
  doInit(args[1]);
618
797
  break;
798
+ case "register":
799
+ doRegister();
800
+ break;
619
801
  case "status":
620
802
  doStatus();
621
803
  break;
@@ -0,0 +1,90 @@
1
+ # GSD-T: Backlog Add — Capture and Categorize a Backlog Item
2
+
3
+ You are adding a new item to the project backlog. The item will be auto-categorized if needed and appended to the bottom of the backlog.
4
+
5
+ ## Step 1: Load Settings
6
+
7
+ Read `.gsd-t/backlog-settings.md` to load:
8
+ - **Types**: The allowed type values (bug, feature, improvement, ux, architecture, etc.)
9
+ - **Apps**: The allowed app values
10
+ - **Categories**: The allowed category values
11
+ - **Default App**: The fallback app when `--app` is not specified
12
+ - **Auto-categorize**: Whether to infer missing fields from title/description
13
+
14
+ If `.gsd-t/backlog-settings.md` does not exist, STOP and tell the user:
15
+ "No backlog settings found. Run `/gsd-t-init` or create `.gsd-t/backlog-settings.md` first."
16
+
17
+ ## Step 2: Parse Arguments
18
+
19
+ Extract from `$ARGUMENTS`:
20
+ - **title** (required) — The quoted string at the start, e.g., `"Fix login timeout"`
21
+ - **--desc "..."** (optional) — A longer description
22
+ - **--type ...** (optional) — The item type (e.g., bug, feature)
23
+ - **--app ...** (optional) — The target app
24
+ - **--category ...** (optional) — The category
25
+
26
+ If no title is provided, STOP and tell the user:
27
+ "Usage: `/gsd-t-backlog-add \"<title>\" [--desc \"...\"] [--type ...] [--app ...] [--category ...]`"
28
+
29
+ ## Step 3: Auto-Categorize
30
+
31
+ For any field NOT explicitly provided:
32
+
33
+ 1. **--app not provided**: Use the **Default App** from settings
34
+ 2. **--type not provided**: If Auto-categorize is true, infer the type from the title and description:
35
+ - Words like "bug", "fix", "broken", "error", "crash" → `bug`
36
+ - Words like "add", "new", "create", "implement" → `feature`
37
+ - Words like "improve", "optimize", "refactor", "clean" → `improvement`
38
+ - Words like "ui", "ux", "design", "layout", "style" → `ux`
39
+ - Words like "architecture", "structure", "pattern", "system" → `architecture`
40
+ - If unclear, default to `feature`
41
+ 3. **--category not provided**: If Auto-categorize is true and categories exist in settings, infer the best-matching category from the title and description. If no good match or no categories defined, leave as `general`.
42
+
43
+ ## Step 4: Validate
44
+
45
+ Check that the resolved values exist in `.gsd-t/backlog-settings.md`:
46
+
47
+ - **Type**: Must be in the Types list. If not found, warn: "Type '{value}' is not in settings. Known types: {list}. Did you mean '{closest match}'?"
48
+ - **App**: Must be in the Apps list. If not found, warn: "App '{value}' is not in settings. Known apps: {list}. Did you mean '{closest match}'?"
49
+ - **Category**: Must be in the Categories list (if categories are defined). If not found and categories exist, warn: "Category '{value}' is not in settings. Known categories: {list}. Did you mean '{closest match}'?"
50
+
51
+ If any validation fails, STOP and show the warning. Do not add the entry until the user confirms or corrects.
52
+
53
+ ## Step 5: Append Entry
54
+
55
+ 1. Read `.gsd-t/backlog.md`
56
+ 2. Count existing entries (count `## {N}.` headings) to determine the next position number
57
+ 3. Append the new entry at the bottom of the file using this EXACT format:
58
+
59
+ ```
60
+ ## {N}. {title}
61
+ - **Type:** {type} | **App:** {app} | **Category:** {category}
62
+ - **Added:** {YYYY-MM-DD}
63
+ - {description}
64
+ ```
65
+
66
+ Where:
67
+ - `{N}` = next sequential position number (existing count + 1)
68
+ - `{title}` = the item title
69
+ - `{type}`, `{app}`, `{category}` = the resolved/validated values
70
+ - `{YYYY-MM-DD}` = today's date
71
+ - `{description}` = the --desc value, or a brief description derived from the title if --desc was not provided
72
+
73
+ Ensure there is an empty line before the new entry.
74
+
75
+ 4. If `.gsd-t/backlog.md` does not exist, create it with the `# Backlog` heading first, then append the entry.
76
+
77
+ ## Step 6: Document Ripple
78
+
79
+ Update `.gsd-t/progress.md` Decision Log:
80
+ - Add entry: `{date} — Added backlog item #{N}: "{title}" (type: {type}, app: {app}, category: {category})`
81
+
82
+ ## Step 7: Test Verification
83
+
84
+ Verify the entry was added correctly:
85
+ 1. Re-read `.gsd-t/backlog.md`
86
+ 2. Confirm the new entry exists at the expected position
87
+ 3. Confirm the format matches the file-format contract exactly
88
+ 4. Report: "Added backlog item #{N}: **{title}** — Type: {type} | App: {app} | Category: {category}"
89
+
90
+ $ARGUMENTS
@@ -0,0 +1,107 @@
1
+ # GSD-T: Backlog Edit — Modify Entry Fields
2
+
3
+ You are editing an existing backlog entry. Only the specified fields are updated — all other fields are preserved as-is.
4
+
5
+ ## Step 1: Read Backlog
6
+
7
+ Read `.gsd-t/backlog.md` and parse all entries.
8
+
9
+ Each entry follows this format:
10
+ ```
11
+ ## {position}. {title}
12
+ - **Type:** {type} | **App:** {app} | **Category:** {category}
13
+ - **Added:** {YYYY-MM-DD}
14
+ - {description}
15
+ ```
16
+
17
+ Count the total number of entries. If the backlog is empty (no entries), inform the user:
18
+ "Backlog is empty. Nothing to edit."
19
+ Stop here.
20
+
21
+ ## Step 2: Parse Arguments
22
+
23
+ Extract from $ARGUMENTS:
24
+ - `<position>` (required) — the position number of the entry to edit
25
+ - `--title "..."` (optional) — new title
26
+ - `--desc "..."` (optional) — new description
27
+ - `--type ...` (optional) — new type
28
+ - `--app ...` (optional) — new app
29
+ - `--category ...` (optional) — new category
30
+
31
+ If no position is provided, show usage:
32
+ "Usage: /gsd-t-backlog-edit <position> [--title \"...\"] [--desc \"...\"] [--type ...] [--app ...] [--category ...]"
33
+ "Example: /gsd-t-backlog-edit 3 --title \"Updated title\" --type bug"
34
+ Stop here.
35
+
36
+ If no optional flags are provided (only position given), inform the user:
37
+ "No fields specified to edit. Use --title, --desc, --type, --app, or --category."
38
+ Stop here.
39
+
40
+ Validate that the position exists in the backlog (between 1 and total entry count). If not:
41
+ "Position {value} is out of range. Backlog has {count} items (valid: 1-{count})."
42
+ Stop here.
43
+
44
+ ## Step 3: Validate Against Settings
45
+
46
+ Read `.gsd-t/backlog-settings.md` to load allowed values.
47
+
48
+ For each provided field that has a constrained value set:
49
+ - **--type**: Check against the `## Types` list. If invalid, warn: "Type '{value}' is not in settings. Available types: {list}. Did you mean '{closest match}'?"
50
+ - **--app**: Check against the `## Apps` list. If invalid, warn: "App '{value}' is not in settings. Available apps: {list}. Did you mean '{closest match}'?"
51
+ - **--category**: Check against the `## Categories` list. If the list is empty, accept any value. If populated and invalid, warn: "Category '{value}' is not in settings. Available categories: {list}. Did you mean '{closest match}'?"
52
+
53
+ If any value is invalid, stop and ask the user whether to proceed with the invalid value or choose from the available options.
54
+
55
+ **--title** and **--desc** are free-text fields — no validation needed.
56
+
57
+ ## Step 4: Update Entry
58
+
59
+ 1. Find the entry at the specified position
60
+ 2. Record the current values as "before" snapshot
61
+ 3. Update only the fields that were specified:
62
+ - `--title`: Update the title in the `## {position}. {title}` heading
63
+ - `--desc`: Update the description line (`- {description}`)
64
+ - `--type`: Update the Type in the metadata line
65
+ - `--app`: Update the App in the metadata line
66
+ - `--category`: Update the Category in the metadata line
67
+ 4. Preserve all unspecified fields exactly as they are
68
+ 5. Preserve the Added date — do not change it
69
+ 6. Rewrite `.gsd-t/backlog.md` with the updated entry in place
70
+
71
+ ## Step 5: Confirm
72
+
73
+ Show the user the before and after:
74
+ ```
75
+ Edited backlog item #{position}:
76
+
77
+ Before:
78
+ Title: {old-title}
79
+ Type: {old-type} | App: {old-app} | Category: {old-category}
80
+ Description: {old-desc}
81
+
82
+ After:
83
+ Title: {new-title}
84
+ Type: {new-type} | App: {new-app} | Category: {new-category}
85
+ Description: {new-desc}
86
+ ```
87
+
88
+ Only highlight fields that actually changed.
89
+
90
+ ## Step 6: Document Ripple
91
+
92
+ If `.gsd-t/progress.md` exists, log the edit in the Decision Log:
93
+ - Date: today's date
94
+ - Entry: "Backlog edit: updated {changed-fields} for '{title}' at position {position}"
95
+
96
+ ## Step 7: Test Verification
97
+
98
+ Verify the rewritten `.gsd-t/backlog.md` is well-formed:
99
+ 1. Re-read the file
100
+ 2. Confirm the edited entry parses correctly (heading, metadata, date, description)
101
+ 3. Confirm all other entries are unchanged
102
+ 4. Confirm total entry count is the same as before the edit
103
+ 5. Confirm positions are still sequential (no gaps or duplicates)
104
+
105
+ If any check fails, report the issue and attempt to fix (up to 2 attempts).
106
+
107
+ $ARGUMENTS
@@ -0,0 +1,59 @@
1
+ # GSD-T: Backlog List — Filtered View of Backlog Items
2
+
3
+ You are displaying the project backlog with optional filtering and limiting.
4
+
5
+ ## Step 1: Read Backlog
6
+
7
+ Read `.gsd-t/backlog.md` and parse all entries.
8
+
9
+ Each entry follows this format:
10
+ ```
11
+ ## {N}. {title}
12
+ - **Type:** {type} | **App:** {app} | **Category:** {category}
13
+ - **Added:** {YYYY-MM-DD}
14
+ - {description}
15
+ ```
16
+
17
+ If `.gsd-t/backlog.md` does not exist or contains only the `# Backlog` heading with no entries, display:
18
+ "No backlog items. Use `/gsd-t-backlog-add` to capture ideas."
19
+ Then STOP.
20
+
21
+ ## Step 2: Apply Filters
22
+
23
+ Parse `$ARGUMENTS` for optional filters:
24
+ - **--type ...** — Show only entries matching this type
25
+ - **--app ...** — Show only entries matching this app
26
+ - **--category ...** — Show only entries matching this category
27
+
28
+ If multiple filters are specified, apply AND logic (entry must match ALL specified filters).
29
+
30
+ If no filters are specified, include all entries.
31
+
32
+ ## Step 3: Apply Limit
33
+
34
+ If **--top N** is specified, keep only the first N entries from the filtered results (by position order, which represents priority).
35
+
36
+ ## Step 4: Display Results
37
+
38
+ Show the filtered entries in a formatted view:
39
+
40
+ ```
41
+ # Backlog ({count} items{filter description})
42
+
43
+ | # | Title | Type | App | Category | Added |
44
+ |---|-------|------|-----|----------|-------|
45
+ | 1 | {title} | {type} | {app} | {category} | {date} |
46
+ | 2 | {title} | {type} | {app} | {category} | {date} |
47
+ ```
48
+
49
+ Where:
50
+ - `{count}` = number of entries shown
51
+ - `{filter description}` = if filters applied, append: `, filtered by type={value}` / `app={value}` / `category={value}` as appropriate. If no filters, omit.
52
+ - The `#` column shows the original position number from the backlog (not a re-numbered index)
53
+
54
+ ## Step 5: Handle Empty Results
55
+
56
+ If filters were applied but no entries match, display:
57
+ "No backlog items match the filters: {filter summary}. Use `/gsd-t-backlog-list` with no arguments to see all items."
58
+
59
+ $ARGUMENTS
@@ -0,0 +1,90 @@
1
+ # GSD-T: Backlog Move — Reorder Items by Position
2
+
3
+ You are reordering a backlog item from one position to another. Position in the backlog represents priority — item 1 is highest priority.
4
+
5
+ ## Step 1: Read Backlog
6
+
7
+ Read `.gsd-t/backlog.md` and parse all entries.
8
+
9
+ Each entry follows this format:
10
+ ```
11
+ ## {position}. {title}
12
+ - **Type:** {type} | **App:** {app} | **Category:** {category}
13
+ - **Added:** {YYYY-MM-DD}
14
+ - {description}
15
+ ```
16
+
17
+ Count the total number of entries. If the backlog is empty (no entries), inform the user:
18
+ "Backlog is empty. Nothing to move."
19
+ Stop here.
20
+
21
+ ## Step 2: Parse Arguments
22
+
23
+ Extract from $ARGUMENTS:
24
+ - `<from-position>` — the current position number of the item to move
25
+ - `<to-position>` — the target position number to move it to
26
+
27
+ Both arguments are required. If either is missing, show usage:
28
+ "Usage: /gsd-t-backlog-move <from-position> <to-position>"
29
+ "Example: /gsd-t-backlog-move 5 2 — moves item 5 to position 2"
30
+ Stop here.
31
+
32
+ ## Step 3: Validate Positions
33
+
34
+ Check that:
35
+ 1. Both `from-position` and `to-position` are positive integers
36
+ 2. Both positions exist in the backlog (between 1 and total entry count)
37
+ 3. `from-position` and `to-position` are different
38
+
39
+ If any check fails, inform the user:
40
+ - Invalid number: "Position must be a positive integer. Got: {value}"
41
+ - Out of range: "Position {value} is out of range. Backlog has {count} items (valid: 1-{count})."
42
+ - Same position: "From and to positions are the same. Nothing to move."
43
+ Stop here.
44
+
45
+ ## Step 4: Move Item
46
+
47
+ 1. Remove the entry at `from-position` from the list
48
+ 2. Insert it at `to-position` in the list
49
+ 3. This shifts other entries up or down accordingly
50
+
51
+ ## Step 5: Renumber and Rewrite
52
+
53
+ 1. Renumber ALL entries sequentially starting from 1 (update the `## {N}. {title}` heading for each)
54
+ 2. Rewrite `.gsd-t/backlog.md` with the reordered entries
55
+ 3. Preserve the `# Backlog` heading at the top
56
+ 4. Preserve all entry content (metadata, date, description) — only the position number in the heading changes
57
+
58
+ ## Step 6: Confirm
59
+
60
+ Show the user what happened:
61
+ ```
62
+ Moved: "{title}" from position {from} to position {to}
63
+
64
+ Updated backlog order (top 5):
65
+ 1. {title}
66
+ 2. {title}
67
+ 3. {title}
68
+ 4. {title}
69
+ 5. {title}
70
+ ```
71
+
72
+ If the backlog has fewer than 5 items, show all of them.
73
+
74
+ ## Step 7: Document Ripple
75
+
76
+ If `.gsd-t/progress.md` exists, log the move in the Decision Log:
77
+ - Date: today's date
78
+ - Entry: "Backlog reorder: moved '{title}' from position {from} to {to}"
79
+
80
+ ## Step 8: Test Verification
81
+
82
+ Verify the rewritten `.gsd-t/backlog.md` is well-formed:
83
+ 1. Re-read the file
84
+ 2. Confirm all entries parse correctly (heading, metadata, date, description)
85
+ 3. Confirm positions are sequential (1, 2, 3... with no gaps or duplicates)
86
+ 4. Confirm total entry count is unchanged from before the move
87
+
88
+ If any check fails, report the issue and attempt to fix (up to 2 attempts).
89
+
90
+ $ARGUMENTS
@@ -0,0 +1,119 @@
1
+ # GSD-T: Backlog Promote — Refine, Classify, and Launch GSD-T Workflow
2
+
3
+ You are promoting a backlog item into the GSD-T workflow. This is the bridge from a captured idea to actionable work: refine the description, classify the scope, remove it from the backlog, and hand off to the appropriate GSD-T command.
4
+
5
+ ## Step 1: Load Context
6
+
7
+ Read:
8
+ 1. `CLAUDE.md`
9
+ 2. `.gsd-t/progress.md` (if exists)
10
+ 3. `.gsd-t/backlog.md` — the backlog file
11
+
12
+ Parse $ARGUMENTS to extract:
13
+ - `<position>` — the entry number to promote
14
+
15
+ If no position is provided, show an error:
16
+ "Usage: `/user:gsd-t-backlog-promote <position>`"
17
+
18
+ ## Step 2: Find and Display Entry
19
+
20
+ Find the entry at the specified position in `.gsd-t/backlog.md`.
21
+
22
+ If the position doesn't exist, show an error:
23
+ "No backlog entry at position {position}. Run `/user:gsd-t-backlog-list` to see available entries."
24
+
25
+ Display the entry to the user:
26
+ ```
27
+ Promoting backlog item #{position}:
28
+
29
+ {title}
30
+ Type: {type} | App: {app} | Category: {category}
31
+ Added: {date}
32
+ {description}
33
+ ```
34
+
35
+ ## Step 3: Refine Description
36
+
37
+ The backlog entry has a 1-2 sentence description. Expand it into full context:
38
+
39
+ 1. Read `CLAUDE.md` and relevant docs (`docs/requirements.md`, `docs/architecture.md`, `docs/workflows.md`) to understand the project context
40
+ 2. Read `.gsd-t/contracts/` to understand existing domain boundaries and interfaces
41
+ 3. Build a comprehensive refined description that includes:
42
+ - **What** needs to be done (concrete deliverables)
43
+ - **Why** it matters (business or technical motivation)
44
+ - **Where** in the codebase it applies (affected files, modules, or domains)
45
+ - **Constraints** or considerations (existing patterns to follow, things to avoid)
46
+
47
+ If the original description is ambiguous or could be interpreted multiple ways, ask the user clarifying questions before proceeding.
48
+
49
+ Present the refined description to the user for confirmation:
50
+ ```
51
+ Refined description:
52
+ {refined description}
53
+
54
+ Does this capture the intent? (Adjust if needed, or confirm to proceed)
55
+ ```
56
+
57
+ ## Step 4: Classify
58
+
59
+ Based on the refined description, determine which GSD-T workflow to create:
60
+
61
+ | Classification | Criteria | Triggers |
62
+ |---------------|----------|----------|
63
+ | **Milestone** | Multi-file, multi-phase work that needs partitioning (complex feature, large refactor) | `gsd-t-milestone` |
64
+ | **Quick** | Small scope, obvious implementation, can be done in one focused session | `gsd-t-quick` |
65
+ | **Debug** | Specific broken behavior that needs diagnosis and fix | `gsd-t-debug` |
66
+ | **Feature** | Significant new capability that needs impact assessment first | `gsd-t-feature` |
67
+
68
+ Present the classification to the user with rationale:
69
+ ```
70
+ Classification: {classification}
71
+
72
+ Rationale: {why this classification fits}
73
+
74
+ If you disagree, tell me the correct classification and I'll adjust.
75
+ ```
76
+
77
+ Wait for user confirmation or override before proceeding.
78
+
79
+ ## Step 5: Remove from Backlog
80
+
81
+ After classification is confirmed:
82
+
83
+ 1. Remove the entry at position {position} from `.gsd-t/backlog.md`
84
+ 2. Renumber all remaining entries sequentially (1, 2, 3...)
85
+ 3. Preserve all other entry content exactly as-is
86
+
87
+ ## Step 6: Launch Workflow
88
+
89
+ Based on the classification, present the command for the user to invoke:
90
+
91
+ - **Milestone**: "Run `/user:gsd-t-milestone {refined description}`"
92
+ - **Quick**: "Run `/user:gsd-t-quick {refined description}`"
93
+ - **Debug**: "Run `/user:gsd-t-debug {refined description}`"
94
+ - **Feature**: "Run `/user:gsd-t-feature {refined description}`"
95
+
96
+ Display the full command with the refined description ready to copy.
97
+
98
+ ## Step 7: Document Ripple
99
+
100
+ Update affected documentation:
101
+
102
+ ### Always update:
103
+ 1. **`.gsd-t/progress.md`** — Add to Decision Log: "{date}: Promoted backlog item #{position} '{title}' as {classification}"
104
+
105
+ ### Check if affected:
106
+ 2. **`docs/requirements.md`** — If the promoted item implies a new requirement, note it
107
+ 3. **`.gsd-t/techdebt.md`** — If this was a debt item being promoted, cross-reference it
108
+
109
+ ### Skip what's not affected.
110
+
111
+ ## Step 8: Test Verification
112
+
113
+ Verify the backlog file is well-formed after removal and renumbering:
114
+
115
+ 1. **Check format**: Confirm `.gsd-t/backlog.md` follows the file-format-contract (sequential numbering, correct entry structure)
116
+ 2. **Check integrity**: Verify no entries were lost or corrupted during renumbering
117
+ 3. **Check empty state**: If all entries were removed, verify file contains only the `# Backlog` heading
118
+
119
+ $ARGUMENTS
@@ -0,0 +1,82 @@
1
+ # GSD-T: Backlog Remove — Drop Item with Optional Reason
2
+
3
+ You are removing an entry from the backlog. This deletes the item, renumbers remaining entries, and logs the removal.
4
+
5
+ ## Step 1: Read Backlog
6
+
7
+ Read `.gsd-t/backlog.md` and parse all entries.
8
+
9
+ Find the entry at the specified position from $ARGUMENTS.
10
+
11
+ If the file doesn't exist or has no entries:
12
+ - "No backlog found. Nothing to remove."
13
+ - Stop.
14
+
15
+ If the position doesn't exist (out of range or invalid):
16
+ - "Position {N} not found. The backlog has {count} entries."
17
+ - Stop.
18
+
19
+ ## Step 2: Confirm Removal
20
+
21
+ Display the entry details to the user:
22
+
23
+ ```
24
+ Remove this backlog item?
25
+
26
+ ## {position}. {title}
27
+ - Type: {type} | App: {app} | Category: {category}
28
+ - Added: {date}
29
+ - {description}
30
+
31
+ Confirm removal? (y/n)
32
+ ```
33
+
34
+ Wait for user confirmation before proceeding. If the user declines, stop.
35
+
36
+ ## Step 3: Remove Entry
37
+
38
+ Delete the entry from `.gsd-t/backlog.md`.
39
+
40
+ ## Step 4: Renumber Entries
41
+
42
+ Renumber ALL remaining entries sequentially starting from 1.
43
+
44
+ Each entry heading must follow the format: `## {position}. {title}`
45
+
46
+ Rewrite `.gsd-t/backlog.md` with the updated entries. If no entries remain, the file should contain only the `# Backlog` heading.
47
+
48
+ ## Step 5: Log Removal
49
+
50
+ Parse $ARGUMENTS for the optional `--reason "..."` flag.
51
+
52
+ Add a Decision Log entry in `.gsd-t/progress.md`:
53
+
54
+ ```
55
+ | {YYYY-MM-DD} | Removed backlog item "{title}"{reason_suffix} |
56
+ ```
57
+
58
+ Where `{reason_suffix}` is ` — Reason: {reason}` if `--reason` was provided, or empty if not.
59
+
60
+ ## Step 6: Document Ripple
61
+
62
+ If `.gsd-t/progress.md` exists, update:
63
+
64
+ ### Always update:
65
+ 1. **`.gsd-t/progress.md`** — Decision Log entry for the removal (done in Step 5)
66
+
67
+ ### Check if affected:
68
+ 2. **`.gsd-t/techdebt.md`** — If the removed item was related to tracked debt, note its removal
69
+
70
+ ### Skip what's not affected — most removals only touch progress.md.
71
+
72
+ ## Step 7: Test Verification
73
+
74
+ Verify the backlog file is well-formed after removal:
75
+
76
+ 1. Read `.gsd-t/backlog.md` and confirm:
77
+ - Entries are numbered sequentially (1, 2, 3...) with no gaps
78
+ - Each entry follows the format: `## {N}. {title}` + metadata line + date line + description
79
+ - No orphaned content or broken formatting
80
+ 2. If any issues found, fix them before finishing
81
+
82
+ $ARGUMENTS
@@ -0,0 +1,154 @@
1
+ # GSD-T: Backlog Settings — Manage Types, Apps, Categories, and Defaults
2
+
3
+ You are managing the backlog settings file. This controls the allowed values for types, apps, and categories used by backlog entries, and the default app assignment.
4
+
5
+ ## Step 1: Read Settings
6
+
7
+ Read `.gsd-t/backlog-settings.md` and parse current settings:
8
+ - **Types** section — list of allowed type values
9
+ - **Apps** section — list of allowed app values
10
+ - **Categories** section — list of allowed category values
11
+ - **Defaults** section — Default App and Auto-categorize values
12
+
13
+ If the file doesn't exist:
14
+ - "No backlog settings found. Run `/gsd-t-init` with backlog support to create settings."
15
+ - Stop.
16
+
17
+ ## Step 2: Parse Subcommand
18
+
19
+ Parse $ARGUMENTS to identify the subcommand and its arguments.
20
+
21
+ Valid subcommands:
22
+ - `list` — no additional args
23
+ - `add-type <name>` — requires a name
24
+ - `remove-type <name>` — requires a name
25
+ - `add-app <name>` — requires a name
26
+ - `remove-app <name>` — requires a name
27
+ - `add-category <name>` — requires a name
28
+ - `remove-category <name>` — requires a name
29
+ - `default-app <name>` — requires a name
30
+
31
+ If no subcommand or an invalid subcommand is provided:
32
+ - Show usage: "Usage: `/gsd-t-backlog-settings <subcommand> [args]`"
33
+ - List available subcommands with brief descriptions
34
+ - Stop.
35
+
36
+ If a subcommand requires a name argument and none is provided:
37
+ - "Missing argument. Usage: `/gsd-t-backlog-settings {subcommand} <name>`"
38
+ - Stop.
39
+
40
+ ## Step 3: Validate
41
+
42
+ Perform validation based on the subcommand:
43
+
44
+ - **add-type/add-app/add-category**: Convert name to lowercase. Check the appropriate section for duplicates. If the value already exists: "'{name}' already exists in {section}." — Stop.
45
+ - **remove-type/remove-app/remove-category**: Check the appropriate section for existence. If the value doesn't exist: "'{name}' not found in {section}." — Stop.
46
+ - **default-app**: Convert name to lowercase. Check that the name exists in the Apps section. If not: "'{name}' is not in the Apps list. Add it first with `add-app {name}`." — Stop.
47
+
48
+ ## Step 4: Execute Subcommand
49
+
50
+ ### `list`
51
+
52
+ Display all current settings in a formatted view:
53
+
54
+ ```
55
+ Backlog Settings:
56
+
57
+ Types: bug, feature, improvement, ux, architecture
58
+ Apps: {app1}, {app2}
59
+ Categories: {cat1}, {cat2}
60
+
61
+ Defaults:
62
+ Default App: {app}
63
+ Auto-categorize: true
64
+ ```
65
+
66
+ Stop after displaying. No file modifications needed.
67
+
68
+ ### `add-type`, `add-app`, `add-category`
69
+
70
+ Append the new value (lowercase) to the appropriate section in `.gsd-t/backlog-settings.md`.
71
+
72
+ Format: `- {name}` added as the last item in the section's list.
73
+
74
+ Confirm: "Added '{name}' to {section}."
75
+
76
+ ### `remove-type`, `remove-app`, `remove-category`
77
+
78
+ Before removing, read `.gsd-t/backlog.md` and check if any existing entries use this value.
79
+
80
+ If entries use this value:
81
+ - Warn: "'{name}' is currently used by {count} backlog entry/entries: {titles}."
82
+ - Ask for confirmation: "Remove anyway? (y/n)"
83
+ - If user declines, stop.
84
+
85
+ Remove the value from the appropriate section in `.gsd-t/backlog-settings.md`.
86
+
87
+ Confirm: "Removed '{name}' from {section}."
88
+
89
+ ### `default-app`
90
+
91
+ Update the `- **Default App:** {value}` line in the Defaults section of `.gsd-t/backlog-settings.md`.
92
+
93
+ Confirm: "Default app changed to '{name}'."
94
+
95
+ ## Step 5: Rewrite Settings File
96
+
97
+ Skip this step for the `list` subcommand.
98
+
99
+ Rewrite `.gsd-t/backlog-settings.md` with the updated settings, preserving the file format:
100
+
101
+ ```markdown
102
+ # Backlog Settings
103
+
104
+ ## Types
105
+ - {type1}
106
+ - {type2}
107
+ ...
108
+
109
+ ## Apps
110
+ - {app1}
111
+ - {app2}
112
+ ...
113
+
114
+ ## Categories
115
+ - {cat1}
116
+ - {cat2}
117
+ ...
118
+
119
+ ## Defaults
120
+ - **Default App:** {app}
121
+ - **Auto-categorize:** true
122
+ ```
123
+
124
+ ## Step 6: Document Ripple
125
+
126
+ Skip this step for the `list` subcommand.
127
+
128
+ If `.gsd-t/progress.md` exists, update:
129
+
130
+ ### Always update:
131
+ 1. **`.gsd-t/progress.md`** — Log the settings change in the Decision Log:
132
+ - For add: `"Added '{name}' to backlog {section}"`
133
+ - For remove: `"Removed '{name}' from backlog {section}"`
134
+ - For default-app: `"Changed default app to '{name}'"`
135
+
136
+ ### Check if affected:
137
+ 2. **`.gsd-t/contracts/file-format-contract.md`** — If this change affects the documented settings format, flag it (should be rare)
138
+
139
+ ### Skip what's not affected — most settings changes only touch progress.md.
140
+
141
+ ## Step 7: Test Verification
142
+
143
+ Skip this step for the `list` subcommand.
144
+
145
+ Verify the settings file is well-formed after update:
146
+
147
+ 1. Read `.gsd-t/backlog-settings.md` and confirm:
148
+ - All four sections exist: Types, Apps, Categories, Defaults
149
+ - Each section's items are `- {value}` format, lowercase
150
+ - Defaults section has `- **Default App:** {value}` and `- **Auto-categorize:** {value}`
151
+ - No empty lines within a section's list, no orphaned content
152
+ 2. If any issues found, fix them before finishing
153
+
154
+ $ARGUMENTS
@@ -47,8 +47,9 @@ The contract didn't specify something it should have. Symptoms:
47
47
  2. Trace through the relevant domain(s)
48
48
  3. Check contract compliance at each boundary
49
49
  4. Identify root cause
50
- 5. Fix and test
51
- 6. Update contracts if needed
50
+ 5. **Destructive Action Guard**: If the fix requires destructive or structural changes (dropping tables, removing columns, changing schema, replacing architecture patterns, removing working modules) → STOP and present the change to the user with what exists, what will change, what will break, and a safe migration path. Wait for explicit approval.
51
+ 6. Fix and test — **adapt the fix to existing structures**, not the other way around
52
+ 7. Update contracts if needed
52
53
 
53
54
  ### Team Mode (for complex cross-domain bugs)
54
55
  ```
@@ -28,7 +28,8 @@ For each task:
28
28
  1. Read the task description, files list, and contract refs
29
29
  2. Read the relevant contract(s) — implement EXACTLY what they specify
30
30
  3. Read the domain's constraints.md — follow all patterns
31
- 4. Implement the task
31
+ 4. **Destructive Action Guard**: Before implementing, check if the task involves any destructive or structural changes (DROP TABLE, schema changes that lose data, removing existing modules, replacing architecture patterns). If YES → STOP and present the change to the user with what exists, what will change, what will break, and a safe migration path. Wait for explicit approval before proceeding.
32
+ 5. Implement the task
32
33
  5. Verify acceptance criteria are met
33
34
  6. Run affected unit tests — fix any failures before proceeding
34
35
  7. If E2E framework exists and task changed UI/routes/flows: run affected E2E specs, update specs if needed
@@ -51,6 +52,7 @@ ALL TEAMMATES must read before starting:
51
52
  5. Your domain's tasks.md — your work
52
53
 
53
54
  RULES FOR ALL TEAMMATES:
55
+ - **Destructive Action Guard**: NEVER drop tables, remove columns, delete data, replace architecture patterns, or remove working modules without messaging the lead first. The lead must get user approval before any destructive action proceeds.
54
56
  - Only modify files listed in your domain's scope.md
55
57
  - Implement interfaces EXACTLY as specified in contracts
56
58
  - If a task is marked BLOCKED, message the lead and wait
@@ -46,6 +46,16 @@ UTILITIES
46
46
  promote-debt Convert techdebt items to milestones
47
47
  populate Auto-populate docs from existing codebase
48
48
 
49
+ BACKLOG
50
+ ───────────────────────────────────────────────────────────────────────────────
51
+ backlog-add Capture item, auto-categorize, append to backlog
52
+ backlog-list Filtered, ordered view of backlog items
53
+ backlog-move Reorder items by position (priority)
54
+ backlog-edit Modify entry fields (title, type, app, category)
55
+ backlog-remove Drop item with optional reason
56
+ backlog-promote Refine, classify, and launch GSD-T workflow
57
+ backlog-settings Manage types, apps, categories, and defaults
58
+
49
59
  ───────────────────────────────────────────────────────────────────────────────
50
60
  Type /user:gsd-t-help {command} for detailed help on any command.
51
61
  Example: /user:gsd-t-help impact
@@ -247,6 +257,48 @@ Use these when user asks for help on a specific command:
247
257
  - **Updates**: `docs/requirements.md`, `docs/architecture.md`, `docs/workflows.md`, `docs/infrastructure.md`, `.gsd-t/progress.md`
248
258
  - **Use when**: You have an existing codebase and want to fill docs with real findings instead of placeholders
249
259
 
260
+ ### backlog-add
261
+ - **Summary**: Capture a new backlog item with auto-categorization
262
+ - **Auto-invoked**: No
263
+ - **Files**: `.gsd-t/backlog.md`, `.gsd-t/backlog-settings.md`
264
+ - **Use when**: You have an idea, bug, or improvement to capture for later
265
+
266
+ ### backlog-list
267
+ - **Summary**: Display backlog with optional filtering by type, app, or category
268
+ - **Auto-invoked**: No
269
+ - **Files**: `.gsd-t/backlog.md` (read-only)
270
+ - **Use when**: Reviewing the backlog to see what's queued up
271
+
272
+ ### backlog-move
273
+ - **Summary**: Reorder a backlog item to change its priority
274
+ - **Auto-invoked**: No
275
+ - **Files**: `.gsd-t/backlog.md`
276
+ - **Use when**: Reprioritizing items in the backlog
277
+
278
+ ### backlog-edit
279
+ - **Summary**: Modify fields of an existing backlog entry
280
+ - **Auto-invoked**: No
281
+ - **Files**: `.gsd-t/backlog.md`, `.gsd-t/backlog-settings.md`
282
+ - **Use when**: Updating details of a captured backlog item
283
+
284
+ ### backlog-remove
285
+ - **Summary**: Remove a backlog item with optional reason
286
+ - **Auto-invoked**: No
287
+ - **Files**: `.gsd-t/backlog.md`
288
+ - **Use when**: Dropping an item that's no longer relevant
289
+
290
+ ### backlog-promote
291
+ - **Summary**: Refine a backlog item and launch the appropriate GSD-T workflow
292
+ - **Auto-invoked**: No
293
+ - **Files**: `.gsd-t/backlog.md`, `.gsd-t/progress.md`
294
+ - **Use when**: Ready to act on a backlog item — promotes to milestone, quick, debug, or feature
295
+
296
+ ### backlog-settings
297
+ - **Summary**: Manage allowed types, apps, categories, and default settings
298
+ - **Auto-invoked**: No
299
+ - **Files**: `.gsd-t/backlog-settings.md`
300
+ - **Use when**: Customizing the classification dimensions for your project
301
+
250
302
  ## Unknown Command
251
303
 
252
304
  If user asks for help on unrecognized command:
@@ -26,9 +26,26 @@ If yes, read `.gsd/` state and create equivalent `.gsd-t/` structure.
26
26
  │ └── .gitkeep
27
27
  ├── domains/
28
28
  │ └── .gitkeep
29
+ ├── backlog.md
30
+ ├── backlog-settings.md
29
31
  └── progress.md
30
32
  ```
31
33
 
34
+ ## Step 2.5: Initialize Backlog
35
+
36
+ Create the backlog files from templates:
37
+ 1. Copy `templates/backlog.md` → `.gsd-t/backlog.md`
38
+ 2. Copy `templates/backlog-settings.md` → `.gsd-t/backlog-settings.md`
39
+
40
+ ### Category Derivation
41
+
42
+ Read the project's `CLAUDE.md` (if it exists) to auto-populate backlog settings:
43
+
44
+ 1. **Apps**: Scan for app names, service names, or product names (look for headings, "Tech Stack" sections, or named components). Populate the `## Apps` section in `backlog-settings.md` with discovered names (lowercase).
45
+ 2. **Categories**: Scan for domain concepts, module names, and technical areas (e.g., "authentication", "payments", "api", "database"). Populate the `## Categories` section.
46
+ 3. **Default App**: Set `**Default App:**` to the most prominent app found (the one mentioned most, or the first one). If only one app is found, use it.
47
+ 4. **If nothing found**: Leave the placeholder values from the template — the user can configure later via `/user:gsd-t-backlog-settings`.
48
+
32
49
  ## Step 3: Initialize Progress File
33
50
 
34
51
  Create `.gsd-t/progress.md`:
@@ -155,9 +172,10 @@ After initialization:
155
172
  ## Step 8: Report
156
173
 
157
174
  Tell the user:
158
- 1. What was created
175
+ 1. What was created (including backlog files: `.gsd-t/backlog.md` and `.gsd-t/backlog-settings.md`)
159
176
  2. What they should fill in (CLAUDE.md details, requirements)
160
- 3. Recommended next step:
177
+ 3. Backlog settings status: whether apps/categories were auto-derived from CLAUDE.md or need manual configuration via `/user:gsd-t-backlog-settings`
178
+ 4. Recommended next step:
161
179
  - New project: "Define your milestone, then run /user:gsd-t-partition"
162
180
  - Existing code: "I've mapped the codebase. Ready for /user:gsd-t-partition {milestone}"
163
181
 
@@ -27,10 +27,11 @@ Proceed.
27
27
  ## Step 3: Execute
28
28
 
29
29
  1. Identify exactly which files need to change
30
- 2. If a contract exists for the relevant interface, implement to match it
31
- 3. Make the change
32
- 4. Verify it works
33
- 5. Commit: `[quick] {description}`
30
+ 2. **Destructive Action Guard**: Check if this task involves destructive or structural changes (DROP TABLE, removing columns, deleting data, replacing architecture patterns, removing working modules, changing schema in ways that conflict with existing data). If YES STOP and present the change to the user with what exists today, what will change, what will break, and a safe migration path. Wait for explicit approval.
31
+ 3. If a contract exists for the relevant interface, implement to match it
32
+ 4. Make the change — **adapt new code to existing structures**, not the other way around
33
+ 5. Verify it works
34
+ 6. Commit: `[quick] {description}`
34
35
 
35
36
  ## Step 4: Document Ripple (if GSD-T is active)
36
37
 
@@ -21,6 +21,11 @@ Domains:
21
21
  {domain-2}: {completed}/{total} tasks {✅ done | 🔄 in progress | ⏳ blocked}
22
22
  {domain-3}: {completed}/{total} tasks {✅ done | 🔄 in progress | ⏳ blocked}
23
23
 
24
+ Backlog: {N} items
25
+ 1. {title} ({type})
26
+ 2. {title} ({type})
27
+ 3. {title} ({type})
28
+
24
29
  Next checkpoint: {description} — waiting on {domain} Task {N}
25
30
  Next action: {what should happen next}
26
31
 
@@ -28,6 +33,10 @@ Recent decisions:
28
33
  - {latest decision from Decision Log}
29
34
  ```
30
35
 
36
+ ### Backlog Section
37
+
38
+ If `.gsd-t/backlog.md` exists, read and parse it. Show total count and top 3 items (position, title, type). If no backlog file exists, skip the Backlog section entirely. If the backlog file exists but is empty (no entries), show `Backlog: No items`.
39
+
31
40
  If there are blockers or issues, highlight them.
32
41
  If the user provides $ARGUMENTS, focus the status on that specific domain or aspect.
33
42
 
@@ -47,7 +47,9 @@ Work through each phase that hasn't been completed:
47
47
  - Count total independent starting tasks across domains
48
48
  - If 3+ domains with independent work AND teams are enabled: use team mode
49
49
  - Otherwise: solo mode
50
-
50
+
51
+ - **Destructive Action Guard**: Before each task, check if it involves destructive or structural changes (DROP TABLE, schema changes that lose data, removing existing modules, replacing architecture patterns). If YES → STOP and present the change to the user. Wait for explicit approval. This applies at ALL autonomy levels.
52
+
51
53
  - **After each task:**
52
54
  - Run quick test-sync (affected tests only)
53
55
  - If test failures: pause and report
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tekyzinc/gsd-t",
3
- "version": "2.5.0",
4
- "description": "GSD-T: Contract-Driven Development for Claude Code — 27 slash commands with impact analysis, test sync, and milestone archival",
3
+ "version": "2.8.0",
4
+ "description": "GSD-T: Contract-Driven Development for Claude Code — 34 slash commands with backlog management, impact analysis, test sync, and milestone archival",
5
5
  "author": "Tekyz, Inc.",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -51,6 +51,13 @@ PROJECT or FEATURE or SCAN
51
51
  | `/user:gsd-t-quick` | Fast task, respects contracts |
52
52
  | `/user:gsd-t-populate` | Auto-populate docs from existing codebase |
53
53
  | `/user:gsd-t-resume` | Restore context, continue |
54
+ | `/user:gsd-t-backlog-add` | Capture item, auto-categorize, append to backlog |
55
+ | `/user:gsd-t-backlog-list` | Filtered, ordered view of backlog items |
56
+ | `/user:gsd-t-backlog-move` | Reorder items by position (priority) |
57
+ | `/user:gsd-t-backlog-edit` | Modify backlog entry fields |
58
+ | `/user:gsd-t-backlog-remove` | Drop item with optional reason |
59
+ | `/user:gsd-t-backlog-promote` | Refine, classify, launch GSD-T workflow |
60
+ | `/user:gsd-t-backlog-settings` | Manage types, apps, categories, defaults |
54
61
  | `/user:branch` | Create and switch to a new git branch |
55
62
  | `/user:checkin` | Auto-bump version, stage, commit, and push |
56
63
  | `/user:Claude-md` | Reload and apply CLAUDE.md directives |
@@ -101,6 +108,44 @@ GSD-T tracks project version in `.gsd-t/progress.md` using semantic versioning:
101
108
  - Version is reflected in: `progress.md`, `README.md`, package manifest (if any), and git tags (`v{version}`)
102
109
 
103
110
 
111
+ # Destructive Action Guard (MANDATORY)
112
+
113
+ **NEVER perform destructive or structural changes without explicit user approval.** This applies at ALL autonomy levels, including Level 3.
114
+
115
+ ```
116
+ BEFORE any of these actions, STOP and ask the user:
117
+ ├── DROP TABLE, DROP COLUMN, DROP INDEX, TRUNCATE, DELETE without WHERE
118
+ ├── Renaming or removing database tables or columns
119
+ ├── Schema migrations that lose data or break existing queries
120
+ ├── Replacing an existing architecture pattern (e.g., normalized → denormalized)
121
+ ├── Removing or replacing existing files/modules that contain working functionality
122
+ ├── Changing ORM models in ways that conflict with the existing database schema
123
+ ├── Removing API endpoints or changing response shapes that existing clients depend on
124
+ ├── Replacing a dependency or framework with a different one
125
+ └── Any change that would require other parts of the system to be rewritten
126
+ ```
127
+
128
+ ### How to handle schema/architecture mismatches:
129
+ 1. **READ the existing schema/code first** — understand what exists before proposing changes
130
+ 2. **Adapt new code to match existing structures** — not the other way around
131
+ 3. **If restructuring is truly needed**, present the case to the user with:
132
+ - What exists today and why it might have been designed that way
133
+ - What you want to change and why
134
+ - What will break if you make the change
135
+ - What data or functionality will be lost
136
+ - A migration path that preserves existing data
137
+ 4. **Wait for explicit approval** before proceeding
138
+
139
+ ### Why this matters:
140
+ Even in development, the user may have:
141
+ - Working functionality they've tested and rely on
142
+ - Data they've carefully set up (seed data, test accounts, configuration)
143
+ - Other code that depends on the current structure
144
+ - Design decisions made for reasons not documented
145
+
146
+ **"Adapt to what exists" is always safer than "replace what exists."**
147
+
148
+
104
149
  # Autonomous Execution Rules
105
150
 
106
151
  ## Prime Rule
@@ -108,6 +153,7 @@ KEEP GOING. Only stop for:
108
153
  1. Unrecoverable errors after 2 fix attempts
109
154
  2. Ambiguity that fundamentally changes project direction
110
155
  3. Milestone completion (checkpoint for user review)
156
+ 4. Destructive actions (see Destructive Action Guard above — ALWAYS stop)
111
157
 
112
158
  ## Pre-Commit Gate (MANDATORY)
113
159
 
@@ -174,6 +220,9 @@ If not specified, use Level 2.
174
220
 
175
221
  # Don't Do These Things
176
222
 
223
+ - NEVER perform destructive or structural changes without explicit user approval (see Destructive Action Guard above).
224
+ - NEVER drop database tables, remove columns, or run destructive SQL on an existing database — adapt new code to the existing schema.
225
+ - NEVER replace existing architecture patterns (e.g., normalized → denormalized) without user approval — even if you think the new way is better.
177
226
  - NEVER commit code without running the Pre-Commit Gate checklist. EVERY commit.
178
227
  - NEVER batch doc updates for later — update docs as part of the same commit as the code change.
179
228
  - NEVER start a phase without reading contracts and relevant docs first.
@@ -0,0 +1,18 @@
1
+ # Backlog Settings
2
+
3
+ ## Types
4
+ - bug
5
+ - feature
6
+ - improvement
7
+ - ux
8
+ - architecture
9
+
10
+ ## Apps
11
+ - {app1}
12
+ - {app2}
13
+
14
+ ## Categories
15
+
16
+ ## Defaults
17
+ - **Default App:** {app}
18
+ - **Auto-categorize:** true
@@ -0,0 +1 @@
1
+ # Backlog