claude-everything-workflow 0.2.7 → 0.2.9
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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/AGENTS.md +11 -18
- package/agents/e2e-runner.md +1 -1
- package/commands/pr.md +3 -1
- package/evals/routing-scenarios.json +253 -0
- package/harness/manifest.json +2 -28
- package/hooks/check-console-log.js +2 -2
- package/package.json +4 -2
- package/rules/01-base.md +2 -2
- package/rules/02-implementation.md +7 -6
- package/rules/05-git-workflow.md +4 -6
- package/rules/common/agent-orchestration.md +1 -1
- package/rules/common/pr-automation.md +1 -1
- package/rules/common/testing.md +2 -2
- package/scripts/eval-scenarios.js +106 -0
- package/scripts/install-rules.js +186 -17
- package/scripts/install.ps1 +42 -15
- package/scripts/install.sh +31 -12
- package/scripts/legacy-common-rule-hashes.json +4 -0
- package/scripts/retired-skill-files.json +7 -0
- package/scripts/verify/install-rules.test.js +80 -24
- package/scripts/verify/metadata-checks.js +7 -8
- package/scripts/verify/repository-checks.js +44 -368
- package/scripts/verify/scenario-checks.js +108 -0
- package/scripts/verify/scenario-checks.test.js +84 -0
- package/scripts/verify/workflow-checks.js +85 -586
- package/scripts/verify-harness.js +2 -0
- package/skills/README.md +2 -4
- package/skills/feature-acceptance/SKILL.md +8 -8
- package/skills/{e2e-testing/SKILL.md → feature-acceptance/references/e2e-testing.md} +3 -9
- package/skills/implement/SKILL.md +2 -0
- package/skills/{subagent-driven-development/SKILL.md → implement/references/parallel-delivery.md} +7 -9
- package/skills/implement/references/ticket-delivery.md +1 -1
- package/skills/using-superpowers/SKILL.md +24 -103
- package/rules/07-forbidden.md +0 -20
- package/rules/08-specialty-rules-index.md +0 -18
- package/rules/09-first-principles-adversarial-testing.md +0 -30
- package/scripts/verify/continuation-checks.test.js +0 -101
- package/scripts/verify/grilling-spec-gate-checks.js +0 -297
- package/scripts/verify/workflow-ownership-fixtures.js +0 -371
- package/scripts/verify/workflow-ownership.js +0 -780
- /package/skills/{e2e-testing → feature-acceptance}/references/playwright-patterns.md +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { parseFrontmatter } = require("./skill-manifest-checks");
|
|
4
|
+
|
|
5
|
+
const SCENARIOS_PATH = "evals/routing-scenarios.json";
|
|
6
|
+
const MIN_SCENARIO_COUNT = 25;
|
|
7
|
+
|
|
8
|
+
function validateScenarios(data, { exists, read, manifest }) {
|
|
9
|
+
const errors = [];
|
|
10
|
+
if (!data || data.schemaVersion !== 1 || !Array.isArray(data.scenarios)) {
|
|
11
|
+
return [`${SCENARIOS_PATH} must have schemaVersion 1 and a scenarios array`];
|
|
12
|
+
}
|
|
13
|
+
if (data.scenarios.length < MIN_SCENARIO_COUNT) {
|
|
14
|
+
errors.push(`${SCENARIOS_PATH} must include at least ${MIN_SCENARIO_COUNT} scenarios (found ${data.scenarios.length})`);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const registeredSkills = new Set((manifest?.skills || []).map((entry) => entry.path));
|
|
18
|
+
const routerBody = exists("skills/using-superpowers/SKILL.md") ? read("skills/using-superpowers/SKILL.md") : "";
|
|
19
|
+
const seenIds = new Set();
|
|
20
|
+
|
|
21
|
+
for (const scenario of data.scenarios) {
|
|
22
|
+
if (!scenario || typeof scenario !== "object") {
|
|
23
|
+
errors.push("scenario entry must be an object");
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
const { id, prompt, expectedTarget, expectedReference, expectedLane, requiredSignals } = scenario;
|
|
27
|
+
if (!id || typeof id !== "string") {
|
|
28
|
+
errors.push("scenario is missing string id");
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (seenIds.has(id)) errors.push(`duplicate scenario id: ${id}`);
|
|
32
|
+
seenIds.add(id);
|
|
33
|
+
|
|
34
|
+
if (!prompt || typeof prompt !== "string" || prompt.trim().length < 6) {
|
|
35
|
+
errors.push(`scenario ${id} must have a non-empty prompt`);
|
|
36
|
+
}
|
|
37
|
+
if (!expectedLane || typeof expectedLane !== "string") {
|
|
38
|
+
errors.push(`scenario ${id} must declare expectedLane`);
|
|
39
|
+
}
|
|
40
|
+
if (!Array.isArray(requiredSignals) || requiredSignals.length === 0) {
|
|
41
|
+
errors.push(`scenario ${id} must declare non-empty requiredSignals`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (expectedTarget === null) {
|
|
45
|
+
for (const signal of requiredSignals || []) {
|
|
46
|
+
if (!routerBody.toLowerCase().includes(signal.toLowerCase())) {
|
|
47
|
+
errors.push(`scenario ${id}: router should cover exclusion signal "${signal}"`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (typeof expectedTarget !== "string" || !exists(expectedTarget)) {
|
|
54
|
+
errors.push(`scenario ${id}: expectedTarget does not exist: ${expectedTarget}`);
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (expectedTarget.startsWith("skills/") && expectedTarget.endsWith("/SKILL.md") && !registeredSkills.has(expectedTarget)) {
|
|
58
|
+
errors.push(`scenario ${id}: expectedTarget skill is not registered in harness/manifest.json: ${expectedTarget}`);
|
|
59
|
+
}
|
|
60
|
+
if (expectedReference && !exists(expectedReference)) {
|
|
61
|
+
errors.push(`scenario ${id}: expectedReference does not exist: ${expectedReference}`);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const targetBody = read(expectedTarget);
|
|
65
|
+
const refBody = expectedReference && exists(expectedReference) ? read(expectedReference) : "";
|
|
66
|
+
let description = "";
|
|
67
|
+
if (expectedTarget.endsWith("/SKILL.md")) {
|
|
68
|
+
const fm = parseFrontmatter(targetBody);
|
|
69
|
+
description = String(fm?.description || "");
|
|
70
|
+
}
|
|
71
|
+
const searchable = `${routerBody}\n${description}\n${targetBody}\n${refBody}`.toLowerCase();
|
|
72
|
+
for (const signal of requiredSignals || []) {
|
|
73
|
+
if (!searchable.includes(signal.toLowerCase())) {
|
|
74
|
+
errors.push(`scenario ${id}: expected route surface for ${expectedTarget} does not cover signal "${signal}"`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return errors;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function runScenarioChecks(context) {
|
|
83
|
+
const { exists, read, fail } = context;
|
|
84
|
+
if (!exists(SCENARIOS_PATH)) {
|
|
85
|
+
fail(`${SCENARIOS_PATH} is missing`);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
let data;
|
|
89
|
+
try {
|
|
90
|
+
data = JSON.parse(read(SCENARIOS_PATH));
|
|
91
|
+
} catch (error) {
|
|
92
|
+
fail(`${SCENARIOS_PATH} is invalid JSON: ${error.message}`);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
let manifest = { skills: [] };
|
|
96
|
+
if (exists("harness/manifest.json")) {
|
|
97
|
+
try {
|
|
98
|
+
manifest = JSON.parse(read("harness/manifest.json"));
|
|
99
|
+
} catch {
|
|
100
|
+
// manifest syntax errors are reported by skill-manifest-checks
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
for (const error of validateScenarios(data, { exists, read, manifest })) {
|
|
104
|
+
fail(error);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
module.exports = { SCENARIOS_PATH, MIN_SCENARIO_COUNT, validateScenarios, runScenarioChecks };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const assert = require("node:assert/strict");
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
const os = require("node:os");
|
|
7
|
+
const { spawnSync } = require("node:child_process");
|
|
8
|
+
const { createHarnessContext } = require("./core");
|
|
9
|
+
const { SCENARIOS_PATH, validateScenarios, runScenarioChecks } = require("./scenario-checks");
|
|
10
|
+
|
|
11
|
+
const root = path.resolve(__dirname, "../..");
|
|
12
|
+
const context = createHarnessContext(root);
|
|
13
|
+
runScenarioChecks(context);
|
|
14
|
+
assert.deepEqual(context.errors, [], `scenario checks failed:\n${context.errors.join("\n")}`);
|
|
15
|
+
|
|
16
|
+
const data = JSON.parse(fs.readFileSync(path.join(root, SCENARIOS_PATH), "utf8"));
|
|
17
|
+
const manifest = JSON.parse(fs.readFileSync(path.join(root, "harness/manifest.json"), "utf8"));
|
|
18
|
+
|
|
19
|
+
// Negative test: missing target file must fail
|
|
20
|
+
const badTargetErrors = validateScenarios(
|
|
21
|
+
{
|
|
22
|
+
schemaVersion: 1,
|
|
23
|
+
scenarios: Array.from({ length: 25 }, (_, i) =>
|
|
24
|
+
i === 0
|
|
25
|
+
? { id: "bad-target", prompt: "test missing target skill", expectedTarget: "skills/nonexistent/SKILL.md", expectedLane: "direct", requiredSignals: ["x"] }
|
|
26
|
+
: data.scenarios[i % data.scenarios.length],
|
|
27
|
+
).map((s, i) => ({ ...s, id: `${s.id}-${i}` })),
|
|
28
|
+
},
|
|
29
|
+
{ exists: context.exists, read: context.read, manifest },
|
|
30
|
+
);
|
|
31
|
+
assert.ok(badTargetErrors.some((e) => e.includes("does not exist")), "missing target must fail");
|
|
32
|
+
|
|
33
|
+
// Negative test: too few scenarios must fail
|
|
34
|
+
const tooFewErrors = validateScenarios(
|
|
35
|
+
{ schemaVersion: 1, scenarios: data.scenarios.slice(0, 5) },
|
|
36
|
+
{ exists: context.exists, read: context.read, manifest },
|
|
37
|
+
);
|
|
38
|
+
assert.ok(tooFewErrors.some((e) => e.includes("at least")), "too few scenarios must fail");
|
|
39
|
+
|
|
40
|
+
// Exercise the evaluator CLI with a stand-in executable at the external host boundary.
|
|
41
|
+
function checkEvalCli() {
|
|
42
|
+
const bin = fs.mkdtempSync(path.join(os.tmpdir(), "cew-eval-test-"));
|
|
43
|
+
const stub = `#!/usr/bin/env node
|
|
44
|
+
const fs = require("node:fs");
|
|
45
|
+
const output = process.argv.indexOf("--output-last-message");
|
|
46
|
+
if (output >= 0) fs.writeFileSync(process.argv[output + 1], process.env.FINAL);
|
|
47
|
+
process.stdout.write(process.env.STDOUT);
|
|
48
|
+
process.stderr.write(process.env.STDERR);
|
|
49
|
+
process.exitCode = Number(process.env.HOST_STATUS);
|
|
50
|
+
`;
|
|
51
|
+
try {
|
|
52
|
+
for (const host of ["claude", "codex"]) {
|
|
53
|
+
fs.writeFileSync(path.join(bin, host), stub, { mode: 0o755 });
|
|
54
|
+
}
|
|
55
|
+
const target = "skills/implement/SKILL.md";
|
|
56
|
+
const correct = JSON.stringify({ target });
|
|
57
|
+
const excluded = JSON.stringify({ target: "NONE", reason: `Do not choose ${target}` });
|
|
58
|
+
const run = (host, id, final, expectedStatus, diagnostics = "", hostStatus = 0) => {
|
|
59
|
+
const result = spawnSync(process.execPath, ["scripts/eval-scenarios.js", "--host", host, "--id", id], {
|
|
60
|
+
cwd: root, encoding: "utf8",
|
|
61
|
+
env: { ...process.env, PATH: bin + path.delimiter + process.env.PATH, FINAL: final,
|
|
62
|
+
STDOUT: host === "codex" ? correct : final, STDERR: diagnostics, HOST_STATUS: String(hostStatus) },
|
|
63
|
+
});
|
|
64
|
+
assert.ifError(result.error);
|
|
65
|
+
assert.equal(result.status, expectedStatus, `${host} ${id}: ${result.stdout} ${result.stderr}`);
|
|
66
|
+
assert.match(result.stdout, expectedStatus === 0 ? /^PASS /m : /^FAIL /m);
|
|
67
|
+
};
|
|
68
|
+
for (const host of ["claude", "codex"]) {
|
|
69
|
+
run(host, "direct-small-change", excluded, 1, correct);
|
|
70
|
+
run(host, "direct-small-change", "NONE. Do not choose implement.", 1);
|
|
71
|
+
run(host, "direct-small-change", "{}", 1, correct);
|
|
72
|
+
run(host, "direct-small-change", correct, 0);
|
|
73
|
+
run(host, "direct-small-change", correct, 1, "", 1);
|
|
74
|
+
run(host, "non-eng-translate", JSON.stringify({ target: "NONE" }), 0);
|
|
75
|
+
}
|
|
76
|
+
} finally {
|
|
77
|
+
fs.rmSync(bin, { recursive: true, force: true });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// These executable shims use POSIX shebangs, as do the Linux and macOS CI jobs.
|
|
82
|
+
if (process.platform !== "win32") checkEvalCli();
|
|
83
|
+
|
|
84
|
+
console.log(`Scenario checks tests passed (${data.scenarios.length} routing scenarios verified).`);
|