@tekyzinc/gsd-t 2.21.0 → 2.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,169 @@
1
+ # GSD-T: QA Agent — Test-Driven Contract Enforcement
2
+
3
+ You are the QA Agent. You are spawned as a teammate by other GSD-T commands. Your sole responsibility is **test generation, execution, and gap reporting**. You never write feature code.
4
+
5
+ ## Identity
6
+
7
+ - **Role**: QA Teammate
8
+ - **What you do**: Write tests, run tests, report results
9
+ - **What you don't do**: Write feature code, modify contracts, change architecture
10
+ - **Context**: You receive contracts from `.gsd-t/contracts/` and the current phase context
11
+
12
+ ## Phase-Specific Behavior
13
+
14
+ Your behavior depends on which phase spawned you:
15
+
16
+ ### During Partition
17
+ **Trigger**: Lead finishes writing contracts in `.gsd-t/contracts/`
18
+ **Action**: Generate contract test skeletons
19
+
20
+ 1. Read all contract files in `.gsd-t/contracts/`
21
+ 2. For each contract, generate test skeletons using the mapping rules below
22
+ 3. Write test files to the project's test directory with `contract-` prefix
23
+ 4. Report: `QA: {N} contract test files generated, {N} test cases total`
24
+
25
+ ### During Plan
26
+ **Trigger**: Lead finishes creating task lists
27
+ **Action**: Generate acceptance test scenarios
28
+
29
+ 1. Read task lists in `.gsd-t/domains/*/tasks.md`
30
+ 2. For each task that delivers user-facing functionality, write acceptance test scenarios
31
+ 3. These are higher-level than contract tests — they test user journeys and workflows
32
+ 4. Report: `QA: {N} acceptance test scenarios generated`
33
+
34
+ ### During Execute
35
+ **Trigger**: Spawned alongside domain teammates
36
+ **Action**: Run tests continuously, write edge case tests
37
+
38
+ 1. Monitor which files domain teammates are changing
39
+ 2. Run contract tests and acceptance tests as implementation proceeds
40
+ 3. Write additional edge case tests for new code paths (not just happy path)
41
+ 4. When a domain teammate completes a task, run all tests for that domain
42
+ 5. Report per-task: `QA: Task {N} — {pass|fail}. {details}`
43
+ 6. Final report: `QA: {pass|fail} — {N}/{N} contract tests passing, {N} edge case tests added`
44
+
45
+ ### During Verify
46
+ **Trigger**: Lead invokes verify phase
47
+ **Action**: Full test audit
48
+
49
+ 1. Run ALL tests — contract tests, acceptance tests, edge case tests, existing project tests
50
+ 2. Coverage audit: For every contract, confirm tests exist and pass
51
+ 3. For every new feature/mode/flow, confirm Playwright specs cover happy path, error states, edge cases
52
+ 4. Gap report: List any untested contracts or code paths
53
+ 5. Report: `QA: {pass|fail} — {N} contract tests, {N} acceptance tests, {N} edge case tests. Gaps: {list or "none"}`
54
+
55
+ ### During Quick
56
+ **Trigger**: Lead runs a quick task
57
+ **Action**: Write tests for the change, run full suite
58
+
59
+ 1. Identify what the quick change touches
60
+ 2. Write/update tests covering the change (regression + new behavior)
61
+ 3. Run the FULL test suite (not just affected tests)
62
+ 4. Report: `QA: {pass|fail} — {N} tests added/updated, full suite {N}/{N} passing`
63
+
64
+ ### During Debug
65
+ **Trigger**: Lead runs a debug session
66
+ **Action**: Write regression test for the bug
67
+
68
+ 1. Understand the bug being fixed
69
+ 2. Write a regression test that FAILS before the fix and PASSES after
70
+ 3. Run the regression test to confirm it catches the bug
71
+ 4. Run the full test suite to confirm the fix doesn't break anything
72
+ 5. Report: `QA: Regression test written — {test name}. Full suite {pass|fail}`
73
+
74
+ ### During Integrate
75
+ **Trigger**: Lead wires domains together
76
+ **Action**: Run cross-domain integration tests
77
+
78
+ 1. Run all contract tests (these test domain boundaries)
79
+ 2. Run acceptance tests that span multiple domains
80
+ 3. Identify any integration gaps (domains that interact but have no cross-domain tests)
81
+ 4. Report: `QA: Integration — {pass|fail}. {N} cross-domain tests, {gaps if any}`
82
+
83
+ ### During Complete-Milestone
84
+ **Trigger**: Lead runs milestone completion
85
+ **Action**: Final gate check
86
+
87
+ 1. Run ALL tests — every test in the project
88
+ 2. Verify every contract has passing tests
89
+ 3. Verify every requirement has at least one test mapping to it
90
+ 4. This is pass/fail with no remediation — just report
91
+ 5. Report: `QA: Final gate — {PASS|FAIL}. {N} total tests, {N} passing, {N} failing. {blocking issues if any}`
92
+
93
+ ## Contract → Test Mapping Rules
94
+
95
+ ### API Contract → Tests
96
+ For each endpoint in `api-contract.md`:
97
+ - Each `## METHOD /path` → one `test.describe` block
98
+ - `Request:` → test sends this payload
99
+ - `Response {code}:` → status code assertion + response shape validation (every field)
100
+ - `Errors:` → one test per error code
101
+ - `Auth:` → test with and without auth
102
+ - Auto-generate: empty body, missing required fields, wrong HTTP method
103
+
104
+ ```typescript
105
+ // @contract-test — auto-generated from .gsd-t/contracts/api-contract.md
106
+ import { test, expect } from '@playwright/test';
107
+
108
+ test.describe('POST /api/users', () => {
109
+ test('returns 201 with expected shape', async ({ request }) => {
110
+ const res = await request.post('/api/users', { data: { /* from Request: */ } });
111
+ expect(res.status()).toBe(201);
112
+ const body = await res.json();
113
+ expect(body).toHaveProperty('id');
114
+ // ... each field from Response 201:
115
+ });
116
+
117
+ test('returns 400 on invalid data', async ({ request }) => {
118
+ // From Errors: field
119
+ });
120
+ });
121
+ ```
122
+
123
+ ### Schema Contract → Tests
124
+ For each table in `schema-contract.md`:
125
+ - Each `## Table` → one `test.describe` block
126
+ - Column constraints → assertion tests (unique, not null, FK)
127
+ - Prefer testing constraints through API endpoints when possible
128
+ - Direct DB assertions only when API doesn't exercise a constraint
129
+
130
+ ### Component Contract → Tests
131
+ For each component in `component-contract.md`:
132
+ - Each `## ComponentName` → one `test.describe` block
133
+ - `Props:` → renders with required props, handles missing optional props
134
+ - `Events:` → event handlers fire correctly
135
+ - API references → verify correct API calls made
136
+ - Auto-generate: empty form, partial form, network error handling
137
+
138
+ ## Test File Conventions
139
+
140
+ - **Location**: Project's test directory (detected from `playwright.config.*` or `package.json`)
141
+ - **Naming**: `contract-{contract-name}.spec.ts` (e.g., `contract-api.spec.ts`)
142
+ - **Marker**: Every generated test includes `// @contract-test` comment
143
+ - **Separation**: Contract tests are distinct from implementation tests — never mix them
144
+ - **Regeneration**: When a contract changes, regenerate the affected test file (preserving any manual additions marked with `// @custom`)
145
+
146
+ ## Communication Protocol
147
+
148
+ Always report to lead via teammate message using this format:
149
+
150
+ ```
151
+ QA: {PASS|FAIL} — {one-line summary}
152
+ Contract tests: {N} passing, {N} failing
153
+ Acceptance tests: {N} passing, {N} failing
154
+ Edge case tests: {N} added
155
+ Gaps: {list or "none"}
156
+ ```
157
+
158
+ ## Blocking Rules
159
+
160
+ - Your FAIL status blocks phase completion
161
+ - Lead cannot proceed to the next phase until you report PASS
162
+ - User can override with explicit approval ("proceed despite QA fail")
163
+ - You do not need lead approval to write or run tests — that's your job
164
+
165
+ ## Cleanup
166
+
167
+ After tests complete (pass or fail), kill any app/server processes spawned during test runs. Do not leave orphaned dev servers.
168
+
169
+ $ARGUMENTS
@@ -24,6 +24,19 @@ Should I proceed with quick mode or use the full execute workflow?"
24
24
  ### If it's within a single domain or pre-partition:
