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.
Files changed (152) hide show
  1. package/AGENTS.md +20 -20
  2. package/CLAUDE.md +1 -5
  3. package/README.md +151 -113
  4. package/agents/e2e-runner.md +8 -141
  5. package/agents/harness-optimizer.md +3 -2
  6. package/commands/code-review.md +10 -15
  7. package/commands/learn.md +97 -0
  8. package/commands/pr.md +5 -6
  9. package/commands/to-spec.md +11 -0
  10. package/commands/verify.md +7 -11
  11. package/harness/manifest.json +346 -0
  12. package/hooks/check-code-size.js +33 -12
  13. package/hooks/check-console-log.js +72 -24
  14. package/package.json +10 -2
  15. package/rules/01-base.md +9 -49
  16. package/rules/02-code-size.md +5 -20
  17. package/rules/03-architecture.md +9 -61
  18. package/rules/04-error-handling.md +4 -26
  19. package/rules/05-git-workflow.md +12 -39
  20. package/rules/06-comments.md +3 -43
  21. package/rules/07-forbidden.md +8 -31
  22. package/rules/08-specialty-rules-index.md +18 -0
  23. package/rules/09-first-principles-adversarial-testing.md +6 -18
  24. package/rules/common/agent-orchestration.md +8 -47
  25. package/rules/common/context-hygiene.md +9 -72
  26. package/rules/common/harness-engineering.md +11 -38
  27. package/rules/common/hooks.md +13 -82
  28. package/rules/common/performance.md +8 -71
  29. package/rules/common/pr-automation.md +7 -68
  30. package/rules/common/skills-learning.md +12 -36
  31. package/rules/common/testing.md +16 -59
  32. package/scripts/cleanup-retired-skills.js +214 -0
  33. package/scripts/install-rules.js +100 -0
  34. package/scripts/install.ps1 +99 -87
  35. package/scripts/install.sh +77 -78
  36. package/scripts/learning/review-confidence.js +1 -4
  37. package/scripts/legacy-common-rule-hashes.json +78 -0
  38. package/scripts/merge-claude-settings.cjs +75 -0
  39. package/scripts/retired-skill-files.json +54 -0
  40. package/scripts/upstream-capability-baseline.json +27 -0
  41. package/scripts/upstream-capability-map.json +155 -0
  42. package/scripts/verify/core.js +91 -0
  43. package/scripts/verify/grilling-spec-gate-checks.js +266 -0
  44. package/scripts/verify/install-rules.test.js +156 -0
  45. package/scripts/verify/metadata-checks.js +747 -0
  46. package/scripts/verify/repository-checks.js +409 -0
  47. package/scripts/verify/runtime-checks.js +593 -0
  48. package/scripts/verify/skill-invocation.test.js +86 -0
  49. package/scripts/verify/skill-manifest-checks.js +197 -0
  50. package/scripts/verify/skill-manifest-checks.test.js +123 -0
  51. package/scripts/verify/workflow-checks.js +685 -0
  52. package/scripts/verify/workflow-ownership-fixtures.js +371 -0
  53. package/scripts/verify/workflow-ownership.js +780 -0
  54. package/scripts/verify-harness.js +18 -1075
  55. package/scripts/verify-upstream-capability-map.js +118 -0
  56. package/skills/README.md +28 -16
  57. package/skills/code-review/SKILL.md +63 -0
  58. package/skills/code-review/references/spec-reviewer-prompt.md +24 -0
  59. package/skills/code-review/references/standards-reviewer-prompt.md +35 -0
  60. package/skills/codebase-design/SKILL.md +63 -0
  61. package/skills/codebase-design/references/deepening.md +27 -0
  62. package/skills/codebase-design/references/design-it-twice.md +17 -0
  63. package/skills/continuous-learning-v2/SKILL.md +8 -8
  64. package/skills/continuous-learning-v2/config.json +0 -4
  65. package/skills/domain-modeling/SKILL.md +101 -0
  66. package/skills/e2e-testing/SKILL.md +20 -310
  67. package/skills/e2e-testing/references/playwright-patterns.md +324 -0
  68. package/skills/feature-acceptance/SKILL.md +89 -0
  69. package/skills/grilling/SKILL.md +83 -0
  70. package/skills/handoff/SKILL.md +55 -0
  71. package/skills/handoff/agents/openai.yaml +2 -0
  72. package/skills/implement/SKILL.md +48 -0
  73. package/skills/implement/references/ticket-delivery.md +43 -0
  74. package/skills/improve-codebase-architecture/SKILL.md +47 -0
  75. package/skills/improve-codebase-architecture/agents/openai.yaml +2 -0
  76. package/skills/iterative-retrieval/SKILL.md +10 -1
  77. package/skills/learn/README.md +2 -2
  78. package/skills/prototype/SKILL.md +50 -0
  79. package/skills/prototype/references/logic.md +28 -0
  80. package/skills/prototype/references/ui.md +30 -0
  81. package/skills/resolving-merge-conflicts/SKILL.md +27 -0
  82. package/skills/spec-gate/SKILL.md +149 -0
  83. package/skills/spec-gate/agents/openai.yaml +4 -0
  84. package/skills/spec-gate/references/spec-document-reviewer-prompt.md +31 -0
  85. package/skills/subagent-driven-development/SKILL.md +95 -414
  86. package/skills/systematic-debugging/SKILL.md +11 -49
  87. package/skills/systematic-debugging/references/diagnosing-bugs.upstream.md +129 -0
  88. package/skills/systematic-debugging/scripts/hitl-loop.template.js +75 -0
  89. package/skills/systematic-debugging/scripts/hitl-loop.template.sh +41 -0
  90. package/skills/test-driven-development/SKILL.md +24 -4
  91. package/skills/to-tickets/SKILL.md +96 -0
  92. package/skills/triage/SKILL.md +53 -0
  93. package/skills/triage/agents/openai.yaml +2 -0
  94. package/skills/triage/references/agent-brief.md +32 -0
  95. package/skills/triage/references/out-of-scope.md +14 -0
  96. package/skills/using-git-worktrees/SKILL.md +8 -5
  97. package/skills/using-superpowers/SKILL.md +76 -43
  98. package/skills/using-superpowers/references/process-outcomes.md +41 -0
  99. package/skills/verification-before-completion/SKILL.md +5 -4
  100. package/skills/visual-companion/SKILL.md +62 -0
  101. package/skills/visual-companion/agents/openai.yaml +4 -0
  102. package/skills/{brainstorming/visual-companion.md → visual-companion/references/guide.md} +1 -1
  103. package/skills/{brainstorming → visual-companion}/scripts/frame-template.html +42 -12
  104. package/skills/visual-companion/scripts/pages.cjs +28 -0
  105. package/skills/visual-companion/scripts/server-utils.cjs +82 -0
  106. package/skills/{brainstorming → visual-companion}/scripts/server.cjs +108 -248
  107. package/skills/{brainstorming → visual-companion}/scripts/start-server.sh +18 -4
  108. package/skills/visual-companion/scripts/websocket.cjs +86 -0
  109. package/agents/architect.md +0 -59
  110. package/agents/code-reviewer.md +0 -57
  111. package/agents/planner.md +0 -124
  112. package/agents/tdd-guide.md +0 -101
  113. package/commands/e2e.md +0 -28
  114. package/commands/evolve.md +0 -42
  115. package/commands/harness-audit.md +0 -27
  116. package/commands/instinct-status.md +0 -38
  117. package/commands/learn-eval.md +0 -91
  118. package/commands/projects.md +0 -27
  119. package/commands/promote.md +0 -29
  120. package/commands/prune.md +0 -46
  121. package/commands/tdd.md +0 -27
  122. package/homunculus/instincts/personal/always-test-first.md +0 -28
  123. package/homunculus/instincts/personal/pr-ci-quality-gate.md +0 -30
  124. package/rules/08-ecc-integration.md +0 -46
  125. package/rules/common/implementation.md +0 -25
  126. package/rules/common/security.md +0 -19
  127. package/skills/brainstorming/SKILL.md +0 -185
  128. package/skills/brainstorming/agents/openai.yaml +0 -3
  129. package/skills/brainstorming/spec-document-reviewer-prompt.md +0 -49
  130. package/skills/context-budget/SKILL.md +0 -59
  131. package/skills/discover-unknowns-zh/SKILL.md +0 -112
  132. package/skills/discover-unknowns-zh/agents/openai.yaml +0 -4
  133. package/skills/discover-unknowns-zh/references/prompt-patterns.md +0 -144
  134. package/skills/documentation-lookup/SKILL.md +0 -90
  135. package/skills/executing-plans/SKILL.md +0 -66
  136. package/skills/find-skills/SKILL.md +0 -142
  137. package/skills/skill-creator/LICENSE.txt +0 -202
  138. package/skills/skill-creator/SKILL.md +0 -356
  139. package/skills/skill-creator/references/output-patterns.md +0 -82
  140. package/skills/skill-creator/references/workflows.md +0 -28
  141. package/skills/skill-creator/scripts/init_skill.py +0 -303
  142. package/skills/skill-creator/scripts/package_skill.py +0 -110
  143. package/skills/skill-creator/scripts/quick_validate.py +0 -95
  144. package/skills/subagent-driven-development/implementer-prompt.md +0 -139
  145. package/skills/subagent-driven-development/scripts/review-package +0 -44
  146. package/skills/subagent-driven-development/scripts/sdd-workspace +0 -22
  147. package/skills/subagent-driven-development/scripts/task-brief +0 -40
  148. package/skills/subagent-driven-development/task-reviewer-prompt.md +0 -188
  149. package/skills/writing-plans/SKILL.md +0 -206
  150. package/skills/writing-plans/plan-document-reviewer-prompt.md +0 -49
  151. /package/skills/{brainstorming → visual-companion}/scripts/helper.js +0 -0
  152. /package/skills/{brainstorming → visual-companion}/scripts/stop-server.sh +0 -0
