claude-everything-workflow 0.1.9 → 0.2.3
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/AGENTS.md +20 -20
- package/CLAUDE.md +1 -5
- package/README.md +151 -113
- package/agents/e2e-runner.md +8 -141
- package/agents/harness-optimizer.md +3 -2
- package/commands/code-review.md +10 -15
- package/commands/learn.md +97 -0
- package/commands/pr.md +5 -6
- package/commands/to-spec.md +11 -0
- package/commands/verify.md +7 -11
- package/harness/manifest.json +346 -0
- package/hooks/check-code-size.js +33 -12
- package/hooks/check-console-log.js +72 -24
- package/package.json +10 -2
- package/rules/01-base.md +9 -49
- package/rules/02-code-size.md +5 -20
- package/rules/03-architecture.md +9 -61
- package/rules/04-error-handling.md +4 -26
- package/rules/05-git-workflow.md +12 -39
- package/rules/06-comments.md +3 -43
- package/rules/07-forbidden.md +8 -31
- package/rules/08-specialty-rules-index.md +18 -0
- package/rules/09-first-principles-adversarial-testing.md +6 -18
- package/rules/common/agent-orchestration.md +8 -47
- package/rules/common/context-hygiene.md +9 -72
- package/rules/common/harness-engineering.md +11 -38
- package/rules/common/hooks.md +13 -82
- package/rules/common/performance.md +8 -71
- package/rules/common/pr-automation.md +7 -68
- package/rules/common/skills-learning.md +12 -36
- package/rules/common/testing.md +16 -59
- package/scripts/cleanup-retired-skills.js +214 -0
- package/scripts/install-rules.js +100 -0
- package/scripts/install.ps1 +99 -87
- package/scripts/install.sh +77 -78
- package/scripts/learning/review-confidence.js +1 -4
- package/scripts/legacy-common-rule-hashes.json +78 -0
- package/scripts/merge-claude-settings.cjs +75 -0
- package/scripts/retired-skill-files.json +54 -0
- package/scripts/upstream-capability-baseline.json +27 -0
- package/scripts/upstream-capability-map.json +155 -0
- package/scripts/verify/core.js +91 -0
- package/scripts/verify/grilling-spec-gate-checks.js +266 -0
- package/scripts/verify/install-rules.test.js +156 -0
- package/scripts/verify/metadata-checks.js +747 -0
- package/scripts/verify/repository-checks.js +409 -0
- package/scripts/verify/runtime-checks.js +593 -0
- package/scripts/verify/skill-invocation.test.js +86 -0
- package/scripts/verify/skill-manifest-checks.js +197 -0
- package/scripts/verify/skill-manifest-checks.test.js +123 -0
- package/scripts/verify/workflow-checks.js +685 -0
- package/scripts/verify/workflow-ownership-fixtures.js +371 -0
- package/scripts/verify/workflow-ownership.js +780 -0
- package/scripts/verify-harness.js +18 -1075
- package/scripts/verify-upstream-capability-map.js +118 -0
- package/skills/README.md +28 -16
- package/skills/code-review/SKILL.md +63 -0
- package/skills/code-review/references/spec-reviewer-prompt.md +24 -0
- package/skills/code-review/references/standards-reviewer-prompt.md +35 -0
- package/skills/codebase-design/SKILL.md +63 -0
- package/skills/codebase-design/references/deepening.md +27 -0
- package/skills/codebase-design/references/design-it-twice.md +17 -0
- package/skills/continuous-learning-v2/SKILL.md +8 -8
- package/skills/continuous-learning-v2/config.json +0 -4
- package/skills/domain-modeling/SKILL.md +101 -0
- package/skills/e2e-testing/SKILL.md +20 -310
- package/skills/e2e-testing/references/playwright-patterns.md +324 -0
- package/skills/feature-acceptance/SKILL.md +89 -0
- package/skills/grilling/SKILL.md +83 -0
- package/skills/handoff/SKILL.md +55 -0
- package/skills/handoff/agents/openai.yaml +2 -0
- package/skills/implement/SKILL.md +48 -0
- package/skills/implement/references/ticket-delivery.md +43 -0
- package/skills/improve-codebase-architecture/SKILL.md +47 -0
- package/skills/improve-codebase-architecture/agents/openai.yaml +2 -0
- package/skills/iterative-retrieval/SKILL.md +10 -1
- package/skills/learn/README.md +2 -2
- package/skills/prototype/SKILL.md +50 -0
- package/skills/prototype/references/logic.md +28 -0
- package/skills/prototype/references/ui.md +30 -0
- package/skills/resolving-merge-conflicts/SKILL.md +27 -0
- package/skills/spec-gate/SKILL.md +149 -0
- package/skills/spec-gate/agents/openai.yaml +4 -0
- package/skills/spec-gate/references/spec-document-reviewer-prompt.md +31 -0
- package/skills/subagent-driven-development/SKILL.md +95 -414
- package/skills/systematic-debugging/SKILL.md +11 -49
- package/skills/systematic-debugging/references/diagnosing-bugs.upstream.md +129 -0
- package/skills/systematic-debugging/scripts/hitl-loop.template.js +75 -0
- package/skills/systematic-debugging/scripts/hitl-loop.template.sh +41 -0
- package/skills/test-driven-development/SKILL.md +24 -4
- package/skills/to-tickets/SKILL.md +96 -0
- package/skills/triage/SKILL.md +53 -0
- package/skills/triage/agents/openai.yaml +2 -0
- package/skills/triage/references/agent-brief.md +32 -0
- package/skills/triage/references/out-of-scope.md +14 -0
- package/skills/using-git-worktrees/SKILL.md +8 -5
- package/skills/using-superpowers/SKILL.md +76 -43
- package/skills/using-superpowers/references/process-outcomes.md +41 -0
- package/skills/verification-before-completion/SKILL.md +5 -4
- package/skills/visual-companion/SKILL.md +62 -0
- package/skills/visual-companion/agents/openai.yaml +4 -0
- package/skills/{brainstorming/visual-companion.md → visual-companion/references/guide.md} +1 -1
- package/skills/{brainstorming → visual-companion}/scripts/frame-template.html +42 -12
- package/skills/visual-companion/scripts/pages.cjs +28 -0
- package/skills/visual-companion/scripts/server-utils.cjs +82 -0
- package/skills/{brainstorming → visual-companion}/scripts/server.cjs +108 -248
- package/skills/{brainstorming → visual-companion}/scripts/start-server.sh +18 -4
- package/skills/visual-companion/scripts/websocket.cjs +86 -0
- package/agents/architect.md +0 -59
- package/agents/code-reviewer.md +0 -57
- package/agents/planner.md +0 -124
- package/agents/tdd-guide.md +0 -101
- package/commands/e2e.md +0 -28
- package/commands/evolve.md +0 -42
- package/commands/harness-audit.md +0 -27
- package/commands/instinct-status.md +0 -38
- package/commands/learn-eval.md +0 -91
- package/commands/projects.md +0 -27
- package/commands/promote.md +0 -29
- package/commands/prune.md +0 -46
- package/commands/tdd.md +0 -27
- package/homunculus/instincts/personal/always-test-first.md +0 -28
- package/homunculus/instincts/personal/pr-ci-quality-gate.md +0 -30
- package/rules/08-ecc-integration.md +0 -46
- package/rules/common/implementation.md +0 -25
- package/rules/common/security.md +0 -19
- package/skills/brainstorming/SKILL.md +0 -185
- package/skills/brainstorming/agents/openai.yaml +0 -3
- package/skills/brainstorming/spec-document-reviewer-prompt.md +0 -49
- package/skills/context-budget/SKILL.md +0 -59
- package/skills/discover-unknowns-zh/SKILL.md +0 -112
- package/skills/discover-unknowns-zh/agents/openai.yaml +0 -4
- package/skills/discover-unknowns-zh/references/prompt-patterns.md +0 -144
- package/skills/documentation-lookup/SKILL.md +0 -90
- package/skills/executing-plans/SKILL.md +0 -66
- package/skills/find-skills/SKILL.md +0 -142
- package/skills/skill-creator/LICENSE.txt +0 -202
- package/skills/skill-creator/SKILL.md +0 -356
- package/skills/skill-creator/references/output-patterns.md +0 -82
- package/skills/skill-creator/references/workflows.md +0 -28
- package/skills/skill-creator/scripts/init_skill.py +0 -303
- package/skills/skill-creator/scripts/package_skill.py +0 -110
- package/skills/skill-creator/scripts/quick_validate.py +0 -95
- package/skills/subagent-driven-development/implementer-prompt.md +0 -139
- package/skills/subagent-driven-development/scripts/review-package +0 -44
- package/skills/subagent-driven-development/scripts/sdd-workspace +0 -22
- package/skills/subagent-driven-development/scripts/task-brief +0 -40
- package/skills/subagent-driven-development/task-reviewer-prompt.md +0 -188
- package/skills/writing-plans/SKILL.md +0 -206
- package/skills/writing-plans/plan-document-reviewer-prompt.md +0 -49
- /package/skills/{brainstorming → visual-companion}/scripts/helper.js +0 -0
- /package/skills/{brainstorming → visual-companion}/scripts/stop-server.sh +0 -0
|
@@ -0,0 +1,685 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const { spawnSync } = require("child_process");
|
|
5
|
+
const { runGrillingSpecGateChecks } = require("./grilling-spec-gate-checks");
|
|
6
|
+
const { runWorkflowOwnershipChecks } = require("./workflow-ownership");
|
|
7
|
+
|
|
8
|
+
let root;
|
|
9
|
+
let exists;
|
|
10
|
+
let read;
|
|
11
|
+
let managedFiles;
|
|
12
|
+
let fail;
|
|
13
|
+
let requireTokens;
|
|
14
|
+
let isVerifierImplementation;
|
|
15
|
+
|
|
16
|
+
function bindContext(context) {
|
|
17
|
+
({
|
|
18
|
+
root,
|
|
19
|
+
exists,
|
|
20
|
+
read,
|
|
21
|
+
managedFiles,
|
|
22
|
+
fail,
|
|
23
|
+
requireTokens,
|
|
24
|
+
isVerifierImplementation,
|
|
25
|
+
} = context);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function checkReadmeWorkflowContract() {
|
|
29
|
+
requireTokens("README.md", [
|
|
30
|
+
"Ticket-first 工程交付闭环",
|
|
31
|
+
"using-superpowers",
|
|
32
|
+
"?key=",
|
|
33
|
+
"4 小时",
|
|
34
|
+
"using-git-worktrees",
|
|
35
|
+
"iterative-retrieval",
|
|
36
|
+
"to-tickets",
|
|
37
|
+
"implement",
|
|
38
|
+
"subagent-driven-development",
|
|
39
|
+
"verification-before-completion",
|
|
40
|
+
"完整流程适用时",
|
|
41
|
+
"没有批准的必需 Spec 不进入 ticket 或 implement",
|
|
42
|
+
"没有用户审核不进入实现",
|
|
43
|
+
"没有 failing test,不写行为代码",
|
|
44
|
+
"没有 review 不标记任务完成",
|
|
45
|
+
"没有新鲜验证证据,不声明完成、通过、已修复或 ready",
|
|
46
|
+
"没有 verify,不进入 PR",
|
|
47
|
+
"`/learn eval --preview` 是非阻塞学习建议门",
|
|
48
|
+
]);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function checkSuperpowersDevLoop() {
|
|
52
|
+
checkReadmeWorkflowContract();
|
|
53
|
+
|
|
54
|
+
requireTokens("rules/01-base.md", [
|
|
55
|
+
"# 执行原则",
|
|
56
|
+
"先理解用户目标",
|
|
57
|
+
"真实调用链",
|
|
58
|
+
"复用项目现有入口",
|
|
59
|
+
"标准库",
|
|
60
|
+
"已安装依赖",
|
|
61
|
+
"最小新增代码",
|
|
62
|
+
"skills/using-superpowers/SKILL.md",
|
|
63
|
+
]);
|
|
64
|
+
|
|
65
|
+
requireTokens("rules/common/skills-learning.md", [
|
|
66
|
+
"skills/using-superpowers/SKILL.md",
|
|
67
|
+
"路由权威来源",
|
|
68
|
+
"rules/01-base.md",
|
|
69
|
+
"rules/common/agent-orchestration.md",
|
|
70
|
+
"不凭记忆执行 skill",
|
|
71
|
+
]);
|
|
72
|
+
|
|
73
|
+
// Skill 正文契约在各自的专门检查中维护;这里仅验证跨文件的闭环入口。
|
|
74
|
+
// 避免同一组流程词在多个检查点重复登记,允许 Skill 删除解释性文案。
|
|
75
|
+
|
|
76
|
+
requireTokens("skills/test-driven-development/SKILL.md", [
|
|
77
|
+
"## Red Test Gate",
|
|
78
|
+
"失败测试",
|
|
79
|
+
"替代验证",
|
|
80
|
+
]);
|
|
81
|
+
|
|
82
|
+
requireTokens("commands/verify.md", [
|
|
83
|
+
"Verify Gate",
|
|
84
|
+
"已运行检查",
|
|
85
|
+
"未运行检查",
|
|
86
|
+
"是否可以进入 `/pr`",
|
|
87
|
+
]);
|
|
88
|
+
|
|
89
|
+
requireTokens("commands/pr.md", [
|
|
90
|
+
"PR Gate",
|
|
91
|
+
"`/verify` 或等价验证结果",
|
|
92
|
+
"先回到验证和修复阶段",
|
|
93
|
+
]);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function checkSpecVisualContracts() {
|
|
97
|
+
requireTokens("skills/spec-gate/SKILL.md", [
|
|
98
|
+
"docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md",
|
|
99
|
+
"Self-Review",
|
|
100
|
+
]);
|
|
101
|
+
|
|
102
|
+
requireTokens("skills/visual-companion/references/guide.md", [
|
|
103
|
+
"session key",
|
|
104
|
+
"?key=",
|
|
105
|
+
"4 hours idle",
|
|
106
|
+
"--idle-timeout-minutes",
|
|
107
|
+
"same port",
|
|
108
|
+
]);
|
|
109
|
+
|
|
110
|
+
requireTokens("skills/visual-companion/scripts/server.cjs", [
|
|
111
|
+
"BRAINSTORM_TOKEN",
|
|
112
|
+
"BRAINSTORM_TOKEN_FILE",
|
|
113
|
+
"Default 4 hours",
|
|
114
|
+
]);
|
|
115
|
+
|
|
116
|
+
requireTokens("skills/visual-companion/scripts/server-utils.cjs", [
|
|
117
|
+
"timingSafeEqualStr",
|
|
118
|
+
"Cache-Control",
|
|
119
|
+
"X-Frame-Options",
|
|
120
|
+
]);
|
|
121
|
+
|
|
122
|
+
requireTokens("skills/visual-companion/scripts/start-server.sh", [
|
|
123
|
+
"--idle-timeout-minutes",
|
|
124
|
+
"BRAINSTORM_TOKEN_FILE",
|
|
125
|
+
"umask 077",
|
|
126
|
+
".last-token",
|
|
127
|
+
]);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function checkSuperpowersArtifactPolicy() {
|
|
131
|
+
requireTokens("rules/05-git-workflow.md", [
|
|
132
|
+
"## Superpowers 本地工件",
|
|
133
|
+
"Superpowers 生成的 Spec 和本地 tickets 仅用于本地工作流",
|
|
134
|
+
"无论保存位置都不得暂存或提交",
|
|
135
|
+
]);
|
|
136
|
+
const repoRoot = spawnSync("git", ["rev-parse", "--show-toplevel"], {
|
|
137
|
+
cwd: root,
|
|
138
|
+
encoding: "utf8",
|
|
139
|
+
timeout: 30000,
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
if (
|
|
143
|
+
repoRoot.status !== 0 ||
|
|
144
|
+
path.resolve(repoRoot.stdout.trim()) !== path.resolve(root)
|
|
145
|
+
) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
requireTokens(".gitignore", ["/docs/superpowers/"]);
|
|
150
|
+
|
|
151
|
+
const tracked = spawnSync("git", ["ls-files", "docs/superpowers"], {
|
|
152
|
+
cwd: root,
|
|
153
|
+
encoding: "utf8",
|
|
154
|
+
timeout: 30000,
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
if (tracked.status !== 0) {
|
|
158
|
+
fail(`unable to inspect tracked Superpowers artifacts: ${tracked.stderr}`);
|
|
159
|
+
} else if (tracked.stdout.trim()) {
|
|
160
|
+
fail(
|
|
161
|
+
`docs/superpowers artifacts must not be tracked:\n${tracked.stdout.trim()}`,
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function checkGrillingCoreContracts() {
|
|
167
|
+
requireTokens("skills/grilling/SKILL.md", [
|
|
168
|
+
"one question per turn",
|
|
169
|
+
"recommended answer",
|
|
170
|
+
"reversal evidence",
|
|
171
|
+
"shared understanding",
|
|
172
|
+
"Do not ask for discoverable facts",
|
|
173
|
+
"Inline uncertainty mode",
|
|
174
|
+
"Explicit grilling session",
|
|
175
|
+
"Route context:",
|
|
176
|
+
"Risk classification:",
|
|
177
|
+
"Resume target:",
|
|
178
|
+
"Reversal evidence:",
|
|
179
|
+
"return to `skills/using-superpowers/SKILL.md` for routing",
|
|
180
|
+
"Existing Confirmed Handoff",
|
|
181
|
+
"Do not re-ask them",
|
|
182
|
+
"recorded reversal evidence appears",
|
|
183
|
+
]);
|
|
184
|
+
requireTokens("skills/using-superpowers/SKILL.md", [
|
|
185
|
+
"discoverable fact",
|
|
186
|
+
"user-owned decision",
|
|
187
|
+
"skills/grilling/SKILL.md",
|
|
188
|
+
"shortest applicable path",
|
|
189
|
+
"explicit formal Spec",
|
|
190
|
+
"high-risk boundary",
|
|
191
|
+
]);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function checkRouteOrdering() {
|
|
195
|
+
const router = read("skills/using-superpowers/SKILL.md");
|
|
196
|
+
const inlineRoute = router.indexOf("unresolved user-owned decision?");
|
|
197
|
+
const specRoute = router.indexOf("explicit formal Spec or high-risk boundary?");
|
|
198
|
+
if (
|
|
199
|
+
inlineRoute === -1 ||
|
|
200
|
+
specRoute === -1 ||
|
|
201
|
+
inlineRoute > specRoute
|
|
202
|
+
) {
|
|
203
|
+
fail(
|
|
204
|
+
"router should resolve a real user decision before entering formal Spec Gate",
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const grillingContract = read("skills/grilling/SKILL.md");
|
|
209
|
+
if (
|
|
210
|
+
/^\s*(?:recommended )?next skill:/im.test(grillingContract) ||
|
|
211
|
+
/^\s*推荐下一 skill:/m.test(grillingContract)
|
|
212
|
+
) {
|
|
213
|
+
fail(
|
|
214
|
+
"skills/grilling/SKILL.md should return routing responsibility instead of recommending the next skill",
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function checkWorkflowDocuments() {
|
|
220
|
+
runWorkflowOwnershipChecks({ read, fail, managedFiles });
|
|
221
|
+
requireTokens("skills/iterative-retrieval/SKILL.md", [
|
|
222
|
+
"事实、证据和盲点缺口",
|
|
223
|
+
"复杂、高风险、多文件或长周期",
|
|
224
|
+
"skills/grilling/SKILL.md",
|
|
225
|
+
"skills/spec-gate/SKILL.md",
|
|
226
|
+
"返回 `skills/using-superpowers/SKILL.md`",
|
|
227
|
+
]);
|
|
228
|
+
requireTokens("skills/using-superpowers/SKILL.md", [
|
|
229
|
+
"shortest applicable path",
|
|
230
|
+
"File count, new features, and ordinary complexity affect",
|
|
231
|
+
"verification intensity, not the lane",
|
|
232
|
+
"A high-risk boundary",
|
|
233
|
+
]);
|
|
234
|
+
requireTokens("rules/01-base.md", [
|
|
235
|
+
"rules/common/testing.md",
|
|
236
|
+
"skills/using-superpowers/SKILL.md",
|
|
237
|
+
]);
|
|
238
|
+
requireTokens("rules/common/testing.md", [
|
|
239
|
+
"隔离端口和环境变量",
|
|
240
|
+
"等待 Web/API ready",
|
|
241
|
+
]);
|
|
242
|
+
requireTokens("rules/common/context-hygiene.md", [
|
|
243
|
+
"任何外部 mutation",
|
|
244
|
+
"发送消息",
|
|
245
|
+
"写入云文档",
|
|
246
|
+
]);
|
|
247
|
+
requireTokens("rules/common/hooks.md", [
|
|
248
|
+
"敏感内容只记录风险和证据位置",
|
|
249
|
+
]);
|
|
250
|
+
requireTokens("rules/common/pr-automation.md", [
|
|
251
|
+
"失败检查不得跳过",
|
|
252
|
+
"Git/PR 操作按 `rules/05-git-workflow.md` 的授权边界执行",
|
|
253
|
+
]);
|
|
254
|
+
for (const file of [
|
|
255
|
+
"rules/common/context-hygiene.md",
|
|
256
|
+
"rules/common/harness-engineering.md",
|
|
257
|
+
"rules/common/performance.md",
|
|
258
|
+
]) {
|
|
259
|
+
requireTokens(file, ["rules/common/agent-orchestration.md"]);
|
|
260
|
+
}
|
|
261
|
+
requireTokens("rules/common/skills-learning.md", [
|
|
262
|
+
"路由权威来源",
|
|
263
|
+
"不要因为多文件或普通复杂度加载完整 process skill 链",
|
|
264
|
+
"rules/01-base.md",
|
|
265
|
+
"rules/common/agent-orchestration.md",
|
|
266
|
+
]);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
function checkComplexityRules() {
|
|
270
|
+
const baseRules = read("rules/01-base.md");
|
|
271
|
+
if (
|
|
272
|
+
baseRules.includes(
|
|
273
|
+
"复杂任务包括新功能、架构调整、多文件行为变化",
|
|
274
|
+
)
|
|
275
|
+
) {
|
|
276
|
+
fail(
|
|
277
|
+
"rules/01-base.md should not classify new or multi-file behavior work as full-flow by default",
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
requireTokens("README.md", [
|
|
281
|
+
"直接提出 grilling 请求",
|
|
282
|
+
"`/to-spec`",
|
|
283
|
+
"`grilling` 是唯一需求澄清引擎",
|
|
284
|
+
"默认最短闭环",
|
|
285
|
+
"按风险逐级升级",
|
|
286
|
+
"完整流程适用时",
|
|
287
|
+
"明确低风险且无未决决策",
|
|
288
|
+
]);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function checkGrillingWorkflow() {
|
|
292
|
+
checkGrillingCoreContracts();
|
|
293
|
+
checkRouteOrdering();
|
|
294
|
+
checkWorkflowDocuments();
|
|
295
|
+
checkComplexityRules();
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function checkSuperpowersRoutingConsistency() {
|
|
299
|
+
requireTokens("skills/iterative-retrieval/SKILL.md", [
|
|
300
|
+
"返回 `skills/using-superpowers/SKILL.md` 重新路由",
|
|
301
|
+
"不要自行枚举或调用下一 skill",
|
|
302
|
+
]);
|
|
303
|
+
requireTokens("skills/using-superpowers/SKILL.md", [
|
|
304
|
+
"explicit formal Spec",
|
|
305
|
+
"high-risk boundary",
|
|
306
|
+
"unresolved user-owned decision?",
|
|
307
|
+
"skills/grilling/SKILL.md",
|
|
308
|
+
]);
|
|
309
|
+
requireTokens("skills/spec-gate/SKILL.md", [
|
|
310
|
+
"zero interview",
|
|
311
|
+
"BLOCKED_BY_UNRESOLVED_DECISION",
|
|
312
|
+
"Spec Gate contract conflict",
|
|
313
|
+
]);
|
|
314
|
+
|
|
315
|
+
const retrieval = read("skills/iterative-retrieval/SKILL.md");
|
|
316
|
+
for (const staleRoute of [
|
|
317
|
+
"交接到 `brainstorming`、`test-driven-development` 或 `executing-plans` skill",
|
|
318
|
+
"再进入 `brainstorming`、`test-driven-development` 或 `executing-plans`",
|
|
319
|
+
]) {
|
|
320
|
+
if (retrieval.includes(staleRoute)) {
|
|
321
|
+
fail(
|
|
322
|
+
"skills/iterative-retrieval/SKILL.md should return to the router " +
|
|
323
|
+
`instead of enumerating follow-up skills: ${staleRoute}`,
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function readCapabilityManifest(manifestPath) {
|
|
331
|
+
if (!exists(manifestPath)) {
|
|
332
|
+
fail(`${manifestPath} is missing`);
|
|
333
|
+
return null;
|
|
334
|
+
}
|
|
335
|
+
try {
|
|
336
|
+
return JSON.parse(read(manifestPath));
|
|
337
|
+
} catch (error) {
|
|
338
|
+
fail(`${manifestPath} is not valid JSON: ${error.message}`);
|
|
339
|
+
return null;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
function checkCapabilityManifestHeader(manifest, manifestPath) {
|
|
344
|
+
const valid =
|
|
345
|
+
manifest.schema_version === 1 &&
|
|
346
|
+
manifest.upstream?.repository === "https://github.com/mattpocock/skills" &&
|
|
347
|
+
/^[0-9a-f]{40}$/.test(manifest.upstream?.commit || "") &&
|
|
348
|
+
manifest.upstream?.baseline === "promoted-engineering";
|
|
349
|
+
if (!valid) fail(`${manifestPath} has an invalid upstream contract`);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
function checkCapabilityEntries(manifest, manifestPath) {
|
|
353
|
+
const expected = [
|
|
354
|
+
"ask-matt", "code-review", "codebase-design", "diagnosing-bugs",
|
|
355
|
+
"domain-modeling", "grill-with-docs", "implement",
|
|
356
|
+
"improve-codebase-architecture", "prototype", "research",
|
|
357
|
+
"resolving-merge-conflicts", "setup-matt-pocock-skills", "tdd",
|
|
358
|
+
"to-spec", "to-tickets", "triage", "wayfinder",
|
|
359
|
+
].sort();
|
|
360
|
+
const capabilities = Array.isArray(manifest.capabilities)
|
|
361
|
+
? manifest.capabilities
|
|
362
|
+
: [];
|
|
363
|
+
const actual = capabilities.map((entry) => entry.upstream).sort();
|
|
364
|
+
if (JSON.stringify(actual) !== JSON.stringify(expected)) {
|
|
365
|
+
fail(`${manifestPath} must map all 17 promoted engineering capabilities`);
|
|
366
|
+
}
|
|
367
|
+
for (const entry of capabilities) {
|
|
368
|
+
const excluded = ["wayfinder", "setup-matt-pocock-skills"].includes(entry.upstream) && entry.status === "excluded" &&
|
|
369
|
+
typeof entry.reason === "string" && entry.reason.trim().length > 0;
|
|
370
|
+
if (!excluded && !["covered", "adapted"].includes(entry.status)) {
|
|
371
|
+
fail(`${entry.upstream} is not capability-equivalent: ${entry.status}`);
|
|
372
|
+
}
|
|
373
|
+
if (!Array.isArray(entry.evidence) || entry.evidence.length === 0) {
|
|
374
|
+
fail(`${entry.upstream} has no local evidence files`);
|
|
375
|
+
continue;
|
|
376
|
+
}
|
|
377
|
+
for (const file of entry.evidence) {
|
|
378
|
+
if (!exists(file)) fail(`${entry.upstream} evidence is missing: ${file}`);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
function checkCapabilitySupportDependencies(manifest, manifestPath) {
|
|
384
|
+
const dependencies = Array.isArray(manifest.support_dependencies)
|
|
385
|
+
? manifest.support_dependencies
|
|
386
|
+
: [];
|
|
387
|
+
const handoff = dependencies.find((entry) => entry.upstream === "handoff");
|
|
388
|
+
const valid =
|
|
389
|
+
handoff?.source_group === "productivity" &&
|
|
390
|
+
["covered", "adapted"].includes(handoff.status) &&
|
|
391
|
+
handoff.evidence?.includes("skills/handoff/SKILL.md") &&
|
|
392
|
+
!handoff.evidence?.includes("commands/handoff.md");
|
|
393
|
+
if (!valid) {
|
|
394
|
+
fail(`${manifestPath} must map the engineering flow's handoff dependency`);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
function checkCapabilityRouting() {
|
|
399
|
+
requireTokens("skills/using-superpowers/SKILL.md", [
|
|
400
|
+
"explicit workflow advice?",
|
|
401
|
+
"workflow advice mode",
|
|
402
|
+
"explicit TDD request?",
|
|
403
|
+
"explicit E2E or Playwright request?",
|
|
404
|
+
"skills/e2e-testing/SKILL.md",
|
|
405
|
+
"agents/e2e-runner.md",
|
|
406
|
+
"explicit harness audit?",
|
|
407
|
+
"agents/harness-optimizer.md",
|
|
408
|
+
"Agent-selected Delivery Topology",
|
|
409
|
+
"delivery request in defined scope?",
|
|
410
|
+
"independent frontier tickets with no overlapping write surface?",
|
|
411
|
+
"skills/implement/SKILL.md",
|
|
412
|
+
"skills/subagent-driven-development/SKILL.md",
|
|
413
|
+
"explicit prototype or runnable design question?",
|
|
414
|
+
"skills/prototype/SKILL.md",
|
|
415
|
+
"external engineering fact or documentation question?",
|
|
416
|
+
"skills/to-tickets/SKILL.md",
|
|
417
|
+
"merge or rebase conflict?",
|
|
418
|
+
"skills/resolving-merge-conflicts/SKILL.md",
|
|
419
|
+
"fresh session or prototype branch?",
|
|
420
|
+
"skills/handoff/SKILL.md",
|
|
421
|
+
]);
|
|
422
|
+
|
|
423
|
+
const router = read("skills/using-superpowers/SKILL.md");
|
|
424
|
+
for (const staleGate of [
|
|
425
|
+
"User-invoked Delivery Gates",
|
|
426
|
+
"recommend `to-tickets`; wait for explicit invocation",
|
|
427
|
+
"recommend `implement`; wait for explicit invocation",
|
|
428
|
+
]) {
|
|
429
|
+
if (router.includes(staleGate)) {
|
|
430
|
+
fail(`router must not retain the obsolete user-invoked delivery gate: ${staleGate}`);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
for (const deliverySkill of [
|
|
435
|
+
"skills/to-tickets/SKILL.md",
|
|
436
|
+
"skills/implement/SKILL.md",
|
|
437
|
+
"skills/subagent-driven-development/SKILL.md",
|
|
438
|
+
]) {
|
|
439
|
+
if (read(deliverySkill).includes("disable-model-invocation: true")) {
|
|
440
|
+
fail(`${deliverySkill} must remain router-selectable for delivery topology`);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
function checkCapabilityFiles() {
|
|
446
|
+
for (const file of [
|
|
447
|
+
"skills/codebase-design/SKILL.md",
|
|
448
|
+
"skills/handoff/SKILL.md",
|
|
449
|
+
"skills/implement/SKILL.md",
|
|
450
|
+
"skills/improve-codebase-architecture/SKILL.md",
|
|
451
|
+
"skills/prototype/SKILL.md",
|
|
452
|
+
"skills/resolving-merge-conflicts/SKILL.md",
|
|
453
|
+
"skills/to-tickets/SKILL.md",
|
|
454
|
+
"skills/triage/SKILL.md",
|
|
455
|
+
]) {
|
|
456
|
+
if (!exists(file)) fail(`${file} is missing`);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
for (const file of [
|
|
460
|
+
"commands/ask-workflow.md",
|
|
461
|
+
"commands/e2e.md",
|
|
462
|
+
"commands/evolve.md",
|
|
463
|
+
"commands/grill.md",
|
|
464
|
+
"commands/grill-with-docs.md",
|
|
465
|
+
"commands/handoff.md",
|
|
466
|
+
"commands/harness-audit.md",
|
|
467
|
+
"commands/implement.md",
|
|
468
|
+
"commands/improve-codebase-architecture.md",
|
|
469
|
+
"commands/instinct-status.md",
|
|
470
|
+
"commands/learn-eval.md",
|
|
471
|
+
"commands/projects.md",
|
|
472
|
+
"commands/promote.md",
|
|
473
|
+
"commands/prune.md",
|
|
474
|
+
"commands/setup-workflow.md",
|
|
475
|
+
"commands/tdd.md",
|
|
476
|
+
"commands/to-tickets.md",
|
|
477
|
+
"commands/triage.md",
|
|
478
|
+
"commands/wayfinder.md",
|
|
479
|
+
]) {
|
|
480
|
+
if (exists(file)) fail(`${file} is a redundant Skill wrapper`);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
function checkDesignCapabilityContracts() {
|
|
485
|
+
requireTokens("skills/codebase-design/SKILL.md", [
|
|
486
|
+
"Module",
|
|
487
|
+
"Interface",
|
|
488
|
+
"Seam",
|
|
489
|
+
"Adapter",
|
|
490
|
+
"Leverage",
|
|
491
|
+
"Locality",
|
|
492
|
+
"deletion test",
|
|
493
|
+
"interface as the test surface",
|
|
494
|
+
]);
|
|
495
|
+
requireTokens("skills/improve-codebase-architecture/SKILL.md", [
|
|
496
|
+
"skills/codebase-design/SKILL.md",
|
|
497
|
+
"skills/visual-companion/SKILL.md",
|
|
498
|
+
"explicit consent",
|
|
499
|
+
"skills/grilling/SKILL.md",
|
|
500
|
+
]);
|
|
501
|
+
requireTokens("skills/prototype/SKILL.md", [
|
|
502
|
+
"Logic",
|
|
503
|
+
"Visual",
|
|
504
|
+
"throwaway",
|
|
505
|
+
"one command to run",
|
|
506
|
+
"Do not silently continue into production code",
|
|
507
|
+
]);
|
|
508
|
+
requireTokens("skills/prototype/references/ui.md", [
|
|
509
|
+
"runnable in-project UI prototype",
|
|
510
|
+
"?variant=",
|
|
511
|
+
"real read-only data",
|
|
512
|
+
"production builds",
|
|
513
|
+
"exact URLs",
|
|
514
|
+
]);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
function checkDeliveryCapabilityContracts() {
|
|
518
|
+
if (exists("skills/research/SKILL.md")) fail("standalone research Skill must be retired");
|
|
519
|
+
const retired = JSON.parse(read("scripts/retired-skill-files.json"));
|
|
520
|
+
if (!retired.retired_skills?.research?.includes("SKILL.md")) {
|
|
521
|
+
fail("research retirement must clean up the installed entrypoint");
|
|
522
|
+
}
|
|
523
|
+
requireTokens("skills/resolving-merge-conflicts/SKILL.md", [
|
|
524
|
+
"primary sources",
|
|
525
|
+
"one hunk at a time",
|
|
526
|
+
"Do not abort",
|
|
527
|
+
"Git authorization",
|
|
528
|
+
]);
|
|
529
|
+
requireTokens("skills/to-tickets/SKILL.md", [
|
|
530
|
+
"tracer bullet",
|
|
531
|
+
"blocking edges",
|
|
532
|
+
"vertical",
|
|
533
|
+
"Do not publish before approval",
|
|
534
|
+
"ready-for-agent",
|
|
535
|
+
]);
|
|
536
|
+
requireTokens("skills/triage/SKILL.md", [
|
|
537
|
+
"needs-triage",
|
|
538
|
+
"needs-info",
|
|
539
|
+
"ready-for-agent",
|
|
540
|
+
"ready-for-human",
|
|
541
|
+
"wontfix",
|
|
542
|
+
"generated by AI during triage",
|
|
543
|
+
"obtain confirmation",
|
|
544
|
+
]);
|
|
545
|
+
requireTokens("skills/test-driven-development/SKILL.md", [
|
|
546
|
+
"Public Seam",
|
|
547
|
+
"测试和调用方应穿过同一个 seam",
|
|
548
|
+
"固定事实",
|
|
549
|
+
"真实系统边界",
|
|
550
|
+
"tracer bullet",
|
|
551
|
+
]);
|
|
552
|
+
requireTokens("skills/handoff/SKILL.md", [
|
|
553
|
+
"temporary directory",
|
|
554
|
+
"private subdirectory",
|
|
555
|
+
"0700",
|
|
556
|
+
"exclusive creation",
|
|
557
|
+
"0600",
|
|
558
|
+
"delete the handoff after consumption",
|
|
559
|
+
"fresh session",
|
|
560
|
+
"Suggested skills",
|
|
561
|
+
"Do not duplicate",
|
|
562
|
+
"Redact",
|
|
563
|
+
"exact path",
|
|
564
|
+
]);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
function checkUpstreamCapabilityParity() {
|
|
568
|
+
const manifestPath = "scripts/upstream-capability-map.json";
|
|
569
|
+
const manifest = readCapabilityManifest(manifestPath);
|
|
570
|
+
if (!manifest) return;
|
|
571
|
+
checkCapabilityManifestHeader(manifest, manifestPath);
|
|
572
|
+
checkCapabilityEntries(manifest, manifestPath);
|
|
573
|
+
checkCapabilitySupportDependencies(manifest, manifestPath);
|
|
574
|
+
checkCapabilityRouting();
|
|
575
|
+
checkCapabilityFiles();
|
|
576
|
+
checkDesignCapabilityContracts();
|
|
577
|
+
checkDeliveryCapabilityContracts();
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
function checkRemovedSkillReferences() {
|
|
581
|
+
for (const skill of ["context-budget", "documentation-lookup"]) {
|
|
582
|
+
for (const file of managedFiles()) {
|
|
583
|
+
if (isVerifierImplementation(file)) continue;
|
|
584
|
+
if (read(file).includes(skill)) {
|
|
585
|
+
fail(`${file} still references removed skill ${skill}`);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
const retiredSkills = [
|
|
591
|
+
"discover-unknowns-zh",
|
|
592
|
+
"skill-creator",
|
|
593
|
+
"writing-plans",
|
|
594
|
+
"executing-plans",
|
|
595
|
+
"wayfinder",
|
|
596
|
+
];
|
|
597
|
+
const allowedRetirementFiles = new Set([
|
|
598
|
+
"README.md",
|
|
599
|
+
"scripts/retired-skill-files.json",
|
|
600
|
+
"scripts/upstream-capability-map.json",
|
|
601
|
+
"scripts/upstream-capability-baseline.json",
|
|
602
|
+
]);
|
|
603
|
+
|
|
604
|
+
for (const skill of retiredSkills) {
|
|
605
|
+
if (exists(`skills/${skill}/SKILL.md`)) {
|
|
606
|
+
fail(`skills/${skill} should be retired`);
|
|
607
|
+
}
|
|
608
|
+
for (const file of managedFiles()) {
|
|
609
|
+
if (
|
|
610
|
+
isVerifierImplementation(file) ||
|
|
611
|
+
allowedRetirementFiles.has(file)
|
|
612
|
+
) {
|
|
613
|
+
continue;
|
|
614
|
+
}
|
|
615
|
+
if (read(file).includes(skill)) {
|
|
616
|
+
fail(`${file} still references retired skill ${skill}`);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
requireTokens("README.md", [
|
|
622
|
+
"Skill 迁移说明",
|
|
623
|
+
"`discover-unknowns-zh` 已退休",
|
|
624
|
+
"`iterative-retrieval`",
|
|
625
|
+
"`research`",
|
|
626
|
+
"`prototype`",
|
|
627
|
+
"`to-tickets`",
|
|
628
|
+
"`implementation-notes`、`explainer` 和 `quiz` 工件链不再属于",
|
|
629
|
+
"`skill-creator` 已退休",
|
|
630
|
+
"`rules/common/skills-learning.md`",
|
|
631
|
+
"scripts/upstream-capability-map.json",
|
|
632
|
+
]);
|
|
633
|
+
requireTokens("scripts/retired-skill-files.json", retiredSkills);
|
|
634
|
+
requireTokens("rules/common/skills-learning.md", [
|
|
635
|
+
"Skill 创建和更新遵循本规则",
|
|
636
|
+
"开放生态中的 skill 查找和安装按用户明确请求使用宿主已有工具",
|
|
637
|
+
]);
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
function checkForbiddenCommandDrift() {
|
|
641
|
+
const patterns = [
|
|
642
|
+
[/\/docs\b/, "removed /docs command reference"],
|
|
643
|
+
[/\/instinct-export\b/, "removed /instinct-export command reference"],
|
|
644
|
+
[/\/instinct-import\b/, "removed /instinct-import command reference"],
|
|
645
|
+
[/--decay\b/, "deprecated decay flag"],
|
|
646
|
+
[/decay-confidence/, "deprecated decay-confidence script"],
|
|
647
|
+
[/置信度降低 0\.02/, "automatic confidence decay"],
|
|
648
|
+
[/超过.*天.*删除/, "time-based instinct deletion"],
|
|
649
|
+
[/--max-age\b/, "time-based prune flag"],
|
|
650
|
+
[/清理过期/, "expired-instinct cleanup wording"],
|
|
651
|
+
];
|
|
652
|
+
|
|
653
|
+
for (const file of managedFiles()) {
|
|
654
|
+
if (
|
|
655
|
+
isVerifierImplementation(file) ||
|
|
656
|
+
["scripts/install.ps1", "scripts/install.sh"].includes(file)
|
|
657
|
+
) continue;
|
|
658
|
+
if (!/\.(md|json|js|ps1|sh)$/.test(file)) continue;
|
|
659
|
+
|
|
660
|
+
const body = read(file);
|
|
661
|
+
const lines = body.split(/\r?\n/);
|
|
662
|
+
for (const [pattern, label] of patterns) {
|
|
663
|
+
lines.forEach((line, index) => {
|
|
664
|
+
if (pattern.test(line)) {
|
|
665
|
+
fail(`${file}:${index + 1} contains ${label}: ${line.trim()}`);
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
function runWorkflowChecks(context) {
|
|
673
|
+
bindContext(context);
|
|
674
|
+
checkSuperpowersDevLoop();
|
|
675
|
+
checkSpecVisualContracts();
|
|
676
|
+
checkSuperpowersArtifactPolicy();
|
|
677
|
+
checkGrillingWorkflow();
|
|
678
|
+
checkSuperpowersRoutingConsistency();
|
|
679
|
+
checkUpstreamCapabilityParity();
|
|
680
|
+
runGrillingSpecGateChecks(context);
|
|
681
|
+
checkRemovedSkillReferences();
|
|
682
|
+
checkForbiddenCommandDrift();
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
module.exports = { runWorkflowChecks };
|