@produck/agent-toolkit 0.3.3 → 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/README.md
CHANGED
|
@@ -2,6 +2,40 @@
|
|
|
2
2
|
|
|
3
3
|
Central CLI toolkit for organization-level AI execution workflows.
|
|
4
4
|
|
|
5
|
+
## First-time bootstrap (downstream repositories)
|
|
6
|
+
|
|
7
|
+
For a new or existing downstream repository that has not yet applied the
|
|
8
|
+
organization baseline, run:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm create @produck/agent-toolkit@latest
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
This command installs `@produck/create-agent-toolkit` and runs
|
|
15
|
+
`enforce-node-baseline` in the current directory. No prior installation is
|
|
16
|
+
required — npm handles the download automatically.
|
|
17
|
+
|
|
18
|
+
What it does (in order):
|
|
19
|
+
|
|
20
|
+
1. Syncs organization AI instruction files into `.github/instructions/produck/`
|
|
21
|
+
2. Runs preflight to verify required files and directories
|
|
22
|
+
3. Deploys the pinned `produck:coverage` script and `c8` devDependency
|
|
23
|
+
4. Deploys `.husky/pre-commit` and `.husky/commit-msg`, and pins `c8`, `husky`,
|
|
24
|
+
`lerna`, `@produck/agent-toolkit` in root `devDependencies`
|
|
25
|
+
|
|
26
|
+
After running, add the persistent enforcement entry to the repository
|
|
27
|
+
`package.json`:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
"produck:baseline": "npm exec --package=@produck/agent-toolkit@latest -- agent-toolkit enforce-node-baseline --cwd ."
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Then future enforcement runs via:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
npm run produck:baseline
|
|
37
|
+
```
|
|
38
|
+
|
|
5
39
|
## Commands
|
|
6
40
|
|
|
7
41
|
- agent-toolkit enforce-node-baseline
|
|
@@ -27,24 +61,54 @@ Equivalent explicit form:
|
|
|
27
61
|
npm exec -- agent-toolkit enforce-node-baseline --cwd .
|
|
28
62
|
```
|
|
29
63
|
|
|
30
|
-
|
|
64
|
+
`enforce-node-baseline` runs four steps in fixed order and stops at the first
|
|
65
|
+
failure:
|
|
66
|
+
|
|
67
|
+
1. `sync-instructions` — distribute organization AI instruction files into
|
|
68
|
+
`.github/instructions/produck/`
|
|
69
|
+
2. `preflight` — verify required files and directories exist
|
|
70
|
+
3. `sync-coverage-script` — deploy pinned `produck:coverage` script and `c8`
|
|
71
|
+
devDependency into each workspace package
|
|
72
|
+
4. `sync-husky-hooks` — deploy `.husky/pre-commit` and `.husky/commit-msg`,
|
|
73
|
+
and pin `c8`, `husky`, `lerna`, `@produck/agent-toolkit` in root
|
|
74
|
+
`devDependencies`
|
|
31
75
|
|
|
76
|
+
Add to downstream repository root `package.json` for one-command enforcement:
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
"produck:baseline": "npm exec --package=@produck/agent-toolkit@latest -- agent-toolkit enforce-node-baseline --cwd ."
|
|
32
80
|
```
|
|
33
|
-
|
|
81
|
+
|
|
82
|
+
Then run:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
npm run produck:baseline
|
|
34
86
|
```
|
|
35
87
|
|
|
36
|
-
|
|
88
|
+
Dry-run to preview changes without writing files:
|
|
37
89
|
|
|
38
90
|
```
|
|
39
|
-
npm exec -- agent-toolkit enforce-node-baseline --cwd .
|
|
91
|
+
npm exec -- agent-toolkit enforce-node-baseline --cwd . --dry-run
|
|
40
92
|
```
|
|
41
93
|
|
|
42
|
-
|
|
94
|
+
Check-only mode to validate without writing:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
npm exec -- agent-toolkit enforce-node-baseline --cwd . --check
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Validate monorepo root `package.json` scripts and workspace structure:
|
|
43
101
|
|
|
44
102
|
```
|
|
45
103
|
npm exec -- agent-toolkit preflight --cwd . --check-workspace-package-json package.json
|
|
46
104
|
```
|
|
47
105
|
|
|
106
|
+
Run preflight with required-file and directory guards:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
npm exec -- agent-toolkit preflight --cwd . --require package.json --ensure-dir logs
|
|
110
|
+
```
|
|
111
|
+
|
|
48
112
|
Capture long output safely:
|
|
49
113
|
|
|
50
114
|
```
|
|
@@ -70,9 +134,9 @@ Deploy organization local anti-drift husky hooks to repository root:
|
|
|
70
134
|
npm exec -- agent-toolkit sync-husky-hooks --cwd .
|
|
71
135
|
```
|
|
72
136
|
|
|
73
|
-
This command pins root local hook dependencies (`husky` and
|
|
74
|
-
`@produck/agent-toolkit`)
|
|
75
|
-
`.husky/commit-msg`.
|
|
137
|
+
This command pins root local hook dependencies (`c8`, `husky`, `lerna`, and
|
|
138
|
+
`@produck/agent-toolkit`) to organization baseline fixed versions and syncs
|
|
139
|
+
`.husky/pre-commit` and `.husky/commit-msg`.
|
|
76
140
|
|
|
77
141
|
Validate commit message format:
|
|
78
142
|
|
|
@@ -162,7 +226,8 @@ Workflow behavior:
|
|
|
162
226
|
|
|
163
227
|
Release policy:
|
|
164
228
|
|
|
165
|
-
-
|
|
229
|
+
- Central package is installed locally in downstream repositories at a fixed
|
|
230
|
+
version managed by `agent-toolkit sync-husky-hooks`.
|
|
166
231
|
- Run format:check and test first, then workspace `publish:dry-run` before
|
|
167
232
|
`publish`.
|
|
168
233
|
- Keep rollback option by republishing previous stable version if needed.
|
|
@@ -98,15 +98,10 @@ export function runEnforceNodeBaseline(options) {
|
|
|
98
98
|
syncInstructionsArgs.push('--dry-run');
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
const preflightArgs = [
|
|
102
|
-
|
|
103
|
-
'--
|
|
104
|
-
|
|
105
|
-
'--require',
|
|
106
|
-
'package.json',
|
|
107
|
-
'--check-workspace-package-json',
|
|
108
|
-
'package.json',
|
|
109
|
-
];
|
|
101
|
+
const preflightArgs = ['preflight', '--cwd', cwd, '--require', 'package.json'];
|
|
102
|
+
if (mode !== 'sync') {
|
|
103
|
+
preflightArgs.push('--check-workspace-package-json', 'package.json');
|
|
104
|
+
}
|
|
110
105
|
|
|
111
106
|
const syncCoverageArgs = ['sync-coverage-script', '--cwd', cwd];
|
|
112
107
|
for (const workspacePath of workspaces) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@produck/agent-toolkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Central CLI toolkit for organization AI execution workflows",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"coverage:check": "npm exec --yes -- c8 --check-coverage --lines 100 --functions 100 --branches 100 --statements 100 node --test test/index.mjs",
|
|
18
18
|
"test": "node --test test/index.mjs",
|
|
19
19
|
"verify": "node ./bin/agent-toolkit.mjs --help && node ./bin/agent-toolkit.mjs preflight --cwd . --require package.json",
|
|
20
|
-
"pack:check": "npm pack --dry-run"
|
|
20
|
+
"pack:check": "npm pack --dry-run",
|
|
21
|
+
"produck:coverage": "c8@11.0.0 --reporter=lcov --reporter=html --reporter=text-summary npm test"
|
|
21
22
|
},
|
|
22
23
|
"files": [
|
|
23
24
|
"bin",
|
|
@@ -30,5 +31,8 @@
|
|
|
30
31
|
"node": ">=18.0.0"
|
|
31
32
|
},
|
|
32
33
|
"license": "MIT",
|
|
33
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "c0aabcec12d70234cfc15cb741fe4ffcf5e4601e",
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"c8": "11.0.0"
|
|
37
|
+
}
|
|
34
38
|
}
|