25
25
  Proceed.
26
26
 
27
+ ## Step 2.5: Spawn QA Agent
28
+
29
+ Spawn the QA teammate to handle testing for this quick task:
30
+
31
+ ```
32
+ Teammate "qa": Read commands/gsd-t-qa.md for your full instructions.
33
+ Phase context: quick. Read .gsd-t/contracts/ for relevant contracts.
34
+ Write tests for the change, run the full test suite.
35
+ Report: test results and any coverage gaps found.
36
+ ```
37
+
38
+ QA failure blocks the commit.
39
+
27
40
  ## Step 3: Execute
28
41
 
29
42
  1. Identify exactly which files need to change
@@ -21,6 +21,19 @@ Identify:
21
21
  - Naming conventions
22
22
  - Test run commands (from package.json scripts, Makefile, or CI config)
23
23
 
24
+ ## Step 1.5: Spawn QA Agent
25
+
26
+ Spawn the QA teammate to assist with test coverage analysis:
27
+
28
+ ```
29
+ Teammate "qa": Read commands/gsd-t-qa.md for your full instructions.
30
+ Phase context: test-sync. Read .gsd-t/contracts/ for contract definitions.
31
+ Audit test coverage against contracts. Identify gaps and stale tests.
32
+ Report: coverage gaps, stale tests, and recommended test tasks.
33
+ ```
34
+
35
+ QA agent works alongside the test sync process. QA failure flags are included in the coverage report.
36
+
24
37
  ## Step 2: Map Code to Tests
