@tekyzinc/gsd-t 2.39.13 → 2.45.11

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.
Files changed (45) hide show
  1. package/README.md +17 -9
  2. package/bin/desktop.ini +2 -0
  3. package/bin/global-sync-manager.js +350 -0
  4. package/bin/gsd-t.js +592 -2
  5. package/bin/metrics-collector.js +167 -0
  6. package/bin/metrics-rollup.js +200 -0
  7. package/bin/patch-lifecycle.js +195 -0
  8. package/bin/rule-engine.js +160 -0
  9. package/commands/desktop.ini +2 -0
  10. package/commands/gsd-t-complete-milestone.md +192 -5
  11. package/commands/gsd-t-debug.md +16 -2
  12. package/commands/gsd-t-execute.md +257 -52
  13. package/commands/gsd-t-help.md +25 -10
  14. package/commands/gsd-t-integrate.md +35 -7
  15. package/commands/gsd-t-metrics.md +143 -0
  16. package/commands/gsd-t-plan.md +49 -2
  17. package/commands/gsd-t-quick.md +15 -3
  18. package/commands/gsd-t-status.md +78 -0
  19. package/commands/gsd-t-test-sync.md +2 -2
  20. package/commands/gsd-t-verify.md +140 -9
  21. package/commands/gsd-t-visualize.md +11 -1
  22. package/commands/gsd-t-wave.md +34 -19
  23. package/docs/GSD-T-README.md +9 -6
  24. package/docs/architecture.md +84 -2
  25. package/docs/ci-examples/desktop.ini +2 -0
  26. package/docs/ci-examples/github-actions.yml +104 -0
  27. package/docs/ci-examples/gitlab-ci.yml +116 -0
  28. package/docs/desktop.ini +2 -0
  29. package/docs/infrastructure.md +87 -1
  30. package/docs/prd-graph-engine.md +2 -2
  31. package/docs/prd-gsd2-hybrid.md +258 -135
  32. package/docs/requirements.md +63 -2
  33. package/examples/.gsd-t/contracts/desktop.ini +2 -0
  34. package/examples/.gsd-t/desktop.ini +2 -0
  35. package/examples/.gsd-t/domains/desktop.ini +2 -0
  36. package/examples/.gsd-t/domains/example-domain/desktop.ini +2 -0
  37. package/examples/desktop.ini +2 -0
  38. package/examples/rules/.gitkeep +0 -0
  39. package/package.json +40 -40
  40. package/scripts/desktop.ini +2 -0
  41. package/scripts/gsd-t-dashboard-server.js +19 -2
  42. package/scripts/gsd-t-dashboard.html +63 -0
  43. package/scripts/gsd-t-event-writer.js +1 -0
  44. package/templates/CLAUDE-global.md +30 -9
  45. package/templates/desktop.ini +2 -0
@@ -12,6 +12,8 @@ A methodology for reliable, parallelizable development using Claude Code with op
12
12
 
13
13
  **Catches downstream effects** — analyzes impact before changes break things.
14
14
 
15
+ **Self-learning rule engine** — declarative rules detect failure patterns from task metrics. Patches progress through 5 lifecycle stages with measurable improvement gates before graduating into permanent methodology.
16
+
15
17
  ---
16
18
 
17
19
  ## Quick Start
@@ -96,26 +98,27 @@ GSD-T reads all state files and tells you exactly where you left off.
96
98
  | `/user:gsd-t-milestone` | Define new milestone | Manual |
97
99
  | `/user:gsd-t-partition` | Decompose into domains + contracts | In wave |
98
100
  | `/user:gsd-t-discuss` | Multi-perspective design exploration | In wave |
99
- | `/user:gsd-t-plan` | Create atomic task lists per domain | In wave |
101
+ | `/user:gsd-t-plan` | Create atomic task lists per domain (tasks auto-split to fit one context window) | In wave |
100
102
  | `/user:gsd-t-impact` | Analyze downstream effects | In wave |
101
- | `/user:gsd-t-execute` | Run tasks (solo or team) | In wave |
103
+ | `/user:gsd-t-execute` | Run tasks task-level fresh dispatch, worktree isolation, adaptive replanning | In wave |
102
104
  | `/user:gsd-t-test-sync` | Sync tests with code changes | In wave |
103
105
  | `/user:gsd-t-qa` | QA agent — test generation, execution, gap reporting | Auto-spawned |
