@dtlabs/ai-toolkit 0.3.0 → 0.4.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/install-toolkit.md +1 -46
- package/.claude/workflows/pm-phase2.js +38 -32
- package/.claude/workflows/pm-phase3.js +24 -20
- package/CHANGELOG.md +23 -0
- package/CLAUDE.global.md +34 -0
- package/CLAUDE.md +15 -99
- package/bin/cli.js +1 -51
- package/package.json +3 -1
|
@@ -171,51 +171,7 @@ configuration is out of scope and risks clobbering the user's existing settings.
|
|
|
171
171
|
|
|
172
172
|
---
|
|
173
173
|
|
|
174
|
-
## Step 5 —
|
|
175
|
-
|
|
176
|
-
After copying the toolkit files, check the state of Matt Pocock's skills:
|
|
177
|
-
|
|
178
|
-
1. **Detect installed version**: check if `~/.claude/skills/mattpocock/.version` exists and read it. If not found, try `npm list -g mattpocock --json` to get the cached version. If neither works, assume not installed.
|
|
179
|
-
|
|
180
|
-
2. **Detect latest available version**: run `npm view mattpocock version` to get the current version on npm. If offline or unavailable, skip the version comparison.
|
|
181
|
-
|
|
182
|
-
3. **Present the appropriate prompt** using `AskUserQuestion`:
|
|
183
|
-
|
|
184
|
-
**Not installed:**
|
|
185
|
-
```
|
|
186
|
-
question: "Matt Pocock's skills are not installed. Install them now?"
|
|
187
|
-
description: "Includes define-feature, grilling, TDD, prototype, handoff, and more.
|
|
188
|
-
Installs globally via: npx skills@latest add mattpocock/skills"
|
|
189
|
-
options:
|
|
190
|
-
- "Yes — install now"
|
|
191
|
-
- "No — skip (install manually later)"
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
**Installed, update available (installed=vX, latest=vY):**
|
|
195
|
-
```
|
|
196
|
-
question: "Matt Pocock skills v{installed} is installed. Update to v{latest}?"
|
|
197
|
-
options:
|
|
198
|
-
- "Yes — update now"
|
|
199
|
-
- "No — keep current version"
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
**Already up to date:**
|
|
203
|
-
```
|
|
204
|
-
question: "Matt Pocock skills v{installed} is already up to date. Re-install?"
|
|
205
|
-
options:
|
|
206
|
-
- "Yes — re-install"
|
|
207
|
-
- "No — skip"
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
4. If the user selects **Yes** (install or update), run:
|
|
211
|
-
```bash
|
|
212
|
-
npx skills@latest add mattpocock/skills
|
|
213
|
-
```
|
|
214
|
-
Report the outcome. If it fails, show the manual install command.
|
|
215
|
-
|
|
216
|
-
---
|
|
217
|
-
|
|
218
|
-
## Step 6 — Compact Instructions opt-in
|
|
174
|
+
## Step 5 — Compact Instructions opt-in
|
|
219
175
|
|
|
220
176
|
The toolkit includes a `# Compact instructions` section for `~/.claude/CLAUDE.md` that guides Claude's auto-compaction (what to keep, what to drop) and enables proactive topic-change suggestions.
|
|
221
177
|
|
|
@@ -304,7 +260,6 @@ New files copied: N
|
|
|
304
260
|
Modified/overwritten: N
|
|
305
261
|
Modified/kept: N (user chose to keep existing version)
|
|
306
262
|
Unchanged (same): N (skipped silently)
|
|
307
|
-
Matt Pocock skills: ✅ installed v{X} / ⬆️ updated v{old}→v{new} / ⏭ skipped / ✅ already up to date v{X}
|
|
308
263
|
Spawn depth: ✅ CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH=2+ present / ⚠️ MISSING — see action above
|
|
309
264
|
Compact instructions: {compact_instructions_status}
|
|
310
265
|
──────────────────────────────────────────────────
|
|
@@ -93,16 +93,18 @@ Write {feature_dir}/{PREFIX}-Effort-Estimate.md with this format:
|
|
|
93
93
|
| Human estimate | {human_estimate} (sequential, no parallelism) |
|
|
94
94
|
| Agent estimate | {agent_estimate} (parallel dispatch, critical path only) |
|
|
95
95
|
|
|
96
|
-
## Per-
|
|
96
|
+
## Per-Phase Breakdown
|
|
97
97
|
|
|
98
|
-
|
|
|
99
|
-
|
|
100
|
-
{one row per US extracted from Section 4}
|
|
98
|
+
| Phase | Title | Tasks | Domains | Est. Human | Est. Agent | Actual Human | Actual Agent |
|
|
99
|
+
|-------|-------|-------|---------|-----------|-----------|-------------|-------------|
|
|
100
|
+
{one row per phase (INFRA + each US) extracted from Section 4 of the Work Breakdown — use ~2h per BE task, ~1h per TEST task, ~30min per INFRA task for human estimate; agent estimate = human / 6 as baseline}
|
|
101
|
+
| **Total** | | **{total_tasks}** | | **{human_estimate}** | **{agent_estimate}** | **—** | **—** |
|
|
101
102
|
|
|
102
103
|
## Notes
|
|
103
104
|
- Human estimate assumes sequential execution with no parallelism.
|
|
104
|
-
- Agent estimate assumes parallel dispatch of independent tasks within each phase.
|
|
105
|
-
- Actual
|
|
105
|
+
- Agent estimate assumes parallel dispatch of independent tasks within each phase (critical path only).
|
|
106
|
+
- Actual Human: filled in if a human developer performed or reviewed the implementation.
|
|
107
|
+
- Actual Agent: filled in by pm-phase3 after implementation completes.
|
|
106
108
|
|
|
107
109
|
TASK 3 — Write the Token-Estimate.md file.
|
|
108
110
|
Write {feature_dir}/{PREFIX}-Token-Estimate.md with this format:
|
|
@@ -111,39 +113,43 @@ Write {feature_dir}/{PREFIX}-Token-Estimate.md with this format:
|
|
|
111
113
|
|
|
112
114
|
## Phase 1 — Documentation (Actuals)
|
|
113
115
|
|
|
114
|
-
| Agent | Task | Model | Tokens
|
|
115
|
-
|
|
116
|
-
| generate-requirements | Generate requirements from feature.md | haiku |
|
|
117
|
-
| generate-tech-spec | Generate tech spec from feature.md | haiku |
|
|
118
|
-
| validate-feature-docs | Validate requirements + tech spec | haiku |
|
|
116
|
+
| Agent | Task | Model | Tokens Est. | Tokens Actual |
|
|
117
|
+
|-------|------|-------|------------|--------------|
|
|
118
|
+
| generate-requirements | Generate requirements from feature.md | haiku | — | {phase1_req_tokens} |
|
|
119
|
+
| generate-tech-spec | Generate tech spec from feature.md | haiku | — | {phase1_spec_tokens} |
|
|
120
|
+
| validate-feature-docs | Validate requirements + tech spec | haiku | — | {phase1_val_tokens} |
|
|
121
|
+
| **Phase 1 total** | | | **—** | **${phase1Tokens}** |
|
|
119
122
|
|
|
120
123
|
## Phase 2 — Work Breakdown (Actuals)
|
|
121
124
|
|
|
122
|
-
| Agent | Task | Model | Tokens
|
|
123
|
-
|
|
124
|
-
| generate-work-breakdown | Generate work breakdown from docs | haiku |
|
|
125
|
+
| Agent | Task | Model | Tokens Est. | Tokens Actual |
|
|
126
|
+
|-------|------|-------|------------|--------------|
|
|
127
|
+
| generate-work-breakdown | Generate work breakdown from docs | haiku | — | {wbTokens from above} |
|
|
128
|
+
| **Phase 2 total** | | | **—** | **{wbTokens from above}** |
|
|
125
129
|
|
|
126
130
|
## Phase 3 — Implementation (Estimates)
|
|
127
131
|
|
|
128
132
|
Estimates based on {total_tasks} tasks ({domain_breakdown}), {user_stories} User Stories.
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
| Agent | Task | Model | Tokens
|
|
132
|
-
|
|
133
|
-
|
|
|
134
|
-
|
|
|
135
|
-
|
|
|
136
|
-
|
|
|
137
|
-
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
| Phase
|
|
144
|
-
|
|
145
|
-
| Phase
|
|
146
|
-
|
|
|
133
|
+
Baseline: ~15,000 tokens/BE task, ~8,000/TEST task, ~5,000/INFRA task.
|
|
134
|
+
|
|
135
|
+
| Agent | Task | Model | Tokens Est. | Tokens Actual |
|
|
136
|
+
|-------|------|-------|------------|--------------|
|
|
137
|
+
| developer-backend | Implement BE/INFRA tasks | sonnet | {estimated: be_tasks * 15000 + infra_tasks * 5000} | — |
|
|
138
|
+
| developer-testing | Implement TEST tasks | sonnet | {estimated: test_tasks * 8000} | — |
|
|
139
|
+
| review-solution (×{user_stories}) | Architect review per US | sonnet | {estimated: user_stories * 8000} | — |
|
|
140
|
+
| remediation | Fix review issues | sonnet | ~10,000 | — |
|
|
141
|
+
| pr-and-registry | Push branch, create PR | sonnet | ~5,000 | — |
|
|
142
|
+
| write-actuals | Update Token/Effort Estimate | sonnet | ~3,000 | — |
|
|
143
|
+
| **Phase 3 total** | | | **{sum of phase 3 estimates}** | **—** |
|
|
144
|
+
|
|
145
|
+
## Grand Total
|
|
146
|
+
|
|
147
|
+
| Phase | Tokens Est. | Tokens Actual |
|
|
148
|
+
|-------|------------|--------------|
|
|
149
|
+
| Phase 1 — Documentation | — | ${phase1Tokens} |
|
|
150
|
+
| Phase 2 — Work Breakdown | — | {wbTokens from above} |
|
|
151
|
+
| Phase 3 — Implementation | {sum of phase 3 estimates} | — |
|
|
152
|
+
| **Total** | **{sum of phase 3 estimates}** | **{phase1Tokens + wbTokens} (partial)** |
|
|
147
153
|
|
|
148
154
|
---
|
|
149
155
|
*Actuals will be appended by pm-phase3 after implementation completes.*
|
|
@@ -30,19 +30,13 @@ const csvPath = `${featureDir}/${prefix}-Work-Breakdown.csv`
|
|
|
30
30
|
|
|
31
31
|
log(`Reading CSV: ${csvPath}`)
|
|
32
32
|
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
required: ['content'],
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const csvResult = await agent(
|
|
40
|
-
`Read the file at path: ${csvPath}\nReturn its full text content as the "content" field.`,
|
|
41
|
-
{ label: 'read-wb-csv', phase: 'Parse', schema: READ_SCHEMA, model: 'haiku' }
|
|
33
|
+
const csvContent = await agent(
|
|
34
|
+
`Read the file at path: ${csvPath}\nReturn ONLY the raw file contents, nothing else. No explanation, no formatting, no JSON wrapping — just the raw text of the file.`,
|
|
35
|
+
{ label: 'read-wb-csv', phase: 'Parse', model: 'haiku' }
|
|
42
36
|
)
|
|
43
37
|
|
|
44
38
|
// Parse CSV into structured phases — pure JS, no AI
|
|
45
|
-
const rows =
|
|
39
|
+
const rows = csvContent
|
|
46
40
|
.split('\n')
|
|
47
41
|
.map(l => l.trim())
|
|
48
42
|
.filter(l => l && !l.startsWith('phase_id')) // skip header and empty lines
|
|
@@ -119,7 +113,6 @@ const buildWaves = (phases) => {
|
|
|
119
113
|
const waves = buildWaves(wb.phases)
|
|
120
114
|
log(`Execution plan: ${waves.length} wave(s) — ${waves.map((w, i) => `wave${i+1}:[${w.map(p => p.phase_id).join(',')}]`).join(' ')}`)
|
|
121
115
|
|
|
122
|
-
const prefix = wb.prefix
|
|
123
116
|
let phasesDone = 0
|
|
124
117
|
const usPassed = []
|
|
125
118
|
const usEscalated = []
|
|
@@ -419,30 +412,41 @@ Append this section at the end of the file:
|
|
|
419
412
|
|
|
420
413
|
---
|
|
421
414
|
|
|
422
|
-
##
|
|
415
|
+
## Phase 3 — Implementation (Actuals)
|
|
423
416
|
|
|
424
417
|
> Phase totals are exact measurements from budget tracking.
|
|
425
418
|
> Per-agent values are exact where each agent ran separately; proportional where merged.
|
|
426
419
|
|
|
427
|
-
| Agent | Phase | Model |
|
|
428
|
-
|
|
429
|
-
${tokenLedger.map(e => `| ${e.agent} | — | ${e.model} | ${e.phase_delta_tokens} |`).join('\n')}
|
|
420
|
+
| Agent | Phase | Model | Tokens Est. | Tokens Actual |
|
|
421
|
+
|-------|-------|-------|------------|--------------|
|
|
422
|
+
${tokenLedger.map(e => `| ${e.agent} | — | ${e.model} | — | ${e.phase_delta_tokens} |`).join('\n')}
|
|
423
|
+
| **Phase 3 total** | | | **—** | **${totalPhase3Tokens}** |
|
|
424
|
+
|
|
425
|
+
## Grand Total (updated)
|
|
426
|
+
|
|
427
|
+
| Phase | Tokens Est. | Tokens Actual |
|
|
428
|
+
|-------|------------|--------------|
|
|
429
|
+
| Phase 1 — Documentation | — | *(see above)* |
|
|
430
|
+
| Phase 2 — Work Breakdown | — | *(see above)* |
|
|
431
|
+
| Phase 3 — Implementation | *(see above)* | ${totalPhase3Tokens} |
|
|
430
432
|
|
|
431
|
-
##
|
|
433
|
+
## Implementation Summary
|
|
432
434
|
|
|
433
435
|
| Metric | Value |
|
|
434
436
|
|--------|-------|
|
|
435
|
-
| Total tokens (pm-phase3) | ${totalPhase3Tokens} (exact) |
|
|
436
437
|
| Implementation phases done | ${phasesDone} |
|
|
437
438
|
| US passed | ${usPassed.join(', ') || 'N/A'} |
|
|
438
439
|
| US escalated | ${usEscalated.join(', ') || 'none'} |
|
|
439
440
|
|
|
440
|
-
TASK 2 —
|
|
441
|
-
Find the file in the feature directory.
|
|
441
|
+
TASK 2 — Update actuals in ${prefix}-Effort-Estimate.md:
|
|
442
|
+
Find the file in the feature directory. Read the existing Per-Phase Breakdown table and update the "Actual Agent" column for each phase that was implemented. Use the token ledger to infer which phases completed:
|
|
443
|
+
- Phases in usPassed: ${usPassed.join(', ') || 'none'} — mark Actual Agent as completed (write the wall-clock duration if available, otherwise write "done (agent)")
|
|
444
|
+
- Phases escalated: ${usEscalated.join(', ') || 'none'} — mark Actual Agent as "escalated"
|
|
445
|
+
- Also append this summary section at the end of the file:
|
|
442
446
|
|
|
443
447
|
---
|
|
444
448
|
|
|
445
|
-
##
|
|
449
|
+
## Implementation Summary
|
|
446
450
|
|
|
447
451
|
| Metric | Estimated | Actual |
|
|
448
452
|
|--------|-----------|--------|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
## 0.1.4 (2026-07-21)
|
|
2
|
+
## [0.4.0](https://github.com/dtlab-tech/ai-toolkit/compare/v0.3.1...v0.4.0) (2026-07-29)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **effort-estimate:** add Est./Actual Human/Agent columns to Per-Phase Breakdown ([696146c](https://github.com/dtlab-tech/ai-toolkit/commit/696146cc583ca13ee18914af19ff4de87a91cb60))
|
|
8
|
+
* FTR-010 unit tests, process-log, OPT-02/03/04, remove Matt Pocock dependency ([1f43a4e](https://github.com/dtlab-tech/ai-toolkit/commit/1f43a4e6bf98a4b5821f1a0ae2dac33aca090597))
|
|
9
|
+
* **token-estimate:** split tokens into Est./Actual columns in pm-phase2 and pm-phase3 ([d85b6e4](https://github.com/dtlab-tech/ai-toolkit/commit/d85b6e4aa871a934190e1d65995cb8e7e8db4495))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **pm-phase3:** read CSV as raw string instead of schema-wrapped object ([1737842](https://github.com/dtlab-tech/ai-toolkit/commit/17378422f6a9dc9168a35c7114cdd227e9214ce8))
|
|
15
|
+
* **pm-phase3:** remove duplicate const prefix declaration ([85455e8](https://github.com/dtlab-tech/ai-toolkit/commit/85455e83929ccc6274d7d888fd429fc83ad78137))
|
|
16
|
+
|
|
17
|
+
## [0.3.1](https://github.com/dtlab-tech/ai-toolkit/compare/v0.3.0...v0.3.1) (2026-07-28)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* include README.md in npm package files ([1998d47](https://github.com/dtlab-tech/ai-toolkit/commit/1998d476d23de1c2791af97b3217492b1364a9c8))
|
|
23
|
+
* include README.md in npm package files ([f710534](https://github.com/dtlab-tech/ai-toolkit/commit/f71053472afeb87c2a4cd8e8a0b826103c6205f0))
|
|
24
|
+
|
|
2
25
|
## [0.3.0](https://github.com/dtlab-tech/ai-toolkit/compare/v0.2.3...v0.3.0) (2026-07-28)
|
|
3
26
|
|
|
4
27
|
|
package/CLAUDE.global.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# AI Toolkit — Gate Protocol
|
|
2
|
+
|
|
3
|
+
> Full catalog (Skills, Commands, Agents, Procedures): see `CLAUDE.md` in the project root,
|
|
4
|
+
> or [`docs/reference.md`](docs/reference.md) for the cheatsheet.
|
|
5
|
+
|
|
6
|
+
## Gate Protocol — MANDATORY RULES
|
|
7
|
+
|
|
8
|
+
These rules apply in every session, without exception.
|
|
9
|
+
|
|
10
|
+
### Launching the Project Manager
|
|
11
|
+
|
|
12
|
+
**Always pass `run_in_background: false` when spawning the `project-manager` agent.**
|
|
13
|
+
|
|
14
|
+
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.
|
|
15
|
+
|
|
16
|
+
### While the PM is running
|
|
17
|
+
|
|
18
|
+
**Do nothing.** No file reads "to prepare", no file writes "to accelerate", no implementation "because it seems stuck". The only permitted actions are:
|
|
19
|
+
|
|
20
|
+
- Receiving gate notifications and presenting them to the user
|
|
21
|
+
- Responding to the user's status questions ("still running")
|
|
22
|
+
- Sending messages to the PM via SendMessage if it is genuinely blocked and the user asks to unblock it
|
|
23
|
+
|
|
24
|
+
If the PM produces relay agents that appear to do nothing useful, that is noise — not a signal that the PM is stuck. Wait.
|
|
25
|
+
|
|
26
|
+
### Gate notifications are hard stops
|
|
27
|
+
|
|
28
|
+
When any gate notification arrives (Gate 1, Gate 2, Findings Gate, or any **HARD STOP** in any agent output):
|
|
29
|
+
|
|
30
|
+
1. Stop immediately — even if mid-turn
|
|
31
|
+
2. Present the full gate content to the user
|
|
32
|
+
3. Wait for explicit written approval before touching any file or spawning any agent
|
|
33
|
+
|
|
34
|
+
This applies even if the PM appears stuck, in a relay loop, or the gate arrives while another tool call is in progress.
|
package/CLAUDE.md
CHANGED
|
@@ -2,19 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A reusable set of AI agents and procedures for software feature delivery and codebase assessment — from requirements to PR, and from audit to remediation.
|
|
4
4
|
|
|
5
|
-
> **
|
|
6
|
-
|
|
7
|
-
## Dependencies
|
|
8
|
-
|
|
9
|
-
This toolkit expects the **`define-feature`** agent from [Matt Pocock's skills package](https://github.com/mattpocock/skills) to be available. That agent is responsible for producing the `feature.md` input file that `/implement-feature` and all downstream agents consume.
|
|
10
|
-
|
|
11
|
-
Install it with:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npx skills@latest add mattpocock/skills
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
> **Tip:** Install Matt's skills globally (`~/.claude/skills/`) so they are available in every project without repeating the setup.
|
|
5
|
+
> **Full catalog of skills, commands, agents, and procedures:** [`docs/reference.md`](docs/reference.md)
|
|
18
6
|
|
|
19
7
|
## How it works
|
|
20
8
|
|
|
@@ -81,89 +69,17 @@ When any gate notification arrives (Gate 1, Gate 2, Findings Gate, or any **HARD
|
|
|
81
69
|
|
|
82
70
|
This applies even if the PM appears stuck, in a relay loop, or the gate arrives while another tool call is in progress.
|
|
83
71
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
| Skill | Command | Purpose |
|
|
100
|
-
|-------|---------|---------|
|
|
101
|
-
| Assess Codebase | `/assess-codebase` | Starts the full assessment pipeline: parallel assessment → intervention docs → approval gate → remediation → review → PR |
|
|
102
|
-
|
|
103
|
-
### General
|
|
104
|
-
|
|
105
|
-
| Skill | Command | Purpose |
|
|
106
|
-
|-------|---------|---------|
|
|
107
|
-
| Gaia | `/hi-gaia [topic]` | Your toolkit assistant — introduces herself, explains pipelines, agents, and commands; helps you find the right tool for your situation |
|
|
108
|
-
|
|
109
|
-
## Commands (slash shortcuts, in `.claude/commands/`)
|
|
110
|
-
|
|
111
|
-
### Feature Delivery
|
|
112
|
-
|
|
113
|
-
| Command | Purpose |
|
|
114
|
-
|---------|---------|
|
|
115
|
-
| `/feature-status <slug>` | Reports presence/state of feature.md, requirements, tech-spec, work-breakdown, and implementation progress |
|
|
116
|
-
| `/check-docs <slug>` | Terse consistency check between feature docs — outputs only the inconsistencies |
|
|
117
|
-
| `/pr-description` | Generates a PR description from the current branch commits + linked feature.md |
|
|
118
|
-
| `/next-task [slug]` | Finds the next unblocked task in the work breakdown and suggests the agent to delegate it to |
|
|
119
|
-
|
|
120
|
-
### Assessment & Remediation
|
|
121
|
-
|
|
122
|
-
| Command | Purpose |
|
|
123
|
-
|---------|---------|
|
|
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 |
|
|
127
|
-
|
|
128
|
-
## Agents (spawnable subagents, in `.claude/agents/`)
|
|
129
|
-
|
|
130
|
-
### Feature Delivery
|
|
131
|
-
|
|
132
|
-
| Agent | subagent_type | Purpose |
|
|
133
|
-
|-------|---------------|---------|
|
|
134
|
-
| Install Toolkit | `install-toolkit` | Copies toolkit files into a destination project |
|
|
135
|
-
| Init AGENTS.md | `init-agents-md` | Analyzes codebase and generates AGENTS.md |
|
|
136
|
-
| Define Feature | `define-feature` | Interviews the user and writes `feature.md` in `docs/features/FTR-XXX-slug/` |
|
|
137
|
-
| Generate Requirements | `generate-requirements` | Produces functional requirements from feature.md |
|
|
138
|
-
| Generate Tech-Spec | `generate-tech-spec` | Produces technical specification from feature + requirements |
|
|
139
|
-
| Validate Docs | `validate-feature-docs` | Cross-validates requirements + tech-spec against feature.md |
|
|
140
|
-
| Generate Work Breakdown | `generate-work-breakdown` | Creates User Stories + tasks from approved docs |
|
|
141
|
-
| Backend Developer | `developer-backend` | Implements backend tasks (DB, BE, INFRA domains) |
|
|
142
|
-
| Frontend Developer | `developer-frontend` | Implements frontend tasks (FE domain) |
|
|
143
|
-
| Testing Agent | `developer-testing` | Creates unit/integration tests (TEST domain) |
|
|
144
|
-
| Review Solution | `review-solution` | Architect-level code review |
|
|
145
|
-
| Project Manager | `project-manager` | Orchestrates the full feature delivery pipeline |
|
|
146
|
-
|
|
147
|
-
### Assessment & Remediation
|
|
148
|
-
|
|
149
|
-
| Agent | subagent_type | Purpose |
|
|
150
|
-
|-------|---------------|---------|
|
|
151
|
-
| Assessment Manager | `assessment-manager` | Orchestrates the assessment pipeline: parallel assessment → intervention docs → approval gate → effort/token estimates → summary |
|
|
152
|
-
| Generic Software Assessment | `generic-software-assessment` | Broad quality analysis across architecture, security, testability, observability, DevOps |
|
|
153
|
-
| Intervention Documentation Standard | `intervention-documentation-standard` | Generates structured, self-contained intervention documents from assessment findings |
|
|
154
|
-
| God Class Decomposition | `god-class-decomposition` | Safe incremental decomposition of oversized classes and methods |
|
|
155
|
-
| Domain Model Refactoring | `domain-model-refactoring` | Splits monolithic model files, introduces type hierarchies, aligns domain vocabulary |
|
|
156
|
-
| Layered Architecture Assessment | `layered-architecture-assessment` | Audits layer boundary violations and namespace/package misalignment |
|
|
157
|
-
| Dependency Injection Refactoring | `dependency-injection-refactoring` | Converts static/direct coupling to constructor-injected services |
|
|
158
|
-
| Security Hardening | `security-hardening` | Input validation, parameterised queries, secret management, log sanitisation, TLS |
|
|
159
|
-
| Dependency Supply Chain Security | `dependency-supply-chain-security` | Lock files, integrity verification, unused dependency audit, SCA in CI |
|
|
160
|
-
| Concurrency Safety Assessment | `concurrency-safety-assessment` | Race conditions, shared mutable state, unsafe shutdown patterns |
|
|
161
|
-
|
|
162
|
-
## Available procedures (in `docs/procedures/`)
|
|
163
|
-
|
|
164
|
-
| Procedure | Purpose |
|
|
165
|
-
|-----------|---------|
|
|
166
|
-
| `code-generation.md` | Step-by-step workflow for generating/modifying code |
|
|
167
|
-
| `code-review.md` | Checklist and process for reviewing code |
|
|
168
|
-
| `secure-coding.md` | Security checklist for auth/data handling |
|
|
169
|
-
| `testing.md` | Strategy and guidelines for writing tests |
|
|
72
|
+
## Compact instructions
|
|
73
|
+
|
|
74
|
+
When compacting this conversation, preserve:
|
|
75
|
+
- Current objective and which pipeline step we are on
|
|
76
|
+
- User decisions and approvals (Gate 1, Gate 2, Findings Gate)
|
|
77
|
+
- Files created or modified this session
|
|
78
|
+
- Open errors or blockers
|
|
79
|
+
- Feature/assessment prefix IDs and artifact paths (e.g. FTR-010, ASSESS-001)
|
|
80
|
+
|
|
81
|
+
Discard:
|
|
82
|
+
- Raw grep/glob/read output that has already been acted on
|
|
83
|
+
- Successful tool-call results that produced no follow-up action
|
|
84
|
+
- Repeated explanations of the same concept
|
|
85
|
+
- Superseded plans or approaches
|
package/bin/cli.js
CHANGED
|
@@ -225,53 +225,6 @@ async function runInstall(label, mappings, force) {
|
|
|
225
225
|
);
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
// ── Matt Pocock skills ───────────────────────────────────────────────────────
|
|
229
|
-
|
|
230
|
-
function isMattPocockInstalled() {
|
|
231
|
-
const homedir = require('os').homedir();
|
|
232
|
-
// 'grilling' is a skill exclusive to Matt Pocock's package — not included in this toolkit
|
|
233
|
-
const pathsToCheck = [
|
|
234
|
-
path.join(homedir, '.claude', 'skills', 'grilling', 'SKILL.md'),
|
|
235
|
-
path.join(process.cwd(), '.claude', 'skills', 'grilling', 'SKILL.md'),
|
|
236
|
-
];
|
|
237
|
-
return pathsToCheck.some(p => fs.existsSync(p));
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
async function installMattPocock() {
|
|
241
|
-
const { execSync } = require('child_process');
|
|
242
|
-
console.log(`\n ${clr('cyan', '↓')} Running: ${dim('npx skills@latest add mattpocock/skills')}\n`);
|
|
243
|
-
try {
|
|
244
|
-
execSync('npx skills@latest add mattpocock/skills', { stdio: 'inherit' });
|
|
245
|
-
console.log(`\n ${clr('green', '✔')} Matt Pocock skills installed successfully.\n`);
|
|
246
|
-
} catch (err) {
|
|
247
|
-
console.error(`\n ${clr('red', '✖')} Install failed: ${err.message}`);
|
|
248
|
-
console.error(` Run manually: ${dim('npx skills@latest add mattpocock/skills')}\n`);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
async function askMattPocock() {
|
|
253
|
-
const installed = isMattPocockInstalled();
|
|
254
|
-
|
|
255
|
-
console.log(divider());
|
|
256
|
-
console.log(bold(' Matt Pocock Skills'));
|
|
257
|
-
console.log(divider());
|
|
258
|
-
console.log(` ${dim('Includes: define-feature, grilling, TDD, prototype, handoff, and more.')}`);
|
|
259
|
-
console.log();
|
|
260
|
-
|
|
261
|
-
if (!installed) {
|
|
262
|
-
console.log(` ${clr('gray', '○')} Status : ${clr('gray', 'not installed')}\n`);
|
|
263
|
-
const ok = await askConfirm('Install Matt Pocock\'s skills now?');
|
|
264
|
-
if (ok) await installMattPocock();
|
|
265
|
-
else console.log(`\n ${clr('gray', 'Skipped. Install later with: npx skills@latest add mattpocock/skills')}\n`);
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
console.log(` ${clr('green', '✔')} Status : ${clr('green', 'installed')}\n`);
|
|
270
|
-
const ok = await askConfirm('Re-install / update Matt Pocock skills?');
|
|
271
|
-
if (ok) await installMattPocock();
|
|
272
|
-
else console.log(` ${clr('gray', 'Skipped.')}\n`);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
228
|
// ── subagent spawn-depth check (verify & advise only — never write) ────────────
|
|
276
229
|
|
|
277
230
|
const SPAWN_DEPTH_VAR = 'CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH';
|
|
@@ -334,7 +287,6 @@ async function installLocal(targetDir, force) {
|
|
|
334
287
|
writeInstalledVersion(targetDir);
|
|
335
288
|
console.log(` ${clr('green', '✔')} ${bold('Install complete.')}\n`);
|
|
336
289
|
checkSpawnDepth(targetDir);
|
|
337
|
-
await askMattPocock();
|
|
338
290
|
console.log(divider());
|
|
339
291
|
console.log(`\n ${bold('Next steps:')}`);
|
|
340
292
|
console.log(` ${clr('cyan', '1.')} Run ${clr('cyan', '/init-agents')} to generate AGENTS.md`);
|
|
@@ -355,13 +307,12 @@ async function installGlobal(force) {
|
|
|
355
307
|
{ src: path.join(packageRoot, '.claude', 'commands'), dest: path.join(target, 'commands') },
|
|
356
308
|
{ src: path.join(packageRoot, '.claude', 'workflows'), dest: path.join(target, 'workflows') },
|
|
357
309
|
{ src: path.join(packageRoot, 'docs'), dest: path.join(target, 'docs') },
|
|
358
|
-
{ src: path.join(packageRoot, 'CLAUDE.md'),
|
|
310
|
+
{ src: path.join(packageRoot, 'CLAUDE.global.md'), dest: path.join(target, 'CLAUDE.md') },
|
|
359
311
|
];
|
|
360
312
|
await runInstall('global Claude folder', mappings, force);
|
|
361
313
|
writeInstalledVersion(target);
|
|
362
314
|
console.log(` ${clr('green', '✔')} ${bold('Global install complete.')}\n`);
|
|
363
315
|
checkSpawnDepth(homedir);
|
|
364
|
-
await askMattPocock();
|
|
365
316
|
console.log(divider());
|
|
366
317
|
console.log(`\n ${bold('Next steps:')}`);
|
|
367
318
|
console.log(` ${clr('cyan', '1.')} The toolkit is now available in all your projects`);
|
|
@@ -419,7 +370,6 @@ if (require.main === module) {
|
|
|
419
370
|
expandMappings,
|
|
420
371
|
categorize,
|
|
421
372
|
readInstalledVersion,
|
|
422
|
-
isMattPocockInstalled,
|
|
423
373
|
NEVER_COPY,
|
|
424
374
|
};
|
|
425
375
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dtlabs/ai-toolkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "AI Toolkit — reusable agents and procedures for developers to build AI-powered applications.",
|
|
5
5
|
"files": [
|
|
6
6
|
"docs/",
|
|
7
7
|
"CLAUDE.md",
|
|
8
8
|
"CHANGELOG.md",
|
|
9
|
+
"README.md",
|
|
10
|
+
"CLAUDE.global.md",
|
|
9
11
|
".claude",
|
|
10
12
|
"bin"
|
|
11
13
|
],
|