@punks/cli 5.0.1 → 5.1.1
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/dist/BASELINE_CHANGELOG.md +24 -1
- package/dist/CHANGELOG.md +49 -0
- package/dist/baseline/scaffold-baseline/baseline.json +15 -5
- package/dist/baseline/scaffold-baseline/data/catalog/packs.json +11 -1
- package/dist/baseline/scaffold-baseline/data/catalog/skills.json +16 -0
- package/dist/baseline/scaffold-baseline/data/scripts/commit-gate-runner.d.ts +2 -1
- package/dist/baseline/scaffold-baseline/data/scripts/commit-gate-runner.mjs +21 -5
- package/dist/baseline/scaffold-baseline/data/scripts/commit-gate-runner.test.ts +192 -14
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/verify-behavior/SKILL.md +1 -1
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/verify-behavior/agents/openai.yaml +2 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/SKILL.md +1 -1
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-backend-structure/SKILL.md +8 -7
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-backend-structure/references/layout.md +32 -6
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-service-design/SKILL.md +2 -0
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/react-doctor/SKILL.md +19 -4
- package/dist/baseline/scaffold-baseline/skills/frameworks/react/react-doctor/references/explain.md +5 -1
- package/dist/baseline/scaffold-baseline.json +5 -5
- package/dist/baseline/scaffold-baseline.tgz +0 -0
- package/dist/data/scripts/commit-gate-runner.mjs +21 -5
- package/dist/index.js +56 -52
- package/dist/skills/agnostic/planning/verify-behavior/SKILL.md +1 -1
- package/dist/skills/agnostic/planning/verify-behavior/agents/openai.yaml +2 -0
- package/dist/skills/agnostic/quality/tdd/SKILL.md +1 -1
- package/dist/skills/frameworks/effect/effect-backend-structure/SKILL.md +8 -7
- package/dist/skills/frameworks/effect/effect-backend-structure/references/layout.md +32 -6
- package/dist/skills/frameworks/effect/effect-service-design/SKILL.md +2 -0
- package/dist/skills/frameworks/react/react-doctor/SKILL.md +19 -4
- package/dist/skills/frameworks/react/react-doctor/references/explain.md +5 -1
- package/package.json +1 -1
|
@@ -2,10 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
-
Compatibility: `>=5.
|
|
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).
|
|
9
32
|
- Resolve the latest canonical `wearedevpunks/skills` `main` once per operator
|
|
10
33
|
command, freeze its immutable commit across scopes and readbacks, and install
|
|
11
34
|
or update only exact verified `hi-cli` content without falling back to the
|
package/dist/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 5.1.1 - 2026-09-17
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Make `hi update` derive managed artifacts from a shared manifest-driven plan,
|
|
10
|
+
validate in an isolated candidate, and reuse validation and prepared-install
|
|
11
|
+
results only for matching relevant inputs (#215).
|
|
12
|
+
- Report update lifecycle progress while preserving a single final JSON stdout
|
|
13
|
+
document, with local cache clearing and optional signed remote-cache
|
|
14
|
+
transport outcomes surfaced explicitly (#215).
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- Fail closed before dependent update work when validation inputs are
|
|
19
|
+
incomplete, uncontained through canonical path aliases, or use uncontrolled
|
|
20
|
+
executable configuration; retain precise subprocess failure facts (#215).
|
|
21
|
+
- Keep update planned and completed operations truthful across no-change,
|
|
22
|
+
recovery, cache-reuse, and managed-drift outcomes (#215).
|
|
23
|
+
|
|
24
|
+
## 5.1.0 - 2026-09-15
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- Distribute `verify-behavior`, `create-verification-skill`, and
|
|
29
|
+
`update-verification-skill` together in the default verification pack while
|
|
30
|
+
preserving project-owned verifier reference bytes (#207).
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- Preserve repository-owned wiki starters during scaffold/check/update and honor
|
|
35
|
+
populated directories and flat routes without false missing-seed findings (#203).
|
|
36
|
+
- Resolve nested Oxlint transition rules through registered workspace plugin
|
|
37
|
+
aliases and retain JSON lint policy in both planning and materialization (#203).
|
|
38
|
+
- Regenerate managed handoffs from current authoring proofs so completed
|
|
39
|
+
post-command work does not leave stale pending actions (#203).
|
|
40
|
+
- Resolve Commit Gate contract roots from the current checkout or linked
|
|
41
|
+
worktree, and report actionable working-directory and process-launch errors
|
|
42
|
+
instead of an empty exit-1 failure (#204).
|
|
43
|
+
- Restore Effect internal-module topology and repository-boundary guidance while
|
|
44
|
+
keeping service qualification and application policy in `effect-service-design`
|
|
45
|
+
(#205).
|
|
46
|
+
- Limit automatic React Doctor and TDD activation to their intended task
|
|
47
|
+
boundaries, and resolve React Doctor changed scans from the checked-out branch's
|
|
48
|
+
configured origin upstream with an explicit base. Keep `verify-behavior`
|
|
49
|
+
available to explicit orchestration without top-level automatic activation
|
|
50
|
+
(#206).
|
|
51
|
+
|
|
3
52
|
## 5.0.1 - 2026-09-10
|
|
4
53
|
|
|
5
54
|
### Fixed
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"channel": "stable",
|
|
4
|
-
"version": "2026.09.
|
|
5
|
-
"tag": "baseline/stable/2026.09.
|
|
6
|
-
"commit": "
|
|
4
|
+
"version": "2026.09.17-d3e11b44",
|
|
5
|
+
"tag": "baseline/stable/2026.09.17-d3e11b44",
|
|
6
|
+
"commit": "d3e11b4481eb4e35c4044278914552827c0ee032",
|
|
7
7
|
"sha256": null,
|
|
8
8
|
"compatibility": {
|
|
9
|
-
"cliVersionRange": ">=5.
|
|
9
|
+
"cliVersionRange": ">=5.1.1 <5.2.0"
|
|
10
10
|
},
|
|
11
|
-
"generatedAt": "2026-09-
|
|
11
|
+
"generatedAt": "2026-09-17T08:01:37.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
|
-
|
|
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
|
|
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,
|
|
98
|
+
const result = await run(command, ownerCwd, {
|
|
83
99
|
HI_STAGED_FILES: files.join("\n"),
|
|
84
100
|
});
|
|
85
|
-
return { ...result, kind, owner: contract.owner ??
|
|
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
|
|
43
|
-
|
|
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: "."
|
|
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
|
|
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
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: verify-behavior
|
|
3
|
-
description: Verify observable product behavior
|
|
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
|
|
@@ -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
|
|
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
|
package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-backend-structure/SKILL.md
CHANGED
|
@@ -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,
|
|
6
|
-
DB integrations, test placement, backend boilerplate, or
|
|
7
|
-
ownership in any Effect backend root. Enforces
|
|
8
|
-
|
|
9
|
-
effect-solutions plus opensrc source
|
|
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
|
|
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
|
|
|
@@ -19,15 +19,41 @@ Inside the current Effect backend root, prefer:
|
|
|
19
19
|
client.ts
|
|
20
20
|
features/
|
|
21
21
|
<domain>/
|
|
22
|
-
|
|
22
|
+
services/
|
|
23
|
+
<capability>/
|
|
24
|
+
service.ts
|
|
25
|
+
binding.ts
|
|
26
|
+
operations/
|
|
27
|
+
<use-case>/
|
|
28
|
+
operation.ts
|
|
23
29
|
models/
|
|
30
|
+
<model>.ts
|
|
24
31
|
repositories/
|
|
25
|
-
|
|
32
|
+
<entity>.ts
|
|
33
|
+
mappers/
|
|
34
|
+
<model>.ts
|
|
26
35
|
errors.ts
|
|
27
36
|
layer.ts
|
|
28
37
|
router.ts
|
|
29
38
|
```
|
|
30
39
|
|
|
40
|
+
## Internal module topology
|
|
41
|
+
|
|
42
|
+
- Public capabilities live in `services/<capability>/service.ts` as the public `Context.Service` capability.
|
|
43
|
+
- Effect backends use `operations/<use-case>/operation.ts` as private `Effect.fn` orchestration for a use case; this replaces the base skill's `actions/` directory convention. Call these units operations consistently inside the Effect feature.
|
|
44
|
+
- `services/<capability>/binding.ts` contains the private `Context.Service` seams that bind the public capability beside it; do not create a separate `composition/` directory for them.
|
|
45
|
+
- Domain models live in `models/<model>.ts`; persistence contracts and adapters live in `repositories/<entity>.ts`; boundary transforms live in `mappers/<model>.ts`. External provider clients and adapter mechanics remain under `integrations/<provider>/` and do not move into repositories.
|
|
46
|
+
- Place an operation's tests in the feature-owned `tests/unit/<use-case>.test.ts` or `tests/integration/<use-case>.test.ts` path shown below; keep reusable local support under `tests/support/`.
|
|
47
|
+
|
|
48
|
+
- Keep module internals private; callers use an explicit public capability surface.
|
|
49
|
+
- Use relative imports within an internal module and source aliases across module boundaries.
|
|
50
|
+
- Avoid pass-through barrels that only re-export private implementation.
|
|
51
|
+
- Repositories expose a narrow capability rather than a table-shaped grab bag.
|
|
52
|
+
- A mapper changes representation; delete a spread-only mapper.
|
|
53
|
+
- Derive types from their owner instead of creating structurally identical duplicate `*Data` types.
|
|
54
|
+
|
|
55
|
+
**Complete when:** every internal file has one role, callers reach only the public capability surface, and each import, repository, mapper, data type, and colocated test preserves that boundary.
|
|
56
|
+
|
|
31
57
|
Dependency direction:
|
|
32
58
|
|
|
33
59
|
- `platform -> features -> integrations`
|
|
@@ -52,7 +78,7 @@ A leaf or module Layer implements only its owned public capability. Keep depende
|
|
|
52
78
|
|
|
53
79
|
### Nearest common parent business Layer
|
|
54
80
|
|
|
55
|
-
The nearest common parent business Layer composes its public child Layers. Those child features are siblings to one another.
|
|
81
|
+
The nearest common parent business Layer composes its public child Layers. Those child features are siblings to one another. Operations or services owned by the parent hold ordering, authorization, state transitions, and other cross-child product policy. The parent imports public child surfaces and keeps child internals private.
|
|
56
82
|
|
|
57
83
|
**Complete when:** every cross-child product decision has one parent owner and the parent Layer exposes the composed parent-domain capability.
|
|
58
84
|
|
|
@@ -75,9 +101,9 @@ Choose the operator from the intended public output. Side-by-side capabilities u
|
|
|
75
101
|
|
|
76
102
|
## Composition terminology
|
|
77
103
|
|
|
78
|
-
Reserve composition terminology for Layers that assemble public capabilities.
|
|
104
|
+
Reserve composition terminology for Layers that assemble public capabilities. Put a private `Context.Service` binding seam at `services/<capability>/binding.ts` beside the public capability it supports. Use `features/<domain>/layer.ts` for domain Layer ownership and `platform/effect/app.ts`, or the repository's equivalent, for the production root.
|
|
79
105
|
|
|
80
|
-
Do not import live implementations directly inside
|
|
106
|
+
Do not import live implementations directly inside operations, services, repositories, or transport adapters.
|
|
81
107
|
|
|
82
108
|
Test layout:
|
|
83
109
|
|
|
@@ -97,7 +123,7 @@ Testing split:
|
|
|
97
123
|
- `tests/support`
|
|
98
124
|
feature-local reusable test support
|
|
99
125
|
- `tests/unit`
|
|
100
|
-
|
|
126
|
+
operation and guard behavior, named for the owning use case
|
|
101
127
|
- `tests/integration`
|
|
102
128
|
live router/app behavior
|
|
103
129
|
|