@produck/agent-toolkit 0.2.1 → 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 +117 -8
- package/bin/agent-toolkit.mjs +28 -3
- package/bin/build-publish-assets.mjs +49 -0
- package/bin/command/enforce-node-baseline/help.txt +19 -0
- package/bin/command/enforce-node-baseline/index.mjs +150 -0
- package/bin/command/main/help.txt +7 -0
- package/bin/command/preflight/help.txt +6 -0
- package/bin/command/preflight/index.mjs +110 -21
- package/bin/command/sync-coverage-script/help.txt +22 -0
- package/bin/command/sync-coverage-script/index.mjs +275 -0
- package/bin/command/sync-husky-hooks/help.txt +22 -0
- package/bin/command/sync-husky-hooks/index.mjs +267 -0
- package/bin/command/validate-commit-msg/help.txt +1 -0
- package/bin/command/validate-commit-msg/index.mjs +31 -0
- package/package.json +7 -3
- package/publish-assets/instructions/produck/00-produck-base.instructions.md +25 -27
- package/publish-assets/instructions/produck/10-produck-node.instructions.md +130 -26
- package/publish-assets/instructions/produck/15-produck-workspace.instructions.md +53 -27
- package/publish-assets/instructions/produck/20-produck-commit.instructions.md +24 -11
- package/publish-assets/instructions/produck/tooling-version-baseline.json +32 -0
|
@@ -79,11 +79,7 @@ indent_style = space
|
|
|
79
79
|
indent_size = 2
|
|
80
80
|
trim_trailing_whitespace = true
|
|
81
81
|
|
|
82
|
-
[*.yml]
|
|
83
|
-
indent_style = space
|
|
84
|
-
indent_size = 2
|
|
85
|
-
|
|
86
|
-
[*.yaml]
|
|
82
|
+
[*.{yml,yaml}]
|
|
87
83
|
indent_style = space
|
|
88
84
|
indent_size = 2
|
|
89
85
|
|
|
@@ -145,8 +141,9 @@ max_line_length = 80
|
|
|
145
141
|
- If details are needed, use additional tagged lines.
|
|
146
142
|
- Do not keep summary as an untagged standalone line.
|
|
147
143
|
- Recommended local validation:
|
|
148
|
-
`npm exec --
|
|
149
|
-
|
|
144
|
+
`npm exec -- agent-toolkit validate-commit-msg --file <message-file>`.
|
|
145
|
+
- Commit precheck policy follows
|
|
146
|
+
`.github/distribution/produck/20-produck-commit.instructions.md`.
|
|
150
147
|
- Canonical source for commit tag/target whitelists, legacy mapping, and
|
|
151
148
|
target syntax is
|
|
152
149
|
`.github/distribution/produck/20-produck-commit.instructions.md`.
|
|
@@ -154,9 +151,6 @@ validate-commit-msg --file <message-file>`.
|
|
|
154
151
|
- For non-monorepo repositories, use `[TAG] summary` directly (no
|
|
155
152
|
package/workspace section headers).
|
|
156
153
|
- Bracketed commit summaries should be in English
|
|
157
|
-
- `[UPGRADE] deps` is allowed for pure dependency upgrades; if IFF artifacts or
|
|
158
|
-
IPC-related artifacts/calls are updated, the summary must name those updates
|
|
159
|
-
explicitly.
|
|
160
154
|
- PR title format is repository-defined; no organization-level title format
|
|
161
155
|
restriction
|
|
162
156
|
- In PR descriptions, summarize what changed, why it changed, how it was
|
|
@@ -186,14 +180,10 @@ Recommended three-step flow:
|
|
|
186
180
|
|
|
187
181
|
Recommended local tools:
|
|
188
182
|
|
|
189
|
-
- `npm exec --
|
|
190
|
-
--
|
|
191
|
-
- `npm exec --
|
|
192
|
-
--
|
|
193
|
-
- `npm exec --package=@produck/agent-toolkit@latest agent-toolkit summarize-log
|
|
194
|
-
--file logs/run.log --last 120`
|
|
195
|
-
- `npm exec --package=@produck/agent-toolkit@latest agent-toolkit summarize-log
|
|
196
|
-
--file logs/run.log --match "FAIL|ERROR"`
|
|
183
|
+
- `npm exec -- agent-toolkit preflight --cwd . --require package.json --ensure-dir logs`
|
|
184
|
+
- `npm exec -- agent-toolkit run-capture --out logs/run.log --cmd "<command>"`
|
|
185
|
+
- `npm exec -- agent-toolkit summarize-log --file logs/run.log --last 120`
|
|
186
|
+
- `npm exec -- agent-toolkit summarize-log --file logs/run.log --match "FAIL|ERROR"`
|
|
197
187
|
|
|
198
188
|
Guardrails:
|
|
199
189
|
|
|
@@ -250,18 +240,25 @@ When CI enforcement is deferred, use manual sync per repository:
|
|
|
250
240
|
|
|
251
241
|
Recommended command:
|
|
252
242
|
|
|
253
|
-
- `npm exec --
|
|
243
|
+
- `npm exec -- agent-toolkit sync-instructions --cwd . --source <path-to-org>/.github/distribution/produck --force --prune`
|
|
254
244
|
|
|
255
|
-
If the package
|
|
256
|
-
|
|
245
|
+
If the installed package includes bundled assets, `--source` can be omitted to
|
|
246
|
+
use those built-in assets.
|
|
257
247
|
|
|
258
248
|
This keeps instruction entrypoints aligned without requiring submodule or
|
|
259
249
|
automatic PR rollout.
|
|
260
250
|
|
|
261
251
|
### Central package execution policy
|
|
262
252
|
|
|
263
|
-
When bridge mechanism uses a central npm package,
|
|
264
|
-
|
|
253
|
+
When bridge mechanism uses a central npm package, the package is installed
|
|
254
|
+
locally in downstream repositories at a fixed version managed by the
|
|
255
|
+
organization baseline.
|
|
256
|
+
|
|
257
|
+
- Local install and pinned version are deployed by
|
|
258
|
+
`agent-toolkit sync-husky-hooks`.
|
|
259
|
+
- Invocation uses the locally installed copy:
|
|
260
|
+
`npm exec -- <bin> ...`.
|
|
261
|
+
- Do not use `npm exec --package=<pkg>@latest` for routine invocations.
|
|
265
262
|
|
|
266
263
|
Local implementation reference in this repository:
|
|
267
264
|
|
|
@@ -270,12 +267,12 @@ Local implementation reference in this repository:
|
|
|
270
267
|
- This local path is the implementation source, not an automatic runtime mount
|
|
271
268
|
for other repositories.
|
|
272
269
|
|
|
273
|
-
Required safeguards for
|
|
270
|
+
Required safeguards for central tooling:
|
|
274
271
|
|
|
275
272
|
- Print resolved package version before running high-impact commands.
|
|
276
273
|
- For high-risk operations, run dry-run/preview first, then execute.
|
|
277
274
|
- Keep an emergency fallback path to a pinned version for incident mitigation.
|
|
278
|
-
- Prefer `npm exec --
|
|
275
|
+
- Prefer `npm exec -- <bin> ...` for predictable invocation.
|
|
279
276
|
|
|
280
277
|
Version observability (required before high-impact operations):
|
|
281
278
|
|
|
@@ -307,7 +304,8 @@ Use the following template text in organization AI instructions:
|
|
|
307
304
|
- For large output tasks, use two phases: capture full output, then analyze.
|
|
308
305
|
- Avoid fragile shell pipeline post-processing for long-output commands.
|
|
309
306
|
- Central package policy:
|
|
310
|
-
-
|
|
307
|
+
- Central package is installed locally at a fixed organization-baseline version.
|
|
308
|
+
- Invoke via `npm exec -- <bin> ...` to use the locally installed copy.
|
|
311
309
|
- Print resolved package version before high-impact execution.
|
|
312
310
|
- Use dry-run first for risky operations; keep rollback path to pinned version.
|
|
313
311
|
- Commit message policy:
|
|
@@ -316,7 +314,7 @@ Use the following template text in organization AI instructions:
|
|
|
316
314
|
- Use only allowed tags: `[INIT]`, `[ADD]`, `[REMOVE]`, `[FIX]`,
|
|
317
315
|
`[REFACTOR]`, `[UPGRADE]`.
|
|
318
316
|
- Optional target syntax is `[TAG] <target>: <summary>` with target in:
|
|
319
|
-
`docs`, `test`, `ci`, `deps`, `api`, `schema`, `infra`.
|
|
317
|
+
`docs`, `test`, `ci`, `deps`, `api`, `schema`, `infra`, `fmt`.
|
|
320
318
|
- Do not assume scripts from organization `.github` repository exist in target
|
|
321
319
|
repositories.
|
|
322
320
|
- If a repository provides stricter rules, repository rules override
|
|
@@ -1,33 +1,19 @@
|
|
|
1
1
|
---
|
|
2
|
-
applyTo: '
|
|
2
|
+
applyTo: '**'
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
<!-- managed-by: @produck/agent-toolkit -->
|
|
6
6
|
<!-- source: .github/distribution/produck/10-produck-node.instructions.md -->
|
|
7
7
|
|
|
8
|
-
# Node.js
|
|
9
|
-
|
|
10
|
-
This document defines the organization-level initialization baseline for Node.js
|
|
11
|
-
repositories.
|
|
8
|
+
# Node.js Baseline (Monorepo + Standalone)
|
|
12
9
|
|
|
13
10
|
## Scope
|
|
14
11
|
|
|
15
|
-
- Applies to
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- Monorepo mode: one repository contains multiple Node.js packages/apps.
|
|
22
|
-
- Standalone mode: one repository represents one Node.js package/app.
|
|
23
|
-
- Repository owners should declare the selected mode in the repository README.
|
|
24
|
-
|
|
25
|
-
## Common baseline (all modes)
|
|
26
|
-
|
|
27
|
-
- Node.js version policy: LTS required (no fixed major version at organization
|
|
28
|
-
level).
|
|
29
|
-
- Package manager: npm only.
|
|
30
|
-
- Module system: ESM by default (`"type": "module"` in `package.json`).
|
|
12
|
+
- Applies to Node.js repositories in the organization.
|
|
13
|
+
- Default package manager: npm.
|
|
14
|
+
- Default language level: modern stable Node.js for current LTS.
|
|
15
|
+
- Module system: ESM by default for executable/publishable Node.js packages
|
|
16
|
+
(`"type": "module"` in package-level `package.json`).
|
|
31
17
|
- Follow the organization `.gitattributes` baseline (LF default for text files).
|
|
32
18
|
- Follow the organization `.editorconfig` baseline.
|
|
33
19
|
|
|
@@ -35,7 +21,7 @@ Required script keys:
|
|
|
35
21
|
|
|
36
22
|
- `deps:install`
|
|
37
23
|
- `test`
|
|
38
|
-
- `coverage`
|
|
24
|
+
- `produck:coverage`
|
|
39
25
|
- `lint`
|
|
40
26
|
- `publish`
|
|
41
27
|
|
|
@@ -44,9 +30,62 @@ Notes:
|
|
|
44
30
|
- Script key names are fixed and must match exactly.
|
|
45
31
|
- `publish` may be a no-op when repository-specific release workflow does not
|
|
46
32
|
use npm publishing.
|
|
33
|
+
- Coverage governance policy:
|
|
34
|
+
- Keep the script key name `produck:coverage` (organization-reserved key).
|
|
35
|
+
- In monorepo mode, workspace subpackage `scripts.produck:coverage` and
|
|
36
|
+
workspace `devDependencies.c8` are fully governed by organization
|
|
37
|
+
baseline.
|
|
38
|
+
- Source of truth for tooling versions/template:
|
|
39
|
+
`.github/distribution/produck/tooling-version-baseline.json`.
|
|
40
|
+
- Use central remediation command to deploy coverage scripts:
|
|
41
|
+
`npm exec -- agent-toolkit sync-coverage-script --cwd .`.
|
|
42
|
+
- Use central remediation command to deploy local anti-drift hook baseline:
|
|
43
|
+
`npm exec -- agent-toolkit sync-husky-hooks --cwd .`.
|
|
44
|
+
- `c8` execution baseline for deployed coverage scripts is fixed to the
|
|
45
|
+
version specified in `tooling-version-baseline.json`.
|
|
46
|
+
- Downstream repositories must not use unversioned `npx c8` or `c8@latest`
|
|
47
|
+
in shared scripts/CI.
|
|
48
|
+
- Root `devDependencies.c8` and root `devDependencies.lerna` must be pinned
|
|
49
|
+
to organization baseline fixed versions via `agent-toolkit sync-husky-hooks`.
|
|
47
50
|
|
|
48
51
|
- Testing strategy and framework are repository-defined.
|
|
49
|
-
-
|
|
52
|
+
- `test` script implementation is repository-defined and is not overwritten by
|
|
53
|
+
organization coverage remediation.
|
|
54
|
+
- Repositories should keep `npm run test` and `npm run produck:coverage`
|
|
55
|
+
executable in steady state.
|
|
56
|
+
- For intermediate commits, temporary non-executable state or failing tests are
|
|
57
|
+
allowed.
|
|
58
|
+
- Commit prechecks still require passing repository style gates (for example
|
|
59
|
+
`format:check` and `lint`).
|
|
60
|
+
|
|
61
|
+
Central toolkit command role model:
|
|
62
|
+
|
|
63
|
+
- `agent-toolkit sync-instructions` is guidance-first distribution for
|
|
64
|
+
organization baseline instructions.
|
|
65
|
+
- `sync-instructions` is not a hard gate; use it to reduce instruction drift,
|
|
66
|
+
but do not assume it can fully prevent AI hallucination or iterative drift.
|
|
67
|
+
- `agent-toolkit preflight` is the hard guard for organization engineering
|
|
68
|
+
baseline and is mandatory for required baseline checks.
|
|
69
|
+
- `agent-toolkit sync-coverage-script` is the hard guard for monorepo coverage
|
|
70
|
+
governance and is mandatory in monorepo mode.
|
|
71
|
+
- `agent-toolkit sync-husky-hooks` is the hard guard for local anti-drift hook
|
|
72
|
+
governance and is mandatory in monorepo mode.
|
|
73
|
+
- For simplified downstream execution of mandatory flow (1 -> 2 -> 3 -> 4),
|
|
74
|
+
use:
|
|
75
|
+
`npm exec -- agent-toolkit`.
|
|
76
|
+
- Equivalent explicit form:
|
|
77
|
+
`npm exec -- agent-toolkit enforce-node-baseline --cwd .`.
|
|
78
|
+
- `agent-toolkit validate-commit-msg` is a hard guard for AI-agent-authored
|
|
79
|
+
`git commit` and `git commit --amend` operations.
|
|
80
|
+
- For human engineers, commit-message validation is recommended rather than
|
|
81
|
+
mandatory unless repository-specific hooks/CI enforce it.
|
|
82
|
+
- Do not require retroactive rewrite/amend of historical commits solely to
|
|
83
|
+
satisfy commit-message validator rules.
|
|
84
|
+
- `agent-toolkit run-capture` and `agent-toolkit summarize-log` are AI-agent
|
|
85
|
+
execution guardrails.
|
|
86
|
+
- These guardrails pair with node-first execution policy: prefer Node.js
|
|
87
|
+
interpreter workflows for parsing/filtering over brittle OS-shell pipelines.
|
|
88
|
+
- For human engineers, `run-capture` and `summarize-log` are optional helpers.
|
|
50
89
|
|
|
51
90
|
Test authoring baseline (required):
|
|
52
91
|
|
|
@@ -114,9 +153,69 @@ Repository layout:
|
|
|
114
153
|
|
|
115
154
|
Script placement:
|
|
116
155
|
|
|
117
|
-
- Root `package.json` must provide `deps:install`, `test`, `coverage`,
|
|
118
|
-
`lint` orchestration scripts.
|
|
156
|
+
- Root `package.json` must provide `deps:install`, `test`, `produck:coverage`,
|
|
157
|
+
and `lint` orchestration scripts.
|
|
158
|
+
- Root `package.json` must reserve `produck:precommit-check` for organization
|
|
159
|
+
anti-drift gate with required value:
|
|
160
|
+
`npm run format:check && npm run lint`.
|
|
161
|
+
- Root `package.json` must reserve `prepare` for husky setup with required
|
|
162
|
+
value: `husky`.
|
|
119
163
|
- `publish` may be defined at root or package level based on release workflow.
|
|
164
|
+
- Workspace subpackage `produck:coverage` scripts must be synchronized by
|
|
165
|
+
`agent-toolkit sync-coverage-script`.
|
|
166
|
+
- Root local hook governance must be synchronized by
|
|
167
|
+
`agent-toolkit sync-husky-hooks`.
|
|
168
|
+
- Root local hook governance must pin root `devDependencies.c8`,
|
|
169
|
+
`devDependencies.husky`, `devDependencies.lerna`, and
|
|
170
|
+
`devDependencies.@produck/agent-toolkit` via
|
|
171
|
+
`agent-toolkit sync-husky-hooks`.
|
|
172
|
+
- Root `package.json` must define a `produck:baseline` script for organization
|
|
173
|
+
baseline enforcement:
|
|
174
|
+
```json
|
|
175
|
+
"produck:baseline": "npm exec --package=@produck/agent-toolkit@latest -- agent-toolkit enforce-node-baseline --cwd ."
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Release tooling policy (required):
|
|
179
|
+
|
|
180
|
+
- Monorepo release workflow must use `lerna`.
|
|
181
|
+
- `lerna` execution version is governed at organization level, not per
|
|
182
|
+
repository.
|
|
183
|
+
- Source of truth for `lerna` version baseline:
|
|
184
|
+
`.github/distribution/produck/tooling-version-baseline.json`.
|
|
185
|
+
- Required execution baseline: version specified in `tooling-version-baseline.json`.
|
|
186
|
+
- Required invocation:
|
|
187
|
+
`npm exec -- lerna <subcommand>`.
|
|
188
|
+
- Downstream repositories must not use unversioned `npx lerna` or
|
|
189
|
+
`lerna@latest` in shared scripts/CI.
|
|
190
|
+
- For high-impact release commands, run dry-run/preview before publish.
|
|
191
|
+
- Keep an emergency organization-level rollback path when baseline version is
|
|
192
|
+
updated.
|
|
193
|
+
|
|
194
|
+
Root workspace `package.json` minimal baseline (required):
|
|
195
|
+
|
|
196
|
+
- `private`: `true`
|
|
197
|
+
- `workspaces` (explicit package path list only)
|
|
198
|
+
- `scripts` with at least: `deps:install`, `test`, `produck:coverage`, `lint`
|
|
199
|
+
- `publish` script is optional at root when release is managed per package or
|
|
200
|
+
by external workflow.
|
|
201
|
+
|
|
202
|
+
`workspaces` field constraints (required):
|
|
203
|
+
|
|
204
|
+
- Do not use wildcard/glob patterns (for example `packages/*`, `**`, `?`,
|
|
205
|
+
`{}` or `[]`).
|
|
206
|
+
- List each workspace package path explicitly.
|
|
207
|
+
|
|
208
|
+
Avoid unused root runtime/publish fields by default:
|
|
209
|
+
|
|
210
|
+
- `type`
|
|
211
|
+
- `main`
|
|
212
|
+
- `exports`
|
|
213
|
+
- `types`
|
|
214
|
+
- `files`
|
|
215
|
+
- `publishConfig`
|
|
216
|
+
|
|
217
|
+
Add the fields above only when the monorepo root itself is an executable
|
|
218
|
+
runtime package or is intentionally published.
|
|
120
219
|
|
|
121
220
|
Ignore strategy:
|
|
122
221
|
|
|
@@ -133,7 +232,12 @@ Repository layout:
|
|
|
133
232
|
Script placement:
|
|
134
233
|
|
|
135
234
|
- The repository root `package.json` must define `deps:install`, `test`,
|
|
136
|
-
`coverage`, `lint`, and `publish`.
|
|
235
|
+
`produck:coverage`, `lint`, and `publish`.
|
|
236
|
+
- Root `package.json` must define a `produck:baseline` script for organization
|
|
237
|
+
baseline enforcement:
|
|
238
|
+
```json
|
|
239
|
+
"produck:baseline": "npm exec --package=@produck/agent-toolkit@latest -- agent-toolkit enforce-node-baseline --cwd ."
|
|
240
|
+
```
|
|
137
241
|
|
|
138
242
|
Ignore strategy:
|
|
139
243
|
|
|
@@ -53,13 +53,20 @@ export default [
|
|
|
53
53
|
];
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
### 2. TypeScript Configuration (`tsconfig.json
|
|
56
|
+
### 2. TypeScript Configuration (`tsconfig.json`, conditional)
|
|
57
57
|
|
|
58
|
-
**Location:** Root `tsconfig.json`
|
|
58
|
+
**Location:** Root `tsconfig.json` (only when needed)
|
|
59
59
|
|
|
60
|
-
**Applies to:**
|
|
60
|
+
**Applies to:** TypeScript packages that opt in
|
|
61
61
|
|
|
62
|
-
**
|
|
62
|
+
**Decision rule:**
|
|
63
|
+
|
|
64
|
+
- If the workspace has no TypeScript source files and no package-level need for
|
|
65
|
+
shared TypeScript options, do not create/deploy root `tsconfig.json`.
|
|
66
|
+
- If any package uses TypeScript source files or needs centralized strict/type
|
|
67
|
+
options, create root `tsconfig.json` and let TypeScript packages extend it.
|
|
68
|
+
|
|
69
|
+
**Recommended key settings when present:**
|
|
63
70
|
|
|
64
71
|
- Target: ES2022
|
|
65
72
|
- Strict mode: enabled
|
|
@@ -67,7 +74,7 @@ export default [
|
|
|
67
74
|
- Source maps: enabled
|
|
68
75
|
- Declaration files: generated
|
|
69
76
|
|
|
70
|
-
**Usage in packages:**
|
|
77
|
+
**Usage in TypeScript packages:**
|
|
71
78
|
|
|
72
79
|
```json
|
|
73
80
|
{
|
|
@@ -127,7 +134,7 @@ export default [
|
|
|
127
134
|
### Verification & Quality
|
|
128
135
|
|
|
129
136
|
```bash
|
|
130
|
-
# Type check all packages
|
|
137
|
+
# Type check all packages (optional: only when root tsconfig.json is present)
|
|
131
138
|
npm run type-check
|
|
132
139
|
|
|
133
140
|
# Format check without writing
|
|
@@ -146,19 +153,40 @@ npm run test
|
|
|
146
153
|
npm run coverage
|
|
147
154
|
```
|
|
148
155
|
|
|
149
|
-
###
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
156
|
+
### Release & Coverage Tooling
|
|
157
|
+
|
|
158
|
+
- Monorepo release workflow is `lerna`-based and required.
|
|
159
|
+
- Source of truth for `lerna`/`c8` versions and coverage script template:
|
|
160
|
+
`.github/distribution/produck/tooling-version-baseline.json`.
|
|
161
|
+
- `lerna` execution version is governed at organization level, not per
|
|
162
|
+
repository.
|
|
163
|
+
- Required execution baseline: version specified in `tooling-version-baseline.json`.
|
|
164
|
+
- Required `lerna` invocation:
|
|
165
|
+
`npm exec -- lerna <subcommand>`.
|
|
166
|
+
- Shared scripts/CI must not use unversioned `npx lerna` or `lerna@latest`.
|
|
167
|
+
- Wrapper scripts are allowed, but should keep parity with organization version
|
|
168
|
+
policy.
|
|
169
|
+
- Workspace subpackage coverage scripts are fully organization-governed.
|
|
170
|
+
- Deploy/repair coverage scripts via central remediation command:
|
|
171
|
+
`npm exec -- agent-toolkit sync-coverage-script --cwd .`.
|
|
172
|
+
- Root anti-drift local hook baseline is organization-governed.
|
|
173
|
+
- Deploy/repair root local hooks via central remediation command:
|
|
174
|
+
`npm exec -- agent-toolkit sync-husky-hooks --cwd .`.
|
|
175
|
+
- Deployed coverage scripts use the `c8` version specified in
|
|
176
|
+
`tooling-version-baseline.json` for each governed workspace package.
|
|
177
|
+
- Deployed local hook baseline uses the `husky` version specified in
|
|
178
|
+
`tooling-version-baseline.json` for root `devDependencies.husky`.
|
|
179
|
+
- Deployed local hook baseline also pins root
|
|
180
|
+
`devDependencies.@produck/agent-toolkit` to the fixed version managed by the organization baseline.
|
|
181
|
+
- Shared scripts/CI must not use unversioned `npx c8` or `c8@latest`.
|
|
182
|
+
- `test` script implementation remains repository-defined and is not overwritten
|
|
183
|
+
by coverage remediation.
|
|
184
|
+
- Root `devDependencies.c8` is pinned at root by `agent-toolkit sync-husky-hooks`;
|
|
185
|
+
workspace package `devDependencies.c8` is pinned per package by
|
|
186
|
+
`agent-toolkit sync-coverage-script`.
|
|
187
|
+
- Root local hooks may be bypassed intentionally by developers (for example via
|
|
188
|
+
`--no-verify`) and are treated as local strong guardrails rather than
|
|
189
|
+
immutable release gates.
|
|
162
190
|
|
|
163
191
|
## Package Integration
|
|
164
192
|
|
|
@@ -168,7 +196,8 @@ npm run eslint-rules:pack-check
|
|
|
168
196
|
2. Create `packages/my-package/package.json` with workspace configuration
|
|
169
197
|
3. Inherit root configs:
|
|
170
198
|
- ESLint: extend `../../eslint.config.mjs`
|
|
171
|
-
- TypeScript
|
|
199
|
+
- TypeScript (when root `tsconfig.json` exists): extend
|
|
200
|
+
`../../tsconfig.json`
|
|
172
201
|
- Prettier: uses root `.prettierrc` automatically
|
|
173
202
|
|
|
174
203
|
### Package-Level Overrides
|
|
@@ -213,8 +242,8 @@ Applies to all editors supporting EditorConfig (VSCode, Vim, Sublime, etc.):
|
|
|
213
242
|
- `typescript-eslint`: TypeScript linting support
|
|
214
243
|
- `globals`: Global variables (browser, node)
|
|
215
244
|
- `prettier`: Code formatter
|
|
216
|
-
- `typescript`: TypeScript compiler
|
|
217
|
-
- `@types/node`: Node.js type definitions
|
|
245
|
+
- `typescript`: TypeScript compiler (when TypeScript is used)
|
|
246
|
+
- `@types/node`: Node.js type definitions (when TypeScript is used)
|
|
218
247
|
|
|
219
248
|
### Peer Dependencies (Packages)
|
|
220
249
|
|
|
@@ -236,16 +265,13 @@ Root scripts are designed for CI pipelines:
|
|
|
236
265
|
```bash
|
|
237
266
|
# Pre-commit checks
|
|
238
267
|
npm run format:check
|
|
268
|
+
# Optional when root tsconfig.json is used
|
|
239
269
|
npm run type-check
|
|
240
270
|
npm run lint
|
|
241
271
|
|
|
242
272
|
# Testing
|
|
243
273
|
npm run test
|
|
244
274
|
npm run coverage
|
|
245
|
-
|
|
246
|
-
# Package verification
|
|
247
|
-
npm run toolkit:verify
|
|
248
|
-
npm run eslint-rules:verify
|
|
249
275
|
```
|
|
250
276
|
|
|
251
277
|
## Best Practices
|
|
@@ -273,7 +299,7 @@ Root `.prettierrc` and `eslint.config.mjs` are synchronized. If conflict occurs:
|
|
|
273
299
|
1. Check both configs have matching rules
|
|
274
300
|
2. Run `npm run format` first, then `npm run lint`
|
|
275
301
|
|
|
276
|
-
### TypeScript includes too many files
|
|
302
|
+
### TypeScript includes too many files (when root tsconfig.json is used)
|
|
277
303
|
|
|
278
304
|
Update `tsconfig.json` `include` and `exclude` patterns:
|
|
279
305
|
|
|
@@ -59,12 +59,6 @@ Allowed tags (fixed whitelist):
|
|
|
59
59
|
- `[UPGRADE]`
|
|
60
60
|
- `[PUBLISH]`
|
|
61
61
|
|
|
62
|
-
Legacy-to-canonical mapping (for migration):
|
|
63
|
-
|
|
64
|
-
- `[ADDED]` -> `[ADD]`
|
|
65
|
-
- `[REMOVED]` -> `[REMOVE]`
|
|
66
|
-
- `[FIXED]` -> `[FIX]`
|
|
67
|
-
|
|
68
62
|
When using this style:
|
|
69
63
|
|
|
70
64
|
- `TAG` must be uppercase and must be one of the allowed tags above.
|
|
@@ -163,11 +157,30 @@ Avoid vague or low-signal messages such as:
|
|
|
163
157
|
|
|
164
158
|
Use the local validator before commit:
|
|
165
159
|
|
|
166
|
-
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
160
|
+
- AI-agent-authored commits/amends:
|
|
161
|
+
validation is required before both `git commit` and `git commit --amend`.
|
|
162
|
+
- For AI-agent-authored operations, do not create or amend a commit when
|
|
163
|
+
validation fails.
|
|
164
|
+
- Human engineer-authored commits/amends:
|
|
165
|
+
validation is recommended by default and may be enforced by
|
|
166
|
+
repository-specific hooks/CI.
|
|
167
|
+
- Do not require retroactive rewrite/amend of historical commits solely for
|
|
168
|
+
commit-message style compliance.
|
|
169
|
+
|
|
170
|
+
Commit precheck gate (AI-agent required, human recommended):
|
|
171
|
+
|
|
172
|
+
- For AI-agent-authored operations, complete repository style gates before both
|
|
173
|
+
`git commit` and `git commit --amend` (for example `format:check` and
|
|
174
|
+
`lint`).
|
|
175
|
+
- For human engineer-authored operations, style gates are recommended baseline
|
|
176
|
+
practice unless repository-specific hooks/CI enforce them.
|
|
177
|
+
- Temporary non-executable state or failing tests are allowed for
|
|
178
|
+
intermediate commits.
|
|
179
|
+
- Test/coverage pass status is not a hard blocker at commit time.
|
|
180
|
+
- Before merge or release, restore executable test commands and fix failing
|
|
181
|
+
tests.
|
|
182
|
+
|
|
183
|
+
- `npm exec -- agent-toolkit validate-commit-msg --file <message-file>`
|
|
171
184
|
|
|
172
185
|
If validation fails, fix the message and rerun until it passes.
|
|
173
186
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"updatedAt": "2026-05-12",
|
|
4
|
+
"tools": {
|
|
5
|
+
"c8": {
|
|
6
|
+
"version": "11.0.0",
|
|
7
|
+
"policy": "pinned",
|
|
8
|
+
"allowLatest": false
|
|
9
|
+
},
|
|
10
|
+
"husky": {
|
|
11
|
+
"version": "9.1.7",
|
|
12
|
+
"policy": "pinned",
|
|
13
|
+
"allowLatest": false
|
|
14
|
+
},
|
|
15
|
+
"lerna": {
|
|
16
|
+
"version": "9.0.7",
|
|
17
|
+
"policy": "pinned",
|
|
18
|
+
"allowLatest": false
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"coverage": {
|
|
22
|
+
"scriptTemplate": "c8@{c8.version} --reporter=lcov --reporter=html --reporter=text-summary npm test"
|
|
23
|
+
},
|
|
24
|
+
"enforce": {
|
|
25
|
+
"sharedScriptsDisallow": [
|
|
26
|
+
"npx c8",
|
|
27
|
+
"c8@latest",
|
|
28
|
+
"npx lerna",
|
|
29
|
+
"lerna@latest"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
}
|