104
106
  | `/user:gsd-t-integrate` | Wire domains together | In wave |
105
- | `/user:gsd-t-verify` | Run quality gates | In wave |
106
- | `/user:gsd-t-complete-milestone` | Archive + git tag | In wave |
107
+ | `/user:gsd-t-verify` | Run quality gates + goal-backward verification → auto-invokes complete-milestone | In wave |
108
+ | `/user:gsd-t-complete-milestone` | Archive + git tag (auto-invoked by verify, also standalone) | In wave |
107
109
 
108
110
  ### Automation & Utilities
109
111
 
110
112
  | Command | Purpose | Auto |
111
113
  |---------|---------|------|
112
114
  | `/user:gsd-t-wave` | Full cycle, auto-advances all phases | Manual |
113
- | `/user:gsd-t-status` | Cross-domain progress view | Manual |
115
+ | `/user:gsd-t-status` | Cross-domain progress view with token breakdown, global ELO and cross-project rankings | Manual |
114
116
  | `/user:gsd-t-resume` | Restore context, continue | Manual |
115
117
  | `/user:gsd-t-quick` | Fast task with GSD-T guarantees | Manual |
116
118
  | `/user:gsd-t-reflect` | Generate retrospective from event stream, propose memory updates | Manual |
117
119
  | `/user:gsd-t-visualize` | Launch browser dashboard — SSE server + React Flow agent visualization | Manual |
118
120
  | `/user:gsd-t-debug` | Systematic debugging with state | Manual |
121
+ | `/user:gsd-t-metrics` | View task telemetry, process ELO, signal distribution, domain health, and cross-project comparison (`--cross-project`) | Manual |
119
122
  | `/user:gsd-t-health` | Validate .gsd-t/ structure, optionally repair | Manual |
120
123
  | `/user:gsd-t-pause` | Save exact position for reliable resume | Manual |
121
124
  | `/user:gsd-t-log` | Sync progress Decision Log with recent git activity | Manual |
@@ -154,7 +157,7 @@ GSD-T reads all state files and tells you exactly where you left off.
154
157
  │ │ │ task + at verify)│ │
155
158
  │ │ └───────────────────┘ │
156
159
  │ ▼ │
157
- │ complete-milestone ◄── verify ◄── integrate ◄──────────────────────┘
160
+ verify+complete ◄──────────── integrate ◄──────────────────────┘
158
161
  │ │
159
162
  └─────────────────────────────────────────────────────────────────────────────┘
160
163
  ```
@@ -1,6 +1,6 @@
1
1
  # Architecture — GSD-T Framework (@tekyzinc/gsd-t)
2
2
 
3
- ## Last Updated: 2026-03-19 (Scan #10, Post-M20/M21)
3
+ ## Last Updated: 2026-03-22 (M23 Headless Mode)
4
4
 
5
5
  ## System Overview
6
6
 
@@ -16,7 +16,7 @@ The framework has no runtime — it is consumed entirely by Claude Code's slash
16
16
  - **Purpose**: Install, update, diagnose, and manage GSD-T across projects
17
17
  - **Location**: `bin/gsd-t.js` (1,798 lines, 90+ functions, all ≤ 30 lines)
18
18
  - **Dependencies**: Node.js built-ins only (fs, path, os, child_process, https, crypto)
19
- - **Subcommands**: install, update, status, doctor, init, uninstall, update-all, register, changelog, graph (index/status/query)
19
+ - **Subcommands**: install, update, status, doctor, init, uninstall, update-all, register, changelog, graph (index/status/query), headless (exec/query)
20
20
  - **Organization**: Configuration → Guard section → Helpers → Heartbeat → Commands → Install/Update → Init → Status → Uninstall → Update-All → Doctor → Register → Update Check → Help → Main dispatch
21
21
  - **All functions ≤ 30 lines** (M6 refactoring). Largest: `doRegister()` at 30 lines, `summarize()` at 30 lines.
22
22
 
@@ -66,6 +66,18 @@ The framework has no runtime — it is consumed entirely by Claude Code's slash
66
66
  - **`scripts/gsd-t-dashboard.html`** (194 lines): React 17 + React Flow v11.11.4 + Dagre via CDN (no build step, no npm deps). Dark theme (`#0d1117`). Renders agent hierarchy as directed graph from `parent_agent_id` relationships. Live event feed (max 200, outcome color-coded). Auto-reconnects on SSE disconnect. Port configurable via `?port=` URL param.
