@punks/cli 5.0.0 → 5.1.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.
Files changed (33) hide show
  1. package/dist/BASELINE_CHANGELOG.md +33 -1
  2. package/dist/CHANGELOG.md +45 -0
  3. package/dist/baseline/scaffold-baseline/baseline.json +15 -5
  4. package/dist/baseline/scaffold-baseline/data/catalog/packs.json +11 -1
  5. package/dist/baseline/scaffold-baseline/data/catalog/skills.json +16 -0
  6. package/dist/baseline/scaffold-baseline/data/scripts/commit-gate-runner.d.ts +2 -1
  7. package/dist/baseline/scaffold-baseline/data/scripts/commit-gate-runner.mjs +21 -5
  8. package/dist/baseline/scaffold-baseline/data/scripts/commit-gate-runner.test.ts +192 -14
  9. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/commands.md +4 -2
  10. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/post-command-flow.md +10 -4
  11. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/verify-behavior/SKILL.md +1 -1
  12. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/verify-behavior/agents/openai.yaml +2 -0
  13. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/SKILL.md +1 -1
  14. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-backend-structure/SKILL.md +8 -7
  15. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-backend-structure/references/layout.md +32 -6
  16. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-service-design/SKILL.md +2 -0
  17. package/dist/baseline/scaffold-baseline/skills/frameworks/react/react-doctor/SKILL.md +19 -4
  18. package/dist/baseline/scaffold-baseline/skills/frameworks/react/react-doctor/references/explain.md +5 -1
  19. package/dist/baseline/scaffold-baseline.json +5 -5
  20. package/dist/baseline/scaffold-baseline.tgz +0 -0
  21. package/dist/data/scripts/commit-gate-runner.mjs +21 -5
  22. package/dist/index.js +19 -18
  23. package/dist/skills/agnostic/cli/hi-cli/references/commands.md +4 -2
  24. package/dist/skills/agnostic/cli/hi-cli/references/post-command-flow.md +10 -4
  25. package/dist/skills/agnostic/planning/verify-behavior/SKILL.md +1 -1
  26. package/dist/skills/agnostic/planning/verify-behavior/agents/openai.yaml +2 -0
  27. package/dist/skills/agnostic/quality/tdd/SKILL.md +1 -1
  28. package/dist/skills/frameworks/effect/effect-backend-structure/SKILL.md +8 -7
  29. package/dist/skills/frameworks/effect/effect-backend-structure/references/layout.md +32 -6
  30. package/dist/skills/frameworks/effect/effect-service-design/SKILL.md +2 -0
  31. package/dist/skills/frameworks/react/react-doctor/SKILL.md +19 -4
  32. package/dist/skills/frameworks/react/react-doctor/references/explain.md +5 -1
  33. package/package.json +1 -1
