@punks/cli 5.0.1 → 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.
- package/dist/BASELINE_CHANGELOG.md +24 -1
- package/dist/CHANGELOG.md +30 -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 +13 -13
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: react-doctor
|
|
3
|
-
description: Use when
|
|
3
|
+
description: Use when the user explicitly requests React Doctor or production changes overlap React runtime APIs.
|
|
4
4
|
version: "1.2.0"
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -8,9 +8,20 @@ version: "1.2.0"
|
|
|
8
8
|
|
|
9
9
|
Scans React codebases for security, performance, correctness, and architecture issues. Outputs a 0-100 health score.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Changed Scope Scan
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Resolve the checked-out branch's configured upstream. If there is no configured
|
|
14
|
+
upstream, stop and ask the user to configure one or select a base explicitly.
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
base="$(git rev-parse --abbrev-ref --symbolic-full-name '@{upstream}')" || {
|
|
18
|
+
echo "React Doctor changed scan has no configured upstream." >&2
|
|
19
|
+
exit 1
|
|
20
|
+
}
|
|
21
|
+
npx react-doctor@latest --verbose --scope changed --base "$base"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Check that the score did not regress.
|
|
14
25
|
|
|
15
26
|
If the score dropped, fix the regressions before committing.
|
|
16
27
|
|
|
@@ -47,7 +58,11 @@ Then apply the narrowest control via `npx react-doctor@latest rules disable|set|
|
|
|
47
58
|
## Command
|
|
48
59
|
|
|
49
60
|
```bash
|
|
50
|
-
|
|
61
|
+
base="$(git rev-parse --abbrev-ref --symbolic-full-name '@{upstream}')" || {
|
|
62
|
+
echo "React Doctor changed scan has no configured upstream." >&2
|
|
63
|
+
exit 1
|
|
64
|
+
}
|
|
65
|
+
npx react-doctor@latest --verbose --scope changed --base "$base"
|
|
51
66
|
```
|
|
52
67
|
|
|
53
68
|
| Flag | Purpose |
|
package/dist/baseline/scaffold-baseline/skills/frameworks/react/react-doctor/references/explain.md
CHANGED
|
@@ -18,7 +18,11 @@ npx react-doctor@latest rules explain react-doctor/no-array-index-as-key
|
|
|
18
18
|
5. Validate the change did what the user wanted:
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
|
|
21
|
+
base="$(git rev-parse --abbrev-ref --symbolic-full-name '@{upstream}')" || {
|
|
22
|
+
echo "React Doctor changed scan has no configured upstream." >&2
|
|
23
|
+
exit 1
|
|
24
|
+
}
|
|
25
|
+
npx react-doctor@latest --verbose --scope changed --base "$base"
|
|
22
26
|
```
|
|
23
27
|
|
|
24
28
|
## Commands
|
|
@@ -1,12 +1,12 @@
|
|
|
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.15-1ee7f8b7",
|
|
5
|
+
"tag": "baseline/stable/2026.09.15-1ee7f8b7",
|
|
6
|
+
"commit": "1ee7f8b72f8fe116ad74aa15923238d3b985c751",
|
|
7
7
|
"archive": "scaffold-baseline.tgz",
|
|
8
|
-
"archiveSha256": "
|
|
8
|
+
"archiveSha256": "0b6c897042951d208ad50e58463e0f00f8c53b04a156c3a0ec3f3512b9cfde08",
|
|
9
9
|
"compatibility": {
|
|
10
|
-
"cliVersionRange": ">=5.0
|
|
10
|
+
"cliVersionRange": ">=5.1.0 <5.2.0"
|
|
11
11
|
}
|
|
12
12
|
}
|
|
Binary file
|
|
@@ -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;
|