67
67
  - **`commands/gsd-t-visualize.md`** (104 lines, 48th command): Starts server via `--detach`, polls `/ping` up to 5s, opens browser cross-platform (win32/darwin/linux). Accepts `stop` argument to shut down server. Step 0 self-spawn with OBSERVABILITY LOGGING.
68
68
 
69
+ ### Headless Mode (M23 — complete)
70
+ - **doHeadless(args)**: Dispatch function for the `headless` CLI subcommand.
71
+ - **doHeadlessExec(command, cmdArgs, flags)**: Wraps `claude -p "/user:gsd-t-{command}"` via `execFileSync`. Verifies claude CLI availability, enforces timeout, writes log file if `--log` requested. Returns structured JSON if `--json` flag set.
72
+ - **parseHeadlessFlags(args)**: Extracts `--json`, `--timeout=N`, `--log` from raw args. Returns `{ flags, positional }`.
73
+ - **buildHeadlessCmd(command, cmdArgs)**: Builds the `/user:gsd-t-{command}` prompt string.
74
+ - **mapHeadlessExitCode(processExitCode, output)**: Maps process exit code + output text patterns to GSD-T exit codes (0–4).
75
+ - **headlessLogPath(projectDir, timestamp)**: Generates `.gsd-t/headless-{timestamp}.log` path.
76
+ - **doHeadlessQuery(type)**: Dispatches to one of 7 query functions. All pure Node.js file reads, no LLM calls, <100ms.
77
+ - **Query functions** (7): `queryStatus`, `queryDomains`, `queryContracts`, `queryDebt`, `queryContext`, `queryBacklog`, `queryGraph` — each reads corresponding `.gsd-t/` file and returns typed JSON result.
78
+ - **Exit codes**: 0=success, 1=verify-fail, 2=context-budget-exceeded, 3=error, 4=blocked-needs-human
79
+ - **CI/CD examples**: `docs/ci-examples/github-actions.yml` (GitHub Actions), `docs/ci-examples/gitlab-ci.yml` (GitLab CI)
80
+
69
81
  ### Graph Engine (M20 — complete)
70
82
  - **`bin/graph-store.js`** (147 lines): File-based graph storage in `.gsd-t/graph/`. 8 JSON files (index, calls, imports, contracts, requirements, tests, surfaces, meta). Read/write operations, MD5 file hashing for incremental indexing, staleness detection. Zero external deps. Note: no symlink protection (TD-099).
71
83
  - **`bin/graph-parsers.js`** (327 lines): Language-specific entity parsers. JS/TS: function declarations, arrow functions, classes, methods, imports (ES/CJS), exports. Python: def/class/import. Regex-based (no Tree-sitter). Returns `{ entities, imports, calls }`.
@@ -271,6 +283,76 @@ QA runs inline or as Task subagent depending on phase (M10 refactor). Removed fr
271
283
  | 2026-02-18 | gsd-t-tools.js as state utility CLI | Reduces token-heavy markdown parsing; compact JSON responses save ~50K tokens/wave | Parsing progress.md inline (original) |
272
284
  | 2026-02-18 | continue-here files for pause/resume | More precise than progress.md; captures exact task+next-action, not just phase | progress.md alone (less precise) |
273
285
 