25
38
 
26
39
  For each file changed in recent tasks:
@@ -12,6 +12,19 @@ Read:
12
12
  5. `docs/requirements.md` — original requirements
13
13
  6. All source code
14
14
 
15
+ ## Step 1.5: Spawn QA Agent
16
+
17
+ Spawn the QA teammate to run the full test audit:
18
+
19
+ ```
20
+ Teammate "qa": Read commands/gsd-t-qa.md for your full instructions.
21
+ Phase context: verify. Read .gsd-t/contracts/ for contract definitions.
22
+ Run full test audit — contract tests, acceptance tests, E2E suite.
23
+ Report: comprehensive test results with pass/fail counts and coverage gaps.
24
+ ```
25
+
26
+ QA failure blocks verification completion.
27
+
15
28
  ## Step 2: Define Verification Dimensions
16
29
 
17
30
  Standard dimensions (adjust based on project):
@@ -88,7 +101,12 @@ Teammate assignments:
88
101
  - Secret/credential handling
89
102
  Report: severity-ranked findings.
90
103
 
91
- Lead: Collect all reports, synthesize, create remediation plan.
104
+ - Teammate "qa": Read commands/gsd-t-qa.md for your full instructions.
105
+ Phase context: verify. Read .gsd-t/contracts/ for contract definitions.
106
+ Run full test audit — contract tests, acceptance tests, E2E suite.
107
+ Report: comprehensive test results with pass/fail counts and coverage gaps.
108
+
109
+ Lead: Collect all reports (including QA), synthesize, create remediation plan.
92
110
  ```
93
111
 
94
112
  ## Step 4: Compile Verification Report
@@ -11,6 +11,10 @@ Read:
11
11
 
12
12
  Determine current status and resume from wherever the milestone left off.
13
13
 
14
+ ## Step 1.5: QA Agent Spawning
15
+
16
+ Every phase that produces or validates code will automatically spawn a QA teammate. The QA agent is spawned per-phase (not once for the entire wave) because each phase has different QA responsibilities. Each phase's command file contains its own QA spawn instructions — follow them when executing that phase.
17
+
14
18
  ## Step 2: Execute Remaining Phases
15
19
 
16
20
  Work through each phase that hasn't been completed:
@@ -98,6 +98,7 @@ GSD-T reads all state files and tells you exactly where you left off.
98
98
  | `/user:gsd-t-impact` | Analyze downstream effects | In wave |
99
99
  | `/user:gsd-t-execute` | Run tasks (solo or team) | In wave |
100
100
  | `/user:gsd-t-test-sync` | Sync tests with code changes | In wave |
101
+ | `/user:gsd-t-qa` | QA agent — test generation, execution, gap reporting | Auto-spawned |
101
102
  | `/user:gsd-t-integrate` | Wire domains together | In wave |
102
103
  | `/user:gsd-t-verify` | Run quality gates | In wave |
103
104
  | `/user:gsd-t-complete-milestone` | Archive + git tag | In wave |
@@ -0,0 +1,82 @@
1
+ # Architecture — GSD-T Framework (@tekyzinc/gsd-t)
2
+
3
+ ## Last Updated: 2026-02-18
4
+
5
+ ## System Overview
6
+
7
+ GSD-T is an npm-distributed methodology framework for Claude Code. It provides slash commands (markdown files), a CLI installer (Node.js), and document templates that together enable contract-driven development with AI assistance.
8
+
9
+ The framework has no runtime — it is consumed entirely by Claude Code's slash command system and the user's shell. The CLI handles installation, updates, and diagnostics. The command files define the workflow methodology that Claude Code follows.
10
+
11
+ ## Components
12
+
13
+ ### CLI Installer (bin/gsd-t.js)
14
+ - **Purpose**: Install, update, diagnose, and manage GSD-T across projects
15
+ - **Location**: `bin/gsd-t.js`
16
+ - **Dependencies**: Node.js built-ins only (fs, path, os, child_process, https)
17
+ - **Subcommands**: install, update, status, doctor, init, uninstall, update-all, register, changelog
18
+
19
+ ### Slash Commands (commands/*.md)
20
+ - **Purpose**: Define the GSD-T methodology as executable workflows for Claude Code
21
+ - **Location**: `commands/`
22
+ - **Count**: 41 (37 GSD-T workflow + 4 utility)
23
+ - **Format**: Pure markdown with step-numbered instructions, team mode blocks, and document ripple sections
24
+
25
+ ### Templates (templates/*.md)
26
+ - **Purpose**: Starter files for project initialization
27
+ - **Location**: `templates/`
28
+ - **Count**: 9 (CLAUDE-global, CLAUDE-project, requirements, architecture, workflows, infrastructure, progress, backlog, backlog-settings)
29
+ - **Tokens**: `{Project Name}`, `{Date}`, `{app}` replaced during init
30
+
31
+ ### Heartbeat System (scripts/gsd-t-heartbeat.js)
32
+ - **Purpose**: Real-time event logging via Claude Code hooks
33
+ - **Location**: `scripts/gsd-t-heartbeat.js`
34
+ - **Output**: `.gsd-t/heartbeat-{session}.jsonl` files
35
+
36
+ ### Examples (examples/)
37
+ - **Purpose**: Reference project structure and settings
38
+ - **Location**: `examples/`
39
+ - **Contents**: settings.json, .gsd-t/ with sample contracts and domain structure
40
+
41
+ ## Data Models
42
+
43
+ ### Progress State (.gsd-t/progress.md)
44
+ | Field | Type | Notes |
45
+ |-------|------|-------|
46
+ | Project | string | Name from CLAUDE.md |
47
+ | Version | semver | Major.Minor.Patch |
48
+ | Status | enum | INITIALIZED, IN_PROGRESS, READY |
49
+ | Current Milestone | string | Active milestone name or "None" |
50
+ | Decision Log | entries | Timestamped log of all changes |
51
+
52
+ ### Backlog (.gsd-t/backlog.md)
53
+ | Field | Type | Notes |
54
+ |-------|------|-------|
55
+ | ID | Bn | Sequential backlog item ID |
56
+ | Type | enum | bug, feature, improvement, ux, architecture |
57
+ | App | string | Target application |
58
+ | Category | string | Domain/module category |
59
+ | Description | string | Item summary |
60
+
61
+ ### Contracts (.gsd-t/contracts/)
62
+ | Contract | Purpose |
63
+ |----------|---------|
64
+ | command-interface-contract.md | Slash command file format and structure |
65
+ | file-format-contract.md | File naming and organization rules |
66
+ | integration-points.md | How components connect |
67
+ | backlog-file-formats.md | Backlog markdown structure |
68
+ | domain-structure.md | Domain directory layout |
69
+ | pre-commit-gate.md | Commit checklist contract |
70
+ | progress-file-format.md | Progress.md structure |
71
+ | wave-phase-sequence.md | Phase ordering rules |
72
+
73
+ ## Design Decisions
74
+
75
+ | Date | Decision | Rationale | Alternatives Considered |
76
+ |------|----------|-----------|------------------------|
77
+ | 2026-02-07 | Zero external dependencies for CLI | Simplicity, no install failures, no supply chain risk | Using commander.js, yargs |
78
+ | 2026-02-07 | Markdown-only command files | Claude Code native format, no build step, human-readable | YAML frontmatter, JSON config |
79
+ | 2026-02-09 | Semantic versioning with git tags | Standard npm practice, enables update checks | CalVer, build numbers |
80
+ | 2026-02-12 | Heartbeat via Claude Code hooks | Non-invasive monitoring, no command file changes needed | Polling, WebSocket |
81
+ | 2026-02-13 | Semantic router over keyword matching | Better intent detection, fewer misroutes | Regex patterns, ML classifier |
82
+ | 2026-02-16 | Mandatory Playwright for all projects | Consistent E2E testing, no "we'll add tests later" | Optional testing, Jest-only |
@@ -0,0 +1,72 @@
1
+ # Infrastructure — GSD-T Framework (@tekyzinc/gsd-t)
2
+
3
+ ## Last Updated: 2026-02-18
4
+
5
+ ## Quick Reference
6
+
7
+ | Task | Command |
8
+ |------|---------|
9
+ | Install GSD-T | `npx @tekyzinc/gsd-t install` |
10
+ | Check status | `npx @tekyzinc/gsd-t status` |
11
+ | Update GSD-T | `npx @tekyzinc/gsd-t update` |
12
+ | Update all projects | `npx @tekyzinc/gsd-t update-all` |
13
+ | Diagnose issues | `npx @tekyzinc/gsd-t doctor` |
14
+ | View changelog | `npx @tekyzinc/gsd-t changelog` |
15
+ | Publish to npm | `npm publish` |
16
+
17
+ ## Local Development
18
+
19
+ ### Setup
20
+ ```bash
21
+ # Clone and install
22
+ git clone https://github.com/Tekyz-Inc/get-stuff-done-teams.git
23
+ cd get-stuff-done-teams
24
+
25
+ # No npm install needed — zero dependencies
26
+ # Test the CLI directly:
27
+ node bin/gsd-t.js status
28
+ ```
29
+
30
+ ### Testing
31
+ ```bash
32
+ # Test CLI subcommands
33
+ node bin/gsd-t.js install
34
+ node bin/gsd-t.js status
35
+ node bin/gsd-t.js doctor
36
+ node bin/gsd-t.js init test-project
37
+
38
+ # Validate command files exist
39
+ ls commands/*.md | wc -l # Should be 41
40
+ ls templates/*.md | wc -l # Should be 9
41
+ ```
42
+
43
+ ## Distribution
44
+
45
+ ### npm Package
46
+ - **Registry**: https://www.npmjs.com/package/@tekyzinc/gsd-t
47
+ - **Publish**: `npm publish` (requires npm login with Tekyz account)
48
+ - **Version**: Managed in `package.json`, synced to `.gsd-t/progress.md`
49
+
50
+ ### Installed Locations
51
+ | What | Where |
52
+ |------|-------|
53
+ | Slash commands | `~/.claude/commands/` |
54
+ | Global config | `~/.claude/CLAUDE.md` |
55
+ | Heartbeat hook | `~/.claude/settings.json` (hooks section) |
56
+ | Version cache | `~/.claude/.gsd-t-version` |
57
+ | Update cache | `~/.claude/.gsd-t-update-cache` |
58
+ | Project registry | `~/.claude/.gsd-t-projects` |
59
+
60
+ ## Repository Structure
61
+
62
+ ```
63
+ get-stuff-done-teams/
64
+ ├── bin/gsd-t.js — CLI (zero dependencies)
65
+ ├── commands/ — 41 slash command files
66
+ ├── templates/ — 9 document templates
67
+ ├── scripts/ — Heartbeat hook script
68
+ ├── examples/ — Reference project structure
69
+ ├── docs/ — Methodology + living docs
70
+ ├── .gsd-t/ — GSD-T state (self-managed)
71
+ └── package.json — npm package config
72
+ ```
@@ -0,0 +1,43 @@
1
+ # Requirements — GSD-T Framework (@tekyzinc/gsd-t)
2
+
3
+ ## Last Updated: 2026-02-18
4
+
5
+ ## Functional Requirements
6
+
7
+ | ID | Requirement | Priority | Status | Tests |
8
+ |----|-------------|----------|--------|-------|
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 | 37 GSD-T workflow slash commands for Claude Code | P1 | complete | validated by use |
11
+ | REQ-003 | 4 utility commands (branch, checkin, Claude-md, gsd smart router) | P1 | complete | validated by use |
12
+ | REQ-004 | Backlog management system (7 commands: add, list, move, edit, remove, promote, settings) | P1 | complete | validated by use |
13
+ | REQ-005 | Contract-driven development with domain partitioning | P1 | complete | validated by use |
14
+ | REQ-006 | Wave orchestration (full cycle: partition → plan → execute → test-sync → integrate → verify) | P1 | complete | validated by use |
15
+ | REQ-007 | Heartbeat system via Claude Code hooks | P2 | complete | hook scripts installed |
16
+ | REQ-008 | Automatic update check against npm registry | P2 | complete | CLI + slash command |
17
+ | REQ-009 | Document templates for living docs (9 templates) | P1 | complete | used by gsd-t-init |
18
+ | REQ-010 | Smart router — natural language intent → command routing | P2 | complete | validated by use |
19
+
20
+ ## Technical Requirements
21
+
22
+ | ID | Requirement | Priority | Status |
23
+ |----|-------------|----------|--------|
24
+ | TECH-001 | Zero external npm dependencies | P1 | complete |
25
+ | TECH-002 | Node.js >= 16 compatibility | P1 | complete |
26
+ | TECH-003 | Cross-platform support (macOS, Linux, Windows) | P1 | complete |
27
+ | TECH-004 | Semantic versioning with git tags | P1 | complete |
28
+ | TECH-005 | Pre-Commit Gate enforced on every commit | P1 | complete |
29
+
30
+ ## Non-Functional Requirements
31
+
32
+ | ID | Requirement | Metric | Status |
33
+ |----|-------------|--------|--------|
34
+ | NFR-001 | CLI install completes in < 5 seconds | < 5s | complete |
35
+ | NFR-002 | No runtime crashes on missing files | graceful fallback | complete |
36
+ | NFR-003 | Command files are pure markdown (no frontmatter) | 100% compliance | complete |
37
+
38
+ ## Test Coverage
39
+
40
+ | Requirement | Test File | Test Name | Status |
41
+ |-------------|-----------|-----------|--------|
42
+ | REQ-001 | manual | CLI subcommand testing | passing |
43
+ | REQ-002–010 | manual | Workflow validation by use | passing |
@@ -0,0 +1,67 @@
1
+ # Workflows — GSD-T Framework (@tekyzinc/gsd-t)
2
+
3
+ ## Last Updated: 2026-02-18
4
+
5
+ ## User Workflows
6
+
7
+ ### Install GSD-T
8
+ 1. Run `npx @tekyzinc/gsd-t install`
9
+ 2. CLI copies commands to `~/.claude/commands/`
10
+ 3. CLI sets up global CLAUDE.md if missing
11
+ 4. CLI installs heartbeat hooks
12
+ 5. User starts Claude Code in their project
13
+
14
+ **Entry point**: `npx @tekyzinc/gsd-t install`
15
+ **Success**: 41 commands available in Claude Code
16
+ **Failure**: CLI reports missing Node.js or permission errors
17
+
18
+ ### Initialize a Project
19
+ 1. User runs `/gsd-t-init` in Claude Code
20
+ 2. Init creates `.gsd-t/` directory structure
21
+ 3. Init creates or updates CLAUDE.md
22
+ 4. Init creates `docs/` living documents if missing
23
+ 5. Init scans existing codebase if code exists
24
+
25
+ **Entry point**: `/gsd-t-init` slash command
26
+ **Success**: Project ready for milestone definition
27
+ **Failure**: Reports what couldn't be created
28
+
29
+ ### Full Wave Cycle
30
+ 1. User defines milestone via `/gsd-t-milestone`
31
+ 2. Partition decomposes into domains + contracts
32
+ 3. Plan creates task lists per domain
33
+ 4. Execute implements tasks (solo or team)
34
+ 5. Test-sync aligns tests with code changes
35
+ 6. Integrate wires domains together
36
+ 7. Verify runs quality gates
37
+ 8. Complete-milestone archives and tags
38
+
39
+ **Entry point**: `/gsd-t-wave` or manual phase-by-phase
40
+ **Success**: Milestone completed, version bumped, git tagged
41
+ **Failure**: Wave pauses at failing phase, user can fix and resume
42
+
43
+ ## Technical Workflows
44
+
45
+ ### CLI Update Check
46
+ 1. CLI reads cached version from `~/.claude/.gsd-t-update-cache`
47
+ 2. If cache is older than 1 hour, query npm registry
48
+ 3. Compare installed vs. latest using semver
49
+ 4. Display update notice if newer version available
50
+
51
+ **Trigger**: Every CLI invocation and `/gsd-t-status`
52
+ **Frequency**: Cached, actual fetch at most once per hour
53
+
54
+ ### Heartbeat Event Logging
55
+ 1. Claude Code hook fires on tool call or notification
56
+ 2. `gsd-t-heartbeat.js` appends JSONL event to `.gsd-t/heartbeat-{session}.jsonl`
57
+ 3. Events include timestamp, type, and context
58
+
59
+ **Trigger**: Claude Code hooks (9 event types)
60
+ **Frequency**: On every hooked event during a session
61
+
62
+ ## Integration Workflows
63
+
64
+ ### npm Publish
65
+ - **Trigger**: Manual `npm publish` after milestone completion
66
+ - **Flow**: Version bumped → CHANGELOG updated → git tagged → npm publish
67
+ - **Verification**: `npx @tekyzinc/gsd-t status` on fresh install
@@ -1,15 +1,13 @@
1
- # Domain: auth — Example
2
-
3
- ## Responsibility
4
- Handles all authentication and authorization: user registration, login, JWT token generation and verification, password hashing, and auth middleware for protecting routes.
5
-
6
- ## Files Owned
7
- - `src/auth/` — all auth service code
8
- - `src/middleware/auth.py` — auth middleware
9
- - `tests/auth/` — auth tests
10
-
11
- ## Inputs (from other domains)
12
- - schema-contract.md: Users table structure for lookups
13
-
14
- ## Outputs (to other domains)
15
- - api-contract.md: POST /api/auth/login, POST /api/auth/register, GET /api/users/me
1
+ # Domain: auth — Example
2
+
3
+ ## Responsibility
4
+ Handles all authentication and authorization: user registration, login, JWT token generation and verification, password hashing, and auth middleware for protecting routes.
5
+
6
+ ## Owned Files/Directories
7
+ - `src/auth/` — all auth service code
8
+ - `src/middleware/auth.py` — auth middleware
9
+ - `tests/auth/` — auth tests
10
+
11
+ ## NOT Owned (do not modify)
12
+ - `src/db/` owned by data-layer domain
13
+ - `src/api/` — owned by api domain (except auth endpoints)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekyzinc/gsd-t",
3
- "version": "2.21.0",
3
+ "version": "2.22.0",
4
4
  "description": "GSD-T: Contract-Driven Development for Claude Code — 42 slash commands with backlog management, impact analysis, test sync, and milestone archival",
5
5
  "author": "Tekyz, Inc.",
6
6
  "license": "MIT",
@@ -55,6 +55,8 @@ process.stdin.on("end", () => {
55
55
  const event = buildEvent(hook);
56
56
  if (event) {
57
57
  cleanupOldHeartbeats(gsdtDir);
58
+ // Symlink check — prevent redirection of event data to arbitrary files
59
+ try { if (fs.lstatSync(file).isSymbolicLink()) return; } catch { /* file doesn't exist yet — safe */ }
58
60
  fs.appendFileSync(file, JSON.stringify(event) + "\n");
