@tekyzinc/gsd-t 2.28.12 → 2.28.14

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.
@@ -85,22 +85,35 @@ If mode is unclear, ask: "What kind of thinking would be most useful right now
85
85
  5. Periodically collect the best ideas into a running list
86
86
 
87
87
  ### Team Mode (if enabled and user requests):
88
+
89
+ **OBSERVABILITY LOGGING (MANDATORY):**
90
+ Before spawning the team — run via Bash:
91
+ `T_START=$(date +%s) && DT_START=$(date +"%Y-%m-%d %H:%M") && TOK_START=${CLAUDE_CONTEXT_TOKENS_USED:-0} && TOK_MAX=${CLAUDE_CONTEXT_TOKENS_MAX:-200000}`
92
+
88
93
  ```
89
94
  Create an agent team for brainstorming:
90
95
 
91
- - Teammate "visionary": Push boundaries. What's the most ambitious
92
- version? What would make this remarkable? Think in terms of
96
+ - Teammate "visionary": Push boundaries. What's the most ambitious
97
+ version? What would make this remarkable? Think in terms of
93
98
  possibilities, not constraints.
94
99
 
95
100
  - Teammate "pragmatist": Keep it real. What can we actually build?
96
101
  What's the shortest path to value? Where are the hidden costs?
97
102
 
98
- - Teammate "devil's advocate": Challenge everything. Why might this
103
+ - Teammate "devil's advocate": Challenge everything. Why might this
99
104
  fail? What are we not seeing? Which assumptions are weakest?
100
105
 
101
106
  Lead: Synthesize the best insights from all three perspectives.
102
107
  ```
103
108
 
109
+ After team completes — run via Bash:
110
+ `T_END=$(date +%s) && DT_END=$(date +"%Y-%m-%d %H:%M") && TOK_END=${CLAUDE_CONTEXT_TOKENS_USED:-0} && DURATION=$((T_END-T_START))`
111
+ Compute tokens and compaction:
112
+ - No compaction (TOK_END >= TOK_START): `TOKENS=$((TOK_END-TOK_START))`, COMPACTED=null
113
+ - Compaction detected (TOK_END < TOK_START): `TOKENS=$(((TOK_MAX-TOK_START)+TOK_END))`, COMPACTED=$DT_END
114
+ Append to `.gsd-t/token-log.md` (create with header `| Datetime-start | Datetime-end | Command | Step | Model | Duration(s) | Notes | Tokens | Compacted |` if missing):
115
+ `| {DT_START} | {DT_END} | gsd-t-brainstorm | Step 3 | sonnet | {DURATION}s | team brainstorm: {topic summary} | {TOKENS} | {COMPACTED} |`
116
+
104
117
  ## Step 4: Capture the Sparks
105
118
 
106
119
  As ideas emerge, maintain a running list. Don't over-organize — just capture:
@@ -7,6 +7,11 @@ You are debugging an issue in a contract-driven project. Your approach should id
7
7
  To give this debug session a fresh context window and prevent compaction, always execute via a Task subagent.
8
8
 
9
9
  **If you are the orchestrating agent** (you received the slash command directly):
10
+
11
+ **OBSERVABILITY LOGGING (MANDATORY):**
12
+ Before spawning — run via Bash:
13
+ `T_START=$(date +%s) && DT_START=$(date +"%Y-%m-%d %H:%M") && TOK_START=${CLAUDE_CONTEXT_TOKENS_USED:-0} && TOK_MAX=${CLAUDE_CONTEXT_TOKENS_MAX:-200000}`
14
+
10
15
  Spawn a fresh subagent using the Task tool:
11
16
  ```
12
17
  subagent_type: general-purpose
@@ -14,7 +19,16 @@ prompt: "You are running gsd-t-debug for this issue: {$ARGUMENTS}
14
19
  Working directory: {current project root}
15
20
  Read CLAUDE.md and .gsd-t/progress.md for project context, then execute gsd-t-debug starting at Step 1."
16
21
  ```
17
- Wait for the subagent to complete. Relay its summary to the user. **Do not execute Steps 1–5 yourself.**
22
+
23
+ After subagent returns — run via Bash:
24
+ `T_END=$(date +%s) && DT_END=$(date +"%Y-%m-%d %H:%M") && TOK_END=${CLAUDE_CONTEXT_TOKENS_USED:-0} && DURATION=$((T_END-T_START))`
25
+ Compute tokens and compaction:
26
+ - No compaction (TOK_END >= TOK_START): `TOKENS=$((TOK_END-TOK_START))`, COMPACTED=null
27
+ - Compaction detected (TOK_END < TOK_START): `TOKENS=$(((TOK_MAX-TOK_START)+TOK_END))`, COMPACTED=$DT_END
28
+ Append to `.gsd-t/token-log.md` (create with header `| Datetime-start | Datetime-end | Command | Step | Model | Duration(s) | Notes | Tokens | Compacted |` if missing):
29
+ `| {DT_START} | {DT_END} | gsd-t-debug | Step 0 | sonnet | {DURATION}s | debug: {issue summary} | {TOKENS} | {COMPACTED} |`
30
+
31
+ Relay the subagent's summary to the user. **Do not execute Steps 1–5 yourself.**
18
32
 
19
33
  **If you are the spawned subagent** (your prompt says "starting at Step 1"):
20
34
  Continue to Step 1 below.
@@ -51,6 +51,10 @@ Work through each open question systematically:
51
51
  ### Team Mode (when agent teams are enabled):
52
52
  If the user requests team exploration or there are 3+ complex open questions:
53
53
 
54
+ **OBSERVABILITY LOGGING (MANDATORY):**
55
+ Before spawning the team — run via Bash:
56
+ `T_START=$(date +%s) && DT_START=$(date +"%Y-%m-%d %H:%M") && TOK_START=${CLAUDE_CONTEXT_TOKENS_USED:-0} && TOK_MAX=${CLAUDE_CONTEXT_TOKENS_MAX:-200000}`
57
+
54
58
  ```
55
59
  Create an agent team:
56
60
 
@@ -61,12 +65,20 @@ ALL TEAMMATES read first:
61
65
 
62
66
  Assign each teammate a distinct perspective:
63
67
  - Teammate 1: Advocate for approach A — build strongest case
64
- - Teammate 2: Advocate for approach B — build strongest case
68
+ - Teammate 2: Advocate for approach B — build strongest case
65
69
  - Teammate 3: Critic — find weaknesses in both, identify risks
66
70
 
67
71
  Lead: Synthesize into decisions and update contracts.
68
72
  ```
69
73
 
74
+ After team completes — run via Bash:
75
+ `T_END=$(date +%s) && DT_END=$(date +"%Y-%m-%d %H:%M") && TOK_END=${CLAUDE_CONTEXT_TOKENS_USED:-0} && DURATION=$((T_END-T_START))`
76
+ Compute tokens and compaction:
77
+ - No compaction (TOK_END >= TOK_START): `TOKENS=$((TOK_END-TOK_START))`, COMPACTED=null
78
+ - Compaction detected (TOK_END < TOK_START): `TOKENS=$(((TOK_MAX-TOK_START)+TOK_END))`, COMPACTED=$DT_END
79
+ Append to `.gsd-t/token-log.md` (create with header `| Datetime-start | Datetime-end | Command | Step | Model | Duration(s) | Notes | Tokens | Compacted |` if missing):
80
+ `| {DT_START} | {DT_END} | gsd-t-discuss | Step 3 | sonnet | {DURATION}s | team discuss: {topic summary} | {TOKENS} | {COMPACTED} |`
81
+
70
82
  Assign teammates based on the nature of the questions:
71
83
  - **Technical choice** (e.g., which database): one advocate per option + critic
72
84
  - **Architecture pattern** (e.g., monolith vs microservice): one advocate per pattern + someone evaluating migration path
@@ -32,12 +32,17 @@ Report: test pass/fail status and any coverage gaps found."
32
32
  ```
33
33
 
34
34
  **OBSERVABILITY LOGGING (MANDATORY):**
35
- Before spawning: run `date +%s` via Bash → save as START
36
- After subagent returns: run `date +%s` compute `DURATION=$((END-START))`
37
- Append to `.gsd-t/token-log.md` (create with header `| Date | Command | Step | Model | Duration(s) | Notes |` if missing):
38
- `| {YYYY-MM-DD HH:MM} | gsd-t-execute | Step 2 | haiku | {DURATION}s | task: {task-name}, {pass/fail} |`
35
+ Before spawning run via Bash:
36
+ `T_START=$(date +%s) && DT_START=$(date +"%Y-%m-%d %H:%M") && TOK_START=${CLAUDE_CONTEXT_TOKENS_USED:-0} && TOK_MAX=${CLAUDE_CONTEXT_TOKENS_MAX:-200000}`
37
+ After subagent returns run via Bash:
38
+ `T_END=$(date +%s) && DT_END=$(date +"%Y-%m-%d %H:%M") && TOK_END=${CLAUDE_CONTEXT_TOKENS_USED:-0} && DURATION=$((T_END-T_START))`
39
+ Compute tokens and compaction:
40
+ - No compaction (TOK_END >= TOK_START): `TOKENS=$((TOK_END-TOK_START))`, COMPACTED=null
41
+ - Compaction detected (TOK_END < TOK_START): `TOKENS=$(((TOK_MAX-TOK_START)+TOK_END))`, COMPACTED=$DT_END
42
+ Append to `.gsd-t/token-log.md` (create with header `| Datetime-start | Datetime-end | Command | Step | Model | Duration(s) | Notes | Tokens | Compacted |` if missing):
43
+ `| {DT_START} | {DT_END} | gsd-t-execute | Step 2 | haiku | {DURATION}s | task: {task-name}, {pass/fail} | {TOKENS} | {COMPACTED} |`
39
44
  If QA found issues, append each to `.gsd-t/qa-issues.md` (create with header `| Date | Command | Step | Model | Duration(s) | Severity | Finding |` if missing):
40
- `| {YYYY-MM-DD HH:MM} | gsd-t-execute | Step 2 | haiku | {DURATION}s | {severity} | {finding} |`
45
+ `| {DT_START} | gsd-t-execute | Step 2 | haiku | {DURATION}s | {severity} | {finding} |`
41
46
 
42
47
  QA failure on any task blocks proceeding to the next task.
43
48
 
@@ -101,12 +101,17 @@ Report: boundary-by-boundary test results with pass/fail counts."
101
101
  ```
102
102
 
103
103
  **OBSERVABILITY LOGGING (MANDATORY):**