286
+ ### GSD 2 Tier 1 — Execution Quality (M22 — complete v2.40.10)
287
+
288
+ Five interlocking capabilities eliminate context rot, enable safe parallel execution, and verify behavior rather than structure alone.
289
+
290
+ **Task-Level Fresh Dispatch**
291
+
292
+ Execute dispatches one subagent per TASK (not per domain). Each task agent gets a fresh context window containing only: domain scope.md, relevant contracts, the single current task, graph context for touched files, and prior task summaries (10-20 lines each). Context utilization per task: ~10-20% (down from 60-75% cumulative per domain). Compaction never triggers. The domain dispatcher (lightweight orchestrator) sequences tasks and passes summaries — it never accumulates full task context.
293
+
294
+ ```
295
+ Execute orchestrator (summaries only — ~4-8% ctx)
296
+ └── Domain-A task-dispatcher
297
+ ├── Task 1 subagent (fresh, 10-20% ctx) → summary → dies
298
+ ├── Task 2 subagent (fresh + task 1 summary) → summary → dies
299
+ └── Task N subagent (fresh + prior summaries) → summary → dies
300
+ ```
301
+
302
+ **Plan command constraint** (added M22): Every task must fit in one context window. If estimated scope exceeds 70% context, plan splits the task automatically.
303
+
304
+ **Worktree Isolation**
305
+
306
+ Parallel domain agents work in isolated git worktrees via Agent tool's `isolation: "worktree"` parameter. No shared filesystem — domains cannot step on each other's files. Merges are sequential and atomic:
307
+
308
+ ```
309
+ Dispatch N domains (isolation: "worktree") → parallel execution
310
+ └── Domain A completes → merge A → run integration tests
311
+ └── Domain B completes → merge B → run integration tests
312
+ └── Conflict or test failure → rollback that domain, others unaffected
313
+ ```
314
+
315
+ Rollback granularity is per-domain (not per-commit). Worktrees are cleaned up after all merges complete.
316
+
317
+ **Goal-Backward Verification**
318
+
319
+ After all structural quality gates pass (tests, contracts, file existence), a goal-backward pass verifies behavior. Reads milestone goals, traces each requirement to code, and checks for placeholders:
320
+ - `console.log("TODO")` / `console.log("implement X")`
321
+ - Hardcoded return values (`return "Synced"`, `return 200` on a path that should compute)
322
+ - `// TODO`, `// FIXME`, `// PLACEHOLDER` comments in critical paths
323
+ - UI components rendering static strings where dynamic data is required
324
+
325
+ Applied in: `verify`, `complete-milestone`, `wave` (verification phase).
326
+
327
+ **Adaptive Replanning**
328
+
329
+ After each domain completes in execute, the orchestrator reads the domain's result summary and evaluates whether remaining domain plans remain valid. If execution revealed new constraints (deprecated API, schema mismatch, missing dependency, incompatible library), affected domain `tasks.md` files are rewritten on disk before the next domain is dispatched.
330
+
331
+ Guard: max 2 replanning cycles per execute run. After that, pause for user input (prevents new-constraint → replan → new-constraint loops).
332
+
333
+ **Context Observability**
334
+
335
+ Extended token-log.md format (M22) includes `Domain`, `Task`, and `Ctx%` columns:
336
+
337
+ ```
338
+ | Datetime-start | Datetime-end | Command | Step | Model | Duration(s) | Notes | Tokens | Compacted | Domain | Task | Ctx% |
339
+ ```
340
+
341
+ Alert thresholds (inline display):
342
+ - `Ctx% >= 70%` → warning: task approaching compaction, consider splitting
343
+ - `Ctx% >= 85%` → critical: compaction likely, task MUST be split
344
+
345
+ `gsd-t-status` displays token breakdown by domain/task/phase. `gsd-t-visualize` consumes the same data for dashboard rendering.
346
+
347
+ ## Planned Architecture Changes (M23-M24)
348
+
349
+ **M23: Headless Mode**
350
+ - New `gsd-t headless` CLI subcommand wrapping `claude -p` for unattended execution.
351
+ - New `gsd-t headless query` for instant JSON state access (no LLM).
352
+
353
+ **M24: Docker**
354
+ - Dockerfile + docker-compose for containerized enterprise execution.
355
+
274
356
  ## Known Architecture Concerns
275
357
 
276
358
  1. **CLI single-file size**: bin/gsd-t.js at 1,438 lines exceeds the 200-line convention, but splitting adds complexity for questionable benefit given zero-dependency constraint. Accepted deviation.
