@dtlabs/ai-toolkit 0.10.1 → 0.11.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/CHANGELOG.md +71 -0
- package/bin/cli.js +1178 -80
- package/docs/installation.md +74 -8
- package/docs/reference.md +60 -12
- package/lib/asset-catalog.js +52 -0
- package/package.json +9 -7
- package/{.claude → src/claude}/agents/install-toolkit.md +30 -103
- package/{.claude → src/claude}/workflows/am-phase1.js +9 -12
- package/{.claude → src/claude}/workflows/pm-phase2.js +2 -2
- package/.claude/scripts/.gitkeep +0 -0
- /package/{.claude → src/claude}/agents/concurrency-safety-assessment.md +0 -0
- /package/{.claude → src/claude}/agents/define-feature.md +0 -0
- /package/{.claude → src/claude}/agents/dependency-injection-refactoring.md +0 -0
- /package/{.claude → src/claude}/agents/dependency-supply-chain-security.md +0 -0
- /package/{.claude → src/claude}/agents/developer-backend.md +0 -0
- /package/{.claude → src/claude}/agents/developer-frontend.md +0 -0
- /package/{.claude → src/claude}/agents/developer-testing.md +0 -0
- /package/{.claude → src/claude}/agents/domain-model-refactoring.md +0 -0
- /package/{.claude → src/claude}/agents/generate-requirements.md +0 -0
- /package/{.claude → src/claude}/agents/generate-tech-spec.md +0 -0
- /package/{.claude → src/claude}/agents/generate-work-breakdown.md +0 -0
- /package/{.claude → src/claude}/agents/generic-software-assessment.md +0 -0
- /package/{.claude → src/claude}/agents/god-class-decomposition.md +0 -0
- /package/{.claude → src/claude}/agents/init-agents-md.md +0 -0
- /package/{.claude → src/claude}/agents/intervention-documentation-standard.md +0 -0
- /package/{.claude → src/claude}/agents/layered-architecture-assessment.md +0 -0
- /package/{.claude → src/claude}/agents/review-solution.md +0 -0
- /package/{.claude → src/claude}/agents/security-hardening.md +0 -0
- /package/{.claude → src/claude}/agents/validate-feature-docs.md +0 -0
- /package/{.claude → src/claude}/agents/validate-work-breakdown-semantic.md +0 -0
- /package/{.claude → src/claude}/commands/assessment-status.md +0 -0
- /package/{.claude → src/claude}/commands/check-docs.md +0 -0
- /package/{.claude → src/claude}/commands/check-interventions.md +0 -0
- /package/{.claude → src/claude}/commands/feature-status.md +0 -0
- /package/{.claude → src/claude}/commands/next-intervention.md +0 -0
- /package/{.claude → src/claude}/commands/next-task.md +0 -0
- /package/{.claude → src/claude}/commands/pr-description.md +0 -0
- /package/{.claude → src/claude}/scripts/wb-render.js +0 -0
- /package/{.claude → src/claude}/scripts/wb-validate.js +0 -0
- /package/{.claude → src/claude}/skills/assess-codebase/SKILL.md +0 -0
- /package/{.claude → src/claude}/skills/define-feature/SKILL.md +0 -0
- /package/{.claude → src/claude}/skills/hi-gaia/SKILL.md +0 -0
- /package/{.claude → src/claude}/skills/implement-feature/SKILL.md +0 -0
- /package/{.claude → src/claude}/skills/init-agents/SKILL.md +0 -0
- /package/{.claude → src/claude}/skills/install-toolkit/SKILL.md +0 -0
- /package/{.claude → src/claude}/workflows/am-phase2.js +0 -0
- /package/{.claude → src/claude}/workflows/pm-phase1.js +0 -0
- /package/{.claude → src/claude}/workflows/pm-phase3.js +0 -0
package/docs/installation.md
CHANGED
|
@@ -13,7 +13,8 @@ No authentication setup required — it is a public package.
|
|
|
13
13
|
|
|
14
14
|
### Local installation (default)
|
|
15
15
|
|
|
16
|
-
Copies
|
|
16
|
+
Copies all asset categories from the toolkit's `src/claude/` tree into the target project's `.claude/`
|
|
17
|
+
directory, plus `docs/` and `CLAUDE.md`:
|
|
17
18
|
|
|
18
19
|
```bash
|
|
19
20
|
npx @dtlabs/ai-toolkit
|
|
@@ -31,9 +32,15 @@ Overwrite existing files without confirmation:
|
|
|
31
32
|
npx @dtlabs/ai-toolkit --local . --force
|
|
32
33
|
```
|
|
33
34
|
|
|
35
|
+
Preview what would change without writing any files (dry run):
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx @dtlabs/ai-toolkit --local . --dry-run
|
|
39
|
+
```
|
|
40
|
+
|
|
34
41
|
### Global installation
|
|
35
42
|
|
|
36
|
-
Merges
|
|
43
|
+
Merges all asset categories into `~/.claude/<category>/`, plus `docs/` and `CLAUDE.md`:
|
|
37
44
|
|
|
38
45
|
```bash
|
|
39
46
|
npm install -g @dtlabs/ai-toolkit
|
|
@@ -46,20 +53,79 @@ Force overwrite:
|
|
|
46
53
|
ai-toolkit --global --force
|
|
47
54
|
```
|
|
48
55
|
|
|
56
|
+
Preview the global install without writing any files:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
ai-toolkit --global --dry-run
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Asset catalog
|
|
63
|
+
|
|
64
|
+
The installer derives the list of installable directories from the **asset catalog**
|
|
65
|
+
(`lib/asset-catalog.js`). Each catalog entry defines:
|
|
66
|
+
|
|
67
|
+
| Field | Description |
|
|
68
|
+
|---|---|
|
|
69
|
+
| `name` | Category name (e.g. `agents`, `skills`) |
|
|
70
|
+
| `sourceDir` | Location inside the package (`src/claude/<name>`) |
|
|
71
|
+
| `runtimeDir` | Destination inside the installed `.claude/` folder (`.claude/<name>`) |
|
|
72
|
+
|
|
73
|
+
Adding a new category to the catalog automatically includes it in every install — no
|
|
74
|
+
changes to `bin/cli.js` are required.
|
|
75
|
+
|
|
49
76
|
### What gets copied where
|
|
50
77
|
|
|
51
78
|
| Mode | Source (in package) | Destination |
|
|
52
79
|
|---|---|---|
|
|
53
|
-
| Local |
|
|
80
|
+
| Local | `src/claude/agents/` | `<target>/.claude/agents/` |
|
|
81
|
+
| Local | `src/claude/skills/` | `<target>/.claude/skills/` |
|
|
82
|
+
| Local | `src/claude/commands/` | `<target>/.claude/commands/` |
|
|
83
|
+
| Local | `src/claude/workflows/` | `<target>/.claude/workflows/` |
|
|
84
|
+
| Local | `src/claude/scripts/` | `<target>/.claude/scripts/` |
|
|
54
85
|
| Local | `docs/` | `<target>/docs/` |
|
|
55
86
|
| Local | `CLAUDE.md` | `<target>/CLAUDE.md` |
|
|
56
|
-
| Global |
|
|
57
|
-
| Global |
|
|
58
|
-
| Global |
|
|
87
|
+
| Global | `src/claude/agents/` | `~/.claude/agents/` |
|
|
88
|
+
| Global | `src/claude/skills/` | `~/.claude/skills/` |
|
|
89
|
+
| Global | `src/claude/commands/` | `~/.claude/commands/` |
|
|
90
|
+
| Global | `src/claude/workflows/` | `~/.claude/workflows/` |
|
|
91
|
+
| Global | `src/claude/scripts/` | `~/.claude/scripts/` |
|
|
59
92
|
| Global | `docs/` | `~/.claude/docs/` |
|
|
60
|
-
| Global | `CLAUDE.md` | `~/.claude/CLAUDE.md` |
|
|
93
|
+
| Global | `CLAUDE.global.md` | `~/.claude/CLAUDE.md` |
|
|
94
|
+
|
|
95
|
+
> The toolkit sources assets from `src/claude/` (versioned, purity-guarded), not from
|
|
96
|
+
> `.claude/` at the project root. The `.claude/` folder in the toolkit repository is for
|
|
97
|
+
> personal configuration only (gitignored).
|
|
61
98
|
|
|
62
|
-
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Upgrade path
|
|
102
|
+
|
|
103
|
+
When a newer version of the toolkit is installed over an existing one, the installer
|
|
104
|
+
automatically detects and removes **orphaned files** — files that were part of a previous
|
|
105
|
+
installation but no longer exist in the current package.
|
|
106
|
+
|
|
107
|
+
Orphaned files are moved to `.claude/.ai-toolkit-trash/<timestamp>/` rather than
|
|
108
|
+
deleted outright, so they can be recovered if needed. Each upgrade session uses a
|
|
109
|
+
unique ISO-timestamp subdirectory, ensuring that repeated upgrades never overwrite
|
|
110
|
+
previously trashed files.
|
|
111
|
+
|
|
112
|
+
The manifest (`.claude/.ai-toolkit-manifest.json`) is updated after each install to
|
|
113
|
+
reflect the current file set. The trash directory is excluded from the manifest automatically.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Developer workflow
|
|
118
|
+
|
|
119
|
+
When developing the toolkit itself, use the convenience scripts in `package.json`:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Preview global install without writing files
|
|
123
|
+
npm run toolkit:dev-install-global
|
|
124
|
+
# (this runs --global --dry-run first, then --global)
|
|
125
|
+
|
|
126
|
+
# Validate that no test files have crept into src/claude/
|
|
127
|
+
npm run toolkit:validate-purity
|
|
128
|
+
```
|
|
63
129
|
|
|
64
130
|
---
|
|
65
131
|
|
package/docs/reference.md
CHANGED
|
@@ -41,7 +41,7 @@ Cheatsheet of every skill, command, agent, and procedure shipped with this toolk
|
|
|
41
41
|
|
|
42
42
|
---
|
|
43
43
|
|
|
44
|
-
## Skills (in `.claude/skills/`)
|
|
44
|
+
## Skills (in `src/claude/skills/`, installed to `.claude/skills/`)
|
|
45
45
|
|
|
46
46
|
Invoked as `/<name>`. Comprehensive workflows that may chain multiple agents.
|
|
47
47
|
|
|
@@ -68,7 +68,7 @@ Invoked as `/<name>`. Comprehensive workflows that may chain multiple agents.
|
|
|
68
68
|
|
|
69
69
|
---
|
|
70
70
|
|
|
71
|
-
## Commands (in `.claude/commands/`)
|
|
71
|
+
## Commands (in `src/claude/commands/`, installed to `.claude/commands/`)
|
|
72
72
|
|
|
73
73
|
Invoked as `/<name>`. Lightweight shortcuts focused on the current state of the repo. Do **not** spawn long-running workflows.
|
|
74
74
|
|
|
@@ -89,7 +89,7 @@ Invoked as `/<name>`. Lightweight shortcuts focused on the current state of the
|
|
|
89
89
|
|
|
90
90
|
---
|
|
91
91
|
|
|
92
|
-
## Agents (in `.claude/agents/`)
|
|
92
|
+
## Agents (in `src/claude/agents/`, installed to `.claude/agents/`)
|
|
93
93
|
|
|
94
94
|
Invoked via the Agent tool with `subagent_type`. Specialised sub-conversations that produce a single deliverable.
|
|
95
95
|
|
|
@@ -160,6 +160,52 @@ Reusable text procedures referenced by agents. **Override locally** by placing a
|
|
|
160
160
|
|
|
161
161
|
---
|
|
162
162
|
|
|
163
|
+
## CLI Commands (`ai-toolkit <command>`)
|
|
164
|
+
|
|
165
|
+
The `ai-toolkit` binary (from `bin/cli.js`) provides commands for runtime asset resolution, script execution, and diagnostics.
|
|
166
|
+
|
|
167
|
+
### Asset resolution
|
|
168
|
+
|
|
169
|
+
| Command | Purpose | Exit |
|
|
170
|
+
|---|---|---|
|
|
171
|
+
| `ai-toolkit resolve-asset <relativePath> [--project <dir>] [--home <dir>]` | Resolve a runtime asset path using the six-phase algorithm; stdout=resolved path | 0 success / 1 error |
|
|
172
|
+
| `ai-toolkit run-asset <relativePath> [--project <dir>] [--home <dir>] [-- ...args]` | Resolve and execute a `scripts/*.js` asset; propagates exit code | script exit code |
|
|
173
|
+
| `ai-toolkit list-assets [--category <name>] [--format json\|plain] [--project <dir>] [--home <dir>]` | List installed runtime assets from `.claude/<category>/`; exit 0 even when empty | 0 always |
|
|
174
|
+
| `ai-toolkit doctor-resolution [--project <dir>] [--home <dir>]` | Doctor resolution diagnostics: reports presence mode, install mode, version, completeness gaps | 0 / 1 |
|
|
175
|
+
| `ai-toolkit validate-purity [<sourceDir>]` | Check that `src/claude/` contains no test or fixture files | 0 clean / 1 violations |
|
|
176
|
+
|
|
177
|
+
### `resolveClaudeRuntimeAsset(relativePath, options)` — resolver API
|
|
178
|
+
|
|
179
|
+
The core runtime resolution algorithm exposed from `bin/cli.js`:
|
|
180
|
+
|
|
181
|
+
```javascript
|
|
182
|
+
const { resolveClaudeRuntimeAsset } = require('@dtlabs/ai-toolkit/bin/cli');
|
|
183
|
+
const resolvedPath = resolveClaudeRuntimeAsset('agents/developer-backend.md', {
|
|
184
|
+
projectDir: '/path/to/project', // optional; defaults to process.cwd()
|
|
185
|
+
home: '/path/to/home', // optional; defaults to os.homedir()
|
|
186
|
+
});
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Six-phase algorithm:
|
|
190
|
+
- **Phase 0**: Input validation (relativePath must be a non-empty string)
|
|
191
|
+
- **Phase A**: Presence detection — checks manifest (condA), version stamp (condB), payload files (condC)
|
|
192
|
+
- **Phase B**: Mode decision — local (project `.claude/`) vs global (`~/.claude/`)
|
|
193
|
+
- **Phase C**: Metadata warnings (version stamp missing, mode ambiguity)
|
|
194
|
+
- **Phase D**: Completeness check — verifies requested file exists, validates catalog membership
|
|
195
|
+
- **Phase E**: Return resolved absolute path with confinement check
|
|
196
|
+
|
|
197
|
+
### Doctor resolution
|
|
198
|
+
|
|
199
|
+
`ai-toolkit doctor-resolution` reports the full resolution diagnosis for a project:
|
|
200
|
+
- Detected presence mode (manifest / stamp / payload / none)
|
|
201
|
+
- Install mode (local / global)
|
|
202
|
+
- Installed version
|
|
203
|
+
- Catalog completeness gaps (files present in asset catalog but missing from runtime)
|
|
204
|
+
|
|
205
|
+
Used by workflow agents to verify installation via doctor resolution before dispatching asset-dependent tasks.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
163
209
|
## Typical flows
|
|
164
210
|
|
|
165
211
|
### Flow 1 — Brand new feature, end-to-end
|
|
@@ -217,12 +263,14 @@ Then delegate manually to the suggested agent, or rerun `/implement-feature` to
|
|
|
217
263
|
|
|
218
264
|
## File locations
|
|
219
265
|
|
|
220
|
-
| What | Local install | Global install |
|
|
221
|
-
|
|
222
|
-
| Agents | `<project>/.claude/agents/` | `~/.claude/agents/` |
|
|
223
|
-
| Skills | `<project>/.claude/skills/` | `~/.claude/skills/` |
|
|
224
|
-
| Commands | `<project>/.claude/commands/` | `~/.claude/commands/` |
|
|
225
|
-
|
|
|
226
|
-
|
|
|
227
|
-
|
|
|
228
|
-
|
|
|
266
|
+
| What | Source (toolkit repo) | Local install | Global install |
|
|
267
|
+
|---|---|---|---|
|
|
268
|
+
| Agents | `src/claude/agents/` | `<project>/.claude/agents/` | `~/.claude/agents/` |
|
|
269
|
+
| Skills | `src/claude/skills/` | `<project>/.claude/skills/` | `~/.claude/skills/` |
|
|
270
|
+
| Commands | `src/claude/commands/` | `<project>/.claude/commands/` | `~/.claude/commands/` |
|
|
271
|
+
| Workflows | `src/claude/workflows/` | `<project>/.claude/workflows/` | `~/.claude/workflows/` |
|
|
272
|
+
| Scripts | `src/claude/scripts/` | `<project>/.claude/scripts/` | `~/.claude/scripts/` |
|
|
273
|
+
| Procedures | `docs/procedures/` | `<project>/docs/procedures/` | `~/.claude/docs/procedures/` |
|
|
274
|
+
| Feature docs | — | `<project>/docs/features/FTR-NNN-slug/` | — |
|
|
275
|
+
| Assessment docs | — | `<project>/docs/assessments/ASSESS-NNN/` | — |
|
|
276
|
+
| This reference | `docs/reference.md` | `<project>/docs/reference.md` | `~/.claude/docs/reference.md` |
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const ASSET_CATEGORIES = [
|
|
4
|
+
{
|
|
5
|
+
name: 'agents',
|
|
6
|
+
sourceDir: 'src/claude/agents',
|
|
7
|
+
runtimeDir: '.claude/agents',
|
|
8
|
+
description: 'Agent definition files (.md with YAML frontmatter)',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'commands',
|
|
12
|
+
sourceDir: 'src/claude/commands',
|
|
13
|
+
runtimeDir: '.claude/commands',
|
|
14
|
+
description: 'Slash command definition files',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'skills',
|
|
18
|
+
sourceDir: 'src/claude/skills',
|
|
19
|
+
runtimeDir: '.claude/skills',
|
|
20
|
+
description: 'User-invocable skill directories with SKILL.md',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'workflows',
|
|
24
|
+
sourceDir: 'src/claude/workflows',
|
|
25
|
+
runtimeDir: '.claude/workflows',
|
|
26
|
+
description: 'Claude Code Workflow orchestrator scripts (.js)',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'scripts',
|
|
30
|
+
sourceDir: 'src/claude/scripts',
|
|
31
|
+
runtimeDir: '.claude/scripts',
|
|
32
|
+
description: 'Utility and helper scripts',
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
function getAssetCategories() {
|
|
37
|
+
return ASSET_CATEGORIES;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function getCategoryByName(name) {
|
|
41
|
+
return ASSET_CATEGORIES.find(cat => cat.name === name);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (require.main === module) {
|
|
45
|
+
console.log(JSON.stringify(ASSET_CATEGORIES, null, 2));
|
|
46
|
+
} else {
|
|
47
|
+
module.exports = {
|
|
48
|
+
ASSET_CATEGORIES,
|
|
49
|
+
getAssetCategories,
|
|
50
|
+
getCategoryByName,
|
|
51
|
+
};
|
|
52
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dtlabs/ai-toolkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "AI Toolkit — reusable agents and procedures for developers to build AI-powered applications.",
|
|
5
5
|
"files": [
|
|
6
6
|
"docs/",
|
|
@@ -8,12 +8,8 @@
|
|
|
8
8
|
"CHANGELOG.md",
|
|
9
9
|
"README.md",
|
|
10
10
|
"CLAUDE.global.md",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
".claude/workflows",
|
|
14
|
-
".claude/skills",
|
|
15
|
-
".claude/scripts/*.js",
|
|
16
|
-
".claude/scripts/.gitkeep",
|
|
11
|
+
"src/claude",
|
|
12
|
+
"lib",
|
|
17
13
|
"bin"
|
|
18
14
|
],
|
|
19
15
|
"bin": {
|
|
@@ -21,7 +17,13 @@
|
|
|
21
17
|
},
|
|
22
18
|
"scripts": {
|
|
23
19
|
"prepublishOnly": "npm pack --dry-run",
|
|
20
|
+
"prepack": "node bin/cli.js validate-purity",
|
|
21
|
+
"toolkit:validate-purity": "node bin/cli.js validate-purity",
|
|
22
|
+
"toolkit:dev-install-global": "node bin/cli.js --global --dry-run && node bin/cli.js --global && node bin/cli.js doctor resolution && node bin/cli.js verify-install",
|
|
24
23
|
"test": "jest --bail",
|
|
24
|
+
"test:cli": "jest --bail --testPathPattern=tests/cli/",
|
|
25
|
+
"test:frontmatter": "jest --bail --testPathPattern=tests/frontmatter/",
|
|
26
|
+
"test:regression": "jest --bail --testPathPattern=tests/regression/",
|
|
25
27
|
"test:coverage": "jest --coverage"
|
|
26
28
|
},
|
|
27
29
|
"devDependencies": {
|
|
@@ -6,7 +6,7 @@ model: sonnet
|
|
|
6
6
|
|
|
7
7
|
# Install Toolkit
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Installs the ai-toolkit into a destination project so it can use `/implement-feature`, `/init-agents`, all developer agents, and all slash commands without needing the toolkit repo locally.
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -15,130 +15,57 @@ Copies the toolkit's agents, skills, commands, and procedures into a destination
|
|
|
15
15
|
The user provides:
|
|
16
16
|
1. **Path to the destination project root** (optional) — defaults to the current working directory if not specified
|
|
17
17
|
2. **`--force`** flag (optional) — overwrite files that already exist in the destination
|
|
18
|
+
3. **`--global`** flag (optional) — install into the global Claude Code config directory (`~/.claude/`) instead of a project
|
|
18
19
|
|
|
19
20
|
---
|
|
20
21
|
|
|
21
|
-
## Step 1 — Validate inputs
|
|
22
|
-
|
|
23
|
-
1. Determine the **toolkit root**: the current working directory (this agent runs from the toolkit repo).
|
|
24
|
-
2. Verify the toolkit root contains `.claude/agents/` — if not, abort: "Error: must be run from the ai-toolkit directory."
|
|
25
|
-
3. Verify the destination path exists — if not, abort: "Error: destination path not found: {path}"
|
|
26
|
-
4. Check if destination is a git repository (look for `.git/`) — warn if not, but continue.
|
|
27
|
-
5. **Version check**:
|
|
28
|
-
- Read `package.json` from the toolkit root to get the current version (e.g. `0.2.0`)
|
|
29
|
-
- Check if `.claude/.ai-toolkit-version` exists in the destination:
|
|
30
|
-
- **File missing** → first install, no prompt needed, continue
|
|
31
|
-
- **Same version** → inform the user and ask: "Toolkit v{x} is already installed. Re-install anyway?"
|
|
32
|
-
- If No: abort cleanly
|
|
33
|
-
- **Different version** → show both versions and ask:
|
|
34
|
-
```
|
|
35
|
-
Version check:
|
|
36
|
-
Installed : v{installed}
|
|
37
|
-
Available : v{current}
|
|
38
|
-
|
|
39
|
-
Proceed and update from v{installed} to v{current}?
|
|
40
|
-
```
|
|
41
|
-
- If No: abort cleanly with "Your current installation was not changed."
|
|
22
|
+
## Step 1 — Validate inputs
|
|
42
23
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
| Source (toolkit) | Destination | Purpose |
|
|
50
|
-
|------------------|-------------|---------|
|
|
51
|
-
| `.claude/agents/` | `{dest}/.claude/agents/` | All spawnable subagents |
|
|
52
|
-
| `.claude/skills/` | `{dest}/.claude/skills/` | All user-invocable skills (except `install-toolkit/`) |
|
|
53
|
-
| `.claude/commands/` | `{dest}/.claude/commands/` | All slash commands |
|
|
54
|
-
| `.claude/workflows/` | `{dest}/.claude/workflows/` | Claude Code Workflow scripts for orchestrated pipelines |
|
|
55
|
-
| `.claude/scripts/` | `{dest}/.claude/scripts/` | CLI scripts for work breakdown validation and rendering |
|
|
56
|
-
| `docs/procedures/` | `{dest}/docs/procedures/` | Generic procedures (only if destination has no override) |
|
|
57
|
-
|
|
58
|
-
For each file, compare source content against destination using an MD5/hash check and determine status:
|
|
59
|
-
- **NEW** — file does not exist in destination → copy automatically, no prompt
|
|
60
|
-
- **SAME** — file exists and content is identical → skip silently, no prompt
|
|
61
|
-
- **MODIFIED** — file exists but content differs → show to user, ask per-file
|
|
62
|
-
|
|
63
|
-
Build and display the plan before executing:
|
|
64
|
-
|
|
65
|
-
```
|
|
66
|
-
📦 Install Plan → {destination}
|
|
67
|
-
──────────────────────────────────────────────────
|
|
68
|
-
.claude/agents/
|
|
69
|
-
✅ NEW generate-requirements.md
|
|
70
|
-
⚠️ MODIFIED developer-backend.md ← content differs
|
|
71
|
-
⏭ SAME review-solution.md
|
|
72
|
-
|
|
73
|
-
.claude/skills/
|
|
74
|
-
✅ NEW implement-feature/SKILL.md
|
|
75
|
-
⏭ SAME init-agents/SKILL.md
|
|
76
|
-
|
|
77
|
-
.claude/workflows/
|
|
78
|
-
✅ NEW pm-phase1.js
|
|
79
|
-
✅ NEW pm-phase2.js
|
|
80
|
-
✅ NEW pm-phase3.js
|
|
81
|
-
✅ NEW am-phase1.js
|
|
82
|
-
✅ NEW am-phase2.js
|
|
83
|
-
|
|
84
|
-
.claude/scripts/
|
|
85
|
-
✅ NEW wb-validate.js
|
|
86
|
-
✅ NEW wb-render.js
|
|
87
|
-
|
|
88
|
-
docs/procedures/
|
|
89
|
-
✅ NEW code-generation.md
|
|
90
|
-
⏭ SAME testing.md
|
|
91
|
-
──────────────────────────────────────────────────
|
|
92
|
-
New: N | Modified: N | Unchanged: N
|
|
93
|
-
```
|
|
24
|
+
1. Determine destination:
|
|
25
|
+
- If `--global` was passed: destination is `~/.claude/` (user-global config dir)
|
|
26
|
+
- Otherwise: destination is the path provided, or the current working directory if omitted
|
|
27
|
+
2. Verify the destination path exists — if not, abort: "Error: destination path not found: {path}"
|
|
28
|
+
3. Check if destination is a git repository (look for `.git/`) — warn if not, but continue.
|
|
94
29
|
|
|
95
30
|
---
|
|
96
31
|
|
|
97
|
-
## Step
|
|
98
|
-
|
|
99
|
-
**Phase A — New files** (no prompt needed): copy all NEW files, creating directories as needed.
|
|
32
|
+
## Step 2 — Run installer
|
|
100
33
|
|
|
101
|
-
|
|
34
|
+
Invoke the ai-toolkit CLI installer. The CLI handles source resolution (no CWD assumption), version checking, asset catalog enumeration, and file copy:
|
|
102
35
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
Overwrite? (y/N):
|
|
36
|
+
```bash
|
|
37
|
+
ai-toolkit install --project "{dest}" # for a project install
|
|
38
|
+
# or
|
|
39
|
+
ai-toolkit install --global # for a global install
|
|
108
40
|
```
|
|
109
41
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
**Phase C — Same files**: skip silently (no output for these).
|
|
113
|
-
|
|
114
|
-
Use shell commands appropriate for the OS. On Windows with bash:
|
|
42
|
+
If `--force` was passed:
|
|
115
43
|
```bash
|
|
116
|
-
|
|
117
|
-
cp "{source_file}" "{dest_file}"
|
|
44
|
+
ai-toolkit install --project "{dest}" --force
|
|
118
45
|
```
|
|
119
46
|
|
|
120
|
-
|
|
47
|
+
The installer will:
|
|
48
|
+
- Compare installed version vs available version and ask for confirmation if already installed at the same version
|
|
49
|
+
- Enumerate all installable assets from the asset catalog (`src/claude/`)
|
|
50
|
+
- Copy NEW files automatically; prompt for MODIFIED files (or overwrite silently if `--force`)
|
|
51
|
+
- Skip SAME files silently
|
|
52
|
+
- Never copy `install-toolkit` skill or `settings.json` / `settings.local.json`
|
|
53
|
+
- Never clobber `docs/procedures/` overrides that exist in the destination
|
|
54
|
+
- Stamp the installed version in `{dest}/.claude/.ai-toolkit-version`
|
|
121
55
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
**For `docs/procedures/`**: copy only files that don't already exist in the destination (regardless of `--force`) — project-specific procedure overrides must never be clobbered.
|
|
56
|
+
Show the installer's output to the user without modification.
|
|
125
57
|
|
|
126
58
|
---
|
|
127
59
|
|
|
128
|
-
## Step
|
|
60
|
+
## Step 3 — Verify result
|
|
129
61
|
|
|
130
|
-
After
|
|
131
|
-
1.
|
|
132
|
-
2. Verify
|
|
133
|
-
3. Write the installed version to `.claude/.ai-toolkit-version` in the destination:
|
|
134
|
-
```bash
|
|
135
|
-
echo "{current_version}" > "{dest}/.claude/.ai-toolkit-version"
|
|
136
|
-
```
|
|
137
|
-
This file is read on future installs to show the version comparison prompt.
|
|
62
|
+
After the installer exits:
|
|
63
|
+
1. Confirm exit code was 0 — if non-zero, report the error and stop
|
|
64
|
+
2. Verify `.claude/.ai-toolkit-version` was written in the destination
|
|
138
65
|
|
|
139
66
|
---
|
|
140
67
|
|
|
141
|
-
## Step
|
|
68
|
+
## Step 4 — Verify subagent spawn depth (verify & advise ONLY — never write)
|
|
142
69
|
|
|
143
70
|
The orchestrated pipelines (`/implement-feature`, `/assess-codebase`) require the
|
|
144
71
|
environment variable `CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH` to be set to `2` or higher.
|
|
@@ -2,7 +2,7 @@ export const meta = {
|
|
|
2
2
|
name: 'am-phase1',
|
|
3
3
|
description: 'Assessment pipeline phase 1: discover assessment agents → scope filter → parallel assessment → intervention-documentation-standard → Token-Estimate → Effort-Estimate → findings_gate_payload.',
|
|
4
4
|
phases: [
|
|
5
|
-
{ title: 'Discovery', detail: '
|
|
5
|
+
{ title: 'Discovery', detail: 'Run ai-toolkit list-assets --category agents --format json, apply scope filter' },
|
|
6
6
|
{ title: 'Assessment', detail: 'Dispatch all assessment agents in parallel' },
|
|
7
7
|
{ title: 'Interventions', detail: 'Run intervention-documentation-standard on all findings' },
|
|
8
8
|
{ title: 'Estimates', detail: 'Write Token-Estimate and Effort-Estimate files' },
|
|
@@ -66,17 +66,14 @@ const SCOPE_AGENT_MAP = {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
const discovery = await agent(
|
|
69
|
-
`
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
- description (from the description: field)
|
|
78
|
-
|
|
79
|
-
Return { "assessment_agents": [ { "name": "...", "description": "..." }, ... ] }`,
|
|
69
|
+
`Run this command and parse its output:\n` +
|
|
70
|
+
`ai-toolkit list-assets --category agents --format json\n\n` +
|
|
71
|
+
`The command outputs a JSON array of installed agent file paths (e.g. [".claude/agents/foo.md", ...]).\n` +
|
|
72
|
+
`For each path in the array, read the file and extract the YAML frontmatter fields: name, description.\n\n` +
|
|
73
|
+
`An assessment agent is one whose file name or description contains one of: "assessment", "audit", "analysis".\n` +
|
|
74
|
+
`Exclude orchestrators (files containing "manager" in their name).\n` +
|
|
75
|
+
`Exclude remediation-only agents (files containing "refactoring", "hardening", "decomposition" in their name UNLESS they also contain "assessment" or "audit").\n\n` +
|
|
76
|
+
`Return { "assessment_agents": [ { "name": "...", "description": "..." }, ... ] }`,
|
|
80
77
|
{
|
|
81
78
|
label: 'discover-assessment-agents',
|
|
82
79
|
phase: 'Discovery',
|
|
@@ -138,7 +138,7 @@ const beforeValidate = budget.spent()
|
|
|
138
138
|
try {
|
|
139
139
|
const validateWrapper = await agent(
|
|
140
140
|
`Run this command and return the result as structured output:\n` +
|
|
141
|
-
`
|
|
141
|
+
`ai-toolkit run-asset scripts/wb-validate.js -- "${featureDir}/${prefix}-Work-Breakdown.json" "${featureDir}/${prefix}-Requirements.md"\n\n` +
|
|
142
142
|
`Capture exitCode (integer), stdout (string), stderr (string). Return all three.`,
|
|
143
143
|
{
|
|
144
144
|
label: 'wb-validate',
|
|
@@ -253,7 +253,7 @@ if (!canRender) {
|
|
|
253
253
|
try {
|
|
254
254
|
renderResult = await agent(
|
|
255
255
|
`Run this command and return the result as structured output:\n` +
|
|
256
|
-
`
|
|
256
|
+
`ai-toolkit run-asset scripts/wb-render.js -- "${featureDir}/${prefix}-Work-Breakdown.json" "${prefix}"\n\n` +
|
|
257
257
|
`Capture exitCode (integer), stdout (string), stderr (string).\n` +
|
|
258
258
|
`Resolve the expected output paths:\n` +
|
|
259
259
|
` markdownPath = "${featureDir}/${prefix}-Work-Breakdown.md"\n` +
|
package/.claude/scripts/.gitkeep
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|