@tekyzinc/gsd-t 2.24.8 → 2.28.12
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/CHANGELOG.md +55 -0
- package/README.md +5 -3
- package/bin/gsd-t.js +23 -0
- package/commands/checkin.md +5 -1
- package/commands/gsd-t-complete-milestone.md +6 -16
- package/commands/gsd-t-debug.md +27 -13
- package/commands/gsd-t-discuss.md +28 -4
- package/commands/gsd-t-execute.md +45 -17
- package/commands/gsd-t-health.md +138 -0
- package/commands/gsd-t-help.md +2 -0
- package/commands/gsd-t-init-scan-setup.md +29 -6
- package/commands/gsd-t-init.md +40 -6
- package/commands/gsd-t-integrate.md +15 -6
- package/commands/gsd-t-partition.md +1 -14
- package/commands/gsd-t-pause.md +78 -0
- package/commands/gsd-t-plan.md +79 -9
- package/commands/gsd-t-quick.md +27 -13
- package/commands/gsd-t-resume.md +6 -3
- package/commands/gsd-t-scan.md +23 -5
- package/commands/gsd-t-status.md +17 -0
- package/commands/gsd-t-test-sync.md +8 -9
- package/commands/gsd-t-verify.md +15 -15
- package/commands/gsd-t-wave.md +9 -5
- package/docs/GSD-T-README.md +2 -0
- package/docs/architecture.md +54 -14
- package/docs/infrastructure.md +15 -7
- package/docs/requirements.md +17 -6
- package/docs/workflows.md +45 -5
- package/examples/settings.json +3 -2
- package/package.json +2 -2
- package/scripts/gsd-t-heartbeat.js +3 -3
- package/scripts/gsd-t-statusline.js +94 -0
- package/scripts/gsd-t-tools.js +163 -0
- package/templates/CLAUDE-global.md +22 -14
package/docs/architecture.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Architecture — GSD-T Framework (@tekyzinc/gsd-t)
|
|
2
2
|
|
|
3
|
-
## Last Updated: 2026-02-18 (Post-
|
|
3
|
+
## Last Updated: 2026-02-18 (Post-M13, Scan #6)
|
|
4
4
|
|
|
5
5
|
## System Overview
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ The framework has no runtime — it is consumed entirely by Claude Code's slash
|
|
|
14
14
|
|
|
15
15
|
### CLI Installer (bin/gsd-t.js)
|
|
16
16
|
- **Purpose**: Install, update, diagnose, and manage GSD-T across projects
|
|
17
|
-
- **Location**: `bin/gsd-t.js` (1,
|
|
17
|
+
- **Location**: `bin/gsd-t.js` (1,438 lines, 81+ functions, all ≤ 30 lines)
|
|
18
18
|
- **Dependencies**: Node.js built-ins only (fs, path, os, child_process, https)
|
|
19
19
|
- **Subcommands**: install, update, status, doctor, init, uninstall, update-all, register, changelog
|
|
20
20
|
- **Organization**: Configuration → Guard section → Helpers → Heartbeat → Commands → Install/Update → Init → Status → Uninstall → Update-All → Doctor → Register → Update Check → Help → Main dispatch
|
|
@@ -23,7 +23,7 @@ The framework has no runtime — it is consumed entirely by Claude Code's slash
|
|
|
23
23
|
### Slash Commands (commands/*.md)
|
|
24
24
|
- **Purpose**: Define the GSD-T methodology as executable workflows for Claude Code
|
|
25
25
|
- **Location**: `commands/`
|
|
26
|
-
- **Count**:
|
|
26
|
+
- **Count**: 45 (41 GSD-T workflow + 4 utility: gsd, branch, checkin, Claude-md) — includes gsd-t-health and gsd-t-pause added in M13
|
|
27
27
|
- **Format**: Pure markdown with step-numbered instructions, team mode blocks, document ripple sections, and $ARGUMENTS terminator
|
|
28
28
|
|
|
29
29
|
### Templates (templates/*.md)
|
|
@@ -36,6 +36,8 @@ The framework has no runtime — it is consumed entirely by Claude Code's slash
|
|
|
36
36
|
- **gsd-t-heartbeat.js** (181 lines, 6 functions, 5 exports): Real-time event logging via Claude Code hooks. Captures 9 event types as structured JSONL. Input capped at 1MB. Session ID validated. Path traversal protection. Secret scrubbing via `scrubSecrets()`/`scrubUrl()` (M5). Notification message + title scrubbing (M8/M9). EVENT_HANDLERS map pattern (M6). Auto-cleanup after 7 days (SessionStart only, M6).
|
|
37
37
|
- **npm-update-check.js** (43 lines): Background npm registry version checker. Spawned detached by CLI when update cache is stale. Path validation within `~/.claude/` (M5). Symlink check before write (M5). 1MB response limit (M5).
|
|
38
38
|
- **gsd-t-fetch-version.js** (26 lines, NEW in M6): Synchronous npm registry fetch. Called by `fetchVersionSync()` via `execFileSync`. HTTPS-only, 5s timeout, 1MB limit. Silent failure on errors (caller validates).
|
|
39
|
+
- **gsd-t-tools.js** (163 lines, NEW in M13): State utility CLI returning compact JSON. Subcommands: state get/set (progress.md), validate (required file presence), parse progress --section, list domains/contracts, git pre-commit-check, template scope/tasks. Zero external dependencies. NOTE: No module.exports — untestable as module (TD-066).
|
|
40
|
+
- **gsd-t-statusline.js** (94 lines, NEW in M13): Context usage bar + project state for Claude Code `statusLine` setting. Reads CLAUDE_CONTEXT_TOKENS_USED/MAX env vars for usage percentage. Color-coded bar (green <50%, yellow <70%, orange <85%, red ≥85%). NOTE: No module.exports — untestable as module (TD-066).
|
|
39
41
|
|
|
40
42
|
### Examples (examples/)
|
|
41
43
|
- **Purpose**: Reference project structure and settings
|
|
@@ -51,6 +53,8 @@ npm install @tekyzinc/gsd-t → bin/gsd-t.js install
|
|
|
51
53
|
├── Copy/append templates/CLAUDE-global.md → ~/.claude/CLAUDE.md
|
|
52
54
|
├── Copy scripts/gsd-t-heartbeat.js → ~/.claude/scripts/
|
|
53
55
|
├── Configure 9 hooks in ~/.claude/settings.json
|
|
56
|
+
├── Copy scripts/gsd-t-tools.js → ~/.claude/scripts/ (installUtilityScripts, M13)
|
|
57
|
+
├── Copy scripts/gsd-t-statusline.js → ~/.claude/scripts/ (installUtilityScripts, M13)
|
|
54
58
|
└── Write version to ~/.claude/.gsd-t-version
|
|
55
59
|
```
|
|
56
60
|
|
|
@@ -101,6 +105,9 @@ Three-tier configuration:
|
|
|
101
105
|
| `backlog-settings.md` | Types, apps, categories | backlog-add/edit/settings | backlog-settings, init |
|
|
102
106
|
| `techdebt.md` | Prioritized tech debt | promote-debt, scan | scan |
|
|
103
107
|
| `scan/*.md` | Codebase analysis | scan (synthesis), setup | scan (teammates) |
|
|
108
|
+
| `CONTEXT.md` | Discuss phase output — Locked Decisions, Deferred Ideas | plan (reads + enforces) | discuss |
|
|
109
|
+
| `continue-here-{ts}.md` | Pause/resume checkpoint — exact position | resume (reads + deletes) | pause |
|
|
110
|
+
| `deferred-items.md` | Log of unresolved issues from execute/quick/debug | (manual review) | execute, quick, debug |
|
|
104
111
|
|
|
105
112
|
## Data Models
|
|
106
113
|
|
|
@@ -142,23 +149,51 @@ PARTITION → DISCUSS → PLAN → IMPACT → EXECUTE → TEST-SYNC → INTEGRAT
|
|
|
142
149
|
|
|
143
150
|
| Phase | Mode | QA Agent | Why |
|
|
144
151
|
|-------|------|----------|-----|
|
|
145
|
-
| Partition | Solo only |
|
|
152
|
+
| Partition | Solo only | NO (removed M10) | Was unnecessary overhead |
|
|
146
153
|
| Discuss | Solo only | No | Always pauses for user input (even Level 3) |
|
|
147
|
-
| Plan | Solo only |
|
|
154
|
+
| Plan | Solo only | NO (removed M10) | Was unnecessary overhead |
|
|
148
155
|
| Impact | Solo only | No | Cross-cutting analysis |
|
|
149
|
-
| Execute | Solo or Team |
|
|
150
|
-
| Test-Sync | Solo only |
|
|
151
|
-
| Integrate | Solo only |
|
|
152
|
-
| Verify | Solo or Team |
|
|
153
|
-
| Complete | Solo only |
|
|
156
|
+
| Execute | Solo or Team | Task subagent (M10) | Each task gets QA after completion |
|
|
157
|
+
| Test-Sync | Solo only | Inline (M10) | Sequential contract coverage audit |
|
|
158
|
+
| Integrate | Solo only | Task subagent (M10) | Cross-domain integration tests |
|
|
159
|
+
| Verify | Solo or Team | Inline (M10) | Full audit runs directly |
|
|
160
|
+
| Complete | Solo only | Inline (M10) | Final gate runs directly |
|
|
154
161
|
|
|
155
162
|
### Wave Orchestrator (Agent-Per-Phase Model)
|
|
156
163
|
|
|
157
164
|
The wave command spawns an independent agent for each phase via the Task tool with `bypassPermissions`. Each phase agent gets a fresh ~200K token context window, eliminating context accumulation and mid-wave compaction. The orchestrator itself stays lightweight (~30KB), reading only `progress.md` and `CLAUDE.md`. State handoff between phases occurs through `.gsd-t/` files.
|
|
158
165
|
|
|
159
|
-
### QA Agent Integration
|
|
166
|
+
### QA Agent Integration (Updated M10)
|
|
160
167
|
|
|
161
|
-
|
|
168
|
+
QA runs inline or as Task subagent depending on phase (M10 refactor). Removed from partition and plan (were unnecessary). execute and integrate spawn QA as Task subagent after each domain checkpoint. test-sync, verify, and complete-milestone run QA inline. QA failure blocks phase completion (user override available).
|
|
169
|
+
|
|
170
|
+
### Execution Quality (M11)
|
|
171
|
+
|
|
172
|
+
**Deviation Rules**: 4-rule protocol added to execute, quick, debug: (1) Bug → fix up to 3 attempts, then defer; (2) Missing dependency → add minimum; (3) Blocker → fix and log; (4) Architectural change → STOP, apply Destructive Action Guard.
|
|
173
|
+
|
|
174
|
+
**Per-Task Commits**: execute enforces `feat({domain}/task-{N})` commit format after each task. Wave spot-check verifies commits were made.
|
|
175
|
+
|
|
176
|
+
**Between-Phase Spot-Check (Wave)**: After each phase agent completes, wave reads progress.md (status), runs git log (commits), and verifies filesystem output. Re-spawns phase agent once on failure. Stops and reports to user if still failing.
|
|
177
|
+
|
|
178
|
+
### Planning Intelligence (M12)
|
|
179
|
+
|
|
180
|
+
**CONTEXT.md**: discuss phase creates `.gsd-t/CONTEXT.md` with three sections: Locked Decisions (plan MUST implement), Deferred Ideas (plan must NOT implement), Claude's Discretion (implementation details left to executor). Plan reads CONTEXT.md and fails validation if any Locked Decision has no task mapping.
|
|
181
|
+
|
|
182
|
+
**Plan Validation**: After creating task lists, plan spawns a Task subagent to validate REQ coverage, Locked Decision mapping, task completeness, contract existence. Max 3 fix iterations before stopping and reporting to user.
|
|
183
|
+
|
|
184
|
+
**REQ Traceability**: Plan writes a traceability table to docs/requirements.md mapping REQ-IDs to domain/task/status. Verify marks matched requirements complete.
|
|
185
|
+
|
|
186
|
+
### Tooling & UX (M13)
|
|
187
|
+
|
|
188
|
+
**gsd-t-tools.js**: State utility CLI for Claude Code agents. Reduces token-heavy markdown parsing with compact JSON responses. Installed to `~/.claude/scripts/`. See Hook Scripts section.
|
|
189
|
+
|
|
190
|
+
**gsd-t-statusline.js**: Visual context usage bar for Claude Code `statusLine` setting. Shows milestone, status, version, and context percentage. Installed to `~/.claude/scripts/`.
|
|
191
|
+
|
|
192
|
+
**gsd-t-health**: New command — validates .gsd-t/ structure against 12 required items. `--repair` creates missing files from templates. Step 0 subagent pattern.
|
|
193
|
+
|
|
194
|
+
**gsd-t-pause**: New command — creates `.gsd-t/continue-here-{timestamp}.md` with exact position snapshot. More precise than progress.md alone.
|
|
195
|
+
|
|
196
|
+
**gsd-t-resume** (updated): Reads continue-here files first (most recent by timestamp), falls back to progress.md. Deletes continue-here file after reading.
|
|
162
197
|
|
|
163
198
|
### Test Suite (test/)
|
|
164
199
|
- **helpers.test.js** (27 tests): Pure helper functions — validateProjectName, applyTokens, isNewerVersion, normalizeEol, etc.
|
|
@@ -166,7 +201,7 @@ The wave command spawns an independent agent for each phase via the Task tool wi
|
|
|
166
201
|
- **security.test.js** (30 tests): Security functions — scrubSecrets (18), scrubUrl (5), summarize integration (4), hasSymlinkInPath (3)
|
|
167
202
|
- **cli-quality.test.js** (22 tests): M6 refactored functions — buildEvent (10), readProjectDeps (3), readPyContent (2), insertGuardSection (3), readUpdateCache (1), addHeartbeatHook (3)
|
|
168
203
|
- **Runner**: Node.js built-in (`node --test`), zero test dependencies
|
|
169
|
-
- **Total**:
|
|
204
|
+
- **Total**: 125 tests, all passing (post-M9)
|
|
170
205
|
|
|
171
206
|
## Security Model
|
|
172
207
|
|
|
@@ -193,10 +228,15 @@ The wave command spawns an independent agent for each phase via the Task tool wi
|
|
|
193
228
|
| 2026-02-16 | Team mode default for scan | Parallel scanning faster, better results | Solo sequential scan |
|
|
194
229
|
| 2026-02-17 | QA Agent as cross-cutting concern | Mandatory test-driven contracts for all code phases | Optional testing, deferred testing |
|
|
195
230
|
| 2026-02-17 | Agent-per-phase wave orchestration | Fresh context window per phase, eliminates compaction | Inline execution (original approach) |
|
|
231
|
+
| 2026-02-18 | QA refactor — remove from partition/plan, Task subagent for execute/integrate | QA on partition/plan added overhead with little value; Task subagent gives QA fresh context | Teammate QA (original), no QA |
|
|
232
|
+
| 2026-02-18 | Deviation Rules + 3-attempt limit | Prevents infinite loops; auto-fixes bugs without blocking; escalates architectural changes | Manual escalation only, no auto-fix |
|
|
233
|
+
| 2026-02-18 | CONTEXT.md from discuss phase | Structured handoff between discuss and plan; fidelity enforcement on Locked Decisions | Free-form decisions in progress.md |
|
|
234
|
+
| 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) |
|
|
235
|
+
| 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) |
|
|
196
236
|
|
|
197
237
|
## Known Architecture Concerns
|
|
198
238
|
|
|
199
|
-
1. **CLI single-file size**: bin/gsd-t.js at 1,
|
|
239
|
+
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.
|
|
200
240
|
2. **Four-file synchronization**: Any command change requires updating README, GSD-T-README, CLAUDE-global template, and gsd-t-help. Manual process — no automated validation.
|
|
201
241
|
3. **Pre-Commit Gate unenforced**: Mental checklist in CLAUDE.md, not a git hook or CI check.
|
|
202
242
|
4. **Progress.md Decision Log growth**: Unbounded append-only log. May need periodic archival strategy for long-lived projects.
|
package/docs/infrastructure.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Infrastructure — GSD-T Framework (@tekyzinc/gsd-t)
|
|
2
2
|
|
|
3
|
-
## Last Updated: 2026-02-18 (Scan #
|
|
3
|
+
## Last Updated: 2026-02-18 (Post-M13, Scan #6)
|
|
4
4
|
|
|
5
5
|
## Quick Reference
|
|
6
6
|
|
|
@@ -30,7 +30,7 @@ node bin/gsd-t.js status
|
|
|
30
30
|
|
|
31
31
|
### Testing
|
|
32
32
|
```bash
|
|
33
|
-
# Run automated test suite (
|
|
33
|
+
# Run automated test suite (125 tests, zero dependencies)
|
|
34
34
|
npm test
|
|
35
35
|
|
|
36
36
|
# Test CLI subcommands manually
|
|
@@ -40,8 +40,12 @@ node bin/gsd-t.js doctor
|
|
|
40
40
|
node bin/gsd-t.js init test-project
|
|
41
41
|
|
|
42
42
|
# Validate command files exist
|
|
43
|
-
ls commands/*.md | wc -l # Should be
|
|
43
|
+
ls commands/*.md | wc -l # Should be 45
|
|
44
44
|
ls templates/*.md | wc -l # Should be 9
|
|
45
|
+
|
|
46
|
+
# Test new utility scripts
|
|
47
|
+
node scripts/gsd-t-tools.js validate
|
|
48
|
+
node scripts/gsd-t-tools.js git pre-commit-check
|
|
45
49
|
```
|
|
46
50
|
|
|
47
51
|
### Scripts
|
|
@@ -50,6 +54,8 @@ ls templates/*.md | wc -l # Should be 9
|
|
|
50
54
|
| `scripts/gsd-t-heartbeat.js` | Claude Code hook event logger (JSONL output, secret scrubbing) |
|
|
51
55
|
| `scripts/npm-update-check.js` | Background npm registry version checker (path-validated) |
|
|
52
56
|
| `scripts/gsd-t-fetch-version.js` | Synchronous npm registry fetch (5s timeout, 1MB limit) |
|
|
57
|
+
| `scripts/gsd-t-tools.js` | State utility CLI — state get/set, validate, list, git check, template read (NEW M13) |
|
|
58
|
+
| `scripts/gsd-t-statusline.js` | Context usage bar + project state for Claude Code statusLine setting (NEW M13) |
|
|
53
59
|
|
|
54
60
|
## Distribution
|
|
55
61
|
|
|
@@ -62,9 +68,11 @@ ls templates/*.md | wc -l # Should be 9
|
|
|
62
68
|
### Installed Locations
|
|
63
69
|
| What | Where |
|
|
64
70
|
|------|-------|
|
|
65
|
-
| Slash commands (
|
|
71
|
+
| Slash commands (45 files) | `~/.claude/commands/` |
|
|
66
72
|
| Global config | `~/.claude/CLAUDE.md` |
|
|
67
73
|
| Heartbeat script | `~/.claude/scripts/gsd-t-heartbeat.js` |
|
|
74
|
+
| State utility CLI | `~/.claude/scripts/gsd-t-tools.js` |
|
|
75
|
+
| Statusline script | `~/.claude/scripts/gsd-t-statusline.js` |
|
|
68
76
|
| Hook configuration | `~/.claude/settings.json` (hooks section) |
|
|
69
77
|
| Version file | `~/.claude/.gsd-t-version` |
|
|
70
78
|
| Update cache | `~/.claude/.gsd-t-update-check` |
|
|
@@ -74,9 +82,9 @@ ls templates/*.md | wc -l # Should be 9
|
|
|
74
82
|
|
|
75
83
|
```
|
|
76
84
|
get-stuff-done-teams/
|
|
77
|
-
├── bin/gsd-t.js — CLI installer (~1,
|
|
78
|
-
├── commands/ —
|
|
79
|
-
├── scripts/ —
|
|
85
|
+
├── bin/gsd-t.js — CLI installer (~1,438 lines, zero dependencies)
|
|
86
|
+
├── commands/ — 45 slash command files (41 GSD-T + 4 utility)
|
|
87
|
+
├── scripts/ — 5 hook/utility scripts (added gsd-t-tools.js, gsd-t-statusline.js in M13)
|
|
80
88
|
├── templates/ — 9 document templates
|
|
81
89
|
├── examples/ — Reference project structure
|
|
82
90
|
├── docs/ — Methodology + living docs
|
package/docs/requirements.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Requirements — GSD-T Framework (@tekyzinc/gsd-t)
|
|
2
2
|
|
|
3
|
-
## Last Updated: 2026-02-18 (Scan #
|
|
3
|
+
## Last Updated: 2026-02-18 (Post-M13, Scan #6)
|
|
4
4
|
|
|
5
5
|
## Functional Requirements
|
|
6
6
|
|
|
7
7
|
| ID | Requirement | Priority | Status | Tests |
|
|
8
8
|
|----|-------------|----------|--------|-------|
|
|
9
9
|
| REQ-001 | CLI installer with install, update, status, doctor, init, uninstall, update-all, register, changelog subcommands | P1 | complete | manual CLI testing |
|
|
10
|
-
| REQ-002 |
|
|
10
|
+
| REQ-002 | 41 GSD-T workflow slash commands for Claude Code (incl. QA agent, health, pause) | P1 | complete | validated by use |
|
|
11
11
|
| REQ-003 | 4 utility commands (gsd smart router, branch, checkin, Claude-md) | P1 | complete | validated by use |
|
|
12
12
|
| REQ-004 | Backlog management system (7 commands: add, list, move, edit, remove, promote, settings) | P1 | complete | validated by use |
|
|
13
13
|
| REQ-005 | Contract-driven development with domain partitioning | P1 | complete | validated by use |
|
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
| REQ-011 | Triage and merge — auto-review, score, merge safe GitHub branches | P2 | complete | validated by use |
|
|
20
20
|
| REQ-012 | QA Agent — test-driven contract enforcement spawned in 10 phases | P1 | complete | validated by use |
|
|
21
21
|
| REQ-013 | Wave orchestrator — agent-per-phase execution with fresh context windows | P1 | complete | validated by use |
|
|
22
|
+
| REQ-014 | Token Efficiency — QA refactored (removed from partition/plan, Task subagent for execute/integrate, inline for test-sync/verify) | P2 | complete (M10) | validated by use |
|
|
23
|
+
| REQ-015 | Execution Quality — Deviation Rules (4-rule, 3-attempt), per-task commits, wave spot-check | P2 | complete (M11) | validated by use |
|
|
24
|
+
| REQ-016 | Planning Intelligence — CONTEXT.md from discuss, plan fidelity enforcement, plan validation subagent, REQ traceability | P2 | complete (M12) | validated by use |
|
|
25
|
+
| REQ-017 | Tooling & UX — gsd-t-tools.js state CLI, gsd-t-statusline.js context bar, gsd-t-health command, gsd-t-pause command | P2 | complete (M13) | validated by use |
|
|
22
26
|
|
|
23
27
|
## Technical Requirements
|
|
24
28
|
|
|
@@ -52,13 +56,20 @@
|
|
|
52
56
|
| REQ-007 | test/security.test.js | Heartbeat security (scrubSecrets, scrubUrl) | passing (30 tests) |
|
|
53
57
|
| REQ-002–005, 008–013 | manual | Workflow validation by use | passing |
|
|
54
58
|
|
|
55
|
-
**Total automated tests**:
|
|
59
|
+
**Total automated tests**: 125 across 4 test files (M4: 64, M5: 30, M6: 22, M9: 9). Runner: `node --test` (zero dependencies).
|
|
56
60
|
|
|
57
61
|
## Gaps Identified
|
|
58
62
|
|
|
59
|
-
### Open (Scan #
|
|
60
|
-
-
|
|
61
|
-
- See `.gsd-t/techdebt.md` for full list
|
|
63
|
+
### Open (Scan #6 — 2026-02-18, Post-M10-M13)
|
|
64
|
+
- 14 new items: TD-066 through TD-079 (1 high: untestable new scripts; 5 medium: contract drift + doc staleness + stateSet injection; 7 low: cleanup)
|
|
65
|
+
- See `.gsd-t/techdebt.md` for full list
|
|
66
|
+
|
|
67
|
+
### Resolved (Milestone 9 + Milestones 10-13, 2026-02-18)
|
|
68
|
+
- ~~Scan #5 items (TD-056-TD-065)~~ — RESOLVED (M9, Cleanup Sprint)
|
|
69
|
+
- ~~Token efficiency gaps~~ — RESOLVED (M10)
|
|
70
|
+
- ~~Execution quality gaps (no deviation rules, no per-task commits)~~ — RESOLVED (M11)
|
|
71
|
+
- ~~Planning intelligence gaps (no CONTEXT.md, no plan validation)~~ — RESOLVED (M12)
|
|
72
|
+
- ~~Tooling gaps (no state CLI, no statusline, no health command, no pause)~~ — RESOLVED (M13)
|
|
62
73
|
|
|
63
74
|
### Resolved (Milestones 3-8, 2026-02-18/19)
|
|
64
75
|
- ~~All scan #4 items (TD-044-TD-055)~~ — RESOLVED (M8)
|
package/docs/workflows.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Workflows — GSD-T Framework (@tekyzinc/gsd-t)
|
|
2
2
|
|
|
3
|
-
## Last Updated: 2026-02-18 (Scan #
|
|
3
|
+
## Last Updated: 2026-02-18 (Post-M13, Scan #6)
|
|
4
4
|
|
|
5
5
|
## User Workflows
|
|
6
6
|
|
|
7
7
|
### Install GSD-T
|
|
8
8
|
1. Run `npx @tekyzinc/gsd-t install`
|
|
9
|
-
2. CLI copies
|
|
9
|
+
2. CLI copies 45 commands to `~/.claude/commands/`
|
|
10
10
|
3. CLI sets up global CLAUDE.md if missing (appends with separator if exists)
|
|
11
11
|
4. CLI installs heartbeat script to `~/.claude/scripts/`
|
|
12
12
|
5. CLI configures 9 hooks in `~/.claude/settings.json`
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
7. User starts Claude Code in their project
|
|
15
15
|
|
|
16
16
|
**Entry point**: `npx @tekyzinc/gsd-t install`
|
|
17
|
-
|
|
17
|
+
5b. CLI installs gsd-t-tools.js and gsd-t-statusline.js to `~/.claude/scripts/` (M13)
|
|
18
|
+
**Success**: 45 commands available in Claude Code
|
|
18
19
|
**Failure**: CLI reports missing Node.js or permission errors
|
|
19
20
|
|
|
20
21
|
### Initialize a Project
|
|
@@ -41,9 +42,14 @@
|
|
|
41
42
|
9. **Verify**: Run 7 quality gate dimensions (functional, contracts, quality, tests, E2E, security, integration)
|
|
42
43
|
10. **Complete**: Archive to `.gsd-t/milestones/`, bump version, git tag
|
|
43
44
|
|
|
45
|
+
Additional wave behaviors (M10-M12):
|
|
46
|
+
- **M10**: QA removed from partition/plan; execute/integrate spawn QA as Task subagent; test-sync/verify/complete run QA inline
|
|
47
|
+
- **M11**: Per-task commits (`feat({domain}/task-{N})`) enforced; between-phase spot-check (status + git + filesystem); Deviation Rules in execute (4-rule protocol, 3-attempt limit)
|
|
48
|
+
- **M12**: discuss creates CONTEXT.md (Locked Decisions); plan reads CONTEXT.md + runs plan validation subagent (max 3 iterations); REQ traceability table in requirements.md; verify marks requirements complete
|
|
49
|
+
|
|
44
50
|
**Entry point**: `/gsd-t-wave` (auto-advances) or manual phase-by-phase
|
|
45
51
|
**Success**: Milestone completed, version bumped, git tagged
|
|
46
|
-
**Failure**: Wave pauses at failing phase;
|
|
52
|
+
**Failure**: Wave pauses at failing phase; spot-check re-spawns phase agent once before stopping
|
|
47
53
|
|
|
48
54
|
### Autonomy Levels
|
|
49
55
|
| Level | Behavior |
|
|
@@ -106,11 +112,45 @@ Every commit must pass applicable checks:
|
|
|
106
112
|
6. Tech debt tracking (discovered/fixed?)
|
|
107
113
|
7. Test execution (affected tests pass?)
|
|
108
114
|
|
|
115
|
+
### Pause and Resume (M13)
|
|
116
|
+
|
|
117
|
+
**Pause workflow** (`/gsd-t-pause`):
|
|
118
|
+
1. Command reads progress.md + domains/*/tasks.md to identify exact position
|
|
119
|
+
2. Creates `.gsd-t/continue-here-{YYYYMMDDTHHMMSS}.md` with: milestone, phase, version, last completed action, next action, open items, user note
|
|
120
|
+
3. File persists until consumed by resume
|
|
121
|
+
4. Multiple pauses create multiple files; resume reads most recent by timestamp
|
|
122
|
+
|
|
123
|
+
**Resume workflow** (`/gsd-t-resume`):
|
|
124
|
+
1. Same-session: skip file reads, use conversation context
|
|
125
|
+
2. Cross-session: glob `.gsd-t/continue-here-*.md`, read most recent
|
|
126
|
+
3. Resume from "Next Action" field in continue-here file (more precise than progress.md alone)
|
|
127
|
+
4. Delete continue-here file after reading
|
|
128
|
+
|
|
129
|
+
### CONTEXT.md Workflow (M12)
|
|
130
|
+
|
|
131
|
+
1. `discuss` phase completes design decisions
|
|
132
|
+
2. Writes `.gsd-t/CONTEXT.md`:
|
|
133
|
+
- **Locked Decisions**: specific decisions the plan MUST implement
|
|
134
|
+
- **Deferred Ideas**: good ideas NOT in scope (plan must NOT implement)
|
|
135
|
+
- **Claude's Discretion**: implementation details left open
|
|
136
|
+
3. `plan` reads CONTEXT.md; every Locked Decision must map to at least one task
|
|
137
|
+
4. Plan validation subagent (Task tool) verifies mapping before finalizing plan
|
|
138
|
+
5. CONTEXT.md persists after plan phase; deleted manually if desired
|
|
139
|
+
6. If discuss is skipped (structured skip), CONTEXT.md is not created; plan handles gracefully
|
|
140
|
+
|
|
141
|
+
### Project Health Check (M13)
|
|
142
|
+
|
|
143
|
+
1. User invokes `/gsd-t-health [--repair]`
|
|
144
|
+
2. Health spawns as Task subagent (fresh context)
|
|
145
|
+
3. Checks 12 items: 5 root files, 3 directories, 4 docs, active milestone domains, version consistency, status validity, Decision Log, contract integrity
|
|
146
|
+
4. Reports status as HEALTHY (0 issues), DEGRADED (1-3), or BROKEN (4+ or critical missing)
|
|
147
|
+
5. With `--repair`: creates missing files from templates (MISSING items only; INVALID items flagged for user)
|
|
148
|
+
|
|
109
149
|
## Integration Workflows
|
|
110
150
|
|
|
111
151
|
### npm Publish
|
|
112
152
|
- **Trigger**: Manual `npm publish` after milestone completion
|
|
113
|
-
- **Pre-publish gate**: `prepublishOnly: "npm test"` runs
|
|
153
|
+
- **Pre-publish gate**: `prepublishOnly: "npm test"` runs 125 tests before publish (M8)
|
|
114
154
|
- **Flow**: Version bumped → CHANGELOG updated → git tagged → `npm publish` → tests run automatically → published
|
|
115
155
|
- **Verification**: `npx @tekyzinc/gsd-t status` on fresh install
|
|
116
156
|
|
package/examples/settings.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"env": {
|
|
3
|
-
"ANTHROPIC_MODEL": "claude-
|
|
3
|
+
"ANTHROPIC_MODEL": "claude-sonnet-4-6",
|
|
4
4
|
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
|
|
5
5
|
},
|
|
6
6
|
"permissions": {
|
|
@@ -13,5 +13,6 @@
|
|
|
13
13
|
],
|
|
14
14
|
"defaultMode": "dontAsk"
|
|
15
15
|
},
|
|
16
|
-
"alwaysThinkingEnabled": true
|
|
16
|
+
"alwaysThinkingEnabled": true,
|
|
17
|
+
"statusLine": "node ~/.claude/scripts/gsd-t-statusline.js"
|
|
17
18
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tekyzinc/gsd-t",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "GSD-T: Contract-Driven Development for Claude Code —
|
|
3
|
+
"version": "2.28.12",
|
|
4
|
+
"description": "GSD-T: Contract-Driven Development for Claude Code — 45 slash commands with backlog management, impact analysis, test sync, and milestone archival",
|
|
5
5
|
"author": "Tekyz, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -92,9 +92,9 @@ function cleanupOldHeartbeats(gsdtDir) {
|
|
|
92
92
|
|
|
93
93
|
const EVENT_HANDLERS = {
|
|
94
94
|
SessionStart: (h) => ({ evt: "session_start", data: { source: h.source, model: h.model } }),
|
|
95
|
-
PostToolUse: (h) => ({ evt: "tool", tool: h.tool_name, data: summarize(h.tool_name, h.tool_input) }),
|
|
96
|
-
SubagentStart: (h) => ({ evt: "agent_spawn", data: { agent_id: h.agent_id, agent_type: h.agent_type } }),
|
|
97
|
-
SubagentStop: (h) => ({ evt: "agent_stop", data: { agent_id: h.agent_id, agent_type: h.agent_type } }),
|
|
95
|
+
PostToolUse: (h) => ({ evt: "tool", tool: h.tool_name, agent_id: h.agent_id || null, data: summarize(h.tool_name, h.tool_input) }),
|
|
96
|
+
SubagentStart: (h) => ({ evt: "agent_spawn", data: { agent_id: h.agent_id, agent_type: h.agent_type, parent_id: h.parent_agent_id || h.session_id } }),
|
|
97
|
+
SubagentStop: (h) => ({ evt: "agent_stop", data: { agent_id: h.agent_id, agent_type: h.agent_type, parent_id: h.parent_agent_id || h.session_id } }),
|
|
98
98
|
TaskCompleted: (h) => ({ evt: "task_done", data: { task: h.task_subject, agent: h.teammate_name } }),
|
|
99
99
|
TeammateIdle: (h) => ({ evt: "agent_idle", data: { agent: h.teammate_name, team: h.team_name } }),
|
|
100
100
|
Notification: (h) => ({ evt: "notification", data: { message: scrubSecrets(h.message), title: scrubSecrets(h.title) } }),
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
// gsd-t-statusline.js — GSD-T status line for Claude Code
|
|
4
|
+
// Outputs compact project status for display in Claude Code's statusLine setting.
|
|
5
|
+
//
|
|
6
|
+
// Configure in ~/.claude/settings.json:
|
|
7
|
+
// "statusLine": "node ~/.claude/scripts/gsd-t-statusline.js"
|
|
8
|
+
//
|
|
9
|
+
// Context usage is read from CLAUDE_CONTEXT_TOKENS_USED and
|
|
10
|
+
// CLAUDE_CONTEXT_TOKENS_MAX environment variables if available.
|
|
11
|
+
// Falls back to GSD-T project state only.
|
|
12
|
+
//
|
|
13
|
+
// Zero external dependencies.
|
|
14
|
+
|
|
15
|
+
const fs = require('fs');
|
|
16
|
+
const path = require('path');
|
|
17
|
+
|
|
18
|
+
// ─── ANSI colors ─────────────────────────────────────────────────────────────
|
|
19
|
+
const GREEN = '\x1b[32m';
|
|
20
|
+
const YELLOW = '\x1b[33m';
|
|
21
|
+
const RED = '\x1b[31m';
|
|
22
|
+
const RESET = '\x1b[0m';
|
|
23
|
+
const DIM = '\x1b[2m';
|
|
24
|
+
const BOLD = '\x1b[1m';
|
|
25
|
+
const ORANGE = '\x1b[38;5;208m'; // 256-color orange
|
|
26
|
+
|
|
27
|
+
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
28
|
+
|
|
29
|
+
function findProjectRoot() {
|
|
30
|
+
let dir = process.cwd();
|
|
31
|
+
while (dir !== path.dirname(dir)) {
|
|
32
|
+
if (fs.existsSync(path.join(dir, '.gsd-t'))) return dir;
|
|
33
|
+
dir = path.dirname(dir);
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function readProgress(root) {
|
|
39
|
+
const p = path.join(root, '.gsd-t', 'progress.md');
|
|
40
|
+
if (!fs.existsSync(p)) return null;
|
|
41
|
+
try { return fs.readFileSync(p, 'utf8'); } catch { return null; }
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function extract(content, key) {
|
|
45
|
+
const m = content.match(new RegExp(`^## ${key}:\\s*(.+)`, 'm'));
|
|
46
|
+
return m ? m[1].trim() : null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function contextBar(pct) {
|
|
50
|
+
// pct: 0-100
|
|
51
|
+
const barLen = 10;
|
|
52
|
+
const filled = Math.round((pct / 100) * barLen);
|
|
53
|
+
const empty = barLen - filled;
|
|
54
|
+
let color;
|
|
55
|
+
if (pct < 50) color = GREEN;
|
|
56
|
+
else if (pct < 70) color = YELLOW;
|
|
57
|
+
else if (pct < 85) color = ORANGE;
|
|
58
|
+
else color = RED;
|
|
59
|
+
return `${color}${'█'.repeat(filled)}${DIM}${'░'.repeat(empty)}${RESET} ${color}${pct}%${RESET}`;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// ─── Main ─────────────────────────────────────────────────────────────────────
|
|
63
|
+
|
|
64
|
+
const root = findProjectRoot();
|
|
65
|
+
|
|
66
|
+
// Context usage from env vars (provided by Claude Code if available)
|
|
67
|
+
const tokensUsed = parseInt(process.env.CLAUDE_CONTEXT_TOKENS_USED || '0', 10);
|
|
68
|
+
const tokensMax = parseInt(process.env.CLAUDE_CONTEXT_TOKENS_MAX || '0', 10);
|
|
69
|
+
const hasContext = tokensMax > 0;
|
|
70
|
+
const ctxPct = hasContext ? Math.min(100, Math.round((tokensUsed / tokensMax) * 100)) : null;
|
|
71
|
+
|
|
72
|
+
// GSD-T project state
|
|
73
|
+
let projectPart = '';
|
|
74
|
+
if (root) {
|
|
75
|
+
const content = readProgress(root);
|
|
76
|
+
if (content) {
|
|
77
|
+
const milestone = extract(content, 'Milestone') || extract(content, 'Current Milestone') || '—';
|
|
78
|
+
const status = extract(content, 'Status') || '—';
|
|
79
|
+
const version = extract(content, 'Version') || '';
|
|
80
|
+
const vStr = version ? ` ${DIM}v${version}${RESET}` : '';
|
|
81
|
+
projectPart = `${BOLD}${milestone}${RESET} ${DIM}${status}${RESET}${vStr}`;
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
84
|
+
projectPart = `${DIM}(no gsd-t project)${RESET}`;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Context bar
|
|
88
|
+
let contextPart = '';
|
|
89
|
+
if (ctxPct !== null) {
|
|
90
|
+
contextPart = ` │ ctx ${contextBar(ctxPct)}`;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const line = `gsd-t │ ${projectPart}${contextPart}`;
|
|
94
|
+
process.stdout.write(line + '\n');
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
// gsd-t-tools.js — GSD-T state utility CLI. Zero external dependencies.
|
|
4
|
+
// Returns compact JSON. Subcommands: state, validate, parse, list, git, template
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const { execSync } = require('child_process');
|
|
8
|
+
|
|
9
|
+
// Find nearest .gsd-t/ directory walking up from cwd
|
|
10
|
+
function findProjectRoot() {
|
|
11
|
+
let dir = process.cwd();
|
|
12
|
+
while (dir !== path.dirname(dir)) {
|
|
13
|
+
if (fs.existsSync(path.join(dir, '.gsd-t'))) return dir;
|
|
14
|
+
dir = path.dirname(dir);
|
|
15
|
+
}
|
|
16
|
+
return process.cwd();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const root = findProjectRoot();
|
|
20
|
+
const gsdDir = path.join(root, '.gsd-t');
|
|
21
|
+
|
|
22
|
+
function readProgress() {
|
|
23
|
+
const p = path.join(gsdDir, 'progress.md');
|
|
24
|
+
if (!fs.existsSync(p)) return null;
|
|
25
|
+
return fs.readFileSync(p, 'utf8');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function stateGet(key) {
|
|
29
|
+
const content = readProgress();
|
|
30
|
+
if (!content) return { error: 'progress.md not found' };
|
|
31
|
+
const re = new RegExp(`^## ${escapeRe(key)}:\\s*(.+)`, 'm');
|
|
32
|
+
const m = content.match(re);
|
|
33
|
+
if (!m) return { error: `key not found: ${key}` };
|
|
34
|
+
return { key, value: m[1].trim() };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function stateSet(key, value) {
|
|
38
|
+
const p = path.join(gsdDir, 'progress.md');
|
|
39
|
+
if (!fs.existsSync(p)) return { error: 'progress.md not found' };
|
|
40
|
+
const content = fs.readFileSync(p, 'utf8');
|
|
41
|
+
const re = new RegExp(`(^## ${escapeRe(key)}:\\s*)(.+)`, 'm');
|
|
42
|
+
if (!re.test(content)) return { error: `key not found: ${key}` };
|
|
43
|
+
fs.writeFileSync(p, content.replace(re, `$1${value}`));
|
|
44
|
+
return { ok: true, key, value };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function validate() {
|
|
48
|
+
const required = [
|
|
49
|
+
'.gsd-t/progress.md',
|
|
50
|
+
'.gsd-t/contracts',
|
|
51
|
+
'.gsd-t/domains',
|
|
52
|
+
'CLAUDE.md',
|
|
53
|
+
];
|
|
54
|
+
const results = {};
|
|
55
|
+
const missing = [];
|
|
56
|
+
for (const f of required) {
|
|
57
|
+
const exists = fs.existsSync(path.join(root, f));
|
|
58
|
+
results[f] = exists ? 'ok' : 'missing';
|
|
59
|
+
if (!exists) missing.push(f);
|
|
60
|
+
}
|
|
61
|
+
return { valid: missing.length === 0, results, missing };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function parseSection(sectionName) {
|
|
65
|
+
const content = readProgress();
|
|
66
|
+
if (!content) return { error: 'progress.md not found' };
|
|
67
|
+
const re = new RegExp(`## ${escapeRe(sectionName)}\\n([\\s\\S]*?)(?=\\n## |$)`);
|
|
68
|
+
const m = content.match(re);
|
|
69
|
+
if (!m) return { error: `section not found: ${sectionName}` };
|
|
70
|
+
return { section: sectionName, content: m[1].trim() };
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function listDomains() {
|
|
74
|
+
const dir = path.join(gsdDir, 'domains');
|
|
75
|
+
if (!fs.existsSync(dir)) return { domains: [] };
|
|
76
|
+
const domains = fs.readdirSync(dir).filter(f => {
|
|
77
|
+
try { return fs.statSync(path.join(dir, f)).isDirectory(); } catch { return false; }
|
|
78
|
+
});
|
|
79
|
+
return { domains };
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function listContracts() {
|
|
83
|
+
const dir = path.join(gsdDir, 'contracts');
|
|
84
|
+
if (!fs.existsSync(dir)) return { contracts: [] };
|
|
85
|
+
const contracts = fs.readdirSync(dir).filter(f => f.endsWith('.md'));
|
|
86
|
+
return { contracts };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function preCommitCheck() {
|
|
90
|
+
const result = {};
|
|
91
|
+
try {
|
|
92
|
+
result.branch = execSync('git branch --show-current', { cwd: root, encoding: 'utf8' }).trim();
|
|
93
|
+
} catch {
|
|
94
|
+
result.branch = 'error';
|
|
95
|
+
}
|
|
96
|
+
try {
|
|
97
|
+
const status = execSync('git status --porcelain', { cwd: root, encoding: 'utf8' }).trim();
|
|
98
|
+
result.clean = status.length === 0;
|
|
99
|
+
result.changes = status ? status.split('\n').filter(Boolean) : [];
|
|
100
|
+
} catch {
|
|
101
|
+
result.clean = 'error';
|
|
102
|
+
}
|
|
103
|
+
try {
|
|
104
|
+
result.lastCommit = execSync('git log -1 --format="%h %s"', { cwd: root, encoding: 'utf8' }).trim();
|
|
105
|
+
} catch {
|
|
106
|
+
result.lastCommit = 'error';
|
|
107
|
+
}
|
|
108
|
+
return result;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function templateScope(domain) {
|
|
112
|
+
const p = path.join(gsdDir, 'domains', domain, 'scope.md');
|
|
113
|
+
if (!fs.existsSync(p)) return { error: `scope.md not found for domain: ${domain}` };
|
|
114
|
+
return { domain, scope: fs.readFileSync(p, 'utf8') };
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function templateTasks(domain) {
|
|
118
|
+
const p = path.join(gsdDir, 'domains', domain, 'tasks.md');
|
|
119
|
+
if (!fs.existsSync(p)) return { error: `tasks.md not found for domain: ${domain}` };
|
|
120
|
+
return { domain, tasks: fs.readFileSync(p, 'utf8') };
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function escapeRe(s) {
|
|
124
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Parse args
|
|
128
|
+
const args = process.argv.slice(2);
|
|
129
|
+
const [cmd, subcmd, ...rest] = args;
|
|
130
|
+
|
|
131
|
+
let result;
|
|
132
|
+
if (cmd === 'state') {
|
|
133
|
+
if (subcmd === 'get' && rest[0]) {
|
|
134
|
+
result = stateGet(rest[0]);
|
|
135
|
+
} else if (subcmd === 'set' && rest[0] && rest[1]) {
|
|
136
|
+
result = stateSet(rest[0], rest[1]);
|
|
137
|
+
} else {
|
|
138
|
+
result = { error: 'Usage: state get <key> | state set <key> <value>' };
|
|
139
|
+
}
|
|
140
|
+
} else if (cmd === 'validate') {
|
|
141
|
+
result = validate();
|
|
142
|
+
} else if (cmd === 'parse' && subcmd === 'progress') {
|
|
143
|
+
const si = args.indexOf('--section');
|
|
144
|
+
const section = si !== -1 ? args[si + 1] : null;
|
|
145
|
+
result = section ? parseSection(section) : { error: 'Usage: parse progress --section <name>' };
|
|
146
|
+
} else if (cmd === 'list') {
|
|
147
|
+
if (subcmd === 'domains') result = listDomains();
|
|
148
|
+
else if (subcmd === 'contracts') result = listContracts();
|
|
149
|
+
else result = { error: 'Usage: list domains | list contracts' };
|
|
150
|
+
} else if (cmd === 'git' && subcmd === 'pre-commit-check') {
|
|
151
|
+
result = preCommitCheck();
|
|
152
|
+
} else if (cmd === 'template') {
|
|
153
|
+
if (subcmd === 'scope' && rest[0]) result = templateScope(rest[0]);
|
|
154
|
+
else if (subcmd === 'tasks' && rest[0]) result = templateTasks(rest[0]);
|
|
155
|
+
else result = { error: 'Usage: template scope <domain> | template tasks <domain>' };
|
|
156
|
+
} else {
|
|
157
|
+
result = {
|
|
158
|
+
error: cmd ? `Unknown command: ${cmd}` : 'No command specified',
|
|
159
|
+
usage: 'state get|set validate parse progress --section <name> list domains|contracts git pre-commit-check template scope|tasks <domain>',
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
process.stdout.write(JSON.stringify(result, null, 2) + '\n');
|