claude-everything-workflow 0.2.9 → 0.2.11
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 +11 -5
- package/README.zh-CN.md +12 -6
- package/bin/claude-everything-workflow.js +16 -4
- package/commands/code-review.md +4 -4
- package/docs/plugins.md +20 -2
- package/evals/routing-scenarios.json +8 -9
- package/package.json +1 -1
- package/scripts/eval-scenarios.js +49 -15
- package/scripts/install-antigravity.js +501 -0
- package/scripts/install-rules.js +186 -32
- package/scripts/install.ps1 +75 -4
- package/scripts/install.sh +72 -20
- package/scripts/legacy-common-rule-hashes.json +2 -1
- package/scripts/verify/install-rules.test.js +367 -7
- package/scripts/verify/metadata-checks.js +23 -0
- package/scripts/verify/scenario-checks.test.js +52 -10
- package/skills/README.md +1 -1
- package/skills/code-review/SKILL.md +15 -21
- package/skills/feature-acceptance/SKILL.md +1 -1
- package/skills/implement/SKILL.md +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-everything-workflow",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
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.
|
|
3
|
+
"version": "0.2.11",
|
|
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/AGENTS.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
## 规则加载策略
|
|
19
19
|
|
|
20
20
|
- 规则按需读取,不要默认全量加载 `rules/` 或 `rules/common/`。
|
|
21
|
-
- `rules/...` 先查项目根 `rules/`;不存在时,Codex 回退 `~/.codex/rules/`,Claude Code 顶层规则回退 `~/.claude/rules/`,专项 `rules/common/...` 回退 `~/.claude/references/rules/common/...`。升级时保留的个人修改优先于同名分发参考。
|
|
21
|
+
- `rules/...` 先查项目根 `rules/`;不存在时,Antigravity(Gemini)回退 `~/.gemini/config/plugins/claude-everything-workflow/references/rules/`,Codex 回退 `~/.codex/rules/`,Claude Code 顶层规则回退 `~/.claude/rules/`,专项 `rules/common/...` 回退 `~/.claude/references/rules/common/...`。升级时保留的个人修改优先于同名分发参考。
|
|
22
22
|
|
|
23
23
|
## 规则索引
|
|
24
24
|
|
package/README.md
CHANGED
|
@@ -30,24 +30,25 @@ CEW works with your existing projects and model. It does not provide a model or
|
|
|
30
30
|
|
|
31
31
|
### Requirements
|
|
32
32
|
|
|
33
|
-
- Claude Code and/or
|
|
33
|
+
- Claude Code, Codex, and/or Antigravity, already installed and configured.
|
|
34
34
|
- Node.js **18+** and npm/npx.
|
|
35
|
-
- macOS/Linux: Bash and `rsync
|
|
35
|
+
- macOS/Linux: Bash and `rsync` (`rsync` is required for Claude Code / Codex installs). Windows: PowerShell; Git Bash/WSL can use the shell installer if Bash and `rsync` are available.
|
|
36
36
|
|
|
37
37
|
### Install from npm
|
|
38
38
|
|
|
39
|
-
Preview the changes, then install
|
|
39
|
+
Preview the changes, then install (Claude Code + Codex, and auto-syncs Antigravity if `~/.gemini` already exists):
|
|
40
40
|
|
|
41
41
|
```sh
|
|
42
42
|
npx claude-everything-workflow install --dry-run
|
|
43
43
|
npx claude-everything-workflow install
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
To install for only one host:
|
|
46
|
+
To install for only one host (use `--antigravity-only` when installing Antigravity on a machine without `~/.gemini`):
|
|
47
47
|
|
|
48
48
|
```sh
|
|
49
49
|
npx claude-everything-workflow install --claude-only
|
|
50
50
|
npx claude-everything-workflow install --codex-only
|
|
51
|
+
npx claude-everything-workflow install --antigravity-only
|
|
51
52
|
```
|
|
52
53
|
|
|
53
54
|
### Install from source
|
|
@@ -60,7 +61,7 @@ node bin/claude-everything-workflow.js install --dry-run
|
|
|
60
61
|
node bin/claude-everything-workflow.js install
|
|
61
62
|
```
|
|
62
63
|
|
|
63
|
-
The CLI selects the shell or PowerShell installer for your platform. The same `--claude-only
|
|
64
|
+
The CLI selects the shell or PowerShell installer for your platform. The same `--claude-only`, `--codex-only`, and `--antigravity-only` options apply. The npm command uses the published package; the source command uses your checkout.
|
|
64
65
|
|
|
65
66
|
### What changes on your machine
|
|
66
67
|
|
|
@@ -68,9 +69,14 @@ The CLI selects the shell or PowerShell installer for your platform. The same `-
|
|
|
68
69
|
| --- | --- | --- |
|
|
69
70
|
| Claude Code | `~/.claude/` | Shared workflow files, `CLAUDE.md` bootstrap, rules, and merged hook settings. |
|
|
70
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`, `rules/AGENTS.md`, on-demand `references/rules/`, converted `skills/` and `agents/`, `scripts/learning/`). |
|
|
71
73
|
|
|
72
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.
|
|
73
75
|
|
|
76
|
+
The Codex installer preserves edits to `~/.codex/rules/02-implementation.md`, and the Antigravity installer uses the same three-way Git merge mechanism for `~/.gemini/config/plugins/claude-everything-workflow/references/rules/02-implementation.md`. On the first upgrade it records the packaged rule as a baseline. Later upgrades use Git to merge independent changes. If a merge conflicts or Git is unavailable, the personal rule stays active and the installer prints the incoming copy’s location and manual merge instructions.
|
|
77
|
+
|
|
78
|
+
For Antigravity, only `rules/AGENTS.md` stays in the auto-loaded plugin `rules/` folder while all detailed rules live under `references/rules/` for on-demand loading. Default `install` syncs Antigravity only when a non-symlink `~/.gemini` directory already exists; pass `--antigravity-only` to install it explicitly. If a legacy `~/.gemini/AGENTS.md` exists, the installer leaves it untouched and prints a notice so you can review or remove it manually.
|
|
79
|
+
|
|
74
80
|
A fresh Claude Code installation puts CEW’s base, Git and security rules in `~/.claude/rules/`. Other CEW rules are available on demand under `~/.claude/references/rules/`. On upgrade, personally edited copies of the three newly migrated rules stay active. Obsolete rules left by older releases can also still load.
|
|
75
81
|
|
|
76
82
|
### Browser verification (optional)
|
package/README.zh-CN.md
CHANGED
|
@@ -30,24 +30,25 @@ CEW 使用你已有的项目和模型,不提供模型,也不替代 Claude Co
|
|
|
30
30
|
|
|
31
31
|
### 环境要求
|
|
32
32
|
|
|
33
|
-
- 已安装并配置 Claude Code 和/或
|
|
33
|
+
- 已安装并配置 Claude Code、Codex 和/或 Antigravity。
|
|
34
34
|
- Node.js **18+**,以及 npm/npx。
|
|
35
|
-
- macOS/Linux:Bash 和 `rsync
|
|
35
|
+
- macOS/Linux:Bash 和 `rsync`(安装 Claude Code / Codex 时需要 `rsync`)。Windows:PowerShell;Git Bash/WSL 配有 Bash 和 `rsync` 时也可使用 shell 安装器。
|
|
36
36
|
|
|
37
37
|
### 从 npm 安装
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
先预览,再执行安装(默认安装 Claude Code 和 Codex;若本机已存在非软链 `~/.gemini` 会一并自动同步 Antigravity):
|
|
40
40
|
|
|
41
41
|
```sh
|
|
42
42
|
npx claude-everything-workflow install --dry-run
|
|
43
43
|
npx claude-everything-workflow install
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
只安装到其中一个(若本机尚未有 `~/.gemini`,请使用 `--antigravity-only` 显式安装):
|
|
47
47
|
|
|
48
48
|
```sh
|
|
49
49
|
npx claude-everything-workflow install --claude-only
|
|
50
50
|
npx claude-everything-workflow install --codex-only
|
|
51
|
+
npx claude-everything-workflow install --antigravity-only
|
|
51
52
|
```
|
|
52
53
|
|
|
53
54
|
### 从源码安装
|
|
@@ -60,7 +61,7 @@ node bin/claude-everything-workflow.js install --dry-run
|
|
|
60
61
|
node bin/claude-everything-workflow.js install
|
|
61
62
|
```
|
|
62
63
|
|
|
63
|
-
命令行入口会按系统选择 shell 或 PowerShell 安装器,同样支持 `--claude-only` 和 `--
|
|
64
|
+
命令行入口会按系统选择 shell 或 PowerShell 安装器,同样支持 `--claude-only`、`--codex-only` 和 `--antigravity-only`。npm 命令安装已发布版本;源码命令安装当前 checkout 中的内容。
|
|
64
65
|
|
|
65
66
|
### 安装会修改什么
|
|
66
67
|
|
|
@@ -68,8 +69,13 @@ node bin/claude-everything-workflow.js install
|
|
|
68
69
|
| --- | --- | --- |
|
|
69
70
|
| Claude Code | `~/.claude/` | 共享工作流文件、`CLAUDE.md` 入口、规则,以及合并后的 hooks 配置。 |
|
|
70
71
|
| Codex | `~/.codex/` | 共享工作流文件和 `AGENTS.md`;不会自动启用 Claude Code hooks。 |
|
|
72
|
+
| Antigravity (Gemini) | `~/.gemini/config/plugins/claude-everything-workflow/` | 原生插件(`plugin.json`、`rules/AGENTS.md`、按需加载的 `references/rules/`、转换后的 `skills/` 与 `agents/`、`scripts/learning/`)。 |
|
|
71
73
|
|
|
72
|
-
安装修改的是用户级目录,可能影响多个项目。顶层配置内容不同时会先备份;共享目录中的同名文件按仓库版本同步。未知文件通常保留,已登记的退役文件按明确清单清理。升级前请备份对共享文件的个人修改。不要直接复制整个 `rules/`
|
|
74
|
+
安装修改的是用户级目录,可能影响多个项目。顶层配置内容不同时会先备份;共享目录中的同名文件按仓库版本同步。未知文件通常保留,已登记的退役文件按明确清单清理。升级前请备份对共享文件的个人修改。不要直接复制整个 `rules/` 目录,安装器会处理不同宿主各自的规则加载位置。
|
|
75
|
+
|
|
76
|
+
Codex 安装器会保留 `~/.codex/rules/02-implementation.md` 中的个人修改;Antigravity 安装器也对 `~/.gemini/config/plugins/claude-everything-workflow/references/rules/02-implementation.md` 采用相同的 Git 三方合并机制。首次升级会记录本次分发的规则,供后续版本比较。此后上游规则变化时,安装器用 Git 自动合并互不冲突的改动。遇到冲突或 Git 不可用时,个人规则继续生效,安装日志会给出新版规则副本和手动合并方法。
|
|
77
|
+
|
|
78
|
+
Antigravity 插件只把入口 `rules/AGENTS.md` 放入自动加载目录 `rules/`,其余详细规则放在 `references/rules/` 按需读取。默认 `install` 仅在存在非符号链接的 `~/.gemini` 目录时自动同步 Antigravity,不存在则跳过;需要首次显式安装时使用 `--antigravity-only`。若存在旧版 `~/.gemini/AGENTS.md`,安装器不会擅自删除,只打印提示供你手动备份或移除。
|
|
73
79
|
|
|
74
80
|
全新安装时,CEW 将执行原则、Git 和安全规则放入 Claude Code 自动读取的 `~/.claude/rules/`,其余规则从 `~/.claude/references/rules/` 按需读取。升级时,本次迁移的三份规则如有个人修改,仍在原处生效。更早版本遗留的退役规则也可能继续加载。
|
|
75
81
|
|
|
@@ -30,14 +30,24 @@ function main() {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function runInstall(args) {
|
|
33
|
-
const supported = new Set([
|
|
33
|
+
const supported = new Set([
|
|
34
|
+
"--claude-only",
|
|
35
|
+
"--codex-only",
|
|
36
|
+
"--antigravity-only",
|
|
37
|
+
"--dry-run",
|
|
38
|
+
"--help",
|
|
39
|
+
"-h",
|
|
40
|
+
]);
|
|
34
41
|
const unknown = args.find((arg) => !supported.has(arg));
|
|
35
42
|
if (unknown) {
|
|
36
43
|
process.stderr.write(`Unknown option: ${unknown}\n`);
|
|
37
44
|
process.exit(1);
|
|
38
45
|
}
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
const onlyFlags = ["--claude-only", "--codex-only", "--antigravity-only"].filter(
|
|
47
|
+
(flag) => args.includes(flag),
|
|
48
|
+
);
|
|
49
|
+
if (onlyFlags.length > 1) {
|
|
50
|
+
process.stderr.write(`${onlyFlags.join(" and ")} cannot be used together\n`);
|
|
41
51
|
process.exit(1);
|
|
42
52
|
}
|
|
43
53
|
if (args.includes("--help") || args.includes("-h")) {
|
|
@@ -84,6 +94,7 @@ function toPowerShellArgs(args) {
|
|
|
84
94
|
return args.map((arg) => {
|
|
85
95
|
if (arg === "--claude-only") return "-ClaudeOnly";
|
|
86
96
|
if (arg === "--codex-only") return "-CodexOnly";
|
|
97
|
+
if (arg === "--antigravity-only") return "-AntigravityOnly";
|
|
87
98
|
if (arg === "--dry-run") return "-DryRun";
|
|
88
99
|
return arg;
|
|
89
100
|
});
|
|
@@ -93,12 +104,13 @@ function printHelp() {
|
|
|
93
104
|
process.stdout.write(`claude-everything-workflow
|
|
94
105
|
|
|
95
106
|
Usage:
|
|
96
|
-
cew install [--claude-only|--codex-only] [--dry-run]
|
|
107
|
+
cew install [--claude-only|--codex-only|--antigravity-only] [--dry-run]
|
|
97
108
|
cew verify
|
|
98
109
|
|
|
99
110
|
Examples:
|
|
100
111
|
npx claude-everything-workflow install
|
|
101
112
|
npx claude-everything-workflow install --codex-only
|
|
113
|
+
npx claude-everything-workflow install --antigravity-only
|
|
102
114
|
npx claude-everything-workflow verify
|
|
103
115
|
`);
|
|
104
116
|
}
|
package/commands/code-review.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: 基于固定基点和已确认范围,按风险选择独立或双轴子代理审查
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# /code-review - 代码审查
|
|
6
6
|
|
|
7
|
-
读取 `skills/code-review/SKILL.md
|
|
7
|
+
读取 `skills/code-review/SKILL.md`,由它决定审查深度、上下文隔离和阻塞边界;不在命令中重写流程。
|
|
8
8
|
|
|
9
9
|
```text
|
|
10
|
-
/code-review <base> [--spec <path>] [--mode auto|
|
|
10
|
+
/code-review <base> [--spec <path>] [--mode auto|independent|dual]
|
|
11
11
|
/code-review --worktree <base> --spec <path>
|
|
12
12
|
/code-review --staged
|
|
13
13
|
```
|
|
@@ -16,7 +16,7 @@ description: 基于固定基点和已确认范围,按风险选择自审、独
|
|
|
16
16
|
- 分支包用 `git diff <base>...HEAD`;混合工作区用 `git diff <base>`,并加入任务所属 untracked 文件。
|
|
17
17
|
- `--staged` 使用 `git diff --cached`;不代表整个分支。
|
|
18
18
|
- `--spec <path>` 或调用方的范围合同都是有效需求来源;已有信息不重复询问。
|
|
19
|
-
- 默认由 Skill
|
|
19
|
+
- 默认由 Skill 按风险选择独立单代理(`independent`)或双轴隔离代理(`dual`,可并行或顺序运行);不提供自审模式,模式参数不能降低必要审查,代理不可用时直接 `BLOCKED`,不得降级。
|
|
20
20
|
- Standards 与 Spec 轴分别报告;缺少需求证据时说明 `NOT RUN`,不根据 diff 编造需求。
|
|
21
21
|
|
|
22
22
|
`$ARGUMENTS`
|
package/docs/plugins.md
CHANGED
|
@@ -55,6 +55,24 @@ codex plugin add claude-everything-workflow@cew
|
|
|
55
55
|
|
|
56
56
|
CLI 命令以宿主版本为准;缺少 `plugin` 子命令时使用支持插件的应用版本或继续使用 npm 安装。
|
|
57
57
|
|
|
58
|
+
## Antigravity (Gemini)
|
|
59
|
+
|
|
60
|
+
Antigravity 支持原生用户级插件(`~/.gemini/config/plugins/claude-everything-workflow/`)。可直接通过 npm 一键安装并在后续像 Codex 一样同步升级:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
npx claude-everything-workflow install --antigravity-only
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
或者运行 `npx claude-everything-workflow install`(当本机已存在非符号链接的 `~/.gemini` 时会自动同步 Antigravity;未存在时跳过,可随时用 `--antigravity-only` 显式安装)。安装器会自动生成或同步:
|
|
67
|
+
|
|
68
|
+
- `plugin.json`:原生插件清单(版本与 `package.json` 保持一致)。
|
|
69
|
+
- `rules/AGENTS.md`:唯一的常驻入口规则,指引按需读取 `references/rules/` 下的基础规则与 `common/` 专项规则。
|
|
70
|
+
- `skills/`:同步全部工作流技能,并把非重复命令(`pr`、`verify`、`to-spec`、`learn`)转换为原生技能;自动清理已退役技能。
|
|
71
|
+
- `agents/`:转换工具名称与插件内引用路径为 Antigravity 原生子代理格式。
|
|
72
|
+
- `references/rules/02-implementation.md`:采用与 Codex 相同的 Git 三方合并机制,升级时保留个人修改。
|
|
73
|
+
|
|
74
|
+
不自动启用 Claude Code 专用 hooks。若本机存在旧版 `~/.gemini/AGENTS.md`,安装器不会自动删除,仅在输出中提示手动确认。
|
|
75
|
+
|
|
58
76
|
### 浏览器验证 MCP
|
|
59
77
|
|
|
60
78
|
Claude 插件根目录的 `.mcp.json` 会注册 `chrome-devtools` MCP,启用插件后无需手动配置。前置条件、手动添加命令和复用已登录 Chrome 的说明见 README 的“浏览器验证(可选)”。
|
|
@@ -63,13 +81,13 @@ Claude 插件根目录的 `.mcp.json` 会注册 `chrome-devtools` MCP,启用
|
|
|
63
81
|
|
|
64
82
|
| 项目 | 插件安装 | npm 安装 |
|
|
65
83
|
| --- | --- | --- |
|
|
66
|
-
| 文件位置 | 宿主管理的插件目录或缓存 | `~/.claude/`、`~/.codex/` |
|
|
84
|
+
| 文件位置 | 宿主管理的插件目录或缓存 | `~/.claude/`、`~/.codex/`、`~/.gemini/config/plugins/claude-everything-workflow/` |
|
|
67
85
|
| 全局入口配置 | 不覆盖已有入口和设置 | 安装器备份并同步入口,Claude hooks 合并进设置 |
|
|
68
86
|
| 工作流 | 宿主发现插件技能,保留原有规则查找方式 | 从用户级目录按需加载 |
|
|
69
87
|
| Claude hooks | 插件生命周期内启用基础检查 | 原有安装器配置 |
|
|
70
88
|
| 停用 | 用宿主插件管理功能禁用或卸载 | 按原有全局配置管理 |
|
|
71
89
|
|
|
72
|
-
|
|
90
|
+
Claude Code / Codex 市场插件不会自动加载随包的 `AGENTS.md` 或注册 `rules/`,也不提供额外的资源路径适配;这些文件被打包不等于其规则已生效。Antigravity 通过 npm 安装器生成的原生插件会将 `rules/AGENTS.md` 放入插件入口并把详细规则放到 `references/rules/` 按需加载。仅使用 Claude / Codex 市场插件时,跨文件工作流仍需目标项目或用户已有配置提供可解析的规则及参考路径,不能视为与 npm 安装完全等价。
|
|
73
91
|
|
|
74
92
|
同一宿主建议选一种方式,避免同名技能和 Claude hooks 重复。已有 npm 安装不会被插件自动迁移或删除;学习系统仍需显式配置。脚本声明的可选外部工具和依赖也不会因安装插件自动安装。基础检查脚本需要 Node.js 18+;运行仓库校验器需要安装 package.json 中的依赖。
|
|
75
93
|
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
{
|
|
24
24
|
"id": "direct-small-change",
|
|
25
25
|
"category": "delivery",
|
|
26
|
-
"prompt": "给 parseConfig 加一个默认值 fallback
|
|
26
|
+
"prompt": "给 parseConfig 加一个默认值 fallback",
|
|
27
27
|
"expectedTarget": "skills/implement/SKILL.md",
|
|
28
28
|
"expectedLane": "direct",
|
|
29
29
|
"requiredSignals": ["direct-scope", "implement"],
|
|
30
|
-
"rationale": "明确、低风险的单次交付请求直接走 direct 通道与 implement
|
|
30
|
+
"rationale": "明确、低风险的单次交付请求直接走 direct 通道与 implement;测试补写由 implement 内部的 TDD 步骤承接,不单独路由。"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"id": "workflow-advice",
|
|
@@ -114,13 +114,12 @@
|
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
116
|
"id": "e2e-flaky-fix",
|
|
117
|
-
"category": "
|
|
117
|
+
"category": "debugging",
|
|
118
118
|
"prompt": "CI 里的 Playwright 测试经常超时 flaky,帮我定位并稳定下来",
|
|
119
|
-
"expectedTarget": "skills/
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"rationale": "Playwright flaky 治理使用 feature-acceptance 的 E2E 与 patterns 参考。"
|
|
119
|
+
"expectedTarget": "skills/systematic-debugging/SKILL.md",
|
|
120
|
+
"expectedLane": "debugging",
|
|
121
|
+
"requiredSignals": ["flaky", "根因"],
|
|
122
|
+
"rationale": "先定位间歇性超时的根因。根因确认后,需要维护或稳定浏览器测试时再使用验收 Skill 的 E2E 参考。"
|
|
124
123
|
},
|
|
125
124
|
{
|
|
126
125
|
"id": "grilling-ambiguous-decision",
|
|
@@ -243,7 +242,7 @@
|
|
|
243
242
|
{
|
|
244
243
|
"id": "new-feature-worktree-and-pr",
|
|
245
244
|
"category": "git",
|
|
246
|
-
"prompt": "
|
|
245
|
+
"prompt": "新功能的范围已确定。这一步只处理 Git:帮我创建独立工作区和分支,说明开发完成后如何提交并开 PR",
|
|
247
246
|
"expectedTarget": "rules/05-git-workflow.md",
|
|
248
247
|
"expectedLane": "git",
|
|
249
248
|
"requiredSignals": ["git worktree", "origin/main"],
|
package/package.json
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* 可选真实模型路由场景评测脚本(不进入 CI,需本地已登录 claude 或 codex CLI)。
|
|
6
6
|
* 用法:
|
|
7
7
|
* node scripts/eval-scenarios.js --host claude --limit 5
|
|
8
|
-
* node scripts/eval-scenarios.js --host codex --id bug-diagnosis
|
|
8
|
+
* node scripts/eval-scenarios.js --host codex --id bug-diagnosis --repeat 3
|
|
9
|
+
*
|
|
10
|
+
* --repeat N 对每个场景采样 N 次;全部命中为 PASS;全部有效但选路不一致为 UNSTABLE;宿主或回答格式异常为 FAIL。
|
|
9
11
|
*/
|
|
10
12
|
|
|
11
13
|
const fs = require("node:fs");
|
|
@@ -17,15 +19,24 @@ const root = path.resolve(__dirname, "..");
|
|
|
17
19
|
const scenariosPath = path.join(root, "evals/routing-scenarios.json");
|
|
18
20
|
|
|
19
21
|
function parseArgs(argv) {
|
|
20
|
-
const opts = { host: "claude", limit: Infinity, id: null, dryRun: false };
|
|
22
|
+
const opts = { host: "claude", limit: Infinity, id: null, repeat: 1, dryRun: false };
|
|
21
23
|
for (let i = 0; i < argv.length; i += 1) {
|
|
22
24
|
const arg = argv[i];
|
|
23
25
|
if (arg === "--host") opts.host = argv[++i];
|
|
24
26
|
else if (arg === "--limit") opts.limit = Number(argv[++i]);
|
|
25
27
|
else if (arg === "--id") opts.id = argv[++i];
|
|
26
|
-
else if (arg === "--
|
|
28
|
+
else if (arg === "--repeat") {
|
|
29
|
+
const value = Number(argv[++i]);
|
|
30
|
+
if (!Number.isInteger(value) || value < 1) {
|
|
31
|
+
throw new Error("--repeat must be a positive integer");
|
|
32
|
+
}
|
|
33
|
+
opts.repeat = value;
|
|
34
|
+
} else if (arg === "--dry-run") opts.dryRun = true;
|
|
27
35
|
else if (arg === "-h" || arg === "--help") {
|
|
28
|
-
console.log(
|
|
36
|
+
console.log(
|
|
37
|
+
"Usage: node scripts/eval-scenarios.js " +
|
|
38
|
+
"[--host claude|codex] [--limit N] [--id <id>] [--repeat N] [--dry-run]",
|
|
39
|
+
);
|
|
29
40
|
process.exit(0);
|
|
30
41
|
} else {
|
|
31
42
|
throw new Error(`Unknown option: ${arg}`);
|
|
@@ -39,8 +50,11 @@ function parseArgs(argv) {
|
|
|
39
50
|
|
|
40
51
|
function buildEvalPrompt(scenario) {
|
|
41
52
|
return [
|
|
42
|
-
"
|
|
43
|
-
"
|
|
53
|
+
"这是一个只读工作流路由测试:只做选路,不执行下方用户请求,不修改任何文件。",
|
|
54
|
+
"根据本仓库的 AGENTS.md、工作流路由、Skill 说明和它们引用的规则,判断分发后由哪个文件直接负责用户当前要做的事。只查工作流文档,不查场景题库、测试、评测脚本或提交记录。",
|
|
55
|
+
"通用路由器只负责转交时,沿分发继续判断;路由器自己完成请求时,可以是答案。多阶段任务按当前要解决的具体问题选负责方。配套参考资料和后续步骤不作为本次目标。",
|
|
56
|
+
"只输出一个 JSON 对象,target 填该 Skill 或规则的完整仓库相对文件路径;目标必须是 Skill 入口(`.../SKILL.md`)或规则文件," +
|
|
57
|
+
"不要填 Skill 内部的 `references/` 文档。无需进入工程流程时填字符串 NONE。不要加 Markdown 围栏。",
|
|
44
58
|
"",
|
|
45
59
|
`用户请求:${scenario.prompt}`,
|
|
46
60
|
].join("\n");
|
|
@@ -64,9 +78,11 @@ function runHost(host, prompt) {
|
|
|
64
78
|
}
|
|
65
79
|
|
|
66
80
|
function selectedTarget(answer) {
|
|
81
|
+
const text = String(answer || "").trim();
|
|
82
|
+
const fenced = /^```(?:json)?[ \t]*\r?\n([\s\S]*?)\r?\n[ \t]*```$/i.exec(text);
|
|
67
83
|
try {
|
|
68
|
-
const value = JSON.parse(
|
|
69
|
-
return typeof value?.target === "string" ? value.target : null;
|
|
84
|
+
const value = JSON.parse(fenced ? fenced[1] : text);
|
|
85
|
+
return typeof value?.target === "string" && value.target.trim() ? value.target : null;
|
|
70
86
|
} catch (error) {
|
|
71
87
|
if (error instanceof SyntaxError) return null;
|
|
72
88
|
throw error;
|
|
@@ -88,15 +104,33 @@ function main() {
|
|
|
88
104
|
passed += 1;
|
|
89
105
|
continue;
|
|
90
106
|
}
|
|
91
|
-
const { result, answer } = runHost(opts.host, evalPrompt);
|
|
92
107
|
const expected = scenario.expectedTarget ?? "NONE";
|
|
93
|
-
const
|
|
94
|
-
|
|
108
|
+
const samples = [];
|
|
109
|
+
for (let i = 0; i < opts.repeat; i += 1) {
|
|
110
|
+
const { result, answer } = runHost(opts.host, evalPrompt);
|
|
111
|
+
const hostFailed = result.status !== 0 || Boolean(result.error);
|
|
112
|
+
samples.push({
|
|
113
|
+
status: result.status,
|
|
114
|
+
hostFailed,
|
|
115
|
+
target: hostFailed ? null : selectedTarget(answer),
|
|
116
|
+
diagnostic: (result.error?.message || result.stderr || "").trim().slice(0, 200),
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
const targets = samples.map((sample) => sample.target);
|
|
120
|
+
const ok = targets.every((target) => target === expected);
|
|
121
|
+
const unstable = !targets.includes(null) && new Set(targets).size > 1;
|
|
95
122
|
if (ok) passed += 1;
|
|
96
|
-
console.log(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
123
|
+
console.log(
|
|
124
|
+
`${ok ? "PASS" : unstable ? "UNSTABLE" : "FAIL"} ${scenario.id} ` +
|
|
125
|
+
`(expected: ${expected}) samples=${JSON.stringify(targets)}`,
|
|
126
|
+
);
|
|
127
|
+
for (const sample of samples) {
|
|
128
|
+
if (sample.target === expected) continue;
|
|
129
|
+
const reason = sample.hostFailed ? "host-error" : sample.target === null ? "invalid-answer" : "wrong-target";
|
|
130
|
+
console.log(
|
|
131
|
+
` exit=${sample.status} target=${JSON.stringify(sample.target)} ` +
|
|
132
|
+
`reason=${reason} ${sample.diagnostic}`,
|
|
133
|
+
);
|
|
100
134
|
}
|
|
101
135
|
}
|
|
102
136
|
console.log(`\nSummary: ${passed}/${list.length} passed.`);
|