@punks/cli 2.1.9 → 2.1.10
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 +1 -1
- package/dist/data/catalog/hooks.ts +8 -0
- package/dist/data/catalog/packs.ts +4 -3
- package/dist/data/catalog/skills.ts +40 -0
- package/dist/data/catalog/tools.ts +9 -1
- package/dist/data/hooks/scaffold-update-check.mjs +181 -0
- package/dist/data/hooks.test.ts +17 -0
- package/dist/data/scripts/sync-subagents.mjs +70 -31
- package/dist/data/subagents/manifest.mjs +120 -0
- package/dist/index.js +455 -49
- package/dist/skills/agnostic/cli/dp-cli/SKILL.md +3 -3
- package/dist/skills/agnostic/cli/dp-cli/references/commands.md +1 -1
- package/dist/skills/agnostic/cli/dp-cli/references/post-command-flow.md +1 -1
- package/dist/skills/agnostic/docs/docs-onboarding/SKILL.md +46 -0
- package/dist/skills/agnostic/docs/docs-onboarding/agents/openai.yaml +4 -0
- package/dist/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +67 -0
- package/dist/skills/agnostic/docs/upstream/mattpocock-writing-skills.md +41 -0
- package/dist/skills/agnostic/docs/writing-beats/SKILL.md +69 -0
- package/dist/skills/agnostic/docs/writing-fragments/SKILL.md +76 -0
- package/dist/skills/agnostic/docs/writing-shape/SKILL.md +75 -0
- package/dist/skills/agnostic/planning/create-plan/SKILL.md +17 -2
- package/dist/skills/agnostic/planning/create-plan/references/planner-phase.md +1 -1
- package/dist/skills/agnostic/planning/create-spec/SKILL.md +55 -10
- package/dist/skills/agnostic/planning/create-spec/references/discovery.md +24 -16
- package/dist/skills/agnostic/planning/create-spec/references/folder-naming.md +6 -2
- package/dist/skills/agnostic/planning/create-spec/references/wiki-bookkeeping.md +29 -5
- package/dist/skills/agnostic/planning/implement-spec/SKILL.md +18 -0
- package/dist/skills/agnostic/planning/stack/SKILL.md +89 -0
- package/dist/skills/agnostic/requirements/write-backlog/SKILL.md +7 -5
- package/dist/skills/frameworks/tanstack-query/tanstack-query/SKILL.md +621 -830
- package/dist/skills/frameworks/tanstack-start/tanstack-start/SKILL.md +250 -0
- package/dist/skills/phases/delivery-phase/SKILL.md +6 -1
- package/dist/skills/phases/docs-ingest-phase/SKILL.md +28 -20
- package/dist/skills/phases/docs-ingest-phase/references/fumadocs-routing.md +8 -5
- package/dist/skills/phases/docs-ingest-phase/references/public-docs.md +82 -0
- package/dist/skills/phases/requirements-phase/SKILL.md +2 -0
- package/dist/skills/phases/review-phase/SKILL.md +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ Before refreshing generated skills, setup migrates legacy per-agent skill folder
|
|
|
42
42
|
|
|
43
43
|
`punks update --yes` applies managed scaffold updates without prompting. It is the non-interactive alias for the apply behavior of `--write`.
|
|
44
44
|
|
|
45
|
-
`punks report` submits reusable Harness docs, workflow, tooling, CLI, skill-pack, or wiki friction to the Harness API. Public CLI submissions are validated, given deterministic metadata, and
|
|
45
|
+
`punks report` submits reusable Harness docs, workflow, tooling, CLI, skill-pack, or wiki friction to the Harness API. Public CLI submissions are validated, given deterministic metadata, deduped against open `harness-report` issues, and created as GitHub issues for maintainer triage. Missing server GitHub credentials fail the command instead of silently storing an internal-only report.
|
|
46
46
|
|
|
47
47
|
Interactive commands check the selected npm dist-tag before running. When a newer CLI is available, `punks` asks for confirmation, reinstalls through the detected global package manager, and exits so the command can be rerun on the upgraded binary. `punks upgrade` keeps the same installer path as an explicit manual command. Use `--tag next` for prerelease channels or `--force` to reinstall the selected tag even when the current version is fresh.
|
|
48
48
|
|
|
@@ -7,6 +7,14 @@ export interface HookDefinition {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export const hookCatalog = [
|
|
10
|
+
{
|
|
11
|
+
id: "scaffold-update-check",
|
|
12
|
+
harness: "shared",
|
|
13
|
+
outputPath: ".agents/hooks/scaffold-update-check.mjs",
|
|
14
|
+
description:
|
|
15
|
+
"Shared session-start hook that reports whether managed Harness scaffold output is current.",
|
|
16
|
+
sourcePath: "hooks/scaffold-update-check.mjs",
|
|
17
|
+
},
|
|
10
18
|
{
|
|
11
19
|
id: "format-edited-file",
|
|
12
20
|
harness: "shared",
|
|
@@ -70,12 +70,12 @@ export const packCatalog = [
|
|
|
70
70
|
id: "docs",
|
|
71
71
|
category: "default",
|
|
72
72
|
triggerPackages: [],
|
|
73
|
-
description: "Default docs pack: docs
|
|
74
|
-
skills: ["docs-ingest-phase"],
|
|
73
|
+
description: "Default docs pack: docs ingest plus public-doc writing primitives.",
|
|
74
|
+
skills: ["docs-ingest-phase", "writing-fragments", "writing-beats", "writing-shape"],
|
|
75
75
|
lintAssets: [],
|
|
76
76
|
hooks: [],
|
|
77
77
|
promptSurfaces: ["shared-agents", "root-prompt-spec", "docs-prompt-spec"],
|
|
78
|
-
promptDetails: ["shared docs baseline", "docs scope spec"],
|
|
78
|
+
promptDetails: ["shared docs baseline", "public-doc writing flow", "docs scope spec"],
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
id: "drizzle",
|
|
@@ -181,6 +181,7 @@ export const packCatalog = [
|
|
|
181
181
|
"create-spec",
|
|
182
182
|
"create-plan",
|
|
183
183
|
"implement-spec",
|
|
184
|
+
"stack",
|
|
184
185
|
"resolve-debt-phase",
|
|
185
186
|
],
|
|
186
187
|
lintAssets: [],
|
|
@@ -124,6 +124,38 @@ export const skillCatalog = [
|
|
|
124
124
|
framework: null,
|
|
125
125
|
requiresTools: [],
|
|
126
126
|
},
|
|
127
|
+
{
|
|
128
|
+
id: "docs-onboarding",
|
|
129
|
+
sourceDirectory: "skills/agnostic/docs/docs-onboarding",
|
|
130
|
+
tier: "agnostic",
|
|
131
|
+
language: null,
|
|
132
|
+
framework: null,
|
|
133
|
+
requiresTools: [],
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: "writing-fragments",
|
|
137
|
+
sourceDirectory: "skills/agnostic/docs/writing-fragments",
|
|
138
|
+
tier: "agnostic",
|
|
139
|
+
language: null,
|
|
140
|
+
framework: null,
|
|
141
|
+
requiresTools: [],
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
id: "writing-beats",
|
|
145
|
+
sourceDirectory: "skills/agnostic/docs/writing-beats",
|
|
146
|
+
tier: "agnostic",
|
|
147
|
+
language: null,
|
|
148
|
+
framework: null,
|
|
149
|
+
requiresTools: [],
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: "writing-shape",
|
|
153
|
+
sourceDirectory: "skills/agnostic/docs/writing-shape",
|
|
154
|
+
tier: "agnostic",
|
|
155
|
+
language: null,
|
|
156
|
+
framework: null,
|
|
157
|
+
requiresTools: [],
|
|
158
|
+
},
|
|
127
159
|
{
|
|
128
160
|
id: "effect-authoring",
|
|
129
161
|
sourceDirectory: "skills/frameworks/effect/effect-authoring",
|
|
@@ -212,6 +244,14 @@ export const skillCatalog = [
|
|
|
212
244
|
framework: null,
|
|
213
245
|
requiresTools: [],
|
|
214
246
|
},
|
|
247
|
+
{
|
|
248
|
+
id: "stack",
|
|
249
|
+
sourceDirectory: "skills/agnostic/planning/stack",
|
|
250
|
+
tier: "agnostic",
|
|
251
|
+
language: null,
|
|
252
|
+
framework: null,
|
|
253
|
+
requiresTools: ["stack"],
|
|
254
|
+
},
|
|
215
255
|
{
|
|
216
256
|
id: "next-best-practices",
|
|
217
257
|
sourceDirectory: "skills/frameworks/nextjs/next-best-practices",
|
|
@@ -19,9 +19,11 @@ export const toolCatalog = [
|
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
id: "opensrc",
|
|
22
|
-
packageName: "opensrc",
|
|
22
|
+
packageName: "opensrc@^0.7.2",
|
|
23
23
|
requiredBins: ["node"],
|
|
24
24
|
ensureCommands: [],
|
|
25
|
+
versionCommand: ["opensrc", "--version"],
|
|
26
|
+
minimumVersion: "0.7.2",
|
|
25
27
|
},
|
|
26
28
|
{
|
|
27
29
|
id: "portless",
|
|
@@ -35,6 +37,12 @@ export const toolCatalog = [
|
|
|
35
37
|
requiredBins: ["node"],
|
|
36
38
|
ensureCommands: [],
|
|
37
39
|
},
|
|
40
|
+
{
|
|
41
|
+
id: "stack",
|
|
42
|
+
packageName: "@kitlangton/stack",
|
|
43
|
+
requiredBins: ["node"],
|
|
44
|
+
ensureCommands: [],
|
|
45
|
+
},
|
|
38
46
|
] as const;
|
|
39
47
|
|
|
40
48
|
export type ToolId = string;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
|
|
8
|
+
const scaffoldManifestFile = ".devpunks/scaffold-manifest.json";
|
|
9
|
+
const okMessage = "Harness scaffold check: OK.";
|
|
10
|
+
const maxOutputLength = 24000;
|
|
11
|
+
|
|
12
|
+
function readStdinJson() {
|
|
13
|
+
try {
|
|
14
|
+
return JSON.parse(readFileSync(0, "utf8"));
|
|
15
|
+
} catch {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function runGit(args, cwd) {
|
|
21
|
+
const result = spawnSync("git", args, {
|
|
22
|
+
cwd,
|
|
23
|
+
encoding: "utf8",
|
|
24
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
return result.status === 0 ? result.stdout.trim() : "";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function repoRoot(cwd) {
|
|
31
|
+
return runGit(["rev-parse", "--show-toplevel"], cwd) || cwd;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function truncateOutput(output) {
|
|
35
|
+
if (output.length <= maxOutputLength) {
|
|
36
|
+
return output;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return `${output.slice(0, maxOutputLength)}\n\n[truncated scaffold check output]`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function commandExists(command, cwd) {
|
|
43
|
+
const result = spawnSync(command, ["--version"], {
|
|
44
|
+
cwd,
|
|
45
|
+
encoding: "utf8",
|
|
46
|
+
stdio: ["ignore", "ignore", "ignore"],
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
return result.status === 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function runUpdateCheck(root) {
|
|
53
|
+
if (!existsSync(path.join(root, scaffoldManifestFile))) {
|
|
54
|
+
return { status: "skipped", message: "" };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const command = commandExists("dp", root) ? "dp" : commandExists("punks", root) ? "punks" : null;
|
|
58
|
+
if (command === null) {
|
|
59
|
+
return {
|
|
60
|
+
status: "skipped",
|
|
61
|
+
message: "Harness scaffold check: skipped (dp command not found).",
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const result = spawnSync(command, ["update", "--check"], {
|
|
66
|
+
cwd: root,
|
|
67
|
+
encoding: "utf8",
|
|
68
|
+
env: {
|
|
69
|
+
...process.env,
|
|
70
|
+
CI: "1",
|
|
71
|
+
NO_COLOR: "1",
|
|
72
|
+
},
|
|
73
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
74
|
+
timeout: 60000,
|
|
75
|
+
});
|
|
76
|
+
const output = truncateOutput([result.stdout, result.stderr].filter(Boolean).join("\n").trim());
|
|
77
|
+
|
|
78
|
+
if (result.error) {
|
|
79
|
+
return {
|
|
80
|
+
status: "error",
|
|
81
|
+
message: [
|
|
82
|
+
"Harness scaffold check failed to run.",
|
|
83
|
+
"",
|
|
84
|
+
`${command} update --check error: ${result.error.message}`,
|
|
85
|
+
].join("\n"),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (result.status === 0) {
|
|
90
|
+
return { status: "ok", message: okMessage };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
status: "diverged",
|
|
95
|
+
message: [
|
|
96
|
+
"Harness scaffold divergence detected.",
|
|
97
|
+
"",
|
|
98
|
+
`Command: ${command} update --check`,
|
|
99
|
+
"",
|
|
100
|
+
output || "(no command output)",
|
|
101
|
+
"",
|
|
102
|
+
"Run `dp update` before relying on scaffolded agents, skills, hooks, or root guidance.",
|
|
103
|
+
].join("\n"),
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function formatForHarness(message, harness) {
|
|
108
|
+
if (!message) {
|
|
109
|
+
return "";
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (harness === "cursor") {
|
|
113
|
+
return JSON.stringify({
|
|
114
|
+
continue: true,
|
|
115
|
+
additional_context: message,
|
|
116
|
+
agent_message: message,
|
|
117
|
+
user_message: message === okMessage ? okMessage : "Harness scaffold divergence detected.",
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return message;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function rootFromInput(input) {
|
|
125
|
+
const candidates = [
|
|
126
|
+
input.cwd,
|
|
127
|
+
input.workspace_root,
|
|
128
|
+
process.env.CLAUDE_PROJECT_DIR,
|
|
129
|
+
process.env.PWD,
|
|
130
|
+
process.cwd(),
|
|
131
|
+
].filter((value) => typeof value === "string" && value.length > 0);
|
|
132
|
+
|
|
133
|
+
return repoRoot(candidates[0] ?? process.cwd());
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function main() {
|
|
137
|
+
const harness = process.argv[2] ?? "plain";
|
|
138
|
+
const input = readStdinJson();
|
|
139
|
+
const root = rootFromInput(input);
|
|
140
|
+
const result = runUpdateCheck(root);
|
|
141
|
+
const output = formatForHarness(result.message, harness);
|
|
142
|
+
|
|
143
|
+
if (output) {
|
|
144
|
+
process.stdout.write(`${output}\n`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export const ScaffoldUpdateCheckPlugin = async ({ client, directory, worktree }) => ({
|
|
149
|
+
event: async ({ event }) => {
|
|
150
|
+
if (event.type !== "session.created") {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const result = runUpdateCheck(repoRoot(worktree || directory || process.cwd()));
|
|
155
|
+
if (!result.message) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
await client.app.log({
|
|
160
|
+
body: {
|
|
161
|
+
service: "scaffold-update-check",
|
|
162
|
+
level: result.status === "diverged" ? "warn" : "info",
|
|
163
|
+
message: result.message,
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
export const testHooks = {
|
|
170
|
+
formatForHarness,
|
|
171
|
+
okMessage,
|
|
172
|
+
runUpdateCheck,
|
|
173
|
+
truncateOutput,
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
const invokedPath = process.argv[1] ? path.resolve(process.argv[1]) : "";
|
|
177
|
+
const modulePath = fileURLToPath(import.meta.url);
|
|
178
|
+
|
|
179
|
+
if (invokedPath && path.basename(invokedPath) === path.basename(modulePath)) {
|
|
180
|
+
main();
|
|
181
|
+
}
|
package/dist/data/hooks.test.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { describe, expect, it } from "@effect/vitest";
|
|
|
7
7
|
type HookModule = {
|
|
8
8
|
readonly testHooks: {
|
|
9
9
|
readonly testCommand?: (root: string) => ReadonlyArray<string>;
|
|
10
|
+
readonly formatForHarness?: (message: string, harness: string) => string;
|
|
10
11
|
readonly toolCommand?: (
|
|
11
12
|
root: string,
|
|
12
13
|
tool: string,
|
|
@@ -89,4 +90,20 @@ describe("scaffolded hooks", () => {
|
|
|
89
90
|
"apps/backend/main.py",
|
|
90
91
|
]);
|
|
91
92
|
});
|
|
93
|
+
|
|
94
|
+
it("formats scaffold update check output for Cursor hooks", async () => {
|
|
95
|
+
const { testHooks } = await loadHookModule("scaffold-update-check.mjs");
|
|
96
|
+
|
|
97
|
+
expect(testHooks.formatForHarness?.("Harness scaffold check: OK.", "codex")).toBe(
|
|
98
|
+
"Harness scaffold check: OK.",
|
|
99
|
+
);
|
|
100
|
+
expect(
|
|
101
|
+
JSON.parse(testHooks.formatForHarness?.("Harness scaffold check: OK.", "cursor") ?? "{}"),
|
|
102
|
+
).toMatchObject({
|
|
103
|
+
continue: true,
|
|
104
|
+
additional_context: "Harness scaffold check: OK.",
|
|
105
|
+
agent_message: "Harness scaffold check: OK.",
|
|
106
|
+
user_message: "Harness scaffold check: OK.",
|
|
107
|
+
});
|
|
108
|
+
});
|
|
92
109
|
});
|
|
@@ -53,7 +53,7 @@ const cursorManagedComment =
|
|
|
53
53
|
const opencodeManagedComment =
|
|
54
54
|
"<!-- Generated by scripts/sync-subagents.mjs. Edit .agents/subagents/manifest.mjs instead. -->";
|
|
55
55
|
|
|
56
|
-
function buildCodexAgentConfig({ hasFormatHook }) {
|
|
56
|
+
function buildCodexAgentConfig({ hasFormatHook, hasUpdateCheckHook }) {
|
|
57
57
|
const lines = [
|
|
58
58
|
"[agents]",
|
|
59
59
|
"max_threads = 6",
|
|
@@ -65,11 +65,22 @@ function buildCodexAgentConfig({ hasFormatHook }) {
|
|
|
65
65
|
"[hooks]",
|
|
66
66
|
];
|
|
67
67
|
|
|
68
|
-
if (hasFormatHook) {
|
|
68
|
+
if (hasFormatHook || hasUpdateCheckHook) {
|
|
69
|
+
const sessionStartHooks = [];
|
|
70
|
+
if (hasUpdateCheckHook) {
|
|
71
|
+
sessionStartHooks.push(
|
|
72
|
+
' { type = "command", command = "node \\"$(git rev-parse --show-toplevel)/.codex/hooks/scaffold-update-check.mjs\\" codex", statusMessage = "Checking Harness scaffold", timeout = 60 },',
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
if (hasFormatHook) {
|
|
76
|
+
sessionStartHooks.push(
|
|
77
|
+
' { type = "command", command = "node \\"$(git rev-parse --show-toplevel)/.codex/hooks/format-edited-file.mjs\\" session-start", statusMessage = "Capturing edited-file baseline", timeout = 30 },',
|
|
78
|
+
);
|
|
79
|
+
}
|
|
69
80
|
lines.push(
|
|
70
81
|
"SessionStart = [",
|
|
71
82
|
' { matcher = "startup|resume", hooks = [',
|
|
72
|
-
|
|
83
|
+
...sessionStartHooks,
|
|
73
84
|
" ] },",
|
|
74
85
|
"]",
|
|
75
86
|
);
|
|
@@ -89,39 +100,66 @@ function buildCodexAgentConfig({ hasFormatHook }) {
|
|
|
89
100
|
return lines.join("\n");
|
|
90
101
|
}
|
|
91
102
|
|
|
92
|
-
function buildClaudeSettingsConfig({ hasFormatHook }) {
|
|
103
|
+
function buildClaudeSettingsConfig({ hasFormatHook, hasUpdateCheckHook }) {
|
|
104
|
+
const hooks = {};
|
|
105
|
+
|
|
106
|
+
if (hasUpdateCheckHook) {
|
|
107
|
+
hooks.SessionStart = [
|
|
108
|
+
{
|
|
109
|
+
hooks: [
|
|
110
|
+
{
|
|
111
|
+
type: "command",
|
|
112
|
+
command: 'node "$CLAUDE_PROJECT_DIR"/.claude/hooks/scaffold-update-check.mjs claude',
|
|
113
|
+
timeout: 60,
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (hasFormatHook) {
|
|
121
|
+
hooks.PostToolUse = [
|
|
122
|
+
{
|
|
123
|
+
matcher: "Edit|Write|MultiEdit",
|
|
124
|
+
hooks: [
|
|
125
|
+
{
|
|
126
|
+
type: "command",
|
|
127
|
+
command: 'node "$CLAUDE_PROJECT_DIR"/.claude/hooks/format-edited-file.mjs claude',
|
|
128
|
+
timeout: 30,
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
},
|
|
132
|
+
];
|
|
133
|
+
}
|
|
134
|
+
|
|
93
135
|
return {
|
|
94
|
-
hooks
|
|
95
|
-
? {
|
|
96
|
-
PostToolUse: [
|
|
97
|
-
{
|
|
98
|
-
matcher: "Edit|Write|MultiEdit",
|
|
99
|
-
hooks: [
|
|
100
|
-
{
|
|
101
|
-
type: "command",
|
|
102
|
-
command: 'node "$CLAUDE_PROJECT_DIR"/.claude/hooks/format-edited-file.mjs claude',
|
|
103
|
-
timeout: 30,
|
|
104
|
-
},
|
|
105
|
-
],
|
|
106
|
-
},
|
|
107
|
-
],
|
|
108
|
-
}
|
|
109
|
-
: {},
|
|
136
|
+
hooks,
|
|
110
137
|
};
|
|
111
138
|
}
|
|
112
139
|
|
|
113
|
-
function buildCursorHooksConfig({ hasFormatHook }) {
|
|
140
|
+
function buildCursorHooksConfig({ hasFormatHook, hasUpdateCheckHook }) {
|
|
141
|
+
const hooks = {};
|
|
142
|
+
|
|
143
|
+
if (hasUpdateCheckHook) {
|
|
144
|
+
hooks.sessionStart = [
|
|
145
|
+
{
|
|
146
|
+
command: "node .cursor/hooks/scaffold-update-check.mjs cursor",
|
|
147
|
+
timeout: 60000,
|
|
148
|
+
},
|
|
149
|
+
];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (hasFormatHook) {
|
|
153
|
+
hooks.afterFileEdit = [
|
|
154
|
+
{
|
|
155
|
+
command: "node .cursor/hooks/format-edited-file.mjs cursor",
|
|
156
|
+
},
|
|
157
|
+
];
|
|
158
|
+
}
|
|
159
|
+
|
|
114
160
|
return {
|
|
115
161
|
version: 1,
|
|
116
|
-
hooks
|
|
117
|
-
? {
|
|
118
|
-
afterFileEdit: [
|
|
119
|
-
{
|
|
120
|
-
command: "node .cursor/hooks/format-edited-file.mjs cursor",
|
|
121
|
-
},
|
|
122
|
-
],
|
|
123
|
-
}
|
|
124
|
-
: {},
|
|
162
|
+
hooks,
|
|
125
163
|
};
|
|
126
164
|
}
|
|
127
165
|
|
|
@@ -370,7 +408,7 @@ async function syncHookSurface() {
|
|
|
370
408
|
await mkdir(cursorHooksDir, { recursive: true });
|
|
371
409
|
await mkdir(opencodePluginsDir, { recursive: true });
|
|
372
410
|
|
|
373
|
-
for (const hookName of ["format-edited-file.mjs"]) {
|
|
411
|
+
for (const hookName of ["format-edited-file.mjs", "scaffold-update-check.mjs"]) {
|
|
374
412
|
const sourcePath = path.join(sharedHooksPath, hookName);
|
|
375
413
|
const targetPaths = [
|
|
376
414
|
path.join(codexHooksDir, hookName),
|
|
@@ -424,6 +462,7 @@ async function main() {
|
|
|
424
462
|
await mkdir(path.dirname(cursorHooksJsonPath), { recursive: true });
|
|
425
463
|
const availableHooks = {
|
|
426
464
|
hasFormatHook: await pathExists(path.join(sharedHooksPath, "format-edited-file.mjs")),
|
|
465
|
+
hasUpdateCheckHook: await pathExists(path.join(sharedHooksPath, "scaffold-update-check.mjs")),
|
|
427
466
|
};
|
|
428
467
|
await writeFile(codexConfigPath, buildCodexAgentConfig(availableHooks), "utf8");
|
|
429
468
|
await rm(path.join(codexDir, "hooks.json"), { force: true });
|
|
@@ -54,6 +54,26 @@ const capabilityPacks = {
|
|
|
54
54
|
"Cross-cutting review, simplification, and architecture-friction analysis for changed code.",
|
|
55
55
|
skills: ["simplify", "improve-codebase-architecture"],
|
|
56
56
|
},
|
|
57
|
+
"workflow-planning": {
|
|
58
|
+
description: "Default workflow planning pack for spec discovery, spec review, and plan review.",
|
|
59
|
+
skills: [
|
|
60
|
+
"create-spec",
|
|
61
|
+
"create-plan",
|
|
62
|
+
"parallel-research",
|
|
63
|
+
"swarm-planner",
|
|
64
|
+
"tdd",
|
|
65
|
+
"simplify",
|
|
66
|
+
"stack",
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
"workflow-requirements": {
|
|
70
|
+
description: "Default workflow requirements pack for grill synthesis and backlog shaping.",
|
|
71
|
+
skills: ["requirements-phase", "requirements-grill", "write-backlog"],
|
|
72
|
+
},
|
|
73
|
+
"workflow-review": {
|
|
74
|
+
description: "Default workflow review pack for readonly artifact checks.",
|
|
75
|
+
skills: ["review-phase", "simplify"],
|
|
76
|
+
},
|
|
57
77
|
"python-core": {
|
|
58
78
|
description:
|
|
59
79
|
"Python project structure, code style, design boundaries, and everyday implementation guidance.",
|
|
@@ -114,6 +134,106 @@ const agents = [
|
|
|
114
134
|
"If the task asks for feature work rather than review, tell the parent to use the relevant implementation specialist.",
|
|
115
135
|
],
|
|
116
136
|
},
|
|
137
|
+
{
|
|
138
|
+
name: "planning-discovery",
|
|
139
|
+
description:
|
|
140
|
+
"Use for bounded readonly orientation before spec or plan writing: gather evidence, contradictions, overlapping work, and open questions without solution design.",
|
|
141
|
+
ownedPaths: ["**/*"],
|
|
142
|
+
guidanceFiles: ["AGENTS.md"],
|
|
143
|
+
activationInstructions: [
|
|
144
|
+
...skillActivationInstructions,
|
|
145
|
+
"Stay read-only and keep the pass bounded to discovery evidence.",
|
|
146
|
+
"Return evidence, contradictions, overlapping work, and open questions; do not choose product direction or design the solution.",
|
|
147
|
+
"Use `parallel-research` only when the evidence can be split across independent sources.",
|
|
148
|
+
],
|
|
149
|
+
packs: ["workflow-planning"],
|
|
150
|
+
skills: ["parallel-research", "create-spec"],
|
|
151
|
+
boundaries: [
|
|
152
|
+
"Do not edit files.",
|
|
153
|
+
"Do not write specs, plans, or backlog items.",
|
|
154
|
+
"Do not resolve open questions; name what the parent must decide.",
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: "requirements-synthesizer",
|
|
159
|
+
description:
|
|
160
|
+
"Use for readonly compression of grill/status/log artifacts into accepted, rejected, superseded, parked, and unresolved decisions.",
|
|
161
|
+
ownedPaths: ["**/*"],
|
|
162
|
+
guidanceFiles: ["AGENTS.md"],
|
|
163
|
+
activationInstructions: [
|
|
164
|
+
...skillActivationInstructions,
|
|
165
|
+
"Stay read-only and treat requirements artifacts as evidence, not permission to invent scope.",
|
|
166
|
+
"Separate accepted, rejected, superseded, parked, and unresolved decisions.",
|
|
167
|
+
"Report whether backlog writing is blocked and name the exact blocking branches.",
|
|
168
|
+
],
|
|
169
|
+
packs: ["workflow-requirements"],
|
|
170
|
+
skills: ["requirements-phase", "requirements-grill", "write-backlog"],
|
|
171
|
+
boundaries: [
|
|
172
|
+
"Do not interview the user unless the parent delegates one exact question.",
|
|
173
|
+
"Do not write or sync backlog items.",
|
|
174
|
+
"Do not silently convert parked or unresolved scope into accepted backlog content.",
|
|
175
|
+
],
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: "backlog-shaper",
|
|
179
|
+
description:
|
|
180
|
+
"Use for draft-only module, epic, and story shaping from closed requirements; provider sync and final backlog decisions stay with the parent.",
|
|
181
|
+
ownedPaths: ["**/*"],
|
|
182
|
+
guidanceFiles: ["AGENTS.md"],
|
|
183
|
+
activationInstructions: [
|
|
184
|
+
...skillActivationInstructions,
|
|
185
|
+
"Use `write-backlog` and the backlog model to derive module -> epic -> story shape from locked direction only.",
|
|
186
|
+
"Keep parked or unresolved scope as deferred notes, not silent backlog content.",
|
|
187
|
+
"Return a draft hierarchy and provider payload considerations; do not sync externally.",
|
|
188
|
+
],
|
|
189
|
+
packs: ["workflow-requirements"],
|
|
190
|
+
skills: ["requirements-phase", "write-backlog"],
|
|
191
|
+
boundaries: [
|
|
192
|
+
"Draft only unless the parent explicitly assigns file edits.",
|
|
193
|
+
"Do not call provider APIs or create tracker items.",
|
|
194
|
+
"Do not add implementation-task detail to product-facing epic or story bodies.",
|
|
195
|
+
],
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: "spec-reviewer",
|
|
199
|
+
description:
|
|
200
|
+
"Use for readonly review of drafted specs before user review, checking invented requirements, contradictions, missing constraints, and vague acceptance criteria.",
|
|
201
|
+
ownedPaths: ["**/*"],
|
|
202
|
+
guidanceFiles: ["AGENTS.md"],
|
|
203
|
+
activationInstructions: [
|
|
204
|
+
...reviewActivationInstructions,
|
|
205
|
+
"Use `create-spec` as the spec contract and keep findings in the problem space.",
|
|
206
|
+
"Check that the draft maps to accepted requirements and does not invent unaccepted scope.",
|
|
207
|
+
"Return actionable spec findings only; do not rewrite the spec unless the parent asks.",
|
|
208
|
+
],
|
|
209
|
+
packs: ["workflow-planning", "workflow-review"],
|
|
210
|
+
skills: ["create-spec", "review-phase", "simplify"],
|
|
211
|
+
boundaries: [
|
|
212
|
+
"Do not edit files unless explicitly assigned.",
|
|
213
|
+
"Do not add implementation design to the spec.",
|
|
214
|
+
"Do not approve vague acceptance criteria without naming the gap.",
|
|
215
|
+
],
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: "plan-reviewer",
|
|
219
|
+
description:
|
|
220
|
+
"Use for readonly review of plans before yielding, checking dependencies, ordering, invalid parallelism, unsafe write overlap, RED targets, validation, and assigned skills.",
|
|
221
|
+
ownedPaths: ["**/*"],
|
|
222
|
+
guidanceFiles: ["AGENTS.md"],
|
|
223
|
+
activationInstructions: [
|
|
224
|
+
...reviewActivationInstructions,
|
|
225
|
+
"Use `create-plan`, `swarm-planner`, and `tdd` as the plan contract.",
|
|
226
|
+
"Check dependency graph, task size, write-scope overlap, RED targets, validation commands, review modes, and assigned skills.",
|
|
227
|
+
"Return specific plan findings; do not implement the plan.",
|
|
228
|
+
],
|
|
229
|
+
packs: ["workflow-planning", "workflow-review"],
|
|
230
|
+
skills: ["create-plan", "swarm-planner", "tdd", "simplify"],
|
|
231
|
+
boundaries: [
|
|
232
|
+
"Do not edit files unless explicitly assigned.",
|
|
233
|
+
"Do not spawn implementation workers.",
|
|
234
|
+
"Do not treat `swarm-planner` itself as the subagent archetype; review the parent-owned plan output.",
|
|
235
|
+
],
|
|
236
|
+
},
|
|
117
237
|
{
|
|
118
238
|
name: "docs-ingest-phase",
|
|
119
239
|
description:
|