@@ -0,0 +1,2 @@
1
+ [.ShellClassInfo]
2
+ IconResource=C:\Program Files\Google\Drive File Stream\122.0.1.0\GoogleDriveFS.exe,27
@@ -0,0 +1,104 @@
1
+ # GSD-T Headless Mode — GitHub Actions Example
2
+ #
3
+ # This workflow demonstrates using `gsd-t headless` for automated milestone
4
+ # verification in CI/CD pipelines.
5
+ #
6
+ # Prerequisites:
7
+ # - ANTHROPIC_API_KEY secret configured in your GitHub repository
8
+ # - GSD-T installed globally (npm install -g @tekyzinc/gsd-t)
9
+ # - Claude Code CLI installed (npm install -g @anthropic-ai/claude-code)
10
+ #
11
+ # Usage: Copy this file to .github/workflows/gsd-t-verify.yml in your project
12
+
13
+ name: GSD-T Headless Verify
14
+
15
+ on:
16
+ push:
17
+ branches: [main, develop]
18
+ pull_request:
19
+ branches: [main]
20
+ workflow_dispatch:
21
+ inputs:
22
+ command:
23
+ description: 'GSD-T command to run (default: verify)'
24
+ required: false
25
+ default: 'verify'
26
+
27
+ jobs:
28
+ gsd-t-verify:
29
+ name: GSD-T Quality Gates
30
+ runs-on: ubuntu-latest
31
+ timeout-minutes: 30
32
+
33
+ steps:
34
+ - name: Checkout repository
35
+ uses: actions/checkout@v4
36
+
37
+ - name: Setup Node.js
38
+ uses: actions/setup-node@v4
39
+ with:
40
+ node-version: '20'
41
+
42
+ - name: Install GSD-T
43
+ run: npm install -g @tekyzinc/gsd-t @anthropic-ai/claude-code
44
+
45
+ - name: Query project status (no LLM needed)
46
+ id: status
47
+ run: |
48
+ STATUS=$(gsd-t headless query status)
49
+ echo "status=$STATUS" >> $GITHUB_OUTPUT
50
+ echo "GSD-T Project Status: $STATUS"
51
+
52
+ - name: Run GSD-T headless verify
53
+ env:
54
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
55
+ run: |
56
+ gsd-t headless ${{ github.event.inputs.command || 'verify' }} \
57
+ --json \
58
+ --timeout=1200 \
59
+ --log
60
+ # Exit codes:
61
+ # 0 = success
62
+ # 1 = verify-fail (tests/gates failed)
63
+ # 2 = context-budget-exceeded (try splitting milestone)
64
+ # 3 = error (claude CLI error)
65
+ # 4 = blocked-needs-human (requires manual review)
66
+
67
+ - name: Upload headless log on failure
68
+ if: failure()
69
+ uses: actions/upload-artifact@v4
70
+ with:
71
+ name: gsd-t-headless-log
72
+ path: .gsd-t/headless-*.log
73
+ retention-days: 7
74
+
75
+ gsd-t-status-gate:
76
+ name: GSD-T State Query Gate
77
+ runs-on: ubuntu-latest
78
+
79
+ steps:
80
+ - name: Checkout repository
81
+ uses: actions/checkout@v4
82
+
83
+ - name: Setup Node.js
84
+ uses: actions/setup-node@v4
85
+ with:
86
+ node-version: '20'
87
+
88
+ - name: Install GSD-T
89
+ run: npm install -g @tekyzinc/gsd-t
90
+
91
+ - name: Check project status
92
+ run: gsd-t headless query status
93
+
94
+ - name: Check for open tech debt
95
+ run: |
96
+ DEBT=$(gsd-t headless query debt)
97
+ COUNT=$(echo "$DEBT" | node -e "const d=JSON.parse(require('fs').readFileSync('/dev/stdin','utf8')); process.exit(d.data.count > 0 ? 1 : 0)" || echo "")
98
+ echo "Tech debt items: $DEBT"
99
+
100
+ - name: List active domains
101
+ run: gsd-t headless query domains
102
+
103
+ - name: Check graph index
104
+ run: gsd-t headless query graph
@@ -0,0 +1,116 @@
1
+ # GSD-T Headless Mode — GitLab CI Example
2
+ #
3
+ # This pipeline demonstrates using `gsd-t headless` for automated milestone
4
+ # verification and state queries in GitLab CI/CD.
5
+ #
6
+ # Prerequisites:
7
+ # - ANTHROPIC_API_KEY variable configured in GitLab CI/CD settings
8
+ # - Node.js 20+ runner
9
+ #
10
+ # Usage: Copy the relevant stages/jobs into your .gitlab-ci.yml
11
+
12
+ stages:
13
+ - status
14
+ - verify
15
+ - report
16
+
17
+ variables:
18
+ NODE_VERSION: "20"
19
+ GSD_T_TIMEOUT: "1200"
20
+
21
+ # ─── Status Stage (no LLM, runs fast) ────────────────────────────────────────
22
+
23
+ gsd-t-status:
24
+ stage: status
25
+ image: node:${NODE_VERSION}
26
+ before_script:
27
+ - npm install -g @tekyzinc/gsd-t
28
+ script:
29
+ - echo "=== Project Status ==="
30
+ - gsd-t headless query status
31
+ - echo "=== Active Domains ==="
32
+ - gsd-t headless query domains
33
+ - echo "=== Contracts ==="
34
+ - gsd-t headless query contracts
35
+ - echo "=== Tech Debt ==="
36
+ - gsd-t headless query debt
37
+ - echo "=== Backlog ==="
38
+ - gsd-t headless query backlog
39
+ artifacts:
40
+ reports:
41
+ # Capture JSON output for downstream jobs
42
+ dotenv: .gsd-t-status.env
43
+ allow_failure: false
44
+
45
+ # ─── Verify Stage (LLM-powered, requires ANTHROPIC_API_KEY) ─────────────────
46
+
47
+ gsd-t-verify:
48
+ stage: verify
49
+ image: node:${NODE_VERSION}
50
+ before_script:
51
+ - npm install -g @tekyzinc/gsd-t @anthropic-ai/claude-code
52
+ script:
53
+ - >
54
+ gsd-t headless verify
55
+ --json
56
+ --timeout=${GSD_T_TIMEOUT}
57
+ --log
58
+ after_script:
59
+ - cat .gsd-t/headless-*.log 2>/dev/null || true
60
+ artifacts:
61
+ when: always
62
+ paths:
63
+ - .gsd-t/headless-*.log
64
+ expire_in: 1 week
65
+ # Exit code mapping:
66
+ # 0 = success — pipeline continues
67
+ # 1 = verify-fail — pipeline fails (tests/quality gates failed)
68
+ # 2 = context-budget-exceeded — pipeline fails (split milestone required)
69
+ # 3 = error — pipeline fails (check claude CLI config)
70
+ # 4 = blocked-needs-human — pipeline fails with manual review needed
71
+ variables:
72
+ ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
73
+ only:
74
+ - main
75
+ - develop
76
+ - merge_requests
77
+
78
+ # ─── Report Stage ────────────────────────────────────────────────────────────
79
+
80
+ gsd-t-context-report:
81
+ stage: report
82
+ image: node:${NODE_VERSION}
83
+ before_script:
84
+ - npm install -g @tekyzinc/gsd-t
85
+ script:
86
+ - echo "=== Token/Context Usage ==="
87
+ - gsd-t headless query context
88
+ - echo "=== Graph Index ==="
89
+ - gsd-t headless query graph
90
+ when: always
91
+ allow_failure: true
92
+
93
+ # ─── Nightly Headless Execute ─────────────────────────────────────────────────
94
+ # Run overnight to execute a milestone phase unattended
95
+
96
+ gsd-t-nightly-execute:
97
+ stage: verify
98
+ image: node:${NODE_VERSION}
99
+ before_script:
100
+ - npm install -g @tekyzinc/gsd-t @anthropic-ai/claude-code
101
+ script:
102
+ - >
103
+ gsd-t headless execute
104
+ --json
105
+ --timeout=3600
106
+ --log
107
+ artifacts:
108
+ when: always
109
+ paths:
110
+ - .gsd-t/headless-*.log
111
+ expire_in: 2 weeks
112
+ variables:
113
+ ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
114
+ only:
115
+ - schedules # Only runs on scheduled pipelines
116
+ allow_failure: false
@@ -0,0 +1,2 @@
1
+ [.ShellClassInfo]
2
+ IconResource=C:\Program Files\Google\Drive File Stream\122.0.1.0\GoogleDriveFS.exe,27
@@ -1,6 +1,6 @@
1
1
  # Infrastructure — GSD-T Framework (@tekyzinc/gsd-t)