59
61
  }
60
62
  } catch (e) {
@@ -69,7 +71,8 @@ function cleanupOldHeartbeats(gsdtDir) {
69
71
  for (const f of files) {
70
72
  if (!f.startsWith("heartbeat-") || !f.endsWith(".jsonl")) continue;
71
73
  const fp = path.join(gsdtDir, f);
72
- const stat = fs.statSync(fp);
74
+ const stat = fs.lstatSync(fp);
75
+ if (stat.isSymbolicLink()) continue; // Don't follow symlinks
73
76
  if (now - stat.mtimeMs > MAX_AGE_MS) {
74
77
  fs.unlinkSync(fp);
75
78
  }
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Background update check — spawned detached by the CLI to refresh the version cache.
5
+ * Usage: node npm-update-check.js <cache-file-path>
6
+ */
7
+
8
+ const https = require("https");
9
+ const fs = require("fs");
10
+
11
+ const cacheFile = process.argv[2];
12
+ if (!cacheFile) process.exit(1);
13
+
14
+ https.get("https://registry.npmjs.org/@tekyzinc/gsd-t/latest",
15
+ { timeout: 5000 }, (res) => {
16
+ let d = "";
17
+ res.on("data", (c) => d += c);
18
+ res.on("end", () => {
19
+ try {
20
+ const v = JSON.parse(d).version;
21
+ if (v && /^\d+\.\d+\.\d+(-[a-zA-Z0-9.]+)?$/.test(v)) {
22
+ fs.writeFileSync(cacheFile,
23
+ JSON.stringify({ latest: v, timestamp: Date.now() }));
24
+ }
25
+ } catch { /* malformed response — skip */ }
26
+ });
27
+ }).on("error", () => {});