claude-everything-workflow 0.2.12 → 0.2.13

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-everything-workflow",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "description": "Evidence-based engineering workflows: implement, debug, review and verify.",
5
5
  "author": { "name": "xu91102" },
6
6
  "homepage": "https://github.com/xu91102/claude-everything-Workflow",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-everything-workflow",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "description": "Evidence-based engineering workflows: implement, debug, review and verify.",
5
5
  "author": { "name": "xu91102" },
6
6
  "homepage": "https://github.com/xu91102/claude-everything-Workflow",
package/README.md CHANGED
@@ -69,7 +69,7 @@ The CLI selects the shell or PowerShell installer for your platform. The same `-
69
69
  | --- | --- | --- |
70
70
  | Claude Code | `~/.claude/` | Shared workflow files, `CLAUDE.md` bootstrap, rules, and merged hook settings. |
71
71
  | Codex | `~/.codex/` | Shared workflow files and `AGENTS.md`; Claude Code hooks are not automatically enabled. |
72
- | Antigravity (Gemini) | `~/.gemini/config/plugins/claude-everything-workflow/` | Native plugin (`plugin.json`, `hooks.json` & `hooks/`, `rules/AGENTS.md`, on-demand `references/rules/`, converted `skills/` and `agents/`, `scripts/learning/`). |
72
+ | Antigravity (Gemini) | `~/.gemini/config/plugins/claude-everything-workflow/` | Native plugin (`plugin.json`, `hooks.json` & `hooks/`, `rules/AGENTS.md`, on-demand `references/rules/`, converted `skills/`, `scripts/learning/`). |
73
73
 
74
74
  Installation updates user-level files and can affect multiple projects. Changed top-level configuration files are backed up; matching files inside shared directories are synchronized from the repository. Unknown files are generally retained, while known retired files are removed by an explicit cleanup list. Back up any personal edits to shared files before upgrading. Use the installer instead of copying the entire `rules/` directory: it handles the different rule locations used by each host.
75
75
 
@@ -144,7 +144,6 @@ claude-everything-Workflow/
144
144
  ├── skills/ # Task-specific workflows
145
145
  ├── rules/ # Project and specialist rules
146
146
  ├── commands/ # Command entry points
147
- ├── agents/ # Specialized agent definitions
148
147
  ├── hooks/ # Hook implementations
149
148
  ├── scripts/ # Installers and validators
150
149
  ├── references/ # Detailed guides and supporting material
package/README.zh-CN.md CHANGED
@@ -69,7 +69,7 @@ node bin/claude-everything-workflow.js install
69
69
  | --- | --- | --- |
70
70
  | Claude Code | `~/.claude/` | 共享工作流文件、`CLAUDE.md` 入口、规则,以及合并后的 hooks 配置。 |
71
71
  | Codex | `~/.codex/` | 共享工作流文件和 `AGENTS.md`;不会自动启用 Claude Code hooks。 |
72
- | Antigravity (Gemini) | `~/.gemini/config/plugins/claude-everything-workflow/` | 原生插件(`plugin.json`、`hooks.json` 与 `hooks/`、`rules/AGENTS.md`、按需加载的 `references/rules/`、转换后的 `skills/` 与 `agents/`、`scripts/learning/`)。 |
72
+ | Antigravity (Gemini) | `~/.gemini/config/plugins/claude-everything-workflow/` | 原生插件(`plugin.json`、`hooks.json` 与 `hooks/`、`rules/AGENTS.md`、按需加载的 `references/rules/`、转换后的 `skills/`、`scripts/learning/`)。 |
73
73
 
74
74
  安装修改的是用户级目录,可能影响多个项目。顶层配置内容不同时会先备份;共享目录中的同名文件按仓库版本同步。未知文件通常保留,已登记的退役文件按明确清单清理。升级前请备份对共享文件的个人修改。不要直接复制整个 `rules/` 目录,安装器会处理不同宿主各自的规则加载位置。
75
75
 
@@ -144,7 +144,6 @@ claude-everything-Workflow/
144
144
  ├── skills/ # 任务工作流
145
145
  ├── rules/ # 项目及专项规则
146
146
  ├── commands/ # 命令入口
147
- ├── agents/ # 专业代理定义
148
147
  ├── hooks/ # Hook 实现
149
148
  ├── scripts/ # 安装与校验脚本
150
149
  ├── references/ # 详细指南及参考材料
package/docs/plugins.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # 插件安装与更新
2
2
 
3
- CEW 提供 Claude Code 和 Codex 两种插件清单,复用仓库现有 `skills/`、`commands/`、`agents/`、规则及脚本,不维护另一套工作流副本。npm 安装方式继续保留。
3
+ CEW 提供 Claude Code 和 Codex 两种插件清单,复用仓库现有 `skills/`、`commands/`、规则及脚本,不维护另一套工作流副本。npm 安装方式继续保留。
4
4
 
5
5
  下列 GitHub 安装命令需要本次插件文件已经合并并推送到远端;本地开发可先按本文末尾验证。
6
6
 
@@ -69,7 +69,6 @@ npx claude-everything-workflow install --antigravity-only
69
69
  - `hooks.json` & `hooks/`:注册 Antigravity 原生 `PreToolUse`(`run_command`)提交密钥与质量拦截钩子,沿用 `ECC_HOOK_PROFILE`、`ECC_DISABLED_HOOKS` 控制;不自动启用 Claude Code 专用编辑/观察 hooks。
70
70
  - `rules/AGENTS.md`:唯一的常驻入口规则,指引按需读取 `references/rules/` 下的基础规则与 `common/` 专项规则。
71
71
  - `skills/`:同步全部工作流技能,并把非重复命令(`pr`、`verify`、`to-spec`、`learn`)转换为原生技能,同时把内部 `commands/` 引用改写为插件内技能路径;自动清理已退役技能。
72
- - `agents/`:转换工具名称与插件内引用路径为 Antigravity 原生子代理格式。
73
72
  - `references/rules/02-implementation.md`:采用与 Codex 相同的 Git 三方合并机制,升级时保留个人修改。
74
73
 
75
74
  若本机存在旧版 `~/.gemini/AGENTS.md`,安装器不会自动删除,仅在输出中提示手动确认。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-everything-workflow",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "description": "Claude Code, Codex, and Antigravity harness with rules, skills, agents, hooks, and verification gates.",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -46,7 +46,6 @@
46
46
  "docs/plugins.md",
47
47
  "evals/",
48
48
  "settings.json",
49
- "agents/",
50
49
  "bin/",
51
50
  "commands/",
52
51
  "hooks/",
@@ -25,6 +25,20 @@ function isSafeRelative(value) {
25
25
  );
26
26
  }
27
27
 
28
+ function validateHashMap(rawMap, label, isValidKey) {
29
+ const entries = rawMap === undefined ? {} : rawMap;
30
+ if (!entries || typeof entries !== "object" || Array.isArray(entries)) {
31
+ throw new Error(`Invalid retired ${label} manifest`);
32
+ }
33
+ for (const [key, hashes] of Object.entries(entries)) {
34
+ if (!isValidKey(key) || !Array.isArray(hashes) || hashes.length === 0 ||
35
+ !hashes.every((hash) => typeof hash === "string" && /^[a-f0-9]{64}$/.test(hash))) {
36
+ throw new Error(`Invalid retired ${label} entry: ${key}`);
37
+ }
38
+ }
39
+ return Object.entries(entries);
40
+ }
41
+
28
42
  function validateManifest(manifest) {
29
43
  if (
30
44
  !manifest ||
@@ -46,15 +60,17 @@ function validateManifest(manifest) {
46
60
  throw new Error(`Invalid retired skill entry: ${skill}`);
47
61
  }
48
62
  }
49
- const agents = manifest.retired_agent_hashes === undefined ? {} : manifest.retired_agent_hashes;
50
- if (!agents || typeof agents !== "object" || Array.isArray(agents)) throw new Error("Invalid retired agent manifest");
51
- for (const [name, hashes] of Object.entries(agents)) {
52
- if (!/^[a-z0-9-]+\.md$/.test(name) || !Array.isArray(hashes) || hashes.length === 0 ||
53
- !hashes.every((hash) => typeof hash === "string" && /^[a-f0-9]{64}$/.test(hash))) {
54
- throw new Error(`Invalid retired agent entry: ${name}`);
55
- }
56
- }
57
- return { skills: entries, agents: Object.entries(agents) };
63
+ const agents = validateHashMap(
64
+ manifest.retired_agent_hashes,
65
+ "agent",
66
+ (name) => /^[a-z0-9-]+\.md$/.test(name),
67
+ );
68
+ const references = validateHashMap(
69
+ manifest.retired_reference_hashes,
70
+ "reference",
71
+ (relative) => isSafeRelative(relative) && relative.endsWith(".md"),
72
+ );
73
+ return { skills: entries, agents, references };
58
74
  }
59
75
 
60
76
  function lstatIfExists(target) {
@@ -177,27 +193,40 @@ function cleanupSkill({ installRoot, skill, knownFiles, dryRun }) {
177
193
  }
178
194
  }
179
195
 
180
- function cleanupRetiredAgents(installRoot, agents, dryRun) {
181
- const directory = path.join(installRoot, "agents");
182
- if (lstatIfExists(installRoot)?.isSymbolicLink() || !lstatIfExists(directory)?.isDirectory()) return;
183
- for (const [name, hashes] of agents) {
184
- const target = path.join(directory, name);
196
+ function cleanupHashedFiles({ installRoot, subDir, entries, label, removeEmptyParents, dryRun }) {
197
+ const rootDir = path.join(installRoot, subDir);
198
+ if (lstatIfExists(installRoot)?.isSymbolicLink()) return;
199
+ const dirStat = lstatIfExists(rootDir);
200
+ if (!dirStat) return;
201
+ if (dirStat.isSymbolicLink() || !dirStat.isDirectory()) return;
202
+
203
+ const directories = new Set();
204
+ for (const [relative, hashes] of entries) {
205
+ const target = path.join(rootDir, relative);
206
+ if (removeEmptyParents) collectKnownDirectories(rootDir, relative, directories);
207
+ if (hasSymlinkParent(rootDir, target)) {
208
+ writeLine(`Preserving retired ${label} through symlink: ${target}`);
209
+ continue;
210
+ }
185
211
  const stat = lstatIfExists(target);
186
212
  if (!stat) continue;
187
213
  if (stat.isSymbolicLink()) {
188
- writeLine(`Preserving symlinked retired agent: ${target}`);
214
+ writeLine(`Preserving symlinked retired ${label}: ${target}`);
189
215
  continue;
190
216
  }
191
217
  if (!stat.isFile()) continue;
192
- // SHA-256 of LF text, including the distinct files generated for Antigravity.
218
+ // SHA-256 of LF text, including host-transformed copies generated for Antigravity.
193
219
  const text = fs.readFileSync(target, "utf8").replace(/\r\n/g, "\n");
194
220
  if (!hashes.includes(createHash("sha256").update(text).digest("hex"))) {
195
- writeLine(`Preserving customized retired agent: ${target}`);
221
+ writeLine(`Preserving customized retired ${label}: ${target}`);
196
222
  continue;
197
223
  }
198
- writeLine(`${dryRun ? "[dry-run] " : ""}Remove retired agent: ${target}`);
224
+ writeLine(`${dryRun ? "[dry-run] " : ""}Remove retired ${label}: ${target}`);
199
225
  if (!dryRun) fs.rmSync(target, { force: true });
200
226
  }
227
+ if (!dryRun && removeEmptyParents) {
228
+ removeEmptyKnownDirectories(directories);
229
+ }
201
230
  }
202
231
 
203
232
  function main(argv = process.argv.slice(2)) {
@@ -220,7 +249,22 @@ function main(argv = process.argv.slice(2)) {
220
249
  if (validateOnly) return 0;
221
250
 
222
251
  const installRoot = path.resolve(positional[0]);
223
- cleanupRetiredAgents(installRoot, retired.agents, dryRun);
252
+ cleanupHashedFiles({
253
+ installRoot,
254
+ subDir: "agents",
255
+ entries: retired.agents,
256
+ label: "agent",
257
+ removeEmptyParents: false,
258
+ dryRun,
259
+ });
260
+ cleanupHashedFiles({
261
+ installRoot,
262
+ subDir: "references",
263
+ entries: retired.references,
264
+ label: "reference",
265
+ removeEmptyParents: true,
266
+ dryRun,
267
+ });
224
268
  const skillsRoot = path.join(installRoot, "skills");
225
269
  const skillsRootStat = lstatIfExists(skillsRoot);
226
270
  if (skillsRootStat?.isSymbolicLink()) {
@@ -19,27 +19,6 @@ const PLUGIN_NAME = "claude-everything-workflow";
19
19
  const PLUGIN_SUBPATH = path.posix.join(".gemini/config/plugins", PLUGIN_NAME);
20
20
  const PLUGIN_HOME_REF = `~/.gemini/config/plugins/${PLUGIN_NAME}`;
21
21
 
22
- const DEFAULT_ANTIGRAVITY_TOOLS = [
23
- "read_file",
24
- "edit_file",
25
- "write_file",
26
- "run_command",
27
- "manage_task",
28
- "search_web",
29
- ];
30
-
31
- const TOOL_MAP = {
32
- Read: ["read_file"],
33
- Glob: ["read_file"],
34
- Grep: ["read_file"],
35
- Edit: ["edit_file"],
36
- MultiEdit: ["edit_file"],
37
- Write: ["write_file"],
38
- Bash: ["run_command", "manage_task"],
39
- WebSearch: ["search_web"],
40
- WebFetch: ["search_web"],
41
- };
42
-
43
22
  function lstatIfExists(target) {
44
23
  try {
45
24
  return fs.lstatSync(target);
@@ -168,30 +147,6 @@ function parseFrontmatter(text) {
168
147
  return { data, body: match[2] };
169
148
  }
170
149
 
171
- function mapTools(rawTools, agentFile = "agent") {
172
- if (rawTools === undefined) {
173
- return [...DEFAULT_ANTIGRAVITY_TOOLS];
174
- }
175
- if (!Array.isArray(rawTools)) {
176
- throw new Error(`agents/${agentFile} declares invalid tools field`);
177
- }
178
- const mapped = [];
179
- const seen = new Set();
180
- for (const tool of rawTools) {
181
- const targets = TOOL_MAP[tool] || (DEFAULT_ANTIGRAVITY_TOOLS.includes(tool) ? [tool] : []);
182
- for (const target of targets) {
183
- if (!seen.has(target)) {
184
- seen.add(target);
185
- mapped.push(target);
186
- }
187
- }
188
- }
189
- if (mapped.length === 0) {
190
- throw new Error(`agents/${agentFile} declares no supported Antigravity tools`);
191
- }
192
- return mapped;
193
- }
194
-
195
150
  function normalizeRepoUrl(repo) {
196
151
  const raw = typeof repo === "string" ? repo : repo?.url;
197
152
  if (typeof raw !== "string" || !raw.trim()) {
@@ -322,43 +277,6 @@ function buildCommandSkills(sourceRoot) {
322
277
  return generated;
323
278
  }
324
279
 
325
- function buildAgentFiles(sourceRoot) {
326
- const agentsDir = path.join(sourceRoot, "agents");
327
- if (!fs.existsSync(agentsDir)) return [];
328
- const generated = [];
329
- for (const entry of fs.readdirSync(agentsDir, { withFileTypes: true })) {
330
- if (!entry.isFile() || !entry.name.endsWith(".md")) continue;
331
- const raw = fs.readFileSync(path.join(agentsDir, entry.name), "utf8");
332
- const { data, body } = parseFrontmatter(raw);
333
- if (
334
- !data ||
335
- typeof data.name !== "string" ||
336
- !data.name.trim() ||
337
- typeof data.description !== "string" ||
338
- !data.description.trim()
339
- ) {
340
- throw new Error(`agents/${entry.name} missing name or description`);
341
- }
342
- const tools = mapTools(data.tools, entry.name);
343
- const updatedBody = body
344
- .replace(/`(skills\/[^`\s]+)`/g, (_, target) => `\`${PLUGIN_HOME_REF}/${target}\``)
345
- .replace(/`(references\/agents\/[^`\s]+)`/g, (_, target) => `\`${PLUGIN_HOME_REF}/${target}\``)
346
- .replace(/^\n+/, "");
347
- const frontmatter = [
348
- `name: ${data.name}`,
349
- `description: ${JSON.stringify(data.description)}`,
350
- "subagent: true",
351
- "mainAgent: false",
352
- `tools: [${tools.join(", ")}]`,
353
- ].join("\n");
354
- generated.push({
355
- relative: path.posix.join("agents", entry.name),
356
- content: `---\n${frontmatter}\n---\n\n${updatedBody}`,
357
- });
358
- }
359
- return generated;
360
- }
361
-
362
280
  function runRetiredSkillCleanup(sourceRoot, pluginRoot, dryRun, log) {
363
281
  const script = path.join(sourceRoot, "scripts/cleanup-retired-skills.js");
364
282
  const args = [script, pluginRoot];
@@ -401,7 +319,6 @@ function installAntigravity({
401
319
  return { srcPath, relPath, mode: fs.statSync(srcPath).mode & 0o777 };
402
320
  });
403
321
  const commandSkills = buildCommandSkills(sourceRoot);
404
- const agentFiles = buildAgentFiles(sourceRoot);
405
322
 
406
323
  const managedPaths = [
407
324
  BACKUP_ROOT_NAME,
@@ -414,7 +331,6 @@ function installAntigravity({
414
331
  ...learningFiles.map((item) => item.relPath),
415
332
  ...hookFiles.map((item) => item.relPath),
416
333
  ...commandSkills.map((item) => item.relative),
417
- ...agentFiles.map((item) => item.relative),
418
334
  ];
419
335
 
420
336
  // Validate every target before the first write; checkedPath refuses symlinks.
@@ -474,7 +390,7 @@ function installAntigravity({
474
390
  log,
475
391
  });
476
392
  }
477
- for (const item of [...commandSkills, ...agentFiles]) {
393
+ for (const item of commandSkills) {
478
394
  writeManagedFile({
479
395
  pluginRoot,
480
396
  relative: item.relative,
@@ -505,7 +421,7 @@ function installAntigravity({
505
421
  return pluginRoot;
506
422
  }
507
423
 
508
- module.exports = { PLUGIN_SUBPATH, installAntigravity, parseFrontmatter, mapTools };
424
+ module.exports = { PLUGIN_SUBPATH, installAntigravity, parseFrontmatter };
509
425
 
510
426
  function parseCli(argv) {
511
427
  let dryRun = false;
@@ -161,7 +161,6 @@ function Install-SharedDirs {
161
161
  param([string]$Destination)
162
162
 
163
163
  $dirs = @(
164
- "agents",
165
164
  "commands",
166
165
  "scripts",
167
166
  "hooks",
@@ -161,7 +161,6 @@ require_rsync() {
161
161
  install_shared_dirs() {
162
162
  local dest="$1"
163
163
 
164
- copy_dir agents "$dest"
165
164
  copy_dir commands "$dest"
166
165
  copy_dir scripts "$dest"
167
166
  copy_dir hooks "$dest"
@@ -10,6 +10,44 @@
10
10
  "ec8b8873829b7dcd07b4bcac2ea9538b24b6417ce23b4a55da41646928a2bfd8",
11
11
  "b83d828efde126a994efafc850cbb628999086383b5ceb8da207ab405680dcc9",
12
12
  "63f8d6dfbd74b09548761d1e99d805850543769a664c9345293264862d062ebf"
13
+ ],
14
+ "database-reviewer.md": [
15
+ "d5d642043654ade78b46a8045532b061e60abfff6b99fc68f8a5249a4e7f9760",
16
+ "5cb705296352174e8b47f8faff78db5fa42dd5e26ba3dc9a9127b08b766acc1b",
17
+ "590242b164f1ce0f0239472a08a2929b4e41e76f9e27cf02ff1d74818c2516a6",
18
+ "85ab06973161d8942f161157b4b90e92a017680bd733c26707e04baad11e0495"
19
+ ],
20
+ "e2e-runner.md": [
21
+ "bb2cbb65f82bf341bb139b95ecf0e6f641647f46947b660481b7f136160c70f9",
22
+ "70b8eb356597cec3a58050af69b6e417a0297fb35e6e4d07e4031123d700fedf",
23
+ "ea1373d5fd2745a5f4d1588e8fc27a1b5a8f34d3934c6ef456e7af6fe8cdce1b",
24
+ "ed47fd8a1638238b4740ec6d9761d04eb517fa5663dabbe28e2df0849a9d5784",
25
+ "765e6dc9d704afe7664a0a61e3a86282ee594480d6919a3c06b2ea559187cbb6",
26
+ "0aab882777d4fbd1bf9a514ba440912b83a1cfc37d62297296ac322b9e896322",
27
+ "89813024c93cb28948656b066609eb42b4d024e96a8aeb5cbc320913c1e75123",
28
+ "025fa4fe21af385f6b43143c0d75708ebbd0e5b00d66dd530834b3071350a01a"
29
+ ],
30
+ "refactor-cleaner.md": [
31
+ "86d77420df109c27875812637e3be0e8913d8e1969dbfd261b1d4fad7263c53b",
32
+ "e9b3d45345d16f1caf08642c5b1f40a5e1dced376b52310f086072d36e150075",
33
+ "2c90b7e0b41ac871c619e568f857487b79079638da005d14dab91892253efcc4"
34
+ ],
35
+ "security-reviewer.md": [
36
+ "320e690a150ac98a9d5d52c998f025d8142f3227de3790e7abd8667e423ad37c",
37
+ "32cd0510aeb4d9d2e29d5d2ccf6a8bbcd801c33ef0642044df414ba17798b4de",
38
+ "c8d43f964eb647e9d316938525b28ca4758258dcf367655deb231deeb0833fc5"
39
+ ]
40
+ },
41
+ "retired_reference_hashes": {
42
+ "agents/database-reviewer.md": [
43
+ "e4c77775c784a06633cee6ead625c3dddbf76f8f45254eb8e8f9211573c40972",
44
+ "c097dd5a3a31d4123a31288c2db2f0c089b70948e8a68b21aca209ec81bada61"
45
+ ],
46
+ "agents/refactor-cleaner.md": [
47
+ "2c00d71fdccfe7f574cb62bf1387b990d5898d8f386e36467977861672043929"
48
+ ],
49
+ "agents/security-reviewer.md": [
50
+ "9234af3500eb826a99e3ba25eff559d721869b475eb43ebe08a4082b8152a9f1"
13
51
  ]
14
52
  },
15
53
  "retired_skills": {
@@ -10,7 +10,6 @@ const MANAGED_ROOTS = [
10
10
  "CLAUDE.md",
11
11
  "settings.json",
12
12
  "commands",
13
- "agents",
14
13
  "skills",
15
14
  "hooks",
16
15
  "scripts",
@@ -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, mapTools } = require("../install-antigravity");
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() {
@@ -631,23 +671,16 @@ function checkInstallerEntrypoint() {
631
671
  }
632
672
  assert.doesNotMatch(read(path.join(agRoot, "skills/pr/SKILL.md")), /\$ARGUMENTS/);
633
673
  assert.doesNotMatch(read(path.join(agRoot, "skills/learn/SKILL.md")), /\$ARGUMENTS/);
634
- const agAgents = fs.readdirSync(path.join(agRoot, "agents")).sort();
635
- const expectedAgents = ["database-reviewer.md", "e2e-runner.md", "refactor-cleaner.md", "security-reviewer.md"];
636
- assert.deepEqual(agAgents, expectedAgents);
674
+ assert.equal(fs.existsSync(path.join(agRoot, "agents")), false,
675
+ "Antigravity plugin must not install retired agents directory");
676
+ assert.equal(fs.existsSync(path.join(agRoot, "references/agents")), false,
677
+ "Antigravity plugin must not install retired references/agents directory");
637
678
  for (const host of [".claude", ".codex"]) {
638
- assert.deepEqual(fs.readdirSync(path.join(profile, host, "agents")).sort(), expectedAgents);
639
- }
640
- for (const agentFile of agAgents) {
641
- const body = read(path.join(agRoot, "agents", agentFile));
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);
679
+ assert.equal(fs.existsSync(path.join(profile, host, "agents")), false,
680
+ `${host} installer must not install retired agents directory`);
681
+ assert.equal(fs.existsSync(path.join(profile, host, "references/agents")), false,
682
+ `${host} installer must not install retired references/agents directory`);
646
683
  }
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
684
  assert.equal(fs.existsSync(path.join(agRoot, "scripts/learning/projects.js")), true);
652
685
  assert.equal(fs.existsSync(path.join(agRoot, "harness/manifest.json")), true);
653
686
  assert.equal(fs.existsSync(path.join(agRoot, "scripts/install-antigravity.js")), false);
@@ -884,13 +917,9 @@ function checkAntigravityEdgeCases() {
884
917
  const linkedPlugin = installAntigravity({ sourceRoot, homeDir: linkedHome, log: () => {} });
885
918
  assert.equal(fs.existsSync(path.join(linkedPlugin, "plugin.json")), true);
886
919
 
887
- // 4. Zero-indent YAML lists parse cleanly; invalid/unmapped explicit tools throw instead of fail-open.
920
+ // 4. Zero-indent YAML lists parse cleanly.
888
921
  const parsedList = parseFrontmatter("---\nname: demo\ntools:\n- Read\n- Grep\n---\n\nBody\n");
889
922
  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
923
 
895
924
  // 5. Reject "." as --backup-id in both CLI entrypoints.
896
925
  for (const script of ["scripts/install-rules.js", "scripts/install-antigravity.js"]) {
@@ -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 publishesHomunculus = packageFiles.some((file) => {
773
- const normalized = file.replace(/\\/g, "/").replace(/^\.\//, "");
774
- return normalized === "homunculus" || normalized.startsWith("homunculus/");
775
- });
776
- if (publishesHomunculus) {
777
- fail("package.json should not publish removed homunculus directory");
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(
@@ -30,6 +30,12 @@ const RETIRED_RULE_PATHS = [
30
30
  ];
31
31
  const RETIRED_AGENT_PATHS = [
32
32
  "agents/harness-optimizer.md",
33
+ "agents/database-reviewer.md",
34
+ "agents/e2e-runner.md",
35
+ "agents/refactor-cleaner.md",
36
+ "agents/security-reviewer.md",
37
+ "references/agents/refactor-cleaner.md",
38
+ "references/agents/security-reviewer.md",
33
39
  ];
34
40
 
35
41
  function checkRouterBudget({ exists, read, fail }) {
@@ -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)),必要时委派 `agents/e2e-runner.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,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
- ```