@@ -2,10 +2,38 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
- Compatibility: `>=5.0.0 <5.1.0`
5
+ Compatibility: `>=5.1.0 <5.2.0`
6
+
7
+ ### Added
8
+
9
+ - Distribute `verify-behavior`, `create-verification-skill`, and
10
+ `update-verification-skill` together in the default verification pack while
11
+ preserving project-owned verifier reference bytes (#207).
6
12
 
7
13
  ### Fixed
8
14
 
15
+ - Restore Effect internal-module topology and repository-boundary guidance; keep
16
+ service qualification and application policy in `effect-service-design` (#205).
17
+ - Sync canonical `wearedevpunks/skills@0519d685213a8085928bde8a5d744fcd6737c931`
18
+ from immutable tag `sync/release-issues-203-207-0519d68`.
19
+ - Limit automatic React Doctor and TDD activation to their intended task
20
+ boundaries, and resolve React Doctor changed scans from the checked-out branch's
21
+ configured origin upstream with an explicit base. Keep `verify-behavior`
22
+ available to explicit orchestration without top-level automatic activation
23
+ (#206).
24
+ - Preserve repository-owned wiki starters and intentionally skipped seeds through
25
+ scaffold/update/check; validate empty directory markers by presence rather than
26
+ authored text (#203).
27
+ - Align generated Oxlint plugin aliases and root JSON policy planning, and refresh
28
+ handoff output from completed authoring so normal update converges (#203).
29
+ - Resolve Commit Gate contract roots from the current checkout or linked
30
+ worktree, and report actionable working-directory and process-launch errors
31
+ instead of an empty exit-1 failure (#204).
32
+ - Resolve the latest canonical `wearedevpunks/skills` `main` once per operator
33
+ command, freeze its immutable commit across scopes and readbacks, and install
34
+ or update only exact verified `hi-cli` content without falling back to the
35
+ compiled skill.
36
+
9
37
  - Materialize Commit Gate setup from the selected nested package root in
10
38
  repositories without a root `package.json`.
11
39
  - Persist independently completed reconciliation receipt entries when Commit
@@ -59,6 +87,10 @@ Compatibility: `>=5.0.0 <5.1.0`
59
87
 
60
88
  ### Changed
61
89
 
90
+ - Clarify that scaffold and update install the shared `verify-behavior` skill
91
+ while preserving project-owned verification references; `implement-spec`
92
+ remains responsible for Uncovered Surface and Uncovered Behavior work.
93
+
62
94
  - Sync canonical `wearedevpunks/skills@584ea4bddd5bcfcf780baf9fb67ff736ba7d0626`; apply the `$writing-for-agents` cleanup for bounded ordered brainstorm evidence and decision criteria, audit the PR #189 Finder entries, and keep `delivery-phase` human-only in its description and metadata.
63
95
  - Make `write-backlog` reconcile existing provider structure before mutation and project lateral Fogs into Area → Initiative → Epic → milestone-bound Story → required Task work with native blockers.
64
96
  - Keep delivery status tied to observed work and production evidence, and add approval-gated backlog Normalization without introducing CI/CD design.
package/dist/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ## 5.1.0 - 2026-09-15
6
+
7
+ ### Added
8
+
9
+ - Distribute `verify-behavior`, `create-verification-skill`, and
10
+ `update-verification-skill` together in the default verification pack while
11
+ preserving project-owned verifier reference bytes (#207).
12
+
13
+ ### Fixed
14
+
15
+ - Preserve repository-owned wiki starters during scaffold/check/update and honor
16
+ populated directories and flat routes without false missing-seed findings (#203).
17
+ - Resolve nested Oxlint transition rules through registered workspace plugin
18
+ aliases and retain JSON lint policy in both planning and materialization (#203).
19
+ - Regenerate managed handoffs from current authoring proofs so completed
20
+ post-command work does not leave stale pending actions (#203).
21
+ - Resolve Commit Gate contract roots from the current checkout or linked
22
+ worktree, and report actionable working-directory and process-launch errors
23
+ instead of an empty exit-1 failure (#204).
24
+ - Restore Effect internal-module topology and repository-boundary guidance while
25
+ keeping service qualification and application policy in `effect-service-design`
26
+ (#205).
27
+ - Limit automatic React Doctor and TDD activation to their intended task
28
+ boundaries, and resolve React Doctor changed scans from the checked-out branch's
29
+ configured origin upstream with an explicit base. Keep `verify-behavior`
30
+ available to explicit orchestration without top-level automatic activation
31
+ (#206).
32
+
33
+ ## 5.0.1 - 2026-09-10
34
+
35
+ ### Fixed
36
+
37
+ - Resolve the latest canonical `wearedevpunks/skills` `main` once per operator
38
+ command, freeze its immutable commit across scopes and readbacks, and install
39
+ or update only exact verified `hi-cli` content without falling back to the
40
+ compiled skill.
41
+
42
+ ### Changed
43
+
44
+ - Clarify that scaffold and update install the shared `verify-behavior` skill
45
+ while preserving project-owned verification references; `implement-spec`
46
+ remains responsible for Uncovered Surface and Uncovered Behavior work.
47
+
3
48
  ## 5.0.0 - 2026-09-10
4
49
 
5
50
  ### Added
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "channel": "stable",
4
- "version": "2026.09.10-2742715b",
5
- "tag": "baseline/stable/2026.09.10-2742715b",
6
- "commit": "2742715b851c533aff245e27182e671cb9f99911",
4
+ "version": "2026.09.15-1ee7f8b7",
5
+ "tag": "baseline/stable/2026.09.15-1ee7f8b7",
6
+ "commit": "1ee7f8b72f8fe116ad74aa15923238d3b985c751",
7
7
  "sha256": null,
8
8
  "compatibility": {
9
- "cliVersionRange": ">=5.0.0 <5.1.0"
9
+ "cliVersionRange": ">=5.1.0 <5.2.0"
10
10
  },
11
- "generatedAt": "2026-09-10T09:52:11.000Z",
11
+ "generatedAt": "2026-09-15T22:12:46.000Z",
12
12
  "capabilities": {
13
13
  "scopedAuthoring": {
14
14
  "revision": "1",
@@ -68,6 +68,11 @@
68
68
  "authoringRevision": "1",
69
69
  "id": "create-spec"
70
70
  },
71
+ {
72
+ "activationRevision": "1",
73
+ "authoringRevision": "1",
74
+ "id": "create-verification-skill"
75
+ },
71
76
  {
72
77
  "activationRevision": "1",
73
78
  "authoringRevision": "1",
@@ -368,6 +373,11 @@
368
373
  "authoringRevision": "1",
369
374
  "id": "implement-spec"
370
375
  },
376
+ {
377
+ "activationRevision": "1",
378
+ "authoringRevision": "1",
379
+ "id": "update-verification-skill"
380
+ },
371
381
  {
372
382
  "activationRevision": "1",
373
383
  "authoringRevision": "1",
@@ -253,12 +253,22 @@
253
253
  "create-spec",
254
254
  "create-plan",
255
255
  "implement-spec",
256
- "verify-behavior",
257
256
  "repo-asset-management",
258
257
  "resolve-debt-phase"
259
258
  ],
260
259
  "triggerPackages": []
261
260
  },
261
+ {
262
+ "category": "default",
263
+ "description": "Default verification pack.",
264
+ "hooks": [],
265
+ "id": "verification",
266
+ "lintAssets": [],
267
+ "promptDetails": [],
268
+ "promptSurfaces": [],
269
+ "skills": ["create-verification-skill", "update-verification-skill", "verify-behavior"],
270
+ "triggerPackages": []
271
+ },
262
272
  {
263
273
  "category": "detected",
264
274
  "description": "Pulumi guidance pack.",
@@ -87,6 +87,14 @@
87
87
  "sourceDirectory": "skills/agnostic/planning/create-spec",
88
88
  "tier": "agnostic"
89
89
  },
90
+ {
91
+ "framework": null,
92
+ "id": "create-verification-skill",
93
+ "language": null,
94
+ "requiresTools": [],
95
+ "sourceDirectory": "skills/agnostic/planning/create-verification-skill",
96
+ "tier": "agnostic"
97
+ },
90
98
  {
91
99
  "framework": null,
92
100
  "id": "delivery-phase",
@@ -567,6 +575,14 @@
567
575
  "sourceDirectory": "skills/agnostic/planning/implement-spec",
568
576
  "tier": "agnostic"
569
577
  },
578
+ {
579
+ "framework": null,
580
+ "id": "update-verification-skill",
581
+ "language": null,
582
+ "requiresTools": [],
583
+ "sourceDirectory": "skills/agnostic/planning/update-verification-skill",
584
+ "tier": "agnostic"
585
+ },
570
586
  {
571
587
  "framework": null,
572
588
  "id": "verify-behavior",
@@ -3,7 +3,8 @@ export interface CommitGateRunnerContract {
3
3
  readonly lint: string;
4
4
  readonly owner?: string;
5
5
  readonly path?: string;
6
- readonly root: string;
6
+ /** Accepted for legacy contracts, but never used as execution authority. */
7
+ readonly root?: string;
7
8
  }
8
9
 
9
10
  export type CommitGateRunnerResult =
@@ -15,10 +15,20 @@ const run = async (command, cwd, environment) => {
15
15
  env: { ...process.env, ...environment },
16
16
  maxBuffer: 10 * 1024 * 1024,
17
17
  });
18
- return { code: 0, stderr: result.stderr, stdout: result.stdout };
18
+ return { code: 0, launchError: "", stderr: result.stderr, stdout: result.stdout };
19
19
  } catch (error) {
20
+ const launchError =
21
+ typeof error.code === "number"
22
+ ? ""
23
+ : [
24
+ typeof error.code === "string" ? error.code : "",
25
+ error instanceof Error ? error.message : String(error),
26
+ ]
27
+ .filter(Boolean)
28
+ .join(": ");
20
29
  return {
21
30
  code: typeof error.code === "number" ? error.code : 1,
31
+ launchError,
22
32
  stderr: error.stderr ?? "",
23
33
  stdout: error.stdout ?? "",
24
34
  };
@@ -36,6 +46,11 @@ const stagedPaths = async () => {
36
46
  return stdout.split("\0").filter(Boolean);
37
47
  };
38
48
 
49
+ const activeWorktreeRoot = async () => {
50
+ const { stdout } = await execFile("git", ["rev-parse", "--show-toplevel"]);
51
+ return stdout.replace(/\n$/u, "");
52
+ };
53
+
39
54
  const shellQuote = (value) => `'${value.replaceAll("'", "'\\''")}'`;
40
55
 
41
56
  const argument = (name) => {
@@ -51,6 +66,7 @@ if (contractsPath === null) {
51
66
  try {
52
67
  const contractsContent = await readFile(contractsPath, "utf-8");
53
68
  const contracts = JSON.parse(contractsContent);
69
+ const worktreeRoot = await activeWorktreeRoot();
54
70
  const staged = await stagedPaths();
55
71
  if (staged.length === 0) {
56
72
  process.exit(0);
@@ -59,7 +75,7 @@ if (contractsPath === null) {
59
75
  const failuresByContract = await Promise.all(
60
76
  contracts.map(async (contract) => {
61
77
  const relativePath = contract.path ?? ".";
62
- const root = path.resolve(contract.root ?? process.cwd(), relativePath);
78
+ const ownerCwd = path.resolve(worktreeRoot, relativePath);
63
79
  const prefix =
64
80
  relativePath === "." || relativePath === "" ? "" : `${relativePath.replace(/\/$/u, "")}/`;
65
81
  const files = staged
@@ -79,10 +95,10 @@ if (contractsPath === null) {
79
95
  const command = scopedTemplate.includes("{files}")
80
96
  ? scopedTemplate.replaceAll("{files}", fileArguments)
81
97
  : `${scopedTemplate} -- ${fileArguments}`;
82
- const result = await run(command, root, {
98
+ const result = await run(command, ownerCwd, {
83
99
  HI_STAGED_FILES: files.join("\n"),
84
100
  });
85
- return { ...result, kind, owner: contract.owner ?? root };
101
+ return { ...result, cwd: ownerCwd, kind, owner: contract.owner ?? ownerCwd };
86
102
  }),
87
103
  );
88
104
  return results.filter((result) => result.code !== 0);
@@ -92,7 +108,7 @@ if (contractsPath === null) {
92
108
 
93
109
  for (const failure of failures) {
94
110
  process.stderr.write(
95
- `Commit Gate ${failure.kind} failed for ${failure.owner} (exit ${failure.code}).\n${failure.stdout}${failure.stderr}`,
111
+ `Commit Gate ${failure.kind} failed for ${failure.owner} in ${failure.cwd} (exit ${failure.code})${failure.launchError === "" ? "" : `: ${failure.launchError}`}.\n${failure.stdout}${failure.stderr}`,
96
112
  );
97
113
  }
98
114
  process.exitCode = failures.length === 0 ? 0 : 1;
@@ -1,8 +1,8 @@
1
1
  import { execFileSync } from "node:child_process";
2
- import { mkdir, mkdtemp, readFile, writeFile } from "node:fs/promises";
2
+ import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { tmpdir } from "node:os";
5
- import { describe, expect, it } from "vitest";
5
+ import { afterEach, describe, expect, it } from "vitest";
6
6
 
7
7
  interface ExecResult {
8
8
  readonly code: number;
@@ -36,20 +36,201 @@ const run = async (
36
36
  };
37
37
  }
38
38
  };
39
+
40
+ const runGit = async (args: readonly string[], cwd: string): Promise<void> => {
41
+ const result = await run("git", args, { cwd });
42
+ if (result.code !== 0) {
43
+ throw new Error(`git ${args.join(" ")} failed (${result.code}): ${result.stderr}`);
44
+ }
45
+ };
39
46
  const runner = path.resolve(import.meta.dirname, "commit-gate-runner.mjs");
47
+ const roots = new Set<string>();
48
+ const linkedWorktrees = new Map<string, string>();
49
+ const markerScript =
50
+ "import fs from 'node:fs'; fs.writeFileSync('marker.out', process.cwd() + '\\n' + process.argv.slice(2).join('\\n'));";
40
51
 
41
- const fixture = async () => {
42
- const root = await mkdtemp(path.join(tmpdir(), "commit-gate-runner-"));
43
- await run("git", ["init", "-q"], { cwd: root });
52
+ const fixture = async (repoName?: string) => {
53
+ const temporaryRoot = await mkdtemp(path.join(tmpdir(), "commit-gate-runner-"));
54
+ roots.add(temporaryRoot);
55
+ const root = repoName === undefined ? temporaryRoot : path.join(temporaryRoot, repoName);
56
+ if (repoName !== undefined) {
57
+ await mkdir(root);
58
+ }
59
+ await runGit(["init", "-q"], root);
60
+ await runGit(["config", "--local", "user.name", "Commit Gate Test"], root);
61
+ await runGit(["config", "--local", "user.email", "commit-gate-test@example.com"], root);
44
62
  await mkdir(path.join(root, ".devpunks"), { recursive: true });
45
- await writeFile(
46
- path.join(root, "marker.mjs"),
47
- "import fs from 'node:fs'; fs.writeFileSync('marker.out', process.cwd() + '\\n' + process.argv.slice(2).join('\\n'));",
48
- );
63
+ await writeFile(path.join(root, "marker.mjs"), markerScript);
49
64
  return root;
50
65
  };
51
66
 
52
67
  describe("Commit Gate runner", () => {
68
+ afterEach(async () => {
69
+ const worktreeResults = await Promise.all(
70
+ [...linkedWorktrees].map(async ([worktree, primary]) => {
71
+ const result = await run("git", ["worktree", "remove", "--force", worktree], {
72
+ cwd: primary,
73
+ });
74
+ return result;
75
+ }),
76
+ );
77
+ linkedWorktrees.clear();
78
+ try {
79
+ await Promise.all(
80
+ [...roots].map(async (root) => {
81
+ await rm(root, { force: true, recursive: true });
82
+ }),
83
+ );
84
+ } finally {
85
+ roots.clear();
86
+ }
87
+ const failedRemoval = worktreeResults.find((result) => result.code !== 0);
88
+ if (failedRemoval !== undefined) {
89
+ throw new Error(`Failed to remove linked worktree: ${failedRemoval.stderr}`);
90
+ }
91
+ });
92
+
93
+ it("ignores a stale legacy root and runs from the active worktree", async () => {
94
+ const root = await fixture();
95
+ await writeFile(path.join(root, "a.ts"), "a");
96
+ await run("git", ["add", "a.ts"], { cwd: root });
97
+ await writeFile(
98
+ path.join(root, ".devpunks/contracts.json"),
99
+ JSON.stringify([
100
+ {
101
+ formatCheck: "node marker.mjs .",
102
+ lint: "node marker.mjs .",
103
+ owner: "root",
104
+ path: ".",
105
+ root: path.join(root, "obsolete-machine-root"),
106
+ },
107
+ ]),
108
+ );
109
+
110
+ const result = await run("node", [runner, "--contracts", ".devpunks/contracts.json"], {
111
+ cwd: root,
112
+ });
113
+
114
+ expect(result.code).toBe(0);
115
+ await expect(readFile(path.join(root, "marker.out"), "utf-8")).resolves.toContain(root);
116
+ });
117
+
118
+ it("preserves trailing whitespace in the active worktree path", async () => {
119
+ const root = await fixture("repo ");
120
+ await writeFile(path.join(root, "a.ts"), "a");
121
+ await run("git", ["add", "a.ts"], { cwd: root });
122
+ await writeFile(
123
+ path.join(root, ".devpunks/contracts.json"),
124
+ JSON.stringify([
125
+ {
126
+ formatCheck: "node marker.mjs .",
127
+ lint: "node marker.mjs .",
128
+ owner: "root",
129
+ path: ".",
130
+ },
131
+ ]),
132
+ );
133
+
134
+ const result = await run("node", [runner, "--contracts", ".devpunks/contracts.json"], {
135
+ cwd: root,
136
+ });
137
+
138
+ expect(result.code).toBe(0);
139
+ await expect(readFile(path.join(root, "marker.out"), "utf-8")).resolves.toContain(root);
140
+ });
141
+
142
+ it("preserves a trailing carriage return in the active worktree path", async () => {
143
+ const root = await fixture("repo\r");
144
+ await writeFile(path.join(root, "a.ts"), "a");
145
+ await run("git", ["add", "a.ts"], { cwd: root });
146
+ await writeFile(
147
+ path.join(root, ".devpunks/contracts.json"),
148
+ JSON.stringify([
149
+ {
150
+ formatCheck: "node marker.mjs .",
151
+ lint: "node marker.mjs .",
152
+ owner: "root",
153
+ path: ".",
154
+ },
155
+ ]),
156
+ );
157
+
158
+ const result = await run("node", [runner, "--contracts", ".devpunks/contracts.json"], {
159
+ cwd: root,
160
+ });
161
+
162
+ expect(result.code).toBe(0);
163
+ await expect(readFile(path.join(root, "marker.out"), "utf-8")).resolves.toContain(root);
164
+ });
165
+
166
+ it("runs owner commands and staged paths from the active linked worktree", async () => {
167
+ const primary = await fixture();
168
+ await writeFile(path.join(primary, "seed.ts"), "seed");
169
+ await runGit(["add", "seed.ts"], primary);
170
+ await runGit(["commit", "-qm", "seed"], primary);
171
+ const linked = await mkdtemp(path.join(tmpdir(), "commit-gate-runner-linked-"));
172
+ await rm(linked, { force: true, recursive: true });
173
+ await runGit(["worktree", "add", "--detach", linked, "HEAD"], primary);
174
+ linkedWorktrees.set(linked, primary);
175
+ roots.add(linked);
176
+ await writeFile(path.join(linked, "marker.mjs"), markerScript);
177
+ await writeFile(path.join(linked, "linked.ts"), "linked");
178
+ await runGit(["add", "linked.ts"], linked);
179
+ await mkdir(path.join(linked, ".devpunks"), { recursive: true });
180
+ await writeFile(
181
+ path.join(linked, ".devpunks/contracts.json"),
182
+ JSON.stringify([
183
+ {
184
+ formatCheck: "node marker.mjs .",
185
+ lint: "node marker.mjs .",
186
+ owner: "root",
187
+ path: ".",
188
+ root: path.join(primary, "obsolete-machine-root"),
189
+ },
190
+ ]),
191
+ );
192
+
193
+ const result = await run("node", [runner, "--contracts", ".devpunks/contracts.json"], {
194
+ cwd: linked,
195
+ });
196
+
197
+ expect(result.code).toBe(0);
198
+ await expect(readFile(path.join(linked, "marker.out"), "utf-8")).resolves.toContain(linked);
199
+ await expect(readFile(path.join(linked, "marker.out"), "utf-8")).resolves.toContain(
200
+ "linked.ts",
201
+ );
202
+ });
203
+
204
+ it("reports owner cwd and launch cause when an owner directory is missing", async () => {
205
+ const root = await fixture();
206
+ const missingOwner = path.join(root, "missing-owner");
207
+ await mkdir(missingOwner);
208
+ await writeFile(path.join(missingOwner, "a.ts"), "a");
209
+ await run("git", ["add", "missing-owner/a.ts"], { cwd: root });
210
+ await rm(missingOwner, { force: true, recursive: true });
211
+ await writeFile(
212
+ path.join(root, ".devpunks/contracts.json"),
213
+ JSON.stringify([
214
+ {
215
+ formatCheck: "node marker.mjs .",
216
+ lint: "node marker.mjs .",
217
+ owner: "missing-owner",
218
+ path: "missing-owner",
219
+ },
220
+ ]),
221
+ );
222
+
223
+ const result = await run("node", [runner, "--contracts", ".devpunks/contracts.json"], {
224
+ cwd: root,
225
+ });
226
+
227
+ expect(result.code).toBe(1);
228
+ expect(result.stderr).toContain("missing-owner");
229
+ expect(result.stderr).toContain("lint");
230
+ expect(result.stderr).toContain(missingOwner);
231
+ expect(result.stderr).toMatch(/ENOENT|no such file/u);
232
+ });
233
+
53
234
  it("does not spawn quality commands when no files are staged", async () => {
54
235
  const root = await fixture();
55
236
  await writeFile(
@@ -60,7 +241,6 @@ describe("Commit Gate runner", () => {
60
241
  lint: "node marker.mjs .",
61
242
  owner: "root",
62
243
  path: ".",
63
- root,
64
244
  },
65
245
  ]),
66
246
  );
@@ -79,7 +259,7 @@ describe("Commit Gate runner", () => {
79
259
  await writeFile(
80
260
  path.join(root, ".devpunks/contracts.json"),
81
261
  JSON.stringify([
82
- { formatCheck: "node fail.mjs", lint: "node fail.mjs", owner: "root", path: ".", root },
262
+ { formatCheck: "node fail.mjs", lint: "node fail.mjs", owner: "root", path: "." },
83
263
  ]),
84
264
  );
85
265
  const result = await run("node", [runner, "--contracts", ".devpunks/contracts.json"], {
@@ -95,7 +275,7 @@ describe("Commit Gate runner", () => {
95
275
  await writeFile(path.join(root, "a.ts"), "a");
96
276
  await writeFile(path.join(root, "gone.ts"), "gone");
97
277
  await run("git", ["add", "."], { cwd: root });
98
- await run("git", ["commit", "-qm", "seed"], { cwd: root });
278
+ await runGit(["commit", "-qm", "seed"], root);
99
279
  await writeFile(path.join(root, "a.ts"), "changed");
100
280
  await run("git", ["add", "a.ts"], { cwd: root });
101
281
  await run("git", ["rm", "-q", "gone.ts"], { cwd: root });
@@ -107,7 +287,6 @@ describe("Commit Gate runner", () => {
107
287
  lint: "node marker.mjs .",
108
288
  owner: "root",
109
289
  path: ".",
110
- root,
111
290
  },
112
291
  ]),
113
292
  );
@@ -132,7 +311,6 @@ describe("Commit Gate runner", () => {
132
311
  lint: "node ../../marker.mjs",
133
312
  owner: "web",
134
313
  path: "apps/web",
135
- root,
136
314
  },
137
315
  ]),
138
316
  );
@@ -60,13 +60,15 @@ The command bypasses package-manager minimum-release-age gates for the selected
60
60
 
61
61
  Report global and project `hi-cli` installations plus legacy `dp-cli` installations without changing them.
62
62
 
63
+ With CLI 5.0.1 or newer, each install or update command resolves the newest canonical shared-skills `main` revision once and verifies installed files against that source content. Report and use the exact revision returned by the command. On CLI 5.0.0 or 4.x, run `hi upgrade` before requesting the newest operator skill.
64
+
63
65
  ## `hi operator install`
64
66
 
65
- Install the frozen `hi-cli` target when absent and verify the resulting global copy.
67
+ Install the global copy when absent and verify its files against the revision resolved for this command.
66
68
 
67
69
  ## `hi operator update`
68
70
 
69
- Update and verify every detected global or project `hi-cli` copy.
71
+ Update every detected global or project `hi-cli` copy and verify its files against the revision resolved for this command.
70
72
 
71
73
  ## `hi operator migrate`
72
74
 
@@ -123,17 +123,23 @@ Never read `.devpunks/`, run scaffold follow-through, or scan unrelated skill ho
123
123
  Report `hi-cli` and legacy `dp-cli` state for global and project scopes:
124
124
 
125
125
  - `status`: report detected installations without changing them
126
- - `install`: verify the resulting global `hi-cli` copy
127
- - `update`: verify every detected `hi-cli` copy
126
+ - `install`: verify the resulting global `hi-cli` copy against the resolved source content
127
+ - `update`: verify every detected `hi-cli` copy against the resolved source content
128
128
  - `migrate`: verify replacements before every detected legacy `dp-cli` copy is removed
129
129
 
130
+ With CLI 5.0.1 or newer, each install or update command resolves the newest canonical shared-skills `main` revision once and verifies installed files against that source content. Report and use the exact revision returned by the command. On CLI 5.0.0 or 4.x, run `hi upgrade` before requesting the newest operator skill.
131
+
130
132
  Operator writes require Skills CLI 1.5.20 or newer. If an action partially fails, return the exact failed Skills CLI command from the result. After successful install, update, or migrate, reload or reactivate `$hi-cli`.
131
133
 
132
134
  ## Project Verifier preservation
133
135
 
134
- For scaffold, update, and their generated Post-Command Handoffs, preserve every existing file below `.agents/skills/verify-behavior/references/` byte-for-byte, including the index, Surface Verification References, Feature Maps, Cross-App Journeys, and helpers. Refreshing the managed `verify-behavior/SKILL.md` does not authorize changing that project-owned tree.
136
+ The shared `verify-behavior` skill is the single entrypoint. Its project-owned references describe how to verify this project's runnable apps and behaviors.
137
+
138
+ For scaffold, update, and their generated Post-Command Handoffs, preserve every existing file below `.agents/skills/verify-behavior/references/` byte-for-byte. This includes the index, Surface Verification References, Feature Maps, Cross-App Journeys, and helpers. Scaffold or update can refresh the shared `verify-behavior/SKILL.md` entrypoint, while the project-owned references keep their exact bytes.
139
+
140
+ Keep an absent Project Verifier absent. These command flows never invoke `create-verification-skill` or `update-verification-skill`. During delivery, `implement-spec` creates a Surface Verification Reference when its selected scenario has an Uncovered Surface. It updates the existing references and Feature Map when the scenario has Uncovered Behavior.
135
141
 
136
- Keep an absent Project Verifier absent. These command flows never invoke `create-verification-skill` or `update-verification-skill`; `implement-spec` owns those coverage-gap branches. Generated handoffs render the current-run preserve action with a pointer to this rule, rather than defining a second policy.
142
+ Generated handoffs state the preserve action and residual scopes for the current run and point here. Structured scope and receipt evidence and generated prompt specs remain the authority for new scope structure.
137
143
 
138
144
  Before completing reconciliation, compare existing project-owned paths and bytes with the pre-command inventory, report any unexpected change as a blocker, and retain the comparison outside command cleanup.
139
145
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: verify-behavior
3
- description: Verify observable product behavior or reproduce reported failures through selected project-owned app references and falsifiable end-to-end evidence.
3
+ description: Verify observable product behavior through selected project-owned app references and falsifiable end-to-end evidence when Debugging Phase invokes reproduce or Implement Spec invokes verify.
4
4
  ---
5
5
 
6
6
  # Verify Behavior
@@ -0,0 +1,2 @@
1
+ policy:
2
+ allow_implicit_invocation: false
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: tdd
3
- description: Test-drive behavior changes with a red-green-refactor loop through public interfaces. Use when the user wants TDD, test-first development, integration-style tests, RED/GREEN evidence, or a bugfix/feature built test-first.
3
+ description: Test-drive behavior changes with a red-green-refactor loop through public interfaces. Use when the user explicitly requests TDD, test-first development, RED/GREEN evidence, or behavior design remains unresolved.
4
4
  ---
5
5
 
6
6
  # Test-Driven Development
@@ -2,17 +2,18 @@
2
2
  name: effect-backend-structure
3
3
  description: |
4
4
  Apply Effect-specific backend structure on top of backend-domain-structure.
5
- Use when creating or changing Effect actions, repositories, transport adapters,
6
- DB integrations, test placement, backend boilerplate, or Layer composition
7
- ownership in any Effect backend root. Enforces actions-own-orchestration,
8
- integration dependency direction, three-level Layer composition operators,
9
- effect-solutions plus opensrc source lookup, and @effect/vitest conventions.
5
+ Use when creating or changing Effect internal modules, actions, repositories,
6
+ transport adapters, DB integrations, test placement, backend boilerplate, or
7
+ Layer composition ownership in any Effect backend root. Enforces concrete
8
+ module boundaries, actions-own-orchestration, integration dependency direction,
9
+ three-level Layer composition operators, effect-solutions plus opensrc source
10
+ lookup, and @effect/vitest conventions.
10
11
  compatibility: Requires Effect v4. Examples are reviewed against the version documented in this repository.
11
12
  ---
12
13
 
13
14
  # Effect Backend Structure
14
15
 
15
- Use this skill with `$backend-domain-structure` and `$effect` for Effect backend code. `$effect` owns Effect v4 API guidance. Use `$effect-service-design` for service qualification, service modules, Layers, requirements, test substitutes, and service audits.
16
+ Use this skill with `$backend-domain-structure` and `$effect` for Effect backend code. `$effect` owns Effect v4 API guidance. Use `$effect-service-design` for service qualification, application policy, service modules, Layers, requirements, test substitutes, and service audits.
16
17
 
17
18
  The agnostic skill owns the layer model:
18
19
 
@@ -21,7 +22,7 @@ The agnostic skill owns the layer model:
21
22
  - `features/*`
22
23
  - shared libraries and packages
23
24
 
24
- This skill adds Effect-specific backend topology, action ownership, source lookup, and test placement rules.
25
+ This skill adds Effect-specific internal-module topology, repository boundaries, action ownership, source lookup, and test placement rules. Read the layout reference when placing code inside an Effect module; `$effect-service-design` remains the authority for deciding whether a seam is a service and for application policy.
25
26
 
26
27
  ## Workflow
27
28