2
2
 
3
- ## Last Updated: 2026-03-09 (Scan #9, Post-M17)
3
+ ## Last Updated: 2026-03-22 (M23 Headless Mode)
4
4
 
5
5
  ## Quick Reference
6
6
 
@@ -14,6 +14,8 @@
14
14
  | View changelog | `npx @tekyzinc/gsd-t changelog` |
15
15
  | Register project | `npx @tekyzinc/gsd-t register` |
16
16
  | Publish to npm | `npm publish` (runs `npm test` automatically via prepublishOnly) |
17
+ | Headless exec | `gsd-t headless <command> [--json] [--timeout=N] [--log]` |
18
+ | Headless query | `gsd-t headless query <type>` (no LLM, <100ms) |
17
19
 
18
20
  ## Local Development
19
21
 
@@ -109,6 +111,90 @@ get-stuff-done-teams/
109
111
  └── package.json — npm package config
110
112
  ```
111
113
 
114
+ ## Headless Mode (M23)
115
+
116
+ Headless mode enables non-interactive GSD-T execution for CI/CD pipelines and overnight builds.
117
+
118
+ ### headless exec
119
+
120
+ Wraps `claude -p "/user:gsd-t-{command} {args}"` for unattended execution.
121
+
122
+ ```bash
123
+ gsd-t headless verify --json --timeout=1200 --log
124
+ gsd-t headless execute --timeout=3600
125
+ gsd-t headless wave --json
126
+ ```
127
+
128
+ **Flags:**
129
+ | Flag | Default | Description |
130
+ |------|---------|-------------|
131
+ | `--json` | off | Output structured JSON envelope |
132
+ | `--timeout=N` | 300s | Kill process after N seconds |
133
+ | `--log` | off | Write output to `.gsd-t/headless-{timestamp}.log` |
134
+
135
+ **Exit codes:**
136
+ | Code | Meaning |
137
+ |------|---------|
138
+ | 0 | success |
139
+ | 1 | verify-fail (tests or quality gates failed) |
140
+ | 2 | context-budget-exceeded (split the milestone) |
141
+ | 3 | error (claude CLI error or process failure) |
142
+ | 4 | blocked-needs-human (requires manual intervention) |
143
+
144
+ **JSON envelope shape (--json flag):**
145
+ ```json
146
+ {
147
+ "success": true,
148
+ "exitCode": 0,
149
+ "gsdtExitCode": 0,
150
+ "command": "verify",
151
+ "args": [],
152
+ "output": "...",
153
+ "timestamp": "2026-03-22T10:00:00.000Z",
154
+ "duration": 42150,
155
+ "logFile": ".gsd-t/headless-1742641200000.log"
156
+ }
157
+ ```
158
+
159
+ ### headless query
160
+
161
+ Pure Node.js file parsing — no LLM calls, <100ms response.
162
+
163
+ ```bash
164
+ gsd-t headless query status # Version, milestone, phase
165
+ gsd-t headless query domains # Domain list with flags
166
+ gsd-t headless query contracts # Contract file list
167
+ gsd-t headless query debt # Tech debt items
168
+ gsd-t headless query context # Token log summary
169
+ gsd-t headless query backlog # Backlog items
170
+ gsd-t headless query graph # Graph index metadata
171
+ ```
172
+
173
+ All queries return JSON to stdout.
174
+
175
+ ### CI/CD Integration
176
+
177
+ Example workflow files are in `docs/ci-examples/`:
178
+ - `github-actions.yml` — GitHub Actions workflow with verify + status gate jobs
179
+ - `gitlab-ci.yml` — GitLab CI pipeline with status/verify/report stages
180
+
181
+ **Quick setup for GitHub Actions:**
182
+ ```yaml
183
+ - name: GSD-T Verify
184
+ env:
185
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
186
+ run: gsd-t headless verify --json --timeout=1200
187
+ ```
188
+
189
+ **Quick setup for GitLab CI:**
190
+ ```yaml
191
+ gsd-t-verify:
192
+ script:
193
+ - gsd-t headless verify --json --timeout=1200
194
+ variables:
195
+ ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
196
+ ```
197
+
112
198
  ## Security Notes
113
199
 
114
200
  - Zero npm dependencies — no supply chain risk
@@ -6,12 +6,12 @@
6
6
  | **PRD ID** | PRD-GRAPH-001 |
7
7
  | **Date** | 2026-03-18 |
8
8
  | **Author** | GSD-T Team |
9
- | **Status** | DRAFT |
9
+ | **Status** | DELIVERED (M20 + M21 complete — 2026-03-20) |
10
10
  | **Milestones** | M20 (Graph Abstraction + Indexer + CGC), M21 (Graph-Powered Commands) |
11
11
  | **Version Target** | 2.37.10 (M20), 2.38.10 (M21) |
12
12
  | **Priority** | P0 — foundational for all future enhancements |
13
13
  | **Predecessor** | M19 (Shared Service Detection v2.35.10) |
14
- | **Successor** | Scan self-validation, then GSD 2 milestones (M22+) |
14
+ | **Successor** | GSD 2 milestones (M22 COMPLETE, M23-M24 queued) |
15
15
 
16
16
  ---
17
17