@@ -0,0 +1,54 @@
1
+ {
2
+ "version": 1,
3
+ "retired_skills": {
4
+ "brainstorming": [
5
+ "SKILL.md",
6
+ "spec-document-reviewer-prompt.md",
7
+ "visual-companion.md",
8
+ "agents/openai.yaml",
9
+ "scripts/frame-template.html",
10
+ "scripts/helper.js",
11
+ "scripts/server.cjs",
12
+ "scripts/start-server.sh",
13
+ "scripts/stop-server.sh"
14
+ ],
15
+ "discover-unknowns-zh": [
16
+ "SKILL.md",
17
+ "agents/openai.yaml",
18
+ "references/prompt-patterns.md"
19
+ ],
20
+ "skill-creator": [
21
+ "SKILL.md",
22
+ "LICENSE.txt",
23
+ "references/output-patterns.md",
24
+ "references/workflows.md",
25
+ "scripts/init_skill.py",
26
+ "scripts/package_skill.py",
27
+ "scripts/quick_validate.py"
28
+ ],
29
+ "writing-plans": [
30
+ "SKILL.md",
31
+ "plan-document-reviewer-prompt.md"
32
+ ],
33
+ "executing-plans": [
34
+ "SKILL.md"
35
+ ],
36
+ "research": [
37
+ "SKILL.md"
38
+ ],
39
+ "wayfinder": [
40
+ "SKILL.md",
41
+ "agents/openai.yaml"
42
+ ],
43
+ "find-skills": [
44
+ "SKILL.md",
45
+ "agents/openai.yaml",
46
+ "references/skills-cli.md"
47
+ ],
48
+ "project-context": [
49
+ "SKILL.md",
50
+ "agents/openai.yaml",
51
+ "references/project-context-template.md"
52
+ ]
53
+ }
54
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "schema_version": 1,
3
+ "repository": "https://github.com/mattpocock/skills",
4
+ "commit": "2ab958093e83e0ec752e6c1c5932da465bf23e0c",
5
+ "engineering": {
6
+ "ask-matt": "b1a134ada29cbfded84bc9a7f93356ab7a3d7f800edf1f541a2a964118ad45a7",
7
+ "code-review": "6a65cc61114f96db07ec41e3920e67c9c5bf70dd6e0901eb9460ebcb2bdc209f",
8
+ "codebase-design": "a8d50abac5a4018f60e1d911d4b6f4e36454ca14d6c390c0695a578c7de65dad",
9
+ "diagnosing-bugs": "7a0779480f323a66d109404646bcc1a14bf0232b45b3e3ea93b652a035718acb",
10
+ "domain-modeling": "152e2c97239affb12a60c5f4a7e74ab546a49ae169688c81f4e2ccc42dafa579",
11
+ "grill-with-docs": "610d091047bcfb9db0f75c057d15538481a721111579fc5ec7f83ad9131a2165",
12
+ "implement": "6d3fd9e83b8f36e5213854779db49b256a457a7ebb4a503e53fa7dcff696adc3",
13
+ "improve-codebase-architecture": "4b4cb798c3863d5b6f5c0b4604af1ecb5beb6df82553c972898a91ba38bcf289",
14
+ "prototype": "03074862d4b6e4eaf472aa75146e1d193dd9e3bba0e4303a9b2425562d1d44cc",
15
+ "research": "af378829f015775a3bcd65ff466826722e99359017ae6bae227ca4c9bd14049c",
16
+ "resolving-merge-conflicts": "c7c9ba81362a786aac05d2223123bf1bd2f8a99c3243a72882ede9c68bedfb24",
17
+ "setup-matt-pocock-skills": "def265a8b15ffb8afc3f335d69e175ba9a7fe3991218984b0e49e8345cde3b20",
18
+ "tdd": "5363bb2775679fe9311fbb67947f95359169c6e7f1fac77c0f25e190bca6cf2f",
19
+ "to-spec": "267638edd513b5918de626ad5605d261952abb7428cb308869c663ca924e93e7",
20
+ "to-tickets": "5ecdf1d4df8a360ed39df21a2347f97ba177afd449a577da4f6b6ea8e1ebb808",
21
+ "triage": "d45827c299c021f77b0f146fefa3ee679b13f99e9a2ffdf48e8de2347adeefe1",
22
+ "wayfinder": "257e40665b28ae959ffdcb97d7a72b074360f4a3d201bd84786505308546e434"
23
+ },
24
+ "support_dependencies": {
25
+ "productivity/handoff": "57c9f1f392d7352cdc85b1e39ca49eddc70ce1dc278bd9653fb4f23dfc2560fc"
26
+ }
27
+ }
@@ -0,0 +1,155 @@
1
+ {
2
+ "schema_version": 1,
3
+ "upstream": {
4
+ "repository": "https://github.com/mattpocock/skills",
5
+ "commit": "2ab958093e83e0ec752e6c1c5932da465bf23e0c",
6
+ "checked_at": "2026-07-31",
7
+ "baseline": "promoted-engineering"
8
+ },
9
+ "capabilities": [
10
+ {
11
+ "upstream": "ask-matt",
12
+ "status": "adapted",
13
+ "evidence": [
14
+ "skills/using-superpowers/SKILL.md"
15
+ ]
16
+ },
17
+ {
18
+ "upstream": "code-review",
19
+ "status": "adapted",
20
+ "evidence": [
21
+ "commands/code-review.md",
22
+ "skills/code-review/SKILL.md",
23
+ "skills/code-review/references/standards-reviewer-prompt.md",
24
+ "skills/code-review/references/spec-reviewer-prompt.md"
25
+ ]
26
+ },
27
+ {
28
+ "upstream": "codebase-design",
29
+ "status": "covered",
30
+ "evidence": [
31
+ "skills/codebase-design/SKILL.md",
32
+ "skills/codebase-design/references/deepening.md"
33
+ ]
34
+ },
35
+ {
36
+ "upstream": "diagnosing-bugs",
37
+ "status": "adapted",
38
+ "evidence": [
39
+ "skills/systematic-debugging/SKILL.md"
40
+ ]
41
+ },
42
+ {
43
+ "upstream": "domain-modeling",
44
+ "status": "adapted",
45
+ "evidence": [
46
+ "skills/domain-modeling/SKILL.md"
47
+ ]
48
+ },
49
+ {
50
+ "upstream": "grill-with-docs",
51
+ "status": "adapted",
52
+ "evidence": [
53
+ "skills/grilling/SKILL.md",
54
+ "skills/domain-modeling/SKILL.md"
55
+ ]
56
+ },
57
+ {
58
+ "upstream": "implement",
59
+ "status": "adapted",
60
+ "evidence": [
61
+ "skills/implement/SKILL.md"
62
+ ]
63
+ },
64
+ {
65
+ "upstream": "improve-codebase-architecture",
66
+ "status": "adapted",
67
+ "evidence": [
68
+ "skills/improve-codebase-architecture/SKILL.md"
69
+ ]
70
+ },
71
+ {
72
+ "upstream": "prototype",
73
+ "status": "adapted",
74
+ "evidence": [
75
+ "skills/prototype/SKILL.md",
76
+ "skills/prototype/references/logic.md",
77
+ "skills/visual-companion/SKILL.md"
78
+ ]
79
+ },
80
+ {
81
+ "upstream": "research",
82
+ "status": "adapted",
83
+ "evidence": [
84
+ "skills/using-superpowers/SKILL.md"
85
+ ],
86
+ "reason": "Engineering source lookup is handled directly with citations; the standalone report Skill is retired."
87
+ },
88
+ {
89
+ "upstream": "resolving-merge-conflicts",
90
+ "status": "covered",
91
+ "evidence": [
92
+ "skills/resolving-merge-conflicts/SKILL.md"
93
+ ]
94
+ },
95
+ {
96
+ "upstream": "setup-matt-pocock-skills",
97
+ "status": "excluded",
98
+ "evidence": [
99
+ "scripts/retired-skill-files.json",
100
+ "README.md"
101
+ ],
102
+ "reason": "The standalone project-context setup Skill is retired; existing project configuration remains supported."
103
+ },
104
+ {
105
+ "upstream": "tdd",
106
+ "status": "adapted",
107
+ "evidence": [
108
+ "skills/test-driven-development/SKILL.md"
109
+ ]
110
+ },
111
+ {
112
+ "upstream": "to-spec",
113
+ "status": "adapted",
114
+ "evidence": [
115
+ "commands/to-spec.md",
116
+ "skills/spec-gate/SKILL.md"
117
+ ]
118
+ },
119
+ {
120
+ "upstream": "to-tickets",
121
+ "status": "adapted",
122
+ "evidence": [
123
+ "skills/to-tickets/SKILL.md"
124
+ ]
125
+ },
126
+ {
127
+ "upstream": "triage",
128
+ "status": "adapted",
129
+ "evidence": [
130
+ "skills/triage/SKILL.md"
131
+ ]
132
+ },
133
+ {
134
+ "upstream": "wayfinder",
135
+ "status": "excluded",
136
+ "evidence": [
137
+ "scripts/retired-skill-files.json",
138
+ "README.md"
139
+ ],
140
+ "reason": "Standalone multi-session decision mapping is intentionally removed from the engineering distribution."
141
+ }
142
+ ],
143
+ "support_dependencies": [
144
+ {
145
+ "upstream": "handoff",
146
+ "source_group": "productivity",
147
+ "status": "adapted",
148
+ "reason": "The promoted Engineering router requires it for prototype detours and context-window crossings.",
149
+ "evidence": [
150
+ "skills/handoff/SKILL.md",
151
+ "skills/using-superpowers/SKILL.md"
152
+ ]
153
+ }
154
+ ]
155
+ }
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+
3
+ const fs = require("fs");
4
+ const path = require("path");
5
+
6
+ const MANAGED_ROOTS = [
7
+ "README.md",
8
+ "AGENTS.md",
9
+ "CLAUDE.md",
10
+ "settings.json",
11
+ "commands",
12
+ "agents",
13
+ "skills",
14
+ "hooks",
15
+ "scripts",
16
+ "rules",
17
+ ];
18
+
19
+ function createFileAccess(root) {
20
+ const rel = (...parts) => path.join(root, ...parts);
21
+ const exists = (file) => fs.existsSync(rel(file));
22
+ const read = (file) => fs.readFileSync(rel(file), "utf8");
23
+
24
+ function walk(dir = "") {
25
+ const base = rel(dir);
26
+ if (!fs.existsSync(base)) return [];
27
+
28
+ const out = [];
29
+ for (const entry of fs.readdirSync(base, { withFileTypes: true })) {
30
+ if (entry.name === ".git" || entry.name === "node_modules") continue;
31
+ const child = path.join(dir, entry.name);
32
+ if (entry.isDirectory()) {
33
+ out.push(...walk(child));
34
+ } else {
35
+ out.push(child.replace(/\\/g, "/"));
36
+ }
37
+ }
38
+ return out;
39
+ }
40
+
41
+ return { rel, exists, read, walk };
42
+ }
43
+
44
+ function createManagedFiles({ rel, walk }) {
45
+ return () => MANAGED_ROOTS.flatMap((item) => {
46
+ const full = rel(item);
47
+ if (!fs.existsSync(full)) return [];
48
+ if (fs.statSync(full).isDirectory()) return walk(item);
49
+ return [item];
50
+ });
51
+ }
52
+
53
+ function createTokenChecker({ exists, read, fail }) {
54
+ return (file, tokens) => {
55
+ if (!exists(file)) {
56
+ fail(`${file} is missing`);
57
+ return;
58
+ }
59
+
60
+ const body = read(file);
61
+ for (const token of tokens) {
62
+ if (!body.includes(token)) fail(`${file} should include ${token}`);
63
+ }
64
+ };
65
+ }
66
+
67
+ function isVerifierImplementation(file) {
68
+ return file === "scripts/verify-harness.js" || file.startsWith("scripts/verify/");
69
+ }
70
+
71
+ function createHarnessContext(root) {
72
+ const errors = [];
73
+ const warnings = [];
74
+ const fileAccess = createFileAccess(root);
75
+ const fail = (message) => errors.push(message);
76
+ const warn = (message) => warnings.push(message);
77
+
78
+ return {
79
+ root,
80
+ errors,
81
+ warnings,
82
+ ...fileAccess,
83
+ managedFiles: createManagedFiles(fileAccess),
84
+ fail,
85
+ warn,
86
+ requireTokens: createTokenChecker({ ...fileAccess, fail }),
87
+ isVerifierImplementation,
88
+ };
89
+ }
90
+
91
+ module.exports = { createHarnessContext };
@@ -0,0 +1,266 @@
1
+ "use strict";
2
+
3
+ const ACTIVE_BRAINSTORMING_REFERENCE = "skills/brainstorming/SKILL.md";
4
+ const PROCESS_OUTCOMES = "skills/using-superpowers/references/process-outcomes.md";
5
+ const BRAINSTORMING_REFERENCE_ALLOWLIST = new Set([
6
+ "README.md",
7
+ "skills/using-superpowers/SKILL.md",
8
+ "scripts/install.sh",
9
+ "scripts/install.ps1",
10
+ ]);
11
+
12
+ const ROUTING_SCENARIOS = [
13
+ {
14
+ name: "clear low-risk task",
15
+ checks: [{ file: "skills/using-superpowers/SKILL.md", tokens: ["direct", "clear low-risk task"] }],
16
+ },
17
+ {
18
+ name: "ordinary task with one user decision",
19
+ checks: [{
20
+ file: "skills/using-superpowers/SKILL.md",
21
+ tokens: ["grilling inline", "unresolved user-owned decision"],
22
+ }],
23
+ },
24
+ {
25
+ name: "explicit grilling request",
26
+ checks: [{ file: "skills/using-superpowers/SKILL.md", tokens: ["explicit grilling request", "grilling explicit"] }],
27
+ },
28
+ {
29
+ name: "clear breaking public API migration",
30
+ checks: [{ file: "skills/spec-gate/SKILL.md", tokens: ["clear breaking public API migration", "Spec drafting"] }],
31
+ },
32
+ {
33
+ name: "public API migration with unresolved compatibility",
34
+ checks: [{
35
+ file: "skills/using-superpowers/SKILL.md",
36
+ tokens: ["unresolved user-owned decision", "resume_target: spec-gate"],
37
+ }],
38
+ },
39
+ {
40
+ name: "Spec Gate discovers an unresolved public contract",
41
+ checks: [{
42
+ file: PROCESS_OUTCOMES,
43
+ tokens: ["BLOCKED_BY_UNRESOLVED_DECISION", "decision map"],
44
+ }],
45
+ },
46
+ {
47
+ name: "user explicitly continues after blocking",
48
+ checks: [{
49
+ file: PROCESS_OUTCOMES,
50
+ tokens: ["new grilling session", "new Spec Gate", "do not resume the old call stack"],
51
+ }],
52
+ },
53
+ {
54
+ name: "unchanged confirmed decision blocks again",
55
+ checks: [{ file: PROCESS_OUTCOMES, tokens: ["Spec Gate contract conflict"] }],
56
+ },
57
+ {
58
+ name: "task only consumes established domain vocabulary",
59
+ checks: [{
60
+ file: "skills/domain-modeling/SKILL.md",
61
+ tokens: ["established `CONTEXT.md` vocabulary", "does not trigger it"],
62
+ }],
63
+ },
64
+ {
65
+ name: "new domain entity and lifecycle without a user decision",
66
+ checks: [{ file: "skills/domain-modeling/SKILL.md", tokens: ["subscription entity", "lifecycle states"] }],
67
+ },
68
+ {
69
+ name: "domain boundary remains a user decision",
70
+ checks: [
71
+ { file: "skills/domain-modeling/SKILL.md", tokens: ["Unresolved consequential decisions"] },
72
+ { file: "skills/using-superpowers/SKILL.md", tokens: ["unresolved user-owned decision"] },
73
+ ],
74
+ },
75
+ {
76
+ name: "explicit /to-spec with sufficient context",
77
+ checks: [{ file: "commands/to-spec.md", tokens: ["skills/spec-gate/SKILL.md"] }],
78
+ },
79
+ {
80
+ name: "old brainstorming name compatibility",
81
+ checks: [{
82
+ file: "skills/using-superpowers/SKILL.md",
83
+ tokens: ["Compatibility Alias", "old name `brainstorming`", "/to-spec"],
84
+ }],
85
+ },
86
+ {
87
+ name: "consented visual comparison",
88
+ checks: [{ file: "skills/visual-companion/SKILL.md", tokens: ["user consent", "visual comparisons"] }],
89
+ },
90
+ ];
91
+
92
+ function checkRequiredPaths({ exists, fail }) {
93
+ for (const file of [
94
+ "skills/spec-gate/SKILL.md",
95
+ "skills/spec-gate/references/spec-document-reviewer-prompt.md",
96
+ "skills/spec-gate/agents/openai.yaml",
97
+ "skills/domain-modeling/SKILL.md",
98
+ "skills/visual-companion/SKILL.md",
99
+ "skills/visual-companion/references/guide.md",
100
+ "commands/to-spec.md",
101
+ ]) {
102
+ if (!exists(file)) fail(`${file} is missing from the new workflow`);
103
+ }
104
+ }
105
+
106
+ function checkSpecGateContract({ exists, read, fail, requireTokens }) {
107
+ const file = "skills/spec-gate/SKILL.md";
108
+ requireTokens(file, [
109
+ "zero interview",
110
+ "READY_FOR_USER_REVIEW",
111
+ "BLOCKED_BY_UNRESOLVED_DECISION",
112
+ "NOT_APPLICABLE",
113
+ "decision_id",
114
+ "blocking_reason",
115
+ "known_constraints",
116
+ "evidence",
117
+ "Local-only artifact policy",
118
+ "Do not stage or commit it.",
119
+ "Spec Gate contract conflict",
120
+ ]);
121
+ if (!exists(file)) return;
122
+
123
+ const body = read(file);
124
+ const blockedSection = body.match(
125
+ /## Outcomes[\s\S]*?BLOCKED_BY_UNRESOLVED_DECISION([\s\S]*?)(?=NOT_APPLICABLE)/,
126
+ );
127
+ if (blockedSection && /^- resume_target\s*$/m.test(blockedSection[1])) {
128
+ fail("Spec Gate blocked outcome must not include resume_target");
129
+ }
130
+ if (/spec-gate\s*->\s*grilling/i.test(body)) {
131
+ fail("Spec Gate must not define an automatic spec-gate -> grilling edge");
132
+ }
133
+ }
134
+
135
+ function checkRouterContract({ exists, read, fail, requireTokens }) {
136
+ const file = "skills/using-superpowers/SKILL.md";
137
+ requireTokens(file, [
138
+ "three lanes",
139
+ "[references/process-outcomes.md](references/process-outcomes.md)",
140
+ "Ordinary direct delivery does not load this reference",
141
+ "spec-gate",
142
+ ]);
143
+ requireTokens(PROCESS_OUTCOMES, [
144
+ "BLOCKED_BY_UNRESOLVED_DECISION",
145
+ "decision map",
146
+ "new grilling session",
147
+ "new Spec Gate",
148
+ "do not resume the old call stack",
149
+ "spec-gate",
150
+ ]);
151
+ if (!exists(file) || !exists(PROCESS_OUTCOMES)) return;
152
+
153
+ const body = read(PROCESS_OUTCOMES);
154
+ if (/BLOCKED_BY_UNRESOLVED_DECISION[\s\S]{0,240}(?:automatically|auto).*grilling/i.test(body)) {
155
+ fail("Router must stop on Spec Gate blocking instead of automatically invoking grilling");
156
+ }
157
+ for (const scenario of ROUTING_SCENARIOS) {
158
+ for (const check of scenario.checks) requireTokens(check.file, check.tokens);
159
+ }
160
+ }
161
+
162
+ function checkSupportingSkills({ requireTokens }) {
163
+ requireTokens("skills/grilling/SKILL.md", [
164
+ "Route context:",
165
+ "Risk classification:",
166
+ "Resume target:",
167
+ "resume_target: spec-gate",
168
+ "return to `skills/using-superpowers/SKILL.md`",
169
+ ]);
170
+ requireTokens("skills/domain-modeling/SKILL.md", [
171
+ "bounded context",
172
+ "lifecycle",
173
+ "CONTEXT.md",
174
+ "approved Spec",
175
+ ]);
176
+ requireTokens("skills/visual-companion/SKILL.md", [
177
+ "user consent",
178
+ "grilling owns the decision loop",
179
+ "does not own continuation",
180
+ ]);
181
+ requireTokens("commands/to-spec.md", ["skills/spec-gate/SKILL.md"]);
182
+ }
183
+
184
+ function checkRemovedBrainstormingReferences(context) {
185
+ const { exists, read, managedFiles, fail, isVerifierImplementation } = context;
186
+ for (const agent of ["agents/harness-optimizer.md"]) {
187
+ if (exists(agent) && read(agent).includes("brainstorming")) {
188
+ fail(`${agent} must not reference brainstorming after the migration`);
189
+ }
190
+ }
191
+
192
+ for (const file of managedFiles()) {
193
+ if (isVerifierImplementation(file) || BRAINSTORMING_REFERENCE_ALLOWLIST.has(file)) continue;
194
+ if (read(file).includes(ACTIVE_BRAINSTORMING_REFERENCE)) {
195
+ fail(`${file} contains active reference to ${ACTIVE_BRAINSTORMING_REFERENCE}`);
196
+ }
197
+ }
198
+
199
+ if (exists("skills/brainstorming/SKILL.md")) {
200
+ fail("skills/brainstorming/SKILL.md must be removed");
201
+ }
202
+ }
203
+
204
+ function checkVisualCompanionSecurity({ requireTokens }) {
205
+ requireTokens("skills/visual-companion/references/guide.md", [
206
+ "session key",
207
+ "?key=",
208
+ "4 hours idle",
209
+ "--idle-timeout-minutes",
210
+ "same port",
211
+ ]);
212
+ requireTokens("skills/visual-companion/scripts/server.cjs", [
213
+ "BRAINSTORM_TOKEN",
214
+ "BRAINSTORM_TOKEN_FILE",
215
+ "Default 4 hours",
216
+ ]);
217
+ requireTokens("skills/visual-companion/scripts/server-utils.cjs", [
218
+ "timingSafeEqualStr",
219
+ "Cache-Control",
220
+ "X-Frame-Options",
221
+ ]);
222
+ }
223
+
224
+ function checkInstallerCleanupContract({ requireTokens }) {
225
+ requireTokens("scripts/install.sh", [
226
+ "cleanup_retired_skills",
227
+ "cleanup-retired-skills.js",
228
+ "validate_retired_skill_manifest",
229
+ "--dry-run",
230
+ "rules/08-ecc-integration.md",
231
+ "skills/subagent-driven-development/implementer-prompt.md",
232
+ ]);
233
+ requireTokens("scripts/install.ps1", [
234
+ "Remove-RetiredSkills",
235
+ "cleanup-retired-skills.js",
236
+ "Test-RetiredSkillManifest",
237
+ "--dry-run",
238
+ "rules\\08-ecc-integration.md",
239
+ "skills\\subagent-driven-development\\implementer-prompt.md",
240
+ ]);
241
+ requireTokens("scripts/retired-skill-files.json", [
242
+ "brainstorming",
243
+ "SKILL.md",
244
+ "scripts/server.cjs",
245
+ "agents/openai.yaml",
246
+ "writing-plans",
247
+ "executing-plans",
248
+ ]);
249
+ requireTokens("scripts/cleanup-retired-skills.js", [
250
+ "Preserving unknown files in retired skill",
251
+ "Preserving symlinked retired skill",
252
+ "Preserving retired path through symlink",
253
+ ]);
254
+ }
255
+
256
+ function runGrillingSpecGateChecks(context) {
257
+ checkRequiredPaths(context);
258
+ checkSpecGateContract(context);
259
+ checkRouterContract(context);
260
+ checkSupportingSkills(context);
261
+ checkRemovedBrainstormingReferences(context);
262
+ checkVisualCompanionSecurity(context);
263
+ checkInstallerCleanupContract(context);
264
+ }
265
+
266
+ module.exports = { runGrillingSpecGateChecks };