claude-everything-workflow 0.2.12 → 0.2.14
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 +1 -1
- package/README.md +1 -2
- package/README.zh-CN.md +1 -2
- package/docs/plugins.md +2 -3
- package/harness/manifest.json +36 -18
- package/package.json +1 -2
- package/rules/common/performance.md +3 -1
- package/scripts/cleanup-retired-skills.js +63 -19
- package/scripts/install-antigravity.js +230 -97
- package/scripts/install.ps1 +0 -1
- package/scripts/install.sh +0 -1
- package/scripts/retired-skill-files.json +38 -0
- package/scripts/verify/core.js +0 -1
- package/scripts/verify/install-rules.test.js +173 -23
- package/scripts/verify/metadata-checks.js +14 -9
- package/scripts/verify/skill-invocation.test.js +4 -0
- package/scripts/verify/skill-manifest-checks.js +1 -1
- package/scripts/verify/skill-manifest-checks.test.js +53 -0
- package/scripts/verify/workflow-checks.js +91 -1
- package/skills/feature-acceptance/SKILL.md +1 -1
- package/skills/spec-gate/SKILL.md +1 -1
- package/skills/using-superpowers/SKILL.md +1 -0
- package/agents/database-reviewer.md +0 -41
- package/agents/e2e-runner.md +0 -21
- package/agents/refactor-cleaner.md +0 -54
- package/agents/security-reviewer.md +0 -47
- package/references/agents/refactor-cleaner.md +0 -75
- package/references/agents/security-reviewer.md +0 -542
|
@@ -7,7 +7,7 @@ const path = require("node:path");
|
|
|
7
7
|
const crypto = require("node:crypto");
|
|
8
8
|
const { spawnSync } = require("node:child_process");
|
|
9
9
|
const { installRules, finalizeBackups, BACKUP_ROOT_NAME } = require("../install-rules");
|
|
10
|
-
const { installAntigravity, parseFrontmatter
|
|
10
|
+
const { installAntigravity, parseFrontmatter } = require("../install-antigravity");
|
|
11
11
|
|
|
12
12
|
const sourceRoot = path.resolve(__dirname, "../..");
|
|
13
13
|
const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), "cew-rules-"));
|
|
@@ -405,6 +405,46 @@ function checkRetiredAgentCleanup() {
|
|
|
405
405
|
assert.match(linkRun.stdout, /Preserving symlinked retired agent:/);
|
|
406
406
|
assert.equal(read(linkedFileTarget), original);
|
|
407
407
|
}
|
|
408
|
+
|
|
409
|
+
// Retired reference cleanup: remove unmodified, preserve customized and symlinked, remove empty subdir.
|
|
410
|
+
const refAgents = path.join(fixture, "references/agents");
|
|
411
|
+
const refName = "security-reviewer.md";
|
|
412
|
+
const refRel = `agents/${refName}`;
|
|
413
|
+
const refTarget = path.join(refAgents, refName);
|
|
414
|
+
fs.mkdirSync(refAgents, { recursive: true });
|
|
415
|
+
const refManifest = JSON.parse(read(path.join(sourceRoot, "scripts/retired-skill-files.json")));
|
|
416
|
+
refManifest.retired_reference_hashes = {
|
|
417
|
+
[refRel]: [crypto.createHash("sha256").update(original).digest("hex")],
|
|
418
|
+
};
|
|
419
|
+
fs.writeFileSync(path.join(fixture, "retired-skill-files.json"), JSON.stringify(refManifest));
|
|
420
|
+
fs.writeFileSync(refTarget, original.replace("\n", "\r\n"));
|
|
421
|
+
run("--dry-run");
|
|
422
|
+
assert.equal(read(refTarget), original);
|
|
423
|
+
run();
|
|
424
|
+
assert.equal(fs.existsSync(refTarget), false, "remove unmodified retired reference on upgrade");
|
|
425
|
+
assert.equal(fs.existsSync(refAgents), false, "remove empty retired reference subdir");
|
|
426
|
+
assert.equal(fs.existsSync(path.join(fixture, "references")), true, "keep references/ root");
|
|
427
|
+
|
|
428
|
+
fs.mkdirSync(refAgents, { recursive: true });
|
|
429
|
+
fs.writeFileSync(refTarget, original + "Custom checklist\n");
|
|
430
|
+
run();
|
|
431
|
+
assert.equal(read(refTarget), original + "Custom checklist\n");
|
|
432
|
+
|
|
433
|
+
const refOutside = path.join(fixture, "personal-ref-agents");
|
|
434
|
+
fs.mkdirSync(refOutside, { recursive: true });
|
|
435
|
+
fs.writeFileSync(path.join(refOutside, refName), original);
|
|
436
|
+
fs.rmSync(refAgents, { recursive: true, force: true });
|
|
437
|
+
fs.symlinkSync(refOutside, refAgents, process.platform === "win32" ? "junction" : "dir");
|
|
438
|
+
run();
|
|
439
|
+
assert.equal(read(path.join(refOutside, refName)), original, "preserve symlinked retired reference dir");
|
|
440
|
+
|
|
441
|
+
// Reject invalid retired_reference_hashes / retired_agent_hashes (including explicit null).
|
|
442
|
+
for (const field of ["retired_agent_hashes", "retired_reference_hashes"]) {
|
|
443
|
+
const badManifest = { ...refManifest, [field]: null };
|
|
444
|
+
fs.writeFileSync(path.join(fixture, "retired-skill-files.json"), JSON.stringify(badManifest));
|
|
445
|
+
const invalidRes = spawnSync(process.execPath, [cleanup, "--validate"], { encoding: "utf8" });
|
|
446
|
+
assert.notEqual(invalidRes.status, 0, `${field}: null must fail manifest validation`);
|
|
447
|
+
}
|
|
408
448
|
}
|
|
409
449
|
|
|
410
450
|
function checkInstallerEntrypoint() {
|
|
@@ -624,30 +664,93 @@ function checkInstallerEntrypoint() {
|
|
|
624
664
|
assert.equal(fs.existsSync(path.join(agRoot, "skills/README.md")), false);
|
|
625
665
|
const agSkills = fs.readdirSync(path.join(agRoot, "skills"), { withFileTypes: true })
|
|
626
666
|
.filter((entry) => entry.isDirectory());
|
|
627
|
-
assert.equal(agSkills.length,
|
|
667
|
+
assert.equal(agSkills.length, 19);
|
|
668
|
+
for (const relocated of ["implement", "to-spec", "continuous-learning-v2"]) {
|
|
669
|
+
assert.equal(
|
|
670
|
+
fs.existsSync(path.join(agRoot, "skills", relocated)),
|
|
671
|
+
false,
|
|
672
|
+
`Antigravity must not expose redundant top-level skills/${relocated}`,
|
|
673
|
+
);
|
|
674
|
+
}
|
|
675
|
+
for (const relRef of [
|
|
676
|
+
"references/skills/implement/SKILL.md",
|
|
677
|
+
"references/skills/implement/references/ticket-delivery.md",
|
|
678
|
+
"references/skills/implement/references/parallel-delivery.md",
|
|
679
|
+
"references/skills/continuous-learning-v2/SKILL.md",
|
|
680
|
+
"references/skills/continuous-learning-v2/hooks/observe-v2.js",
|
|
681
|
+
]) {
|
|
682
|
+
assert.equal(fs.existsSync(path.join(agRoot, relRef)), true, `missing relocated file: ${relRef}`);
|
|
683
|
+
}
|
|
684
|
+
// Relocated observe-v2.js resolves scripts/learning/project-utils cleanly in default and enabled modes.
|
|
685
|
+
{
|
|
686
|
+
const relocatedObserve = path.join(agRoot, "references/skills/continuous-learning-v2/hooks/observe-v2.js");
|
|
687
|
+
const disabledHome = path.join(tempRoot, "ag-observe-disabled");
|
|
688
|
+
fs.mkdirSync(disabledHome, { recursive: true });
|
|
689
|
+
const disabledRes = spawnSync(process.execPath, [relocatedObserve, "post"], {
|
|
690
|
+
cwd: agRoot,
|
|
691
|
+
env: { ...process.env, HOME: disabledHome, USERPROFILE: disabledHome },
|
|
692
|
+
input: "{}",
|
|
693
|
+
encoding: "utf8",
|
|
694
|
+
timeout: 10000,
|
|
695
|
+
});
|
|
696
|
+
assert.ifError(disabledRes.error);
|
|
697
|
+
assert.equal(disabledRes.status, 0, disabledRes.stderr);
|
|
698
|
+
assert.equal(disabledRes.stderr, "");
|
|
699
|
+
|
|
700
|
+
const enabledHome = path.join(tempRoot, "ag-observe-enabled");
|
|
701
|
+
const cfgDir = path.join(enabledHome, ".claude/skills/continuous-learning-v2");
|
|
702
|
+
const obsPath = path.join(enabledHome, ".claude/homunculus/observations.jsonl");
|
|
703
|
+
fs.mkdirSync(cfgDir, { recursive: true });
|
|
704
|
+
const baseCfg = JSON.parse(read(path.join(sourceRoot, "skills/continuous-learning-v2/config.json")));
|
|
705
|
+
baseCfg.observation = {
|
|
706
|
+
...baseCfg.observation,
|
|
707
|
+
enabled: true,
|
|
708
|
+
store_path: "~/.claude/homunculus/observations.jsonl",
|
|
709
|
+
};
|
|
710
|
+
fs.writeFileSync(path.join(cfgDir, "config.json"), JSON.stringify(baseCfg, null, 2));
|
|
711
|
+
|
|
712
|
+
const enabledRes = spawnSync(process.execPath, [relocatedObserve, "post"], {
|
|
713
|
+
cwd: agRoot,
|
|
714
|
+
env: { ...process.env, HOME: enabledHome, USERPROFILE: enabledHome },
|
|
715
|
+
input: JSON.stringify({ tool: "Edit", cwd: sourceRoot, tool_input: { file_path: "README.md" } }),
|
|
716
|
+
encoding: "utf8",
|
|
717
|
+
timeout: 10000,
|
|
718
|
+
});
|
|
719
|
+
assert.ifError(enabledRes.error);
|
|
720
|
+
assert.equal(enabledRes.status, 0, enabledRes.stderr);
|
|
721
|
+
assert.equal(enabledRes.stderr, "");
|
|
722
|
+
const firstRecord = JSON.parse(read(obsPath).trim().split(/\r?\n/)[0]);
|
|
723
|
+
assert.equal(firstRecord.tool, "Edit");
|
|
724
|
+
assert.equal(firstRecord.event, "tool_complete");
|
|
725
|
+
}
|
|
628
726
|
for (const dir of agSkills) {
|
|
629
727
|
const skillMd = read(path.join(agRoot, "skills", dir.name, "SKILL.md"));
|
|
630
728
|
assert.match(skillMd, new RegExp(`^---\\nname: ${dir.name}\\ndescription: .+`, "m"));
|
|
631
729
|
}
|
|
632
730
|
assert.doesNotMatch(read(path.join(agRoot, "skills/pr/SKILL.md")), /\$ARGUMENTS/);
|
|
633
731
|
assert.doesNotMatch(read(path.join(agRoot, "skills/learn/SKILL.md")), /\$ARGUMENTS/);
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
732
|
+
assert.match(
|
|
733
|
+
read(path.join(agRoot, "skills/using-superpowers/SKILL.md")),
|
|
734
|
+
/read-reference ~\/\.gemini\/config\/plugins\/claude-everything-workflow\/references\/skills\/implement\/SKILL\.md/,
|
|
735
|
+
);
|
|
736
|
+
assert.match(
|
|
737
|
+
read(path.join(agRoot, "skills/learn/SKILL.md")),
|
|
738
|
+
/~\/\.gemini\/config\/plugins\/claude-everything-workflow\/references\/skills\/continuous-learning-v2\/SKILL\.md/,
|
|
739
|
+
);
|
|
740
|
+
assert.match(
|
|
741
|
+
read(path.join(agRoot, "references/rules/common/agent-orchestration.md")),
|
|
742
|
+
/plugins\/claude-everything-workflow\/references\/skills\/implement\/references\/parallel-delivery\.md/,
|
|
743
|
+
);
|
|
744
|
+
assert.equal(fs.existsSync(path.join(agRoot, "agents")), false,
|
|
745
|
+
"Antigravity plugin must not install retired agents directory");
|
|
746
|
+
assert.equal(fs.existsSync(path.join(agRoot, "references/agents")), false,
|
|
747
|
+
"Antigravity plugin must not install retired references/agents directory");
|
|
637
748
|
for (const host of [".claude", ".codex"]) {
|
|
638
|
-
assert.
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
assert.match(body, /^subagent: true$/m);
|
|
643
|
-
assert.match(body, /^mainAgent: false$/m);
|
|
644
|
-
assert.match(body, /^tools: \[/m);
|
|
645
|
-
assert.doesNotMatch(body, /^model:/m);
|
|
749
|
+
assert.equal(fs.existsSync(path.join(profile, host, "agents")), false,
|
|
750
|
+
`${host} installer must not install retired agents directory`);
|
|
751
|
+
assert.equal(fs.existsSync(path.join(profile, host, "references/agents")), false,
|
|
752
|
+
`${host} installer must not install retired references/agents directory`);
|
|
646
753
|
}
|
|
647
|
-
assert.match(read(path.join(agRoot, "agents/e2e-runner.md")),
|
|
648
|
-
/~\/\.gemini\/config\/plugins\/claude-everything-workflow\/skills\/feature-acceptance\/references\/e2e-testing\.md/);
|
|
649
|
-
assert.match(read(path.join(agRoot, "agents/security-reviewer.md")),
|
|
650
|
-
/~\/\.gemini\/config\/plugins\/claude-everything-workflow\/references\/agents\/security-reviewer\.md/);
|
|
651
754
|
assert.equal(fs.existsSync(path.join(agRoot, "scripts/learning/projects.js")), true);
|
|
652
755
|
assert.equal(fs.existsSync(path.join(agRoot, "harness/manifest.json")), true);
|
|
653
756
|
assert.equal(fs.existsSync(path.join(agRoot, "scripts/install-antigravity.js")), false);
|
|
@@ -670,7 +773,11 @@ function checkInstallerEntrypoint() {
|
|
|
670
773
|
read(path.join(agRoot, "references/rules/05-git-workflow.md")),
|
|
671
774
|
/~\/\.gemini\/config\/plugins\/claude-everything-workflow\/skills\/pr\/SKILL\.md/,
|
|
672
775
|
);
|
|
673
|
-
assert.doesNotMatch(read(path.join(agRoot, "skills/continuous-learning-v2/SKILL.md")), /`commands\/`/);
|
|
776
|
+
assert.doesNotMatch(read(path.join(agRoot, "references/skills/continuous-learning-v2/SKILL.md")), /`commands\/`/);
|
|
777
|
+
assert.match(
|
|
778
|
+
read(path.join(agRoot, "references/skills/continuous-learning-v2/SKILL.md")),
|
|
779
|
+
/~\/\.gemini\/config\/plugins\/claude-everything-workflow\/skills\/learn\/SKILL\.md/,
|
|
780
|
+
);
|
|
674
781
|
|
|
675
782
|
// Re-running Antigravity install with unchanged files must not create a spurious backup.
|
|
676
783
|
const agBackups = path.join(agRoot, BACKUP_ROOT_NAME);
|
|
@@ -884,13 +991,9 @@ function checkAntigravityEdgeCases() {
|
|
|
884
991
|
const linkedPlugin = installAntigravity({ sourceRoot, homeDir: linkedHome, log: () => {} });
|
|
885
992
|
assert.equal(fs.existsSync(path.join(linkedPlugin, "plugin.json")), true);
|
|
886
993
|
|
|
887
|
-
// 4. Zero-indent YAML lists parse cleanly
|
|
994
|
+
// 4. Zero-indent YAML lists parse cleanly.
|
|
888
995
|
const parsedList = parseFrontmatter("---\nname: demo\ntools:\n- Read\n- Grep\n---\n\nBody\n");
|
|
889
996
|
assert.deepEqual(parsedList.data.tools, ["Read", "Grep"]);
|
|
890
|
-
assert.deepEqual(mapTools(["Read", "Grep"], "demo.md"), ["read_file"]);
|
|
891
|
-
assert.throws(() => mapTools(["UnknownTool"], "demo.md"), /no supported Antigravity tools/);
|
|
892
|
-
assert.throws(() => mapTools([], "demo.md"), /no supported Antigravity tools/);
|
|
893
|
-
assert.throws(() => mapTools("Read", "demo.md"), /invalid tools/);
|
|
894
997
|
|
|
895
998
|
// 5. Reject "." as --backup-id in both CLI entrypoints.
|
|
896
999
|
for (const script of ["scripts/install-rules.js", "scripts/install-antigravity.js"]) {
|
|
@@ -926,6 +1029,53 @@ function checkAntigravityEdgeCases() {
|
|
|
926
1029
|
true,
|
|
927
1030
|
);
|
|
928
1031
|
}
|
|
1032
|
+
|
|
1033
|
+
// 7. Upgrade cleanup removes legacy top-level relocated/skipped skills safely.
|
|
1034
|
+
{
|
|
1035
|
+
const upgradeHome = path.join(tempRoot, "ag-relocate-upgrade-home");
|
|
1036
|
+
const upgradePlugin = path.join(upgradeHome, ".gemini/config/plugins/claude-everything-workflow");
|
|
1037
|
+
const outsideTarget = path.join(tempRoot, "ag-outside-tospec");
|
|
1038
|
+
fs.mkdirSync(outsideTarget, { recursive: true });
|
|
1039
|
+
fs.writeFileSync(path.join(outsideTarget, "SKILL.md"), "Outside content must stay\n");
|
|
1040
|
+
|
|
1041
|
+
const legacyImplement = path.join(upgradePlugin, "skills/implement");
|
|
1042
|
+
const legacyClv2 = path.join(upgradePlugin, "skills/continuous-learning-v2");
|
|
1043
|
+
fs.mkdirSync(path.join(legacyImplement, "references"), { recursive: true });
|
|
1044
|
+
fs.mkdirSync(path.join(legacyClv2, "hooks"), { recursive: true });
|
|
1045
|
+
fs.writeFileSync(path.join(legacyImplement, "SKILL.md"), "Old implement\n");
|
|
1046
|
+
fs.writeFileSync(path.join(legacyImplement, "references/ticket-delivery.md"), "Old ref\n");
|
|
1047
|
+
fs.writeFileSync(path.join(legacyImplement, "personal-notes.md"), "Keep personal notes\n");
|
|
1048
|
+
fs.writeFileSync(path.join(legacyClv2, "SKILL.md"), "Old clv2\n");
|
|
1049
|
+
fs.writeFileSync(path.join(legacyClv2, "hooks/observe-v2.js"), "Old hook\n");
|
|
1050
|
+
fs.symlinkSync(
|
|
1051
|
+
outsideTarget,
|
|
1052
|
+
path.join(upgradePlugin, "skills/to-spec"),
|
|
1053
|
+
process.platform === "win32" ? "junction" : "dir",
|
|
1054
|
+
);
|
|
1055
|
+
|
|
1056
|
+
installAntigravity({ sourceRoot, homeDir: upgradeHome, dryRun: true, log: () => {} });
|
|
1057
|
+
assert.equal(fs.existsSync(path.join(legacyImplement, "SKILL.md")), true, "dry-run must not delete legacy files");
|
|
1058
|
+
assert.equal(fs.existsSync(path.join(legacyClv2, "SKILL.md")), true, "dry-run must not delete legacy clv2");
|
|
1059
|
+
|
|
1060
|
+
installAntigravity({ sourceRoot, homeDir: upgradeHome, log: () => {} });
|
|
1061
|
+
assert.equal(fs.existsSync(path.join(legacyImplement, "SKILL.md")), false);
|
|
1062
|
+
assert.equal(fs.existsSync(path.join(legacyImplement, "references/ticket-delivery.md")), false);
|
|
1063
|
+
assert.equal(read(path.join(legacyImplement, "personal-notes.md")), "Keep personal notes\n");
|
|
1064
|
+
assert.equal(fs.existsSync(legacyClv2), false);
|
|
1065
|
+
assert.equal(read(path.join(outsideTarget, "SKILL.md")), "Outside content must stay\n");
|
|
1066
|
+
assert.equal(fs.lstatSync(path.join(upgradePlugin, "skills/to-spec")).isSymbolicLink(), true);
|
|
1067
|
+
|
|
1068
|
+
// Non-symlink legacy skills/to-spec/SKILL.md is also removed on upgrade.
|
|
1069
|
+
const toSpecHome = path.join(tempRoot, "ag-tospec-upgrade-home");
|
|
1070
|
+
const legacyToSpec = path.join(
|
|
1071
|
+
toSpecHome,
|
|
1072
|
+
".gemini/config/plugins/claude-everything-workflow/skills/to-spec",
|
|
1073
|
+
);
|
|
1074
|
+
fs.mkdirSync(legacyToSpec, { recursive: true });
|
|
1075
|
+
fs.writeFileSync(path.join(legacyToSpec, "SKILL.md"), "Old to-spec\n");
|
|
1076
|
+
installAntigravity({ sourceRoot, homeDir: toSpecHome, log: () => {} });
|
|
1077
|
+
assert.equal(fs.existsSync(legacyToSpec), false);
|
|
1078
|
+
}
|
|
929
1079
|
}
|
|
930
1080
|
|
|
931
1081
|
try {
|
|
@@ -113,7 +113,6 @@ function checkReadmeTreePaths() {
|
|
|
113
113
|
|
|
114
114
|
const ignored = new Set([
|
|
115
115
|
"claude-everything-Workflow",
|
|
116
|
-
"agents/...",
|
|
117
116
|
]);
|
|
118
117
|
const stack = [];
|
|
119
118
|
|
|
@@ -169,7 +168,6 @@ function checkPackageOnlyLists(ps, sh) {
|
|
|
169
168
|
|
|
170
169
|
function checkInstallerSurface(ps, sh) {
|
|
171
170
|
const sharedDirs = [
|
|
172
|
-
"agents",
|
|
173
171
|
"commands",
|
|
174
172
|
"scripts",
|
|
175
173
|
"hooks",
|
|
@@ -209,6 +207,12 @@ function checkInstallerSurface(ps, sh) {
|
|
|
209
207
|
if (sh.includes('copy_dir homunculus "$dest"')) {
|
|
210
208
|
fail("scripts/install.sh should not install removed homunculus directory");
|
|
211
209
|
}
|
|
210
|
+
if (/^\s*"agents",?$/m.test(ps)) {
|
|
211
|
+
fail("scripts/install.ps1 should not install retired agents directory");
|
|
212
|
+
}
|
|
213
|
+
if (sh.includes('copy_dir agents "$dest"')) {
|
|
214
|
+
fail("scripts/install.sh should not install retired agents directory");
|
|
215
|
+
}
|
|
212
216
|
const retiredCommands = [
|
|
213
217
|
"e2e.md", "evolve.md", "grill.md", "harness-audit.md", "instinct-status.md",
|
|
214
218
|
"learn-eval.md", "projects.md", "promote.md", "prune.md", "setup-workflow.md",
|
|
@@ -739,7 +743,6 @@ function checkRouterTargets() {
|
|
|
739
743
|
}
|
|
740
744
|
|
|
741
745
|
const token = target
|
|
742
|
-
.replace(/^agents\//, "")
|
|
743
746
|
.replace(/^skills\//, "skills/")
|
|
744
747
|
.replace(/\.md$/, "")
|
|
745
748
|
.replace(/\/SKILL$/, "");
|
|
@@ -769,12 +772,14 @@ function checkNpmPackageSurface() {
|
|
|
769
772
|
if (!packageFiles.includes("README.zh-CN.md")) {
|
|
770
773
|
fail("package.json should publish README.zh-CN.md so the language link works in the package");
|
|
771
774
|
}
|
|
772
|
-
const
|
|
773
|
-
const
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
775
|
+
for (const retiredDir of ["homunculus", "agents"]) {
|
|
776
|
+
const publishesRetired = packageFiles.some((file) => {
|
|
777
|
+
const normalized = file.replace(/\\/g, "/").replace(/^\.\//, "");
|
|
778
|
+
return normalized === retiredDir || normalized.startsWith(`${retiredDir}/`);
|
|
779
|
+
});
|
|
780
|
+
if (publishesRetired) {
|
|
781
|
+
fail(`package.json should not publish retired ${retiredDir} directory`);
|
|
782
|
+
}
|
|
778
783
|
}
|
|
779
784
|
|
|
780
785
|
const cliHelp = spawnSync(
|
|
@@ -21,10 +21,14 @@ function validate(compatibility, invocation, claudeFlag, policy) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const both = ["claude-code", "codex"];
|
|
24
|
+
const allHosts = ["claude-code", "codex", "antigravity"];
|
|
24
25
|
const disabledPolicy = "policy:\n allow_implicit_invocation: false\n";
|
|
25
26
|
assert.match(validate(both, "explicit-only", true), /codex.*disable implicit invocation/i);
|
|
26
27
|
assert.match(validate(both, "explicit-only", false, disabledPolicy), /claude-code.*disable implicit invocation/i);
|
|
27
28
|
assert.equal(validate(both, "explicit-only", true, disabledPolicy), "");
|
|
29
|
+
assert.equal(validate(allHosts, "explicit-only", true, disabledPolicy), "");
|
|
30
|
+
assert.equal(validate(allHosts, "implicit", false), "");
|
|
31
|
+
assert.equal(validate(["antigravity"], "explicit-only", false), "");
|
|
28
32
|
assert.equal(validate(["claude-code"], "explicit-only", true), "");
|
|
29
33
|
assert.equal(validate(["codex"], "explicit-only", false, disabledPolicy), "");
|
|
30
34
|
assert.match(validate(["codex"], "explicit-only", false,
|
|
@@ -10,7 +10,7 @@ const MAX_SKILL_TOKENS = 5000;
|
|
|
10
10
|
const MAX_DESCRIPTION_CHARS = 128;
|
|
11
11
|
const NAME_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
12
12
|
const VERSION_PATTERN = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
|
|
13
|
-
const COMPATIBILITIES = new Set(["claude-code", "codex"]);
|
|
13
|
+
const COMPATIBILITIES = new Set(["claude-code", "codex", "antigravity"]);
|
|
14
14
|
|
|
15
15
|
function isSafeRelativePath(value) {
|
|
16
16
|
return typeof value === "string" && value.length > 0 &&
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const assert = require("assert");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const { createHarnessContext } = require("./core");
|
|
4
6
|
const { validateManifest } = require("./skill-manifest-checks");
|
|
7
|
+
const { checkResidentContextBudget } = require("./workflow-checks");
|
|
5
8
|
|
|
6
9
|
function run() {
|
|
7
10
|
const valid = {
|
|
@@ -129,6 +132,56 @@ function run() {
|
|
|
129
132
|
read: () => "---\nname: demo-skill\ndescription: demo\nversion: 2.0.0\n---\n",
|
|
130
133
|
}).join("\n"), /version does not match frontmatter/);
|
|
131
134
|
|
|
135
|
+
const antigravityValid = structuredClone(valid);
|
|
136
|
+
antigravityValid.skills[0].compatibility = ["claude-code", "codex", "antigravity"];
|
|
137
|
+
assert.deepStrictEqual(validateManifest(antigravityValid, {
|
|
138
|
+
exists: (file) => file === "skills/demo-skill/SKILL.md" || file === "AGENTS.md",
|
|
139
|
+
skillPaths: ["skills/demo-skill/SKILL.md"],
|
|
140
|
+
read: () => "---\nname: demo-skill\ndescription: demo\n---\n",
|
|
141
|
+
}), []);
|
|
142
|
+
|
|
143
|
+
// Resident context budget check passes on repository and rejects over-budget fixtures.
|
|
144
|
+
const repoRoot = path.resolve(__dirname, "../..");
|
|
145
|
+
const repoCtx = createHarnessContext(repoRoot);
|
|
146
|
+
checkResidentContextBudget(repoCtx);
|
|
147
|
+
assert.deepStrictEqual(repoCtx.errors, []);
|
|
148
|
+
|
|
149
|
+
const overBudgetErrors = [];
|
|
150
|
+
checkResidentContextBudget(
|
|
151
|
+
{
|
|
152
|
+
root: repoRoot,
|
|
153
|
+
exists: (file) => file === "AGENTS.md" || file === "harness/manifest.json" || file === "skills/a/SKILL.md",
|
|
154
|
+
read: (file) => {
|
|
155
|
+
if (file === "AGENTS.md") return "x".repeat(200);
|
|
156
|
+
if (file === "harness/manifest.json") {
|
|
157
|
+
return JSON.stringify({
|
|
158
|
+
skills: [{ name: "a", path: "skills/a/SKILL.md", invocation: "implicit" }],
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
return `---\nname: a\ndescription: ${"y".repeat(60)}\n---\n`;
|
|
162
|
+
},
|
|
163
|
+
fail: (msg) => overBudgetErrors.push(msg),
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
maxAgentsChars: 100,
|
|
167
|
+
maxClaudeResidentRulesChars: 150,
|
|
168
|
+
maxImplicitSkillMetadataChars: 50,
|
|
169
|
+
maxAntigravitySkills: 5,
|
|
170
|
+
maxAntigravitySkillMetadataChars: 50,
|
|
171
|
+
},
|
|
172
|
+
() => ({
|
|
173
|
+
exposedSkills: Array.from({ length: 6 }, (_, i) => ({
|
|
174
|
+
name: `skill-${i}`,
|
|
175
|
+
description: "desc".repeat(10),
|
|
176
|
+
})),
|
|
177
|
+
}),
|
|
178
|
+
);
|
|
179
|
+
assert.match(overBudgetErrors.join("\n"), /AGENTS\.md exceeds resident budget/);
|
|
180
|
+
assert.match(overBudgetErrors.join("\n"), /Claude resident rules exceed budget/);
|
|
181
|
+
assert.match(overBudgetErrors.join("\n"), /Implicit skill metadata exceeds budget/);
|
|
182
|
+
assert.match(overBudgetErrors.join("\n"), /Antigravity exposed skills exceed budget/);
|
|
183
|
+
assert.match(overBudgetErrors.join("\n"), /Antigravity skill metadata exceeds budget/);
|
|
184
|
+
|
|
132
185
|
console.log("skill manifest checks tests passed");
|
|
133
186
|
}
|
|
134
187
|
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const fs = require("fs");
|
|
4
|
+
const { parseFrontmatter } = require("./skill-manifest-checks");
|
|
5
|
+
const { resolveAntigravitySkillPlan } = require("../install-antigravity");
|
|
4
6
|
|
|
5
7
|
const ROUTER_PATH = "skills/using-superpowers/SKILL.md";
|
|
6
8
|
const MAX_ROUTER_LINES = 50;
|
|
9
|
+
const RESIDENT_CONTEXT_BUDGETS = {
|
|
10
|
+
maxAgentsChars: 1800,
|
|
11
|
+
maxClaudeResidentRulesChars: 5200,
|
|
12
|
+
maxImplicitSkillMetadataChars: 2200,
|
|
13
|
+
maxAntigravitySkills: 19,
|
|
14
|
+
maxAntigravitySkillMetadataChars: 2100,
|
|
15
|
+
};
|
|
7
16
|
const EXPECTED_TOP_LEVEL_RULES = [
|
|
8
17
|
"01-base.md",
|
|
9
18
|
"02-implementation.md",
|
|
@@ -30,6 +39,12 @@ const RETIRED_RULE_PATHS = [
|
|
|
30
39
|
];
|
|
31
40
|
const RETIRED_AGENT_PATHS = [
|
|
32
41
|
"agents/harness-optimizer.md",
|
|
42
|
+
"agents/database-reviewer.md",
|
|
43
|
+
"agents/e2e-runner.md",
|
|
44
|
+
"agents/refactor-cleaner.md",
|
|
45
|
+
"agents/security-reviewer.md",
|
|
46
|
+
"references/agents/refactor-cleaner.md",
|
|
47
|
+
"references/agents/security-reviewer.md",
|
|
33
48
|
];
|
|
34
49
|
|
|
35
50
|
function checkRouterBudget({ exists, read, fail }) {
|
|
@@ -110,12 +125,87 @@ function checkVisualCompanionSecurity({ requireTokens }) {
|
|
|
110
125
|
]);
|
|
111
126
|
}
|
|
112
127
|
|
|
128
|
+
function checkResidentContextBudget(
|
|
129
|
+
{ root, exists, read, fail },
|
|
130
|
+
budgets = RESIDENT_CONTEXT_BUDGETS,
|
|
131
|
+
planResolver = resolveAntigravitySkillPlan,
|
|
132
|
+
) {
|
|
133
|
+
if (exists("AGENTS.md")) {
|
|
134
|
+
const agentsChars = read("AGENTS.md").length;
|
|
135
|
+
if (agentsChars > budgets.maxAgentsChars) {
|
|
136
|
+
fail(`AGENTS.md exceeds resident budget (${agentsChars} > ${budgets.maxAgentsChars} chars)`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const claudeResidentFiles = [
|
|
141
|
+
"AGENTS.md",
|
|
142
|
+
"CLAUDE.md",
|
|
143
|
+
"rules/01-base.md",
|
|
144
|
+
"rules/02-implementation.md",
|
|
145
|
+
"rules/05-git-workflow.md",
|
|
146
|
+
];
|
|
147
|
+
const claudeResidentChars = claudeResidentFiles
|
|
148
|
+
.filter((file) => exists(file))
|
|
149
|
+
.reduce((sum, file) => sum + read(file).length, 0);
|
|
150
|
+
if (claudeResidentChars > budgets.maxClaudeResidentRulesChars) {
|
|
151
|
+
fail(
|
|
152
|
+
`Claude resident rules exceed budget (${claudeResidentChars} > ${budgets.maxClaudeResidentRulesChars} chars)`,
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (exists("harness/manifest.json")) {
|
|
157
|
+
let manifest;
|
|
158
|
+
try {
|
|
159
|
+
manifest = JSON.parse(read("harness/manifest.json"));
|
|
160
|
+
} catch {
|
|
161
|
+
manifest = null;
|
|
162
|
+
}
|
|
163
|
+
if (Array.isArray(manifest?.skills)) {
|
|
164
|
+
let implicitChars = 0;
|
|
165
|
+
for (const skill of manifest.skills) {
|
|
166
|
+
if (skill?.invocation !== "implicit" || !skill?.path || !exists(skill.path)) continue;
|
|
167
|
+
try {
|
|
168
|
+
const fm = parseFrontmatter(read(skill.path));
|
|
169
|
+
implicitChars += String(skill.name || "").length + String(fm?.description || "").trim().length;
|
|
170
|
+
} catch {
|
|
171
|
+
// Invalid YAML is reported by skill-manifest-checks.
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (implicitChars > budgets.maxImplicitSkillMetadataChars) {
|
|
175
|
+
fail(
|
|
176
|
+
`Implicit skill metadata exceeds budget (${implicitChars} > ${budgets.maxImplicitSkillMetadataChars} chars)`,
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (root) {
|
|
183
|
+
const plan = planResolver(root);
|
|
184
|
+
if (plan.exposedSkills.length > budgets.maxAntigravitySkills) {
|
|
185
|
+
fail(
|
|
186
|
+
`Antigravity exposed skills exceed budget (${plan.exposedSkills.length} > ${budgets.maxAntigravitySkills})`,
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
const agMetadataChars = plan.exposedSkills.reduce(
|
|
190
|
+
(sum, skill) => sum + skill.name.length + skill.description.length,
|
|
191
|
+
0,
|
|
192
|
+
);
|
|
193
|
+
if (agMetadataChars > budgets.maxAntigravitySkillMetadataChars) {
|
|
194
|
+
fail(
|
|
195
|
+
`Antigravity skill metadata exceeds budget (` +
|
|
196
|
+
`${agMetadataChars} > ${budgets.maxAntigravitySkillMetadataChars} chars)`,
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
113
202
|
function runWorkflowChecks(context) {
|
|
114
203
|
checkRouterBudget(context);
|
|
115
204
|
checkTopLevelRules(context);
|
|
116
205
|
checkMergedSkillReferences(context);
|
|
117
206
|
checkRetiredReferences(context);
|
|
118
207
|
checkVisualCompanionSecurity(context);
|
|
208
|
+
checkResidentContextBudget(context);
|
|
119
209
|
}
|
|
120
210
|
|
|
121
|
-
module.exports = { runWorkflowChecks };
|
|
211
|
+
module.exports = { runWorkflowChecks, checkResidentContextBudget, RESIDENT_CONTEXT_BUDGETS };
|
|
@@ -14,7 +14,7 @@ description: "建立或维护项目验收与 Playwright E2E,执行真实流程
|
|
|
14
14
|
## 项目验收与 E2E 能力
|
|
15
15
|
|
|
16
16
|
- **建立 / 维护验收能力**:读取 [项目验收能力](references/project-verification.md),复用目标项目的驱动与测试入口,生成或更新项目本地操作说明和功能地图,并实际跑通。
|
|
17
|
-
- **可重跑 E2E / Playwright**:需要新增、维护可在 CI 重跑的浏览器测试,或在根因确认后修复不稳定用例时,读取 [可重跑 E2E 测试](references/e2e-testing.md)(按需再读 [playwright-patterns.md](references/playwright-patterns.md)
|
|
17
|
+
- **可重跑 E2E / Playwright**:需要新增、维护可在 CI 重跑的浏览器测试,或在根因确认后修复不稳定用例时,读取 [可重跑 E2E 测试](references/e2e-testing.md)(按需再读 [playwright-patterns.md](references/playwright-patterns.md))。
|
|
18
18
|
- **执行验收**:先查项目指令指定的验收入口和功能地图,复用已验证命令,按本次改动选择受影响用例;没有地图时仍可完成一次性验收,不强制脚手架。工具失效时保留失败证据;只在授权范围内修复,不通过删用例或改成功标准取得通过。
|
|
19
19
|
|
|
20
20
|
CEW 维护通用方法;平台命令、选择器、账号前置条件和功能地图由目标项目维护。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: spec-gate
|
|
3
|
-
description: Create and self-review a formal Spec for explicit or costly-to-reverse work; wait for approval.
|
|
3
|
+
description: Create and self-review a formal Spec (/to-spec) for explicit or costly-to-reverse work; wait for approval.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Spec Gate
|
|
@@ -13,6 +13,7 @@ description: Route engineering delivery and explicitly requested engineering wor
|
|
|
13
13
|
- 选最短适用路径,只读当前阶段需要的 Skill,不预加载整条链路;简短说明选择后即执行。
|
|
14
14
|
- 显式请求某一专职能力(如 `grilling`、`feature-acceptance`、`handoff`、`triage`、`prototype`、`improve-codebase-architecture`、`resolving-merge-conflicts`、`test-driven-development`、`code-review`)时,宿主按各 Skill 的 `description` 直接匹配,不再逐条在路由表重复列出。
|
|
15
15
|
- 复杂度本身不触发额外门禁;`handoff`、`triage`、`improve-codebase-architecture` 仅在用户明确请求时使用。
|
|
16
|
+
- 需要多份规则或引用时同一轮并发读取,避免分轮串行拉长冷启动;低风险极小改动(1–2 文件、明确验收且无高风险边界)可直接按 `rules/01-base.md` 与 `rules/common/testing.md` 实施,仍须完成独立审查与验证。
|
|
16
17
|
|
|
17
18
|
## 三条交付通道
|
|
18
19
|
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: database-reviewer
|
|
3
|
-
description: PostgreSQL 数据库专家,专注于查询优化、模式设计、安全性和性能。在编写 SQL、创建迁移、设计模式或排查数据库性能问题时主动使用。融合了 Supabase 最佳实践。
|
|
4
|
-
tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"]
|
|
5
|
-
model: opus
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Database Reviewer
|
|
9
|
-
|
|
10
|
-
你是一位 PostgreSQL 数据库审查专家,目标是发现查询性能、模式设计、安全、并发和数据完整性风险。
|
|
11
|
-
|
|
12
|
-
## 使用边界
|
|
13
|
-
|
|
14
|
-
- 默认以只读审查为主,先返回发现和证据。
|
|
15
|
-
- 只有用户明确要求修复时,才建议或执行迁移、索引或 SQL 改动。
|
|
16
|
-
- 不读取生产凭据,不直接连接生产数据库,除非用户明确授权并提供安全环境。
|
|
17
|
-
|
|
18
|
-
## 审查流程
|
|
19
|
-
|
|
20
|
-
1. 确认变更范围:迁移、SQL、Repository、ORM 查询、RLS、索引或连接配置。
|
|
21
|
-
2. 查询性能:检查 WHERE/JOIN 列索引、N+1、分页、排序、全表扫描和 EXPLAIN 需求。
|
|
22
|
-
3. 模式设计:检查数据类型、主外键、NOT NULL、CHECK、时间戳、金额和命名。
|
|
23
|
-
4. 安全与权限:检查 RLS、最小权限、租户隔离、PII 和日志暴露。
|
|
24
|
-
5. 并发与事务:检查锁、竞态、幂等、死锁和原子性。
|
|
25
|
-
6. 输出阻塞问题、证据位置、建议 SQL 或验证命令。
|
|
26
|
-
|
|
27
|
-
## 输出格式
|
|
28
|
-
|
|
29
|
-
```markdown
|
|
30
|
-
# 数据库审查报告
|
|
31
|
-
|
|
32
|
-
## 阻塞问题
|
|
33
|
-
- [严重性] `file:line`:[问题、影响、修复建议]
|
|
34
|
-
|
|
35
|
-
## 建议改进
|
|
36
|
-
- [建议、收益、风险]
|
|
37
|
-
|
|
38
|
-
## 需要验证
|
|
39
|
-
- [EXPLAIN / 测试 / 迁移回滚检查]
|
|
40
|
-
|
|
41
|
-
```
|
package/agents/e2e-runner.md
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: e2e-runner
|
|
3
|
-
description: 端到端测试专家,负责发现项目现有测试入口,优先使用 Playwright 创建、维护和运行可重复的 E2E 自动化测试;Agent Browser 或 MCP 仅作为可选探索和调试辅助。输出执行命令、测试结果、失败原因和产物路径。
|
|
4
|
-
tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"]
|
|
5
|
-
model: sonnet
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# E2E 测试运行器
|
|
9
|
-
|
|
10
|
-
负责把用户指定的关键流程落实为可复跑、可审阅的 Playwright 测试。开始前读取 `skills/feature-acceptance/references/e2e-testing.md`;需要 POM、配置、flaky 或制品示例时,再读取 `skills/feature-acceptance/references/playwright-patterns.md`。
|
|
11
|
-
|
|
12
|
-
## 边界
|
|
13
|
-
|
|
14
|
-
- 优先项目已有脚本、依赖和 CLI;Agent Browser/MCP 只做探索,不替代最终测试。
|
|
15
|
-
- 只修改本次 E2E 范围内的测试、配置和必要脚本,不顺手重构产品代码。
|
|
16
|
-
- 失败时先读取 CLI、trace、截图、视频和 HTML 报告,再判断测试、产品或环境根因。
|
|
17
|
-
- 可复跑测试用 Playwright CLI;需要登录态的交互式查看由主会话用 chrome-devtools MCP(`--autoConnect`)完成,不新开浏览器。
|
|
18
|
-
|
|
19
|
-
## 回传
|
|
20
|
-
|
|
21
|
-
返回关键旅程、修改文件、实际命令、通过/失败结果、失败原因和制品路径;未运行的检查及剩余风险必须明确说明。
|