@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.
- package/README.md +2 -2
- package/dist/data/AGENTS.md +3 -1
- package/dist/data/catalog/hooks.ts +8 -0
- package/dist/data/catalog/lint.ts +28 -82
- package/dist/data/catalog/packs.ts +8 -6
- package/dist/data/catalog/skills.ts +48 -0
- package/dist/data/catalog/tools.ts +9 -1
- package/dist/data/hooks/format-edited-file.mjs +1 -1
- package/dist/data/hooks/scaffold-update-check.mjs +181 -0
- package/dist/data/hooks.test.ts +19 -2
- package/dist/data/scripts/sync-subagents.mjs +70 -37
- package/dist/data/subagents/manifest.mjs +120 -0
- package/dist/index.js +1916 -767
- 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/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 +57 -12
- package/dist/skills/agnostic/planning/create-spec/references/backlog-sync.md +5 -2
- 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 +34 -7
- package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +32 -9
- package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +4 -2
- package/dist/skills/agnostic/planning/implement-spec/references/parallel.md +3 -3
- package/dist/skills/agnostic/planning/implement-spec/references/sequential.md +16 -6
- package/dist/skills/agnostic/planning/stack/SKILL.md +89 -0
- package/dist/skills/agnostic/quality/autoreview/SKILL.md +191 -0
- package/dist/skills/agnostic/quality/autoreview/scripts/autoreview +1176 -0
- package/dist/skills/agnostic/quality/autoreview/scripts/test-review-harness +176 -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 +26 -9
- 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`
|
|
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
|
|
|
@@ -92,7 +92,7 @@ bun run release:publish
|
|
|
92
92
|
|
|
93
93
|
`bun run baseline:publish` builds the current scaffold baseline, creates or updates the `baseline/stable/<date>-<sha>` GitHub release, and uploads the baseline manifest plus tarball. Use it when scaffold data changes but the npm executable does not need a new version.
|
|
94
94
|
|
|
95
|
-
`bun run release:publish` builds the CLI, publishes a sanitized npm package from the built `dist/` output, updates the `latest` dist-tag, also updates `next` for latest releases, pushes the matching `v<version>` git tag, and creates the GitHub release from `CHANGELOG.md
|
|
95
|
+
`bun run release:publish` builds the CLI, publishes a sanitized npm package from the built `dist/` output, updates the `latest` dist-tag, also updates `next` for latest releases, pushes the matching `v<version>` git tag, and creates or updates the GitHub release title and notes from the categorized `CHANGELOG.md` content. GitHub notes use compact category labels such as `changed:` and `fixed:` without changelog publish metadata. Commit the version bump and changelog entry before running it; the script refuses dirty worktrees, missing changelog entries, uncategorized release notes, and existing tags that point at another commit. Set `NPM_TAG=beta` for beta prereleases without moving `latest`.
|
|
96
96
|
|
|
97
97
|
Before npm releases, authenticate against the public npm registry:
|
|
98
98
|
|
package/dist/data/AGENTS.md
CHANGED
|
@@ -96,7 +96,9 @@ Strong success criteria let you loop independently. Weak criteria ("make it work
|
|
|
96
96
|
|
|
97
97
|
## Subagents
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
Before delegating, verify the active harness global/project settings actually enable subagent execution. Then verify `.agents/subagents/manifest.mjs` exists and the chosen specialist has matching owned paths, guidance files, and skills.
|
|
100
|
+
|
|
101
|
+
Use readonly subagents aggressively for research, auditing, docs updating, investigating multiple hypotheses, or exploring unrelated areas. Implementation subagents are allowed only when a skill or plan explicitly requires them, such as `implement-spec` sequential single-worker execution or parallel waves. If the runtime guard fails, repair setup or execute locally; do not claim inactive worker coverage.
|
|
100
102
|
|
|
101
103
|
## Notes — Cross-session Memory
|
|
102
104
|
|
|
@@ -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",
|
|
@@ -15,6 +15,7 @@ export interface LintPlacementDefinition {
|
|
|
15
15
|
export interface LintAssetDefinition {
|
|
16
16
|
readonly id: LintAssetId;
|
|
17
17
|
readonly description: string;
|
|
18
|
+
readonly oxlintPresets: ReadonlyArray<string>;
|
|
18
19
|
readonly plugins: ReadonlyArray<string>;
|
|
19
20
|
readonly jsPlugins: ReadonlyArray<LintJsPluginDefinition>;
|
|
20
21
|
readonly settings: Record<string, unknown>;
|
|
@@ -24,7 +25,7 @@ export interface LintAssetDefinition {
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
const sharedReactPlacement = {
|
|
27
|
-
recommendedConfigFile: ".
|
|
28
|
+
recommendedConfigFile: "oxlint.config.ts",
|
|
28
29
|
recommendedFiles: ["<detected-react-workspace>/**/*.{js,jsx,ts,tsx}"],
|
|
29
30
|
recommendedWorkspaces: ["detected React workspaces"],
|
|
30
31
|
placementNotes:
|
|
@@ -32,7 +33,7 @@ const sharedReactPlacement = {
|
|
|
32
33
|
} as const satisfies LintPlacementDefinition;
|
|
33
34
|
|
|
34
35
|
const webOnlyPlacement = {
|
|
35
|
-
recommendedConfigFile: ".
|
|
36
|
+
recommendedConfigFile: "oxlint.config.ts",
|
|
36
37
|
recommendedFiles: ["<detected-nextjs-workspace>/**/*.{js,jsx,ts,tsx}"],
|
|
37
38
|
recommendedWorkspaces: ["detected Next.js workspaces"],
|
|
38
39
|
placementNotes:
|
|
@@ -40,7 +41,7 @@ const webOnlyPlacement = {
|
|
|
40
41
|
} as const satisfies LintPlacementDefinition;
|
|
41
42
|
|
|
42
43
|
const effectPlacement = {
|
|
43
|
-
recommendedConfigFile: ".
|
|
44
|
+
recommendedConfigFile: "oxlint.config.ts",
|
|
44
45
|
recommendedFiles: ["<detected-effect-workspace>/**/*.{js,jsx,ts,tsx}"],
|
|
45
46
|
recommendedWorkspaces: ["detected Effect workspaces"],
|
|
46
47
|
placementNotes:
|
|
@@ -48,7 +49,7 @@ const effectPlacement = {
|
|
|
48
49
|
} as const satisfies LintPlacementDefinition;
|
|
49
50
|
|
|
50
51
|
const vitestPlacement = {
|
|
51
|
-
recommendedConfigFile: ".
|
|
52
|
+
recommendedConfigFile: "oxlint.config.ts",
|
|
52
53
|
recommendedFiles: [
|
|
53
54
|
"<detected-test-workspace>/**/*.{test,spec}.{js,jsx,ts,tsx}",
|
|
54
55
|
"<detected-test-workspace>/src/test/**/*.{js,jsx,ts,tsx}",
|
|
@@ -61,38 +62,19 @@ const vitestPlacement = {
|
|
|
61
62
|
export const lintCatalog = [
|
|
62
63
|
{
|
|
63
64
|
id: "react-core",
|
|
64
|
-
description: "
|
|
65
|
-
|
|
65
|
+
description: "Ultracite React preset for rendered app and shared UI code.",
|
|
66
|
+
oxlintPresets: ["react"],
|
|
67
|
+
plugins: [],
|
|
66
68
|
jsPlugins: [],
|
|
67
69
|
settings: {},
|
|
68
|
-
rules: {
|
|
69
|
-
"react/rules-of-hooks": "error",
|
|
70
|
-
"react/exhaustive-deps": "error",
|
|
71
|
-
"react/forward-ref-uses-ref": "error",
|
|
72
|
-
"react/jsx-key": "error",
|
|
73
|
-
"react/jsx-no-comment-textnodes": "error",
|
|
74
|
-
"react/jsx-no-duplicate-props": "error",
|
|
75
|
-
"react/jsx-no-target-blank": "error",
|
|
76
|
-
"react/jsx-no-undef": "error",
|
|
77
|
-
"react/jsx-no-useless-fragment": "error",
|
|
78
|
-
"react/no-children-prop": "error",
|
|
79
|
-
"react/no-danger-with-children": "error",
|
|
80
|
-
"react/no-direct-mutation-state": "error",
|
|
81
|
-
"react/no-find-dom-node": "error",
|
|
82
|
-
"react/no-render-return-value": "error",
|
|
83
|
-
"react/no-string-refs": "error",
|
|
84
|
-
"react/no-this-in-sfc": "error",
|
|
85
|
-
"react/no-unknown-property": "error",
|
|
86
|
-
"react/no-unescaped-entities": "error",
|
|
87
|
-
"react/no-unsafe": "error",
|
|
88
|
-
"react/void-dom-elements-no-children": "error",
|
|
89
|
-
},
|
|
70
|
+
rules: {},
|
|
90
71
|
requiredDevDependencies: [],
|
|
91
72
|
placement: sharedReactPlacement,
|
|
92
73
|
},
|
|
93
74
|
{
|
|
94
75
|
id: "react-hooks",
|
|
95
76
|
description: "React Hooks lint rules via the JS plugin bridge for Oxlint.",
|
|
77
|
+
oxlintPresets: [],
|
|
96
78
|
plugins: [],
|
|
97
79
|
jsPlugins: [
|
|
98
80
|
{
|
|
@@ -102,6 +84,7 @@ export const lintCatalog = [
|
|
|
102
84
|
],
|
|
103
85
|
settings: {},
|
|
104
86
|
rules: {
|
|
87
|
+
"react-hooks-js/exhaustive-deps": "error",
|
|
105
88
|
"react-hooks-js/component-hook-factories": "error",
|
|
106
89
|
"react-hooks-js/config": "error",
|
|
107
90
|
"react-hooks-js/error-boundaries": "error",
|
|
@@ -112,6 +95,7 @@ export const lintCatalog = [
|
|
|
112
95
|
"react-hooks-js/preserve-manual-memoization": "error",
|
|
113
96
|
"react-hooks-js/purity": "error",
|
|
114
97
|
"react-hooks-js/refs": "error",
|
|
98
|
+
"react-hooks-js/rules-of-hooks": "error",
|
|
115
99
|
"react-hooks-js/set-state-in-effect": "error",
|
|
116
100
|
"react-hooks-js/set-state-in-render": "error",
|
|
117
101
|
"react-hooks-js/static-components": "error",
|
|
@@ -124,6 +108,7 @@ export const lintCatalog = [
|
|
|
124
108
|
{
|
|
125
109
|
id: "react-you-might-not-need-an-effect",
|
|
126
110
|
description: "Guidance rules that push React code away from unnecessary effects.",
|
|
111
|
+
oxlintPresets: [],
|
|
127
112
|
plugins: [],
|
|
128
113
|
jsPlugins: [
|
|
129
114
|
{
|
|
@@ -136,7 +121,6 @@ export const lintCatalog = [
|
|
|
136
121
|
"react-you-might-not-need-an-effect-js/no-adjust-state-on-prop-change": "error",
|
|
137
122
|
"react-you-might-not-need-an-effect-js/no-chain-state-updates": "error",
|
|
138
123
|
"react-you-might-not-need-an-effect-js/no-derived-state": "error",
|
|
139
|
-
"react-you-might-not-need-an-effect-js/no-empty-effect": "error",
|
|
140
124
|
"react-you-might-not-need-an-effect-js/no-event-handler": "error",
|
|
141
125
|
"react-you-might-not-need-an-effect-js/no-initialize-state": "error",
|
|
142
126
|
"react-you-might-not-need-an-effect-js/no-pass-data-to-parent": "error",
|
|
@@ -148,31 +132,12 @@ export const lintCatalog = [
|
|
|
148
132
|
},
|
|
149
133
|
{
|
|
150
134
|
id: "next-core",
|
|
151
|
-
description: "Next.js
|
|
152
|
-
|
|
135
|
+
description: "Ultracite Next.js preset for the main web application.",
|
|
136
|
+
oxlintPresets: ["next"],
|
|
137
|
+
plugins: [],
|
|
153
138
|
jsPlugins: [],
|
|
154
139
|
settings: {},
|
|
155
|
-
rules: {
|
|
156
|
-
"nextjs/inline-script-id": "error",
|
|
157
|
-
"nextjs/next-script-for-ga": "error",
|
|
158
|
-
"nextjs/no-assign-module-variable": "error",
|
|
159
|
-
"nextjs/no-async-client-component": "error",
|
|
160
|
-
"nextjs/no-before-interactive-script-outside-document": "error",
|
|
161
|
-
"nextjs/no-css-tags": "error",
|
|
162
|
-
"nextjs/no-document-import-in-page": "error",
|
|
163
|
-
"nextjs/no-duplicate-head": "error",
|
|
164
|
-
"nextjs/no-head-element": "error",
|
|
165
|
-
"nextjs/no-head-import-in-document": "error",
|
|
166
|
-
"nextjs/no-html-link-for-pages": "error",
|
|
167
|
-
"nextjs/no-img-element": "error",
|
|
168
|
-
"nextjs/no-page-custom-font": "error",
|
|
169
|
-
"nextjs/no-script-component-in-head": "error",
|
|
170
|
-
"nextjs/no-styled-jsx-in-document": "error",
|
|
171
|
-
"nextjs/no-sync-scripts": "error",
|
|
172
|
-
"nextjs/no-title-in-document-head": "error",
|
|
173
|
-
"nextjs/no-typos": "error",
|
|
174
|
-
"nextjs/no-unwanted-polyfillio": "error",
|
|
175
|
-
},
|
|
140
|
+
rules: {},
|
|
176
141
|
requiredDevDependencies: [],
|
|
177
142
|
placement: {
|
|
178
143
|
...webOnlyPlacement,
|
|
@@ -182,25 +147,13 @@ export const lintCatalog = [
|
|
|
182
147
|
},
|
|
183
148
|
{
|
|
184
149
|
id: "tanstack-query-core",
|
|
185
|
-
description: "TanStack
|
|
150
|
+
description: "Ultracite TanStack preset for query/router/start framework linting.",
|
|
151
|
+
oxlintPresets: ["tanstack"],
|
|
186
152
|
plugins: [],
|
|
187
|
-
jsPlugins: [
|
|
188
|
-
{
|
|
189
|
-
name: "tanstack-query-js",
|
|
190
|
-
specifier: "@tanstack/eslint-plugin-query",
|
|
191
|
-
},
|
|
192
|
-
],
|
|
153
|
+
jsPlugins: [],
|
|
193
154
|
settings: {},
|
|
194
|
-
rules: {
|
|
195
|
-
|
|
196
|
-
"tanstack-query-js/infinite-query-property-order": "error",
|
|
197
|
-
"tanstack-query-js/mutation-property-order": "error",
|
|
198
|
-
"tanstack-query-js/no-rest-destructuring": "warn",
|
|
199
|
-
"tanstack-query-js/no-unstable-deps": "error",
|
|
200
|
-
"tanstack-query-js/no-void-query-fn": "error",
|
|
201
|
-
"tanstack-query-js/stable-query-client": "error",
|
|
202
|
-
},
|
|
203
|
-
requiredDevDependencies: ["@tanstack/eslint-plugin-query"],
|
|
155
|
+
rules: {},
|
|
156
|
+
requiredDevDependencies: [],
|
|
204
157
|
placement: {
|
|
205
158
|
...webOnlyPlacement,
|
|
206
159
|
placementNotes:
|
|
@@ -210,6 +163,7 @@ export const lintCatalog = [
|
|
|
210
163
|
{
|
|
211
164
|
id: "effect-no-barrel-imports",
|
|
212
165
|
description: "Effect architectural rule that blocks barrel-package imports.",
|
|
166
|
+
oxlintPresets: [],
|
|
213
167
|
plugins: [],
|
|
214
168
|
jsPlugins: [
|
|
215
169
|
{
|
|
@@ -231,20 +185,12 @@ export const lintCatalog = [
|
|
|
231
185
|
},
|
|
232
186
|
{
|
|
233
187
|
id: "vitest-core",
|
|
234
|
-
description: "Vitest
|
|
235
|
-
|
|
188
|
+
description: "Ultracite Vitest preset for repo-owned test globs.",
|
|
189
|
+
oxlintPresets: ["vitest"],
|
|
190
|
+
plugins: [],
|
|
236
191
|
jsPlugins: [],
|
|
237
|
-
settings: {
|
|
238
|
-
|
|
239
|
-
typecheck: false,
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
rules: {
|
|
243
|
-
"vitest/consistent-each-for": "warn",
|
|
244
|
-
"vitest/no-conditional-tests": "error",
|
|
245
|
-
"vitest/no-import-node-test": "error",
|
|
246
|
-
"vitest/warn-todo": "warn",
|
|
247
|
-
},
|
|
192
|
+
settings: {},
|
|
193
|
+
rules: {},
|
|
248
194
|
requiredDevDependencies: [],
|
|
249
195
|
placement: vitestPlacement,
|
|
250
196
|
},
|
|
@@ -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: [],
|
|
@@ -205,7 +206,7 @@ export const packCatalog = [
|
|
|
205
206
|
triggerPackages: ["react", "react-dom"],
|
|
206
207
|
description: "React guidance pack.",
|
|
207
208
|
skills: ["async-react-patterns", "vercel-composition-patterns", "vercel-react-best-practices"],
|
|
208
|
-
lintAssets: ["react-core", "react-
|
|
209
|
+
lintAssets: ["react-core", "react-you-might-not-need-an-effect"],
|
|
209
210
|
hooks: [],
|
|
210
211
|
promptSurfaces: ["shared-agents", "root-prompt-spec", "workspace-prompt-spec"],
|
|
211
212
|
promptDetails: ["shared react structure baseline", "workspace react composition rules"],
|
|
@@ -214,8 +215,9 @@ export const packCatalog = [
|
|
|
214
215
|
id: "research",
|
|
215
216
|
category: "default",
|
|
216
217
|
triggerPackages: [],
|
|
217
|
-
description:
|
|
218
|
-
|
|
218
|
+
description:
|
|
219
|
+
"Default research pack: parallel research, structured review, and architecture inspection.",
|
|
220
|
+
skills: ["parallel-research", "review-phase", "autoreview", "improve-codebase-architecture"],
|
|
219
221
|
lintAssets: [],
|
|
220
222
|
hooks: [],
|
|
221
223
|
promptSurfaces: ["shared-agents", "root-prompt-spec", "workspace-prompt-spec"],
|
|
@@ -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",
|
|
@@ -324,6 +364,14 @@ export const skillCatalog = [
|
|
|
324
364
|
framework: null,
|
|
325
365
|
requiresTools: [],
|
|
326
366
|
},
|
|
367
|
+
{
|
|
368
|
+
id: "autoreview",
|
|
369
|
+
sourceDirectory: "skills/agnostic/quality/autoreview",
|
|
370
|
+
tier: "agnostic",
|
|
371
|
+
language: null,
|
|
372
|
+
framework: null,
|
|
373
|
+
requiresTools: [],
|
|
374
|
+
},
|
|
327
375
|
{
|
|
328
376
|
id: "simplify",
|
|
329
377
|
sourceDirectory: "skills/agnostic/quality/simplify",
|
|
@@ -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;
|
|
@@ -243,7 +243,7 @@ function lintCommandForPath(root, relativePath) {
|
|
|
243
243
|
return null;
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
return toolCommand(root, "oxlint", [
|
|
246
|
+
return toolCommand(root, "oxlint", [relativePath]);
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
function formatAndLintFiles(root, filePaths) {
|
|
@@ -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,
|
|
@@ -57,9 +58,9 @@ describe("scaffolded hooks", () => {
|
|
|
57
58
|
"pnpm-lock.yaml": "",
|
|
58
59
|
}),
|
|
59
60
|
"oxlint",
|
|
60
|
-
["
|
|
61
|
+
["src/index.ts"],
|
|
61
62
|
),
|
|
62
|
-
).toEqual(["pnpm", "exec", "oxlint", "
|
|
63
|
+
).toEqual(["pnpm", "exec", "oxlint", "src/index.ts"]);
|
|
63
64
|
});
|
|
64
65
|
|
|
65
66
|
it("routes Python backend files through Ruff in their project", async () => {
|
|
@@ -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
|
});
|