104
- Before spawning: run `date +%s` via Bash → save as START
105
- After subagent returns: run `date +%s` compute `DURATION=$((END-START))`
106
- Append to `.gsd-t/token-log.md` (create with header `| Date | Command | Step | Model | Duration(s) | Notes |` if missing):
107
- `| {YYYY-MM-DD HH:MM} | gsd-t-integrate | Step 5 | haiku | {DURATION}s | {pass/fail}, {N} boundaries tested |`
104
+ Before spawning run via Bash:
105
+ `T_START=$(date +%s) && DT_START=$(date +"%Y-%m-%d %H:%M") && TOK_START=${CLAUDE_CONTEXT_TOKENS_USED:-0} && TOK_MAX=${CLAUDE_CONTEXT_TOKENS_MAX:-200000}`
106
+ After subagent returns run via Bash:
107
+ `T_END=$(date +%s) && DT_END=$(date +"%Y-%m-%d %H:%M") && TOK_END=${CLAUDE_CONTEXT_TOKENS_USED:-0} && DURATION=$((T_END-T_START))`
108
+ Compute tokens and compaction:
109
+ - No compaction (TOK_END >= TOK_START): `TOKENS=$((TOK_END-TOK_START))`, COMPACTED=null
110
+ - Compaction detected (TOK_END < TOK_START): `TOKENS=$(((TOK_MAX-TOK_START)+TOK_END))`, COMPACTED=$DT_END
111
+ Append to `.gsd-t/token-log.md` (create with header `| Datetime-start | Datetime-end | Command | Step | Model | Duration(s) | Notes | Tokens | Compacted |` if missing):
112
+ `| {DT_START} | {DT_END} | gsd-t-integrate | Step 5 | haiku | {DURATION}s | {pass/fail}, {N} boundaries tested | {TOKENS} | {COMPACTED} |`
108
113
  If QA found issues, append each to `.gsd-t/qa-issues.md` (create with header `| Date | Command | Step | Model | Duration(s) | Severity | Finding |` if missing):
109
- `| {YYYY-MM-DD HH:MM} | gsd-t-integrate | Step 5 | haiku | {DURATION}s | {severity} | {finding} |`
114
+ `| {DT_START} | gsd-t-integrate | Step 5 | haiku | {DURATION}s | {severity} | {finding} |`
110
115
 
111
116
  QA failure blocks integration completion.
112
117
 
@@ -192,12 +192,17 @@ Report: PASS (all checks pass) or FAIL with specific gaps listed."
192
192
  ```
193
193
 
194
194
  **OBSERVABILITY LOGGING (MANDATORY):**
195
- Before spawning: run `date +%s` via Bash → save as START
196
- After subagent returns: run `date +%s` compute `DURATION=$((END-START))`
197
- Append to `.gsd-t/token-log.md` (create with header `| Date | Command | Step | Model | Duration(s) | Notes |` if missing):
198
- `| {YYYY-MM-DD HH:MM} | gsd-t-plan | Step 7 | haiku | {DURATION}s | {PASS/FAIL}, iteration {N} |`
195
+ Before spawning run via Bash:
196
+ `T_START=$(date +%s) && DT_START=$(date +"%Y-%m-%d %H:%M") && TOK_START=${CLAUDE_CONTEXT_TOKENS_USED:-0} && TOK_MAX=${CLAUDE_CONTEXT_TOKENS_MAX:-200000}`
197
+ After subagent returns run via Bash:
198
+ `T_END=$(date +%s) && DT_END=$(date +"%Y-%m-%d %H:%M") && TOK_END=${CLAUDE_CONTEXT_TOKENS_USED:-0} && DURATION=$((T_END-T_START))`
199
+ Compute tokens and compaction:
200
+ - No compaction (TOK_END >= TOK_START): `TOKENS=$((TOK_END-TOK_START))`, COMPACTED=null
201
+ - Compaction detected (TOK_END < TOK_START): `TOKENS=$(((TOK_MAX-TOK_START)+TOK_END))`, COMPACTED=$DT_END
202
+ Append to `.gsd-t/token-log.md` (create with header `| Datetime-start | Datetime-end | Command | Step | Model | Duration(s) | Notes | Tokens | Compacted |` if missing):
203
+ `| {DT_START} | {DT_END} | gsd-t-plan | Step 7 | haiku | {DURATION}s | {PASS/FAIL}, iteration {N} | {TOKENS} | {COMPACTED} |`
199
204
  If validation FAIL, append each gap to `.gsd-t/qa-issues.md` (create with header `| Date | Command | Step | Model | Duration(s) | Severity | Finding |` if missing):
200
- `| {YYYY-MM-DD HH:MM} | gsd-t-plan | Step 7 | haiku | {DURATION}s | medium | {gap description} |`
205
+ `| {DT_START} | gsd-t-plan | Step 7 | haiku | {DURATION}s | medium | {gap description} |`
201
206
 
202
207
  **If FAIL**: Fix the identified gaps (up to 3 iterations). If still failing after 3 iterations, STOP and report to user with the specific gaps. Plan cannot proceed until validation PASSES.
203
208
 
@@ -7,6 +7,11 @@ You are executing a small, focused task that doesn't need full phase planning. T
7
7
  To give this task a fresh context window and prevent compaction during consecutive quick runs, always execute via a Task subagent.
8
8
 
9
9
  **If you are the orchestrating agent** (you received the slash command directly):
10
+
11
+ **OBSERVABILITY LOGGING (MANDATORY):**
12
+ Before spawning — run via Bash:
13
+ `T_START=$(date +%s) && DT_START=$(date +"%Y-%m-%d %H:%M") && TOK_START=${CLAUDE_CONTEXT_TOKENS_USED:-0} && TOK_MAX=${CLAUDE_CONTEXT_TOKENS_MAX:-200000}`
14
+
10
15
  Spawn a fresh subagent using the Task tool:
11
16
  ```
