@punks/cli 2.1.7 → 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.
Files changed (48) hide show
  1. package/README.md +2 -2
  2. package/dist/data/AGENTS.md +3 -1
  3. package/dist/data/catalog/hooks.ts +8 -0
  4. package/dist/data/catalog/lint.ts +28 -82
  5. package/dist/data/catalog/packs.ts +8 -6
  6. package/dist/data/catalog/skills.ts +48 -0
  7. package/dist/data/catalog/tools.ts +9 -1
  8. package/dist/data/hooks/format-edited-file.mjs +1 -1
  9. package/dist/data/hooks/scaffold-update-check.mjs +181 -0
  10. package/dist/data/hooks.test.ts +19 -2
  11. package/dist/data/scripts/sync-subagents.mjs +70 -37
  12. package/dist/data/subagents/manifest.mjs +120 -0
  13. package/dist/index.js +1916 -767
  14. package/dist/skills/agnostic/cli/dp-cli/SKILL.md +3 -3
  15. package/dist/skills/agnostic/cli/dp-cli/references/commands.md +1 -1
  16. package/dist/skills/agnostic/docs/docs-onboarding/SKILL.md +46 -0
  17. package/dist/skills/agnostic/docs/docs-onboarding/agents/openai.yaml +4 -0
  18. package/dist/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +67 -0
  19. package/dist/skills/agnostic/docs/upstream/mattpocock-writing-skills.md +41 -0
  20. package/dist/skills/agnostic/docs/writing-beats/SKILL.md +69 -0
  21. package/dist/skills/agnostic/docs/writing-fragments/SKILL.md +76 -0
  22. package/dist/skills/agnostic/docs/writing-shape/SKILL.md +75 -0
  23. package/dist/skills/agnostic/planning/create-plan/SKILL.md +17 -2
  24. package/dist/skills/agnostic/planning/create-plan/references/planner-phase.md +1 -1
  25. package/dist/skills/agnostic/planning/create-spec/SKILL.md +57 -12
  26. package/dist/skills/agnostic/planning/create-spec/references/backlog-sync.md +5 -2
  27. package/dist/skills/agnostic/planning/create-spec/references/discovery.md +24 -16
  28. package/dist/skills/agnostic/planning/create-spec/references/folder-naming.md +6 -2
  29. package/dist/skills/agnostic/planning/create-spec/references/wiki-bookkeeping.md +29 -5
  30. package/dist/skills/agnostic/planning/implement-spec/SKILL.md +34 -7
  31. package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +32 -9
  32. package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +4 -2
  33. package/dist/skills/agnostic/planning/implement-spec/references/parallel.md +3 -3
  34. package/dist/skills/agnostic/planning/implement-spec/references/sequential.md +16 -6
  35. package/dist/skills/agnostic/planning/stack/SKILL.md +89 -0
  36. package/dist/skills/agnostic/quality/autoreview/SKILL.md +191 -0
  37. package/dist/skills/agnostic/quality/autoreview/scripts/autoreview +1176 -0
  38. package/dist/skills/agnostic/quality/autoreview/scripts/test-review-harness +176 -0
  39. package/dist/skills/agnostic/requirements/write-backlog/SKILL.md +7 -5
  40. package/dist/skills/frameworks/tanstack-query/tanstack-query/SKILL.md +621 -830
  41. package/dist/skills/frameworks/tanstack-start/tanstack-start/SKILL.md +250 -0
  42. package/dist/skills/phases/delivery-phase/SKILL.md +6 -1
  43. package/dist/skills/phases/docs-ingest-phase/SKILL.md +28 -20
  44. package/dist/skills/phases/docs-ingest-phase/references/fumadocs-routing.md +8 -5
  45. package/dist/skills/phases/docs-ingest-phase/references/public-docs.md +82 -0
  46. package/dist/skills/phases/requirements-phase/SKILL.md +2 -0
  47. package/dist/skills/phases/review-phase/SKILL.md +26 -9
  48. package/package.json +1 -1
@@ -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
- ' { type = "command", command = "node \\"$(git rev-parse --show-toplevel)/.codex/hooks/format-edited-file.mjs\\" session-start", statusMessage = "Capturing edited-file baseline", timeout = 30 },',
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: hasFormatHook
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: hasFormatHook
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
 
@@ -129,12 +167,6 @@ function buildOpenCodeConfig(existingConfig, { hasFormatHook }) {
129
167
  const config = { ...existingConfig };
130
168
 
131
169
  if (hasFormatHook) {
132
- config.plugin = [
133
- ...new Set([
134
- ...(Array.isArray(config.plugin) ? config.plugin : []),
135
- "./.opencode/plugins/format-edited-file.mjs",
136
- ]),
137
- ];
138
170
  config.formatter = {
139
171
  ...(typeof config.formatter === "object" && config.formatter !== null
140
172
  ? config.formatter
@@ -376,7 +408,7 @@ async function syncHookSurface() {
376
408
  await mkdir(cursorHooksDir, { recursive: true });
377
409
  await mkdir(opencodePluginsDir, { recursive: true });
378
410
 
379
- for (const hookName of ["format-edited-file.mjs"]) {
411
+ for (const hookName of ["format-edited-file.mjs", "scaffold-update-check.mjs"]) {
380
412
  const sourcePath = path.join(sharedHooksPath, hookName);
381
413
  const targetPaths = [
382
414
  path.join(codexHooksDir, hookName),
@@ -430,6 +462,7 @@ async function main() {
430
462
  await mkdir(path.dirname(cursorHooksJsonPath), { recursive: true });
431
463
  const availableHooks = {
432
464
  hasFormatHook: await pathExists(path.join(sharedHooksPath, "format-edited-file.mjs")),
465
+ hasUpdateCheckHook: await pathExists(path.join(sharedHooksPath, "scaffold-update-check.mjs")),
433
466
  };
434
467
  await writeFile(codexConfigPath, buildCodexAgentConfig(availableHooks), "utf8");
435
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: