@dtlabs/ai-toolkit 0.1.6 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/define-feature.md +1 -0
- package/.claude/agents/dependency-injection-refactoring.md +1 -0
- package/.claude/agents/dependency-supply-chain-security.md +1 -0
- package/.claude/agents/developer-backend.md +1 -0
- package/.claude/agents/developer-frontend.md +1 -0
- package/.claude/agents/developer-testing.md +1 -0
- package/.claude/agents/domain-model-refactoring.md +1 -0
- package/.claude/agents/god-class-decomposition.md +1 -0
- package/.claude/agents/init-agents-md.md +1 -0
- package/.claude/agents/install-toolkit.md +134 -3
- package/.claude/agents/intervention-documentation-standard.md +1 -0
- package/.claude/agents/review-solution.md +1 -0
- package/.claude/agents/security-hardening.md +1 -0
- package/.claude/commands/check-interventions.md +152 -0
- package/.claude/commands/next-intervention.md +113 -0
- package/.claude/settings.json +5 -0
- package/.claude/skills/assess-codebase/SKILL.md +139 -60
- package/.claude/skills/implement-feature/SKILL.md +208 -26
- package/.claude/workflows/am-phase1.js +304 -0
- package/.claude/workflows/am-phase2.js +166 -0
- package/.claude/workflows/pm-phase1.js +163 -0
- package/.claude/workflows/pm-phase2.js +108 -0
- package/.claude/workflows/pm-phase3.js +309 -0
- package/CHANGELOG.md +101 -3
- package/CLAUDE.md +34 -0
- package/README.md +26 -0
- package/bin/cli.js +64 -5
- package/docs/token-optimization-backlog.md +115 -0
- package/docs/token-optimization.md +274 -0
- package/package.json +1 -1
- package/.claude/agents/assessment-manager.md +0 -416
- package/.claude/agents/project-manager.md +0 -309
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
export const meta = {
|
|
2
|
+
name: 'pm-phase2',
|
|
3
|
+
description: 'Feature delivery phase 2: generate-work-breakdown → Effort-Estimate → gate2_payload. Precondition: Gate 1 approved.',
|
|
4
|
+
phases: [
|
|
5
|
+
{ title: 'Work Breakdown', detail: 'Run generate-work-breakdown' },
|
|
6
|
+
{ title: 'Effort Estimate', detail: 'Parse WB metrics, write Effort-Estimate.md' },
|
|
7
|
+
],
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// args: "<path-to-feature.md>"
|
|
11
|
+
const featurePath = (typeof args === 'string' ? args : '').trim().split(/\s+/)[0]
|
|
12
|
+
|
|
13
|
+
// ── generate-work-breakdown ───────────────────────────────────────────────────
|
|
14
|
+
phase('Work Breakdown')
|
|
15
|
+
|
|
16
|
+
const tokenLedger = []
|
|
17
|
+
|
|
18
|
+
log(`Running generate-work-breakdown for ${featurePath}`)
|
|
19
|
+
const beforeWB = budget.spent()
|
|
20
|
+
await agent(featurePath, {
|
|
21
|
+
agentType: 'generate-work-breakdown',
|
|
22
|
+
label: 'generate-work-breakdown',
|
|
23
|
+
phase: 'Work Breakdown',
|
|
24
|
+
})
|
|
25
|
+
const wbTokens = budget.spent() - beforeWB
|
|
26
|
+
tokenLedger.push({ agent: 'generate-work-breakdown', model: 'haiku', phase_delta_tokens: wbTokens })
|
|
27
|
+
log(`generate-work-breakdown done — phase delta: ${wbTokens} tokens`)
|
|
28
|
+
|
|
29
|
+
// ── Parse WB + write Effort-Estimate ─────────────────────────────────────────
|
|
30
|
+
phase('Effort Estimate')
|
|
31
|
+
|
|
32
|
+
const PARSE_SCHEMA = {
|
|
33
|
+
type: 'object',
|
|
34
|
+
properties: {
|
|
35
|
+
prefix: { type: 'string' },
|
|
36
|
+
feature_dir: { type: 'string' },
|
|
37
|
+
user_stories: { type: 'number' },
|
|
38
|
+
total_tasks: { type: 'number' },
|
|
39
|
+
domain_breakdown: { type: 'string' },
|
|
40
|
+
implementation_phases: { type: 'number' },
|
|
41
|
+
human_estimate: { type: 'string' },
|
|
42
|
+
agent_estimate: { type: 'string' },
|
|
43
|
+
work_breakdown_path: { type: 'string' },
|
|
44
|
+
effort_estimate_path: { type: 'string' },
|
|
45
|
+
},
|
|
46
|
+
required: ['prefix', 'user_stories', 'total_tasks', 'work_breakdown_path'],
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const metrics = await agent(
|
|
50
|
+
`You have two tasks:
|
|
51
|
+
|
|
52
|
+
TASK 1 — Read the Work Breakdown file.
|
|
53
|
+
The feature.md is at: ${featurePath}
|
|
54
|
+
The directory containing feature.md also contains the Work Breakdown file named {PREFIX}-Work-Breakdown.md,
|
|
55
|
+
where PREFIX matches the pattern [A-Z]+-[0-9]+ from the directory name (e.g. FTR-009).
|
|
56
|
+
Use Glob or Read to find and read that file.
|
|
57
|
+
|
|
58
|
+
Extract from the Summary table:
|
|
59
|
+
- prefix (e.g. "FTR-009")
|
|
60
|
+
- feature_dir (directory containing feature.md)
|
|
61
|
+
- user_stories (integer)
|
|
62
|
+
- total_tasks (integer)
|
|
63
|
+
- domain_breakdown (e.g. "DB:0, BE:11, FE:0, INFRA:4, TEST:0")
|
|
64
|
+
- implementation_phases (integer)
|
|
65
|
+
- human_estimate (e.g. "~34h")
|
|
66
|
+
- agent_estimate (e.g. "~2h 6min")
|
|
67
|
+
- work_breakdown_path (full path to the Work Breakdown file)
|
|
68
|
+
|
|
69
|
+
TASK 2 — Write the Effort-Estimate.md file.
|
|
70
|
+
Write {feature_dir}/{PREFIX}-Effort-Estimate.md with the extracted metrics in this format:
|
|
71
|
+
|
|
72
|
+
# Effort Estimate — {PREFIX} — {Feature Title}
|
|
73
|
+
|
|
74
|
+
| Metric | Value |
|
|
75
|
+
|--------|-------|
|
|
76
|
+
| User Stories | {user_stories} |
|
|
77
|
+
| Total tasks | {total_tasks} ({domain_breakdown}) |
|
|
78
|
+
| Implementation phases | {implementation_phases} |
|
|
79
|
+
| Human estimate | {human_estimate} (sequential, no parallelism) |
|
|
80
|
+
| Agent estimate | {agent_estimate} (parallel dispatch, critical path only) |
|
|
81
|
+
|
|
82
|
+
Set effort_estimate_path to the full path of the written file.
|
|
83
|
+
|
|
84
|
+
Return the extracted metrics as structured output.`,
|
|
85
|
+
{
|
|
86
|
+
label: 'parse-wb-write-effort-estimate',
|
|
87
|
+
phase: 'Effort Estimate',
|
|
88
|
+
schema: PARSE_SCHEMA,
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
log(`WB parsed: ${metrics.user_stories} US, ${metrics.total_tasks} tasks, ${metrics.implementation_phases} phases`)
|
|
93
|
+
log(`Effort-Estimate written: ${metrics.effort_estimate_path}`)
|
|
94
|
+
|
|
95
|
+
return {
|
|
96
|
+
prefix: metrics.prefix,
|
|
97
|
+
feature_path: featurePath,
|
|
98
|
+
user_stories: metrics.user_stories,
|
|
99
|
+
total_tasks: metrics.total_tasks,
|
|
100
|
+
domain_breakdown: metrics.domain_breakdown || 'N/A',
|
|
101
|
+
implementation_phases: metrics.implementation_phases,
|
|
102
|
+
human_estimate: metrics.human_estimate || 'N/A',
|
|
103
|
+
agent_estimate: metrics.agent_estimate || 'N/A',
|
|
104
|
+
work_breakdown_path: metrics.work_breakdown_path,
|
|
105
|
+
effort_estimate_path: metrics.effort_estimate_path || '',
|
|
106
|
+
token_ledger: tokenLedger,
|
|
107
|
+
errors: [],
|
|
108
|
+
}
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
export const meta = {
|
|
2
|
+
name: 'pm-phase3',
|
|
3
|
+
description: 'Feature delivery phase 3: implementation loop (developer agents + review-solution per US, max 2 rework cycles, git commit per US) → remediation → PR → Feature Registry → Token-Estimate actuals → Effort-Estimate actuals.',
|
|
4
|
+
phases: [
|
|
5
|
+
{ title: 'Implementation', detail: 'Dispatch developer agents per work breakdown, review per US' },
|
|
6
|
+
{ title: 'Remediation', detail: 'Fix OPEN issues from Issues Register' },
|
|
7
|
+
{ title: 'PR', detail: 'Push branch, create PR, update registry' },
|
|
8
|
+
{ title: 'Actuals', detail: 'Write Token-Estimate and Effort-Estimate actuals' },
|
|
9
|
+
],
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// args: "<path-to-feature.md> --branch feature/FTR-NNN-slug"
|
|
13
|
+
const argStr = typeof args === 'string' ? args : ''
|
|
14
|
+
const featurePath = argStr.trim().split(/\s+/)[0]
|
|
15
|
+
const branchMatch = argStr.match(/--branch\s+(\S+)/)
|
|
16
|
+
const branch = branchMatch ? branchMatch[1] : null
|
|
17
|
+
|
|
18
|
+
// ── Implementation ────────────────────────────────────────────────────────────
|
|
19
|
+
phase('Implementation')
|
|
20
|
+
|
|
21
|
+
log(`Starting implementation for ${featurePath}${branch ? ` on branch ${branch}` : ''}`)
|
|
22
|
+
|
|
23
|
+
const tokenLedger = []
|
|
24
|
+
const escalations = []
|
|
25
|
+
|
|
26
|
+
// Read the Work Breakdown and execute implementation
|
|
27
|
+
// A single orchestration agent handles the full implementation loop:
|
|
28
|
+
// parse WB → per-phase dispatch → review per US → rework (max 2 cycles) → commit per US
|
|
29
|
+
// It uses sub-tool calls (Read, Bash, etc.) to do git work and reads the WB itself.
|
|
30
|
+
// It does NOT spawn further subagents — it reads files and calls Bash for git commands.
|
|
31
|
+
|
|
32
|
+
const IMPL_SCHEMA = {
|
|
33
|
+
type: 'object',
|
|
34
|
+
properties: {
|
|
35
|
+
prefix: { type: 'string' },
|
|
36
|
+
phases_done: { type: 'number' },
|
|
37
|
+
us_passed: { type: 'array', items: { type: 'string' } },
|
|
38
|
+
us_escalated: { type: 'array', items: { type: 'string' } },
|
|
39
|
+
issues_path: { type: 'string' },
|
|
40
|
+
issues_open: { type: 'number' },
|
|
41
|
+
},
|
|
42
|
+
required: ['prefix', 'phases_done'],
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const beforeImpl = budget.spent()
|
|
46
|
+
|
|
47
|
+
const implResult = await agent(
|
|
48
|
+
`You are the implementation orchestrator for the feature delivery pipeline.
|
|
49
|
+
|
|
50
|
+
Feature path: ${featurePath}
|
|
51
|
+
Branch: ${branch || '(already checked out)'}
|
|
52
|
+
|
|
53
|
+
Your job:
|
|
54
|
+
|
|
55
|
+
1. Read {PREFIX}-Work-Breakdown.md (same directory as feature.md).
|
|
56
|
+
Extract all phases, tasks, domains, and User Story groupings from Section 4.
|
|
57
|
+
|
|
58
|
+
2. For each phase in order:
|
|
59
|
+
a. Identify tasks grouped by User Story (US-XX) or INFRA.
|
|
60
|
+
b. For each group, spawn the correct developer agent:
|
|
61
|
+
- DB/BE/INFRA tasks → subagent_type: developer-backend
|
|
62
|
+
- FE tasks → subagent_type: developer-frontend
|
|
63
|
+
- TEST tasks → subagent_type: developer-testing
|
|
64
|
+
Prompt: "${featurePath} <comma-separated task IDs>"
|
|
65
|
+
Independent groups within a phase can be dispatched in parallel (multiple Agent calls in same response).
|
|
66
|
+
c. When ALL tasks for a User Story are done → spawn review-solution:
|
|
67
|
+
subagent_type: review-solution, prompt: "${featurePath} --scope <US-ID>"
|
|
68
|
+
- PASS (no CRITICAL): git add -A && git commit -m "feat({PREFIX}): implement {US-ID} — {title}"
|
|
69
|
+
Log WARNING/INFO findings to {PREFIX}-Issues.md.
|
|
70
|
+
- FAIL (CRITICAL): rework — re-dispatch the developer agent with the review findings appended to the prompt.
|
|
71
|
+
Max 2 rework cycles. After 2 failed cycles → escalate (add to escalations list).
|
|
72
|
+
INFRA tasks: reviewed as a group, commit: "feat({PREFIX}): implement shared infrastructure (INFRA)"
|
|
73
|
+
|
|
74
|
+
3. After all phases complete:
|
|
75
|
+
- Read {PREFIX}-Issues.md if it exists. Count OPEN items.
|
|
76
|
+
- Report: prefix, phases_done, us_passed (list of US IDs that passed), us_escalated (list that escalated), issues_path, issues_open.
|
|
77
|
+
|
|
78
|
+
IMPORTANT RULES:
|
|
79
|
+
- Never use run_in_background: true when spawning agents.
|
|
80
|
+
- Track escalations: if a US fails review after 2 rework cycles, add its ID to us_escalated and continue.
|
|
81
|
+
- Partial failures are acceptable — continue with remaining phases.
|
|
82
|
+
- All git commands via Bash tool.
|
|
83
|
+
- Commit message format: feat({PREFIX}): implement {US-ID} — {US title}`,
|
|
84
|
+
{
|
|
85
|
+
label: 'implementation-orchestrator',
|
|
86
|
+
phase: 'Implementation',
|
|
87
|
+
schema: IMPL_SCHEMA,
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
const implTokens = budget.spent() - beforeImpl
|
|
92
|
+
tokenLedger.push({ agent: 'implementation-orchestrator', model: 'sonnet', phase_delta_tokens: implTokens })
|
|
93
|
+
log(`Implementation done — ${implResult.phases_done} phases, ${(implResult.us_passed || []).length} US passed, ${(implResult.us_escalated || []).length} escalated`)
|
|
94
|
+
log(`Phase delta: ${implTokens} tokens`)
|
|
95
|
+
|
|
96
|
+
if (implResult.us_escalated?.length) {
|
|
97
|
+
for (const usId of implResult.us_escalated) {
|
|
98
|
+
escalations.push({ usId, reason: 'CRITICAL review finding unresolved after 2 rework cycles' })
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const prefix = implResult.prefix
|
|
103
|
+
const issuesPath = implResult.issues_path || ''
|
|
104
|
+
|
|
105
|
+
// ── Remediation ───────────────────────────────────────────────────────────────
|
|
106
|
+
phase('Remediation')
|
|
107
|
+
|
|
108
|
+
const REM_SCHEMA = {
|
|
109
|
+
type: 'object',
|
|
110
|
+
properties: {
|
|
111
|
+
issues_fixed: { type: 'number' },
|
|
112
|
+
issues_deferred: { type: 'number' },
|
|
113
|
+
},
|
|
114
|
+
required: ['issues_fixed', 'issues_deferred'],
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
let issuesFixed = 0
|
|
118
|
+
let issuesDeferred = 0
|
|
119
|
+
|
|
120
|
+
if (implResult.issues_open > 0 && issuesPath) {
|
|
121
|
+
log(`Remediation: ${implResult.issues_open} OPEN issues`)
|
|
122
|
+
const beforeRem = budget.spent()
|
|
123
|
+
|
|
124
|
+
const remResult = await agent(
|
|
125
|
+
`You are a remediation agent for the feature delivery pipeline.
|
|
126
|
+
|
|
127
|
+
Read the Issues Register at: ${issuesPath}
|
|
128
|
+
|
|
129
|
+
For each OPEN issue:
|
|
130
|
+
- If severity is INFO: mark it DEFERRED immediately (update the Status column to DEFERRED). Do not dispatch a developer agent.
|
|
131
|
+
- If severity is WARNING: dispatch the appropriate developer agent (developer-backend for most cases) with the issue description. Then spawn review-solution to verify the fix. Max 1 retry per issue. If unresolved after 1 retry, mark DEFERRED.
|
|
132
|
+
|
|
133
|
+
After processing all issues, return:
|
|
134
|
+
{ "issues_fixed": N, "issues_deferred": N }
|
|
135
|
+
|
|
136
|
+
Update the Issues Register Status column in place for each resolved/deferred issue.`,
|
|
137
|
+
{
|
|
138
|
+
label: 'remediation',
|
|
139
|
+
phase: 'Remediation',
|
|
140
|
+
schema: REM_SCHEMA,
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
const remTokens = budget.spent() - beforeRem
|
|
145
|
+
tokenLedger.push({ agent: 'remediation', model: 'sonnet', phase_delta_tokens: remTokens })
|
|
146
|
+
issuesFixed = remResult.issues_fixed || 0
|
|
147
|
+
issuesDeferred = remResult.issues_deferred || 0
|
|
148
|
+
log(`Remediation done — fixed: ${issuesFixed}, deferred: ${issuesDeferred} | phase delta: ${remTokens} tokens`)
|
|
149
|
+
} else {
|
|
150
|
+
log('Remediation: no OPEN issues — skipped')
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// ── PR ────────────────────────────────────────────────────────────────────────
|
|
154
|
+
phase('PR')
|
|
155
|
+
|
|
156
|
+
const PR_SCHEMA = {
|
|
157
|
+
type: 'object',
|
|
158
|
+
properties: {
|
|
159
|
+
pr_url: { type: 'string' },
|
|
160
|
+
registry_updated: { type: 'boolean' },
|
|
161
|
+
},
|
|
162
|
+
required: ['pr_url'],
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const beforePR = budget.spent()
|
|
166
|
+
|
|
167
|
+
const prResult = await agent(
|
|
168
|
+
`You are the PR and registry agent for the feature delivery pipeline.
|
|
169
|
+
|
|
170
|
+
Feature path: ${featurePath}
|
|
171
|
+
Branch: ${branch || 'current branch'}
|
|
172
|
+
Prefix: ${prefix}
|
|
173
|
+
Issues fixed: ${issuesFixed}, deferred: ${issuesDeferred}
|
|
174
|
+
|
|
175
|
+
Your tasks:
|
|
176
|
+
|
|
177
|
+
1. If there are remediation fixes, commit them:
|
|
178
|
+
git add -A
|
|
179
|
+
git commit -m "fix(${prefix}): remediate review issues"
|
|
180
|
+
|
|
181
|
+
2. Push the branch:
|
|
182
|
+
git push -u origin ${branch || 'HEAD'}
|
|
183
|
+
|
|
184
|
+
3. Create a PR targeting develop:
|
|
185
|
+
gh pr create \\
|
|
186
|
+
--title "feat(${prefix}): <Feature Title from feature.md>" \\
|
|
187
|
+
--base develop \\
|
|
188
|
+
--body "## Summary
|
|
189
|
+
- Implements <Feature Title> (<N> User Stories, <N> tasks)
|
|
190
|
+
- Source docs: ${prefix}-Requirements.md, ${prefix}-Tech-Spec.md
|
|
191
|
+
|
|
192
|
+
## Implementation
|
|
193
|
+
- Architect review: all US passed
|
|
194
|
+
- Issues Register: ${issuesFixed} fixed, ${issuesDeferred} deferred → see ${prefix}-Issues.md
|
|
195
|
+
|
|
196
|
+
## Test plan
|
|
197
|
+
- [ ] Build passes
|
|
198
|
+
- [ ] Tests pass
|
|
199
|
+
- [ ] Manual smoke test of key flows"
|
|
200
|
+
|
|
201
|
+
4. Update the Feature Registry (internal_docs/features/REGISTRY.md):
|
|
202
|
+
Find or append the entry for ${prefix}. Set Status to "completed".
|
|
203
|
+
|
|
204
|
+
Return { "pr_url": "<url>", "registry_updated": true/false }.
|
|
205
|
+
If the PR creation fails, return { "pr_url": "(PR creation failed)", "registry_updated": false }.`,
|
|
206
|
+
{
|
|
207
|
+
label: 'pr-and-registry',
|
|
208
|
+
phase: 'PR',
|
|
209
|
+
schema: PR_SCHEMA,
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
const prTokens = budget.spent() - beforePR
|
|
214
|
+
tokenLedger.push({ agent: 'pr-and-registry', model: 'sonnet', phase_delta_tokens: prTokens })
|
|
215
|
+
log(`PR done: ${prResult.pr_url} | phase delta: ${prTokens} tokens`)
|
|
216
|
+
|
|
217
|
+
// ── Actuals ───────────────────────────────────────────────────────────────────
|
|
218
|
+
phase('Actuals')
|
|
219
|
+
|
|
220
|
+
// Compute proportional distribution of phase tokens across logical agents
|
|
221
|
+
// Phase tokens are exact (budget.spent() deltas); per-agent breakdown is proportional.
|
|
222
|
+
// This is documented in the Token-Estimate file with a disclaimer.
|
|
223
|
+
const totalImplTokens = tokenLedger.reduce((s, e) => s + (e.phase_delta_tokens || 0), 0)
|
|
224
|
+
|
|
225
|
+
const ACTUALS_SCHEMA = {
|
|
226
|
+
type: 'object',
|
|
227
|
+
properties: {
|
|
228
|
+
token_estimate_path: { type: 'string' },
|
|
229
|
+
effort_estimate_path: { type: 'string' },
|
|
230
|
+
},
|
|
231
|
+
required: [],
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const beforeActuals = budget.spent()
|
|
235
|
+
|
|
236
|
+
await agent(
|
|
237
|
+
`You are the actuals recorder for the feature delivery pipeline.
|
|
238
|
+
|
|
239
|
+
Feature path: ${featurePath}
|
|
240
|
+
Prefix: ${prefix}
|
|
241
|
+
|
|
242
|
+
Token ledger (phase-level measurements):
|
|
243
|
+
${JSON.stringify(tokenLedger, null, 2)}
|
|
244
|
+
|
|
245
|
+
Total tokens consumed by pm-phase3 workflow (all phases combined): ${totalImplTokens} (exact, from budget tracking)
|
|
246
|
+
|
|
247
|
+
TASK 1 — Update Token-Estimate.md:
|
|
248
|
+
Find ${prefix}-Token-Estimate.md in the feature directory.
|
|
249
|
+
If it doesn't exist, create it with the structure from docs/procedures/token-estimation.md.
|
|
250
|
+
|
|
251
|
+
Append this section at the end:
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## Actuals vs Estimate
|
|
256
|
+
|
|
257
|
+
> ⚠️ Per-agent values are proportional distributions of the phase total.
|
|
258
|
+
> Phase totals (pm-phase3 total: ${totalImplTokens} tokens) are exact measurements.
|
|
259
|
+
> Individual agent breakdown is estimated proportionally.
|
|
260
|
+
|
|
261
|
+
| Agent | Task / Scope | Model | Phase delta tokens | Notes |
|
|
262
|
+
|-------|-------------|-------|-------------------|-------|
|
|
263
|
+
${tokenLedger.map(e => `| ${e.agent} | — | ${e.model} | ${e.phase_delta_tokens} | exact phase delta |`).join('\n')}
|
|
264
|
+
|
|
265
|
+
## Grand Total (pm-phase3)
|
|
266
|
+
|
|
267
|
+
| Metric | Value |
|
|
268
|
+
|--------|-------|
|
|
269
|
+
| Total tokens (pm-phase3) | ${totalImplTokens} (exact) |
|
|
270
|
+
| Implementation phases | ${implResult.phases_done} |
|
|
271
|
+
| US passed | ${(implResult.us_passed || []).join(', ') || 'N/A'} |
|
|
272
|
+
| US escalated | ${(implResult.us_escalated || []).join(', ') || 'none'} |
|
|
273
|
+
|
|
274
|
+
TASK 2 — Append actuals to Effort-Estimate.md:
|
|
275
|
+
Find ${prefix}-Effort-Estimate.md in the feature directory.
|
|
276
|
+
Append:
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## Actuals vs Estimate
|
|
281
|
+
|
|
282
|
+
| Metric | Estimated | Actual |
|
|
283
|
+
|--------|-----------|--------|
|
|
284
|
+
| Implementation phases | ${implResult.phases_done} | ${implResult.phases_done} |
|
|
285
|
+
| Issues fixed | — | ${issuesFixed} |
|
|
286
|
+
| Issues deferred | — | ${issuesDeferred} |
|
|
287
|
+
|
|
288
|
+
Return { "token_estimate_path": "<path>", "effort_estimate_path": "<path>" }.`,
|
|
289
|
+
{
|
|
290
|
+
label: 'write-actuals',
|
|
291
|
+
phase: 'Actuals',
|
|
292
|
+
schema: ACTUALS_SCHEMA,
|
|
293
|
+
}
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
const actualsTokens = budget.spent() - beforeActuals
|
|
297
|
+
tokenLedger.push({ agent: 'write-actuals', model: 'sonnet', phase_delta_tokens: actualsTokens })
|
|
298
|
+
log(`Actuals written | phase delta: ${actualsTokens} tokens`)
|
|
299
|
+
|
|
300
|
+
return {
|
|
301
|
+
pr_url: prResult.pr_url,
|
|
302
|
+
token_ledger: tokenLedger,
|
|
303
|
+
issues_summary: {
|
|
304
|
+
escalations: escalations.length,
|
|
305
|
+
escalation_details: escalations,
|
|
306
|
+
issues_fixed: issuesFixed,
|
|
307
|
+
issues_deferred: issuesDeferred,
|
|
308
|
+
},
|
|
309
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,102 @@
|
|
|
1
|
-
## 0.1.
|
|
2
|
-
## 0.1.
|
|
3
|
-
|
|
1
|
+
## 0.1.4 (2026-07-21)
|
|
2
|
+
## [0.2.0](https://github.com/dtlab-tech/ai-toolkit/compare/v0.1.7...v0.2.0) (2026-07-27)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **FTR-007:** explicit per-agent model assignment ([853eb0f](https://github.com/dtlab-tech/ai-toolkit/commit/853eb0f956a9a1aa64dedac7100fb1ad9eab4b08))
|
|
8
|
+
* **FTR-007:** implement US-01 — explicit per-agent model assignment ([0fe5fba](https://github.com/dtlab-tech/ai-toolkit/commit/0fe5fba9b25dc261e840d99d97105dec7c0c9318))
|
|
9
|
+
* **FTR-008:** compact instructions block for ~/.claude/CLAUDE.md ([738df59](https://github.com/dtlab-tech/ai-toolkit/commit/738df597e2da3edc04de68462f0e4555b232941d))
|
|
10
|
+
* **FTR-008:** implement compact instructions block ([0dab04d](https://github.com/dtlab-tech/ai-toolkit/commit/0dab04d9c14392866c9046eee9e7052a2beac586))
|
|
11
|
+
* **FTR-009:** implement shared infrastructure (INFRA) ([31bceb9](https://github.com/dtlab-tech/ai-toolkit/commit/31bceb9788a1f403eea3f2971b87959fa9e33f97))
|
|
12
|
+
* **FTR-009:** implement US-01 — Feature Delivery Workflow Scripts ([7f6dd7d](https://github.com/dtlab-tech/ai-toolkit/commit/7f6dd7da8280d9bc6b5b9922bf7f751c1837f8ad))
|
|
13
|
+
* **FTR-009:** implement US-02 — Assessment Workflow Scripts ([7b1e668](https://github.com/dtlab-tech/ai-toolkit/commit/7b1e668217f89ef16011fbe253a8e4bfb5714d0c))
|
|
14
|
+
* **FTR-009:** rewrite orchestrators as Workflow scripts ([7f63b20](https://github.com/dtlab-tech/ai-toolkit/commit/7f63b209e6f4826115c74189847f68d77dc16ac1))
|
|
15
|
+
* release develop → main (FTR-007, FTR-008, FTR-009) ([66c9e05](https://github.com/dtlab-tech/ai-toolkit/commit/66c9e05dde12be03f2c3d2a13eea112103fd6a20))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **FTR-009:** remediate review issues; update registry ([6aaeeb0](https://github.com/dtlab-tech/ai-toolkit/commit/6aaeeb0465b4d2003e61f33f7c6d0641bc477f9c))
|
|
21
|
+
* **FTR-009:** rewrite all 5 workflow scripts with correct Workflow SDK API ([2c6da04](https://github.com/dtlab-tech/ai-toolkit/commit/2c6da041c07a1c233678cd0d64dfeaf66f0674a5))
|
|
22
|
+
|
|
23
|
+
## 0.1.7 (2026-07-23)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Features
|
|
27
|
+
|
|
28
|
+
* add effort estimation and actuals tracking to project manager workflow ([0b81915](https://github.com/dtlab-tech/ai-toolkit/commit/0b819154584c725ccca09a825888aee8f3f5f34f))
|
|
29
|
+
* add effort estimation and actuals tracking to project manager workflow ([f9e74ef](https://github.com/dtlab-tech/ai-toolkit/commit/f9e74ef39972e3f0f3b0d3b6e4311d15fa9035cc))
|
|
30
|
+
* add GitHub Actions workflow to auto-publish to npm on merge to main ([f8d89ea](https://github.com/dtlab-tech/ai-toolkit/commit/f8d89ea20364796ce699b8228041f7f436ff3bdd))
|
|
31
|
+
* add GitHub Actions workflow to auto-publish to npm on merge to main ([abe2c45](https://github.com/dtlab-tech/ai-toolkit/commit/abe2c45336586794267d4ac7faf164cb82758fb6))
|
|
32
|
+
* add option to install Matt Pocock's skills during toolkit installation ([441183d](https://github.com/dtlab-tech/ai-toolkit/commit/441183d30214ed6eb570ae41ddf858229276b6d5))
|
|
33
|
+
* add option to install Matt Pocock's skills during toolkit installation ([f0d4fa3](https://github.com/dtlab-tech/ai-toolkit/commit/f0d4fa3ff783498d77e5b399d22d5828c8b157a6))
|
|
34
|
+
* add pricing documentation for cost estimation and blended cost formula ([91f6392](https://github.com/dtlab-tech/ai-toolkit/commit/91f63926ef2eabd20ad09a186f323d00abba9963))
|
|
35
|
+
* add pricing documentation for cost estimation and blended cost formula ([a9361ed](https://github.com/dtlab-tech/ai-toolkit/commit/a9361eda75b2c36d2515df976782af67bba1c4e4))
|
|
36
|
+
* Add SWF AI Toolkit with agents, skills, commands, and procedures for software feature delivery ([327a282](https://github.com/dtlab-tech/ai-toolkit/commit/327a2826bf4a147bcf2f993bc3ea254eaa12b18b))
|
|
37
|
+
* Add SWF AI Toolkit with agents, skills, commands, and procedures for software feature delivery ([97eb589](https://github.com/dtlab-tech/ai-toolkit/commit/97eb589a2b63a9ea45634c71aaae07d08bc1deaf))
|
|
38
|
+
* add version check during toolkit installation and update installed version file ([0e0eeea](https://github.com/dtlab-tech/ai-toolkit/commit/0e0eeea1bafe78e4d5c4214efc1b7acab9799ac8))
|
|
39
|
+
* add version check during toolkit installation and update installed version file ([4681ed4](https://github.com/dtlab-tech/ai-toolkit/commit/4681ed445a83c7f3bee5677bb773deaa7b0f86e2))
|
|
40
|
+
* assessment pipeline enhancements — token/effort estimation, registry, intervention commands, and Gaia assistant ([0cb512c](https://github.com/dtlab-tech/ai-toolkit/commit/0cb512cfd6d18c38216584ca454ab2077e641762))
|
|
41
|
+
* auto-generate CHANGELOG.md on publish via conventional-changelog ([6fdbd69](https://github.com/dtlab-tech/ai-toolkit/commit/6fdbd69c011ad3d568f3070f4c2dcd87092623e9))
|
|
42
|
+
* auto-generate CHANGELOG.md on publish via conventional-changelog ([49df865](https://github.com/dtlab-tech/ai-toolkit/commit/49df865633ebcede49f6c879921e775f1945271b))
|
|
43
|
+
* Enhance agent descriptions and add completion summaries ([a3aa811](https://github.com/dtlab-tech/ai-toolkit/commit/a3aa81169f102a09c95a46a98aa3b4f82bbb3b31))
|
|
44
|
+
* Enhance agent descriptions and add completion summaries ([1b2fe4a](https://github.com/dtlab-tech/ai-toolkit/commit/1b2fe4a2bf1c52107c8605533f2a0cdd85d1afbf))
|
|
45
|
+
* enhance file installation process with detailed status reporting and user prompts ([c12ca72](https://github.com/dtlab-tech/ai-toolkit/commit/c12ca72e111ead2f3c53b8846507f61fb572125b))
|
|
46
|
+
* enhance file installation process with detailed status reporting and user prompts ([10b56a4](https://github.com/dtlab-tech/ai-toolkit/commit/10b56a4d10455366cfec0690b8e9e428399f845a))
|
|
47
|
+
* enhance installation process with version checks and optional Matt Pocock skills installation ([16411e7](https://github.com/dtlab-tech/ai-toolkit/commit/16411e755c6586e8d33bd13b62402b3648e05b9c))
|
|
48
|
+
* enhance installation process with version checks and optional Matt Pocock skills installation ([8c1f0ae](https://github.com/dtlab-tech/ai-toolkit/commit/8c1f0ae92828e27b8a7ffb110eb35e27094b7006))
|
|
49
|
+
* enhance project manager with feature registry checks for cross-feature analysis ([30eb5e5](https://github.com/dtlab-tech/ai-toolkit/commit/30eb5e50fc16501e9cc38a5b4a8264e3eac96e5d))
|
|
50
|
+
* enhance project manager with feature registry checks for cross-feature analysis ([0d44ec3](https://github.com/dtlab-tech/ai-toolkit/commit/0d44ec35caa0460203c7c55d7eacff9320ef681f))
|
|
51
|
+
* enhance SWF AI Toolkit guide with detailed introduction and context awareness ([60bb2b8](https://github.com/dtlab-tech/ai-toolkit/commit/60bb2b86f3915f9844b58e7eeb44e88ce3877a4c))
|
|
52
|
+
* enhance SWF AI Toolkit guide with detailed introduction and context awareness ([f4ca293](https://github.com/dtlab-tech/ai-toolkit/commit/f4ca2938f6b4103785274018376ac2997e28cfc2))
|
|
53
|
+
* enhance token tracking and reporting in project manager and implement feature workflow ([fa873b8](https://github.com/dtlab-tech/ai-toolkit/commit/fa873b82b84bd3b332b44c0e2dd458820defd502))
|
|
54
|
+
* enhance token tracking and reporting in project manager and implement feature workflow ([92336ed](https://github.com/dtlab-tech/ai-toolkit/commit/92336edb3b523a5f5ed40d21b6fe38f7024ba322))
|
|
55
|
+
* **FTR-001:** add token estimation to assessment pipeline ([2f8a630](https://github.com/dtlab-tech/ai-toolkit/commit/2f8a63077e79c09ac25b2d60c74946fc7d229282))
|
|
56
|
+
* **FTR-001:** add token estimation to assessment pipeline ([93879ad](https://github.com/dtlab-tech/ai-toolkit/commit/93879ad00c60e9985424f07c104fa332883a4921))
|
|
57
|
+
* **FTR-002:** Add assessment pipeline effort estimation documentation and process log ([873c28f](https://github.com/dtlab-tech/ai-toolkit/commit/873c28f925a820292a1dc68600b1ebf991336903))
|
|
58
|
+
* **FTR-002:** Add assessment pipeline effort estimation documentation and process log ([30c891b](https://github.com/dtlab-tech/ai-toolkit/commit/30c891be8e337c63064982413570c1c4ade4d08f))
|
|
59
|
+
* **FTR-003:** reduce assessment pipeline to read-only — findings gate replaces remediation gate ([681f6fc](https://github.com/dtlab-tech/ai-toolkit/commit/681f6fc6500514c21f03ae61ee82e788ff65a6c6))
|
|
60
|
+
* **FTR-003:** reduce assessment pipeline to read-only — findings gate replaces remediation gate ([918ca26](https://github.com/dtlab-tech/ai-toolkit/commit/918ca2608e25d0ee2aa91b9047d921b7eaa5c021))
|
|
61
|
+
* **FTR-004:** generate requirements, tech-spec, validation, and work breakdown docs ([5ba2da7](https://github.com/dtlab-tech/ai-toolkit/commit/5ba2da7bee2e7bde5136874f277f19ad83be8464))
|
|
62
|
+
* **FTR-004:** implement INFRA + US-01 through US-03 — assessment registry write logic ([1989e38](https://github.com/dtlab-tech/ai-toolkit/commit/1989e38fc1b0ef5b40ff2e54cc83a2cd49e5c5d3))
|
|
63
|
+
* **FTR-004:** implement US-04 through US-06 — test specification ([baad095](https://github.com/dtlab-tech/ai-toolkit/commit/baad09524d8c352330a024fc7a80e89c635c0fc8))
|
|
64
|
+
* **FTR-004:** update project-manager token estimates to complete status ([959cc99](https://github.com/dtlab-tech/ai-toolkit/commit/959cc9921d470bfa874c5108f320848718d97c9a))
|
|
65
|
+
* **FTR-005:** add /next-intervention and /check-interventions commands ([f744ad2](https://github.com/dtlab-tech/ai-toolkit/commit/f744ad2032abe936feff9ae67ddd863ba86511a1))
|
|
66
|
+
* **FTR-006:** add assessment-aware PR description command to enhance context for intervention branches ([3023729](https://github.com/dtlab-tech/ai-toolkit/commit/302372919a2c07de313175c61f51000fcb2c99bc))
|
|
67
|
+
* refactor Matt Pocock skills installation checks and simplify version handling ([58d3efd](https://github.com/dtlab-tech/ai-toolkit/commit/58d3efddf35b453cf25de701ed5f4b829d0a1a34))
|
|
68
|
+
* refactor Matt Pocock skills installation checks and simplify version handling ([7de059e](https://github.com/dtlab-tech/ai-toolkit/commit/7de059e01fe5d71b75331732a833e00acfbb2a98))
|
|
69
|
+
* rename help skill to hi-gaia and introduce Gaia as toolkit assistant ([4c7c6f4](https://github.com/dtlab-tech/ai-toolkit/commit/4c7c6f422c8f97b9e79361faed4c95ed5001322c))
|
|
70
|
+
* rename help skill to hi-gaia and introduce Gaia as toolkit assistant ([c45fef0](https://github.com/dtlab-tech/ai-toolkit/commit/c45fef09a475dc795dfbbc12485e1ea01f4776d4))
|
|
71
|
+
* update Azure pipeline to dynamically resolve NPM registry URL ([2c6a817](https://github.com/dtlab-tech/ai-toolkit/commit/2c6a81777475f9ed6ad3f9f4b42fe7e7b2ada67e))
|
|
72
|
+
* update Azure pipeline to dynamically resolve NPM registry URL ([0f4601f](https://github.com/dtlab-tech/ai-toolkit/commit/0f4601fabb4b885dadc28e3f868feacdb97e474b))
|
|
73
|
+
* update Matt Pocock skills check to verify 'grilling' skill presence ([47b0592](https://github.com/dtlab-tech/ai-toolkit/commit/47b0592be0438c2d5152030e95674f0d0c23bf9a))
|
|
74
|
+
* update Matt Pocock skills check to verify 'grilling' skill presence ([d92d729](https://github.com/dtlab-tech/ai-toolkit/commit/d92d72946920c1cd9bf29f470a7a95b7bd84a254))
|
|
75
|
+
* update package name and installation instructions to reflect new organization ([b67193a](https://github.com/dtlab-tech/ai-toolkit/commit/b67193a630e3bb95cc5b58e4ead1b914cc74b9dc))
|
|
76
|
+
* update package name and installation instructions to reflect new organization ([0b09994](https://github.com/dtlab-tech/ai-toolkit/commit/0b09994220a563f1d3d12e5286be4a884af34aab))
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
### Bug Fixes
|
|
80
|
+
|
|
81
|
+
* add git tag on publish so conventional-changelog can read commit range ([6d4e427](https://github.com/dtlab-tech/ai-toolkit/commit/6d4e427d068da80d607db6e356cc79ea6e6ded9d))
|
|
82
|
+
* add git tag on publish so conventional-changelog can read commit range ([114f558](https://github.com/dtlab-tech/ai-toolkit/commit/114f55871c8e5892b36754cad3ba5d88b082706a))
|
|
83
|
+
* correct shell syntax in version bump commit message ([f988609](https://github.com/dtlab-tech/ai-toolkit/commit/f98860994d1cd3c4ef3d9b86aade6155e0ec6408))
|
|
84
|
+
* correct shell syntax in version bump commit message ([8e25e16](https://github.com/dtlab-tech/ai-toolkit/commit/8e25e160496125387e4a69707b04c24739008c5c))
|
|
85
|
+
* enhance NPM registry resolution by adding ADO_FEED_SCOPE variable ([2ff13e4](https://github.com/dtlab-tech/ai-toolkit/commit/2ff13e44510f507453136b5840d9dfc5c2afc3c5))
|
|
86
|
+
* enhance NPM registry resolution by adding ADO_FEED_SCOPE variable ([77b79c6](https://github.com/dtlab-tech/ai-toolkit/commit/77b79c6f1836b71bf96e1b7457d1c1ca28324253))
|
|
87
|
+
* **FTR-005:** address review warnings + add gate protocol to CLAUDE.md ([2e64780](https://github.com/dtlab-tech/ai-toolkit/commit/2e647809ba5279c492060dde52ab8134490fc59d))
|
|
88
|
+
* pull --rebase before pushing version bump to avoid rejection ([cf751d0](https://github.com/dtlab-tech/ai-toolkit/commit/cf751d0984bdddc683dfc67e378b4f563c6cfbe2))
|
|
89
|
+
* pull --rebase before pushing version bump to avoid rejection ([b70c748](https://github.com/dtlab-tech/ai-toolkit/commit/b70c74832f48e9261fbe894542de5977c3bcafa4))
|
|
90
|
+
* remove project-specific references and fix stale artifact filenames ([c272354](https://github.com/dtlab-tech/ai-toolkit/commit/c2723549f1a3de4f099b85b44c87603b9c601e72))
|
|
91
|
+
* remove project-specific references and fix stale artifact filenames ([1861fb9](https://github.com/dtlab-tech/ai-toolkit/commit/1861fb98708ce8ff8fcae7f5947f4e9dc9ba6937))
|
|
92
|
+
* remove run_in_background from PM and assessment-manager — background notifications not delivered to sub-agent contexts ([29a7b97](https://github.com/dtlab-tech/ai-toolkit/commit/29a7b97649ad5798eaf96c5a1acabb214c0c0c96))
|
|
93
|
+
* update installation instructions in README for clarity and completeness ([293a2dd](https://github.com/dtlab-tech/ai-toolkit/commit/293a2ddf0bebd386ba799ee24f6465b317897495))
|
|
94
|
+
* update installation instructions in README for clarity and completeness ([d682026](https://github.com/dtlab-tech/ai-toolkit/commit/d6820268dc1a60d99e80162e262adaba2974f9f7))
|
|
95
|
+
* update package references from [@denistomada](https://github.com/denistomada) to [@fincantieri](https://github.com/fincantieri) in README and installation documentation ([32ad6ae](https://github.com/dtlab-tech/ai-toolkit/commit/32ad6ae24db1719ad3cb1f4eea02bc11494cacd6))
|
|
96
|
+
* update package references from [@denistomada](https://github.com/denistomada) to [@fincantieri](https://github.com/fincantieri) in README and installation documentation ([5854119](https://github.com/dtlab-tech/ai-toolkit/commit/585411991604acc06a85ecf5b8a9beffe1ef82a2))
|
|
97
|
+
* update package.json to correct author and package name ([53dae47](https://github.com/dtlab-tech/ai-toolkit/commit/53dae47132da53e4fce98fdd683eb7acb4678b5a))
|
|
98
|
+
* update package.json to correct author and package name ([81a6b7c](https://github.com/dtlab-tech/ai-toolkit/commit/81a6b7c1ebfe6fab632eb44ddc48c962efc69997))
|
|
99
|
+
* update repository URL in package.json and remove publishConfig ([7f3dc15](https://github.com/dtlab-tech/ai-toolkit/commit/7f3dc15df57653bed00b139123396d5d2ba24d3e))
|
|
100
|
+
* update repository URL in package.json and remove publishConfig ([b912958](https://github.com/dtlab-tech/ai-toolkit/commit/b9129582804758128f3e9dffdd8cd9302d4e529f))
|
|
101
|
+
|
|
4
102
|
## 0.1.3 (2026-07-14)
|
package/CLAUDE.md
CHANGED
|
@@ -51,6 +51,38 @@ An `AGENTS.md` file in the project root with:
|
|
|
51
51
|
|
|
52
52
|
Generic procedures live in `docs/procedures/` in this toolkit. Projects can override any procedure by placing a file with the same name at `docs/procedures/` in their own root. Agents check the project first, then fall back to the toolkit.
|
|
53
53
|
|
|
54
|
+
## Gate Protocol — MANDATORY RULES
|
|
55
|
+
|
|
56
|
+
These rules apply in every session, without exception.
|
|
57
|
+
|
|
58
|
+
### Launching the Project Manager
|
|
59
|
+
|
|
60
|
+
**Always pass `run_in_background: false` when spawning the `project-manager` agent.**
|
|
61
|
+
|
|
62
|
+
Running the PM in the background leaves the main loop free to act independently. This creates two parallel execution paths that will conflict. The PM must block the main loop until it reaches a gate and returns.
|
|
63
|
+
|
|
64
|
+
### While the PM is running
|
|
65
|
+
|
|
66
|
+
**Do nothing.** No file reads "to prepare", no file writes "to accelerate", no implementation "because it seems stuck". The only permitted actions are:
|
|
67
|
+
|
|
68
|
+
- Receiving gate notifications and presenting them to the user
|
|
69
|
+
- Responding to the user's status questions ("still running")
|
|
70
|
+
- Sending messages to the PM via SendMessage if it is genuinely blocked and the user asks to unblock it
|
|
71
|
+
|
|
72
|
+
If the PM produces relay agents that appear to do nothing useful, that is noise — not a signal that the PM is stuck. Wait.
|
|
73
|
+
|
|
74
|
+
### Gate notifications are hard stops
|
|
75
|
+
|
|
76
|
+
When any gate notification arrives (Gate 1, Gate 2, Findings Gate, or any **HARD STOP** in any agent output):
|
|
77
|
+
|
|
78
|
+
1. Stop immediately — even if mid-turn
|
|
79
|
+
2. Present the full gate content to the user
|
|
80
|
+
3. Wait for explicit written approval before touching any file or spawning any agent
|
|
81
|
+
|
|
82
|
+
This applies even if the PM appears stuck, in a relay loop, or the gate arrives while another tool call is in progress.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
54
86
|
## Skills (user-invocable, in `.claude/skills/`)
|
|
55
87
|
|
|
56
88
|
### Feature Delivery
|
|
@@ -90,6 +122,8 @@ Generic procedures live in `docs/procedures/` in this toolkit. Projects can over
|
|
|
90
122
|
| Command | Purpose |
|
|
91
123
|
|---------|---------|
|
|
92
124
|
| `/assessment-status <prefix>` | Reports presence/state of all assessment artifacts (assessments, interventions, approvals, issues register) |
|
|
125
|
+
| `/next-intervention [prefix]` | Finds the next un-actioned flagged intervention and suggests the `/define-feature` invocation to start on it |
|
|
126
|
+
| `/check-interventions [prefix]` | Full reconciliation table: every intervention cross-referenced against the Index, on-disk files, and existing feature folders |
|
|
93
127
|
|
|
94
128
|
## Agents (spawnable subagents, in `.claude/agents/`)
|
|
95
129
|
|
package/README.md
CHANGED
|
@@ -65,6 +65,32 @@ The toolkit ships **generic agents** that work with any project. Each agent read
|
|
|
65
65
|
|
|
66
66
|
Generic procedures live in `docs/procedures/`. Projects can override any of them by placing a file with the same name at their own `docs/procedures/`. Agents check the project first, then fall back to the toolkit.
|
|
67
67
|
|
|
68
|
+
## Required configuration — subagent spawn depth
|
|
69
|
+
|
|
70
|
+
> ⚠️ **This setting is not optional for the orchestrated pipelines.** Without it, `/implement-feature` and `/assess-codebase` silently degrade.
|
|
71
|
+
|
|
72
|
+
The toolkit is built on a **two-level agent hierarchy**: an orchestrator (`project-manager` or `assessment-manager`) is spawned as a subagent, and it in turn spawns the specialized worker agents (developers, reviewers, assessors), each on its own role-appropriate model with an isolated context.
|
|
73
|
+
|
|
74
|
+
Since Claude Code **v2.1.217, a subagent cannot spawn further subagents by default** (spawn depth is capped at 1, an intentional guard against unbounded recursive fan-out and cost). Under that default, when an orchestrator runs as a subagent it has **no `Agent` tool** — so instead of delegating, it executes every worker's task *inline, in its own context, on its own model*. The consequences:
|
|
75
|
+
|
|
76
|
+
- **Per-agent model assignment stops taking effect** — the `haiku`/`sonnet`/`opus` mapping on each agent is never applied, because those agents are never actually spawned. Everything runs on the orchestrator's model.
|
|
77
|
+
- **Context isolation is lost** — one long orchestrator context replaces the intended per-agent isolation.
|
|
78
|
+
- **Per-agent token telemetry disappears** — no per-agent `<usage>` blocks are emitted, so `*-Token-Estimate.md` records only an aggregate orchestrator total.
|
|
79
|
+
|
|
80
|
+
To let the toolkit work as designed, raise the allowed depth to **2** (main loop → orchestrator → workers). This repo already sets it in [`.claude/settings.json`](.claude/settings.json):
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"env": {
|
|
85
|
+
"CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH": "2"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**When you install the toolkit into another project, you must add this setting yourself.** The installers (`npx @dtlabs/ai-toolkit`, `ai-toolkit --global`, and the `/install-toolkit` agent) **never copy or edit any `settings.json`** — that file is user-owned, and merging it automatically would risk clobbering your existing configuration. Instead, each installer **checks** whether `CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH` is set to `2`+ in the destination and, if it is missing, prints the exact snippet to add (to `.claude/settings.json` for one project, or `~/.claude/settings.json` for all projects). After adding it, restart Claude Code so the variable is loaded.
|
|
91
|
+
|
|
92
|
+
The orchestrator agents already omit the `tools:` frontmatter field, so they inherit the `Agent` tool automatically once the depth allows it — no per-agent changes are needed.
|
|
93
|
+
|
|
68
94
|
## Documentation
|
|
69
95
|
|
|
70
96
|
- [Quick Reference](docs/reference.md) — cheatsheet of every skill, command, agent, and procedure
|