12
17
  subagent_type: general-purpose
@@ -14,7 +19,16 @@ prompt: "You are running gsd-t-quick for this request: {$ARGUMENTS}
14
19
  Working directory: {current project root}
15
20
  Read CLAUDE.md and .gsd-t/progress.md for project context, then execute gsd-t-quick starting at Step 1."
16
21
  ```
17
- Wait for the subagent to complete. Relay its summary to the user. **Do not execute Steps 1–5 yourself.**
22
+
23
+ After subagent returns — run via Bash:
24
+ `T_END=$(date +%s) && DT_END=$(date +"%Y-%m-%d %H:%M") && TOK_END=${CLAUDE_CONTEXT_TOKENS_USED:-0} && DURATION=$((T_END-T_START))`
25
+ Compute tokens and compaction:
26
+ - No compaction (TOK_END >= TOK_START): `TOKENS=$((TOK_END-TOK_START))`, COMPACTED=null
27
+ - Compaction detected (TOK_END < TOK_START): `TOKENS=$(((TOK_MAX-TOK_START)+TOK_END))`, COMPACTED=$DT_END
28
+ Append to `.gsd-t/token-log.md` (create with header `| Datetime-start | Datetime-end | Command | Step | Model | Duration(s) | Notes | Tokens | Compacted |` if missing):
29
+ `| {DT_START} | {DT_END} | gsd-t-quick | Step 0 | sonnet | {DURATION}s | quick: {task summary} | {TOKENS} | {COMPACTED} |`
30
+
31
+ Relay the subagent's summary to the user. **Do not execute Steps 1–5 yourself.**
18
32
 
19
33
  **If you are the spawned subagent** (your prompt says "starting at Step 1"):
20
34
  Continue to Step 1 below.
@@ -106,7 +106,19 @@ Teammate assignments:
106
106
  - Secret/credential handling
107
107
  Report: severity-ranked findings.
108
108
 
109
- Lead: After receiving teammate reports, spawn a Task subagent to run the full test suite and contract audit. Collect all reports, synthesize, create remediation plan.
109
+ Lead: After receiving teammate reports:
110
+ **OBSERVABILITY LOGGING (MANDATORY):**
111
+ Before spawning — run via Bash:
112
+ `T_START=$(date +%s) && DT_START=$(date +"%Y-%m-%d %H:%M") && TOK_START=${CLAUDE_CONTEXT_TOKENS_USED:-0} && TOK_MAX=${CLAUDE_CONTEXT_TOKENS_MAX:-200000}`
113
+ Spawn a Task subagent to run the full test suite and contract audit.
114
+ After subagent returns — run via Bash:
115
+ `T_END=$(date +%s) && DT_END=$(date +"%Y-%m-%d %H:%M") && TOK_END=${CLAUDE_CONTEXT_TOKENS_USED:-0} && DURATION=$((T_END-T_START))`
116
+ Compute tokens and compaction:
117
+ - No compaction (TOK_END >= TOK_START): `TOKENS=$((TOK_END-TOK_START))`, COMPACTED=null
118
+ - Compaction detected (TOK_END < TOK_START): `TOKENS=$(((TOK_MAX-TOK_START)+TOK_END))`, COMPACTED=$DT_END
119
+ Append to `.gsd-t/token-log.md` (create with header `| Datetime-start | Datetime-end | Command | Step | Model | Duration(s) | Notes | Tokens | Compacted |` if missing):
120
+ `| {DT_START} | {DT_END} | gsd-t-verify | Step 4 | haiku | {DURATION}s | test audit + contract review | {TOKENS} | {COMPACTED} |`
121
+ Collect all reports, synthesize, create remediation plan.
110
122
  ```
111
123
 
112
124
  ## Step 5: Compile Verification Report
@@ -47,6 +47,10 @@ For each remaining phase, spawn an **independent agent** using the Task tool. Ea
47
47
 
48
48
  For each phase, spawn the agent like this:
49
49
 
50
+ **OBSERVABILITY LOGGING (MANDATORY) — repeat for every phase spawn:**
51
+ Before spawning — run via Bash:
52
+ `T_START=$(date +%s) && DT_START=$(date +"%Y-%m-%d %H:%M") && TOK_START=${CLAUDE_CONTEXT_TOKENS_USED:-0} && TOK_MAX=${CLAUDE_CONTEXT_TOKENS_MAX:-200000}`
53
+
50
54
  ```
51
55
  Task agent (subagent_type: "general-purpose", mode: "bypassPermissions"):
52
56
  "Execute the {PHASE} phase of the current GSD-T milestone.
@@ -65,6 +69,14 @@ Task agent (subagent_type: "general-purpose", mode: "bypassPermissions"):
65
69
  Report back: one-line status summary."
66
70
  ```
67
71
 
72
+ After phase agent returns — run via Bash:
73
+ `T_END=$(date +%s) && DT_END=$(date +"%Y-%m-%d %H:%M") && TOK_END=${CLAUDE_CONTEXT_TOKENS_USED:-0} && DURATION=$((T_END-T_START))`
74
+ Compute tokens and compaction:
75
+ - No compaction (TOK_END >= TOK_START): `TOKENS=$((TOK_END-TOK_START))`, COMPACTED=null
76
+ - Compaction detected (TOK_END < TOK_START): `TOKENS=$(((TOK_MAX-TOK_START)+TOK_END))`, COMPACTED=$DT_END
77
+ Append to `.gsd-t/token-log.md` (create with header `| Datetime-start | Datetime-end | Command | Step | Model | Duration(s) | Notes | Tokens | Compacted |` if missing):
78
+ `| {DT_START} | {DT_END} | gsd-t-wave | {PHASE} | sonnet | {DURATION}s | phase: {PHASE} | {TOKENS} | {COMPACTED} |`
79
+
68
80
  ### Phase Sequence
69
81
 
70
82
  Execute phases in this order, spawning one agent per phase:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekyzinc/gsd-t",
3
- "version": "2.28.12",
3
+ "version": "2.28.14",
4
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",
@@ -93,8 +93,8 @@ function cleanupOldHeartbeats(gsdtDir) {
93
93
  const EVENT_HANDLERS = {
94
94
  SessionStart: (h) => ({ evt: "session_start", data: { source: h.source, model: h.model } }),
95
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 } }),
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, tokens: process.env.CLAUDE_CONTEXT_TOKENS_USED ? parseInt(process.env.CLAUDE_CONTEXT_TOKENS_USED, 10) : null } }),
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, tokens: process.env.CLAUDE_CONTEXT_TOKENS_USED ? parseInt(process.env.CLAUDE_CONTEXT_TOKENS_USED, 10) : null } }),
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) } }),