@givolt/i3-composer-agent 2.2.1 → 2.2.2
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/.agents/plugins/marketplace.json +1 -1
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +38 -17
- package/bin/asset-fingerprint.cjs +3 -5
- package/bin/i3-composer-agent.cjs +9 -5
- package/bin/install.cjs +42 -66
- package/bin/legacy-native-files.json +329 -0
- package/bin/native-command-validation.cjs +27 -0
- package/bin/native-content.cjs +0 -1
- package/bin/native-layout.cjs +135 -0
- package/bin/native-migration.cjs +93 -0
- package/bin/native-runtime.cjs +57 -0
- package/bin/native-version-validation.cjs +8 -0
- package/bin/wizard.cjs +3 -1
- package/docs/codebuddy-setup.md +4 -3
- package/docs/codex-setup.md +5 -3
- package/docs/workbuddy-setup.md +8 -6
- package/evals/README.md +31 -22
- package/evals/skill-impact.md +6 -0
- package/package.json +3 -1
- package/plugin.json +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Installed as scripts/i3-composer-agent/lib/installation.cjs. Resolve from
|
|
4
|
+
// this file, never the caller's working directory or the host's package.json.
|
|
5
|
+
const fs = require('node:fs');
|
|
6
|
+
const path = require('node:path');
|
|
7
|
+
const EXPECTED_VERSION = '__I3_INSTALL_VERSION__';
|
|
8
|
+
const root = path.resolve(__dirname, '../../..');
|
|
9
|
+
const manifestPath = path.join(root, '.i3-composer-agent.json');
|
|
10
|
+
|
|
11
|
+
function resolveOwned(relative) {
|
|
12
|
+
if (typeof relative !== 'string' || relative.includes('\\') || relative.includes(':')
|
|
13
|
+
|| relative.includes('\0') || relative.split('/').some(part => ['', '.', '..'].includes(part))) {
|
|
14
|
+
throw new Error(`安装清单路径无效:${relative}`);
|
|
15
|
+
}
|
|
16
|
+
let file = root;
|
|
17
|
+
for (const part of relative.split('/')) {
|
|
18
|
+
file = path.join(file, part);
|
|
19
|
+
if (!fs.existsSync(file)) throw new Error(`安装内容缺失:${relative}`);
|
|
20
|
+
if (fs.lstatSync(file).isSymbolicLink()) throw new Error(`安装内容不能通过符号链接替代:${relative}`);
|
|
21
|
+
}
|
|
22
|
+
if (!fs.statSync(file).isFile()) throw new Error(`安装文件无效:${relative}`);
|
|
23
|
+
return file;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function loadInstallation() {
|
|
27
|
+
let manifest;
|
|
28
|
+
try { manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')); }
|
|
29
|
+
catch (error) { throw new Error(`无法读取安装清单 ${manifestPath}:${error.message}`); }
|
|
30
|
+
if (manifest.name !== 'i3-composer-agent' || manifest.layoutVersion !== 2
|
|
31
|
+
|| manifest.version !== EXPECTED_VERSION || !Array.isArray(manifest.assets) || !manifest.assets.length) {
|
|
32
|
+
throw new Error(`安装清单的名称、布局或版本不匹配:${manifestPath}`);
|
|
33
|
+
}
|
|
34
|
+
const assets = new Set(manifest.assets);
|
|
35
|
+
for (const [category, suffix] of [['skills', '/SKILL.md'], ['commands', '.md'], ['agents', '.md']]) {
|
|
36
|
+
const names = manifest.catalog?.[category];
|
|
37
|
+
if (!Array.isArray(names) || !names.length || new Set(names).size !== names.length) {
|
|
38
|
+
throw new Error(`安装清单缺少有效的 ${category} 目录项:${manifestPath}`);
|
|
39
|
+
}
|
|
40
|
+
for (const name of names) {
|
|
41
|
+
if (typeof name !== 'string' || !/^[a-z0-9][a-z0-9-]*$/.test(name)
|
|
42
|
+
|| !assets.has(`${category}/${name}${suffix}`)) throw new Error(`安装清单目录项无效:${category}/${name}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
for (const relative of assets) resolveOwned(relative);
|
|
46
|
+
const resources = {};
|
|
47
|
+
for (const category of ['references', 'evals', 'hooks', 'scripts', 'docs']) {
|
|
48
|
+
const relative = `${category}/i3-composer-agent`;
|
|
49
|
+
if (manifest.resources?.[category] !== relative || ![...assets].some(file => file.startsWith(relative + '/'))) {
|
|
50
|
+
throw new Error(`安装清单缺少资源:${category}`);
|
|
51
|
+
}
|
|
52
|
+
resources[category] = path.join(root, relative);
|
|
53
|
+
}
|
|
54
|
+
return { root, manifest, catalog: manifest.catalog, resources, skillsDirectory: path.join(root, 'skills') };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
module.exports = { loadInstallation };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
try {
|
|
5
|
+
const { loadInstallation } = require('./lib/installation.cjs');
|
|
6
|
+
const { manifest } = loadInstallation();
|
|
7
|
+
console.log(`安装版本 ${manifest.version},布局 ${manifest.layoutVersion};${manifest.assets.length} 个登记文件均存在。`);
|
|
8
|
+
} catch (error) { console.error(error.message); process.exitCode = 1; }
|
package/bin/wizard.cjs
CHANGED
|
@@ -44,7 +44,9 @@ async function confirm(plan) {
|
|
|
44
44
|
for (const target of plan.targets) {
|
|
45
45
|
console.log(` ${target.agents.join(', ')}: ${target.skillsDirectory}`);
|
|
46
46
|
if (target.commandsDirectory) console.log(` 命令:${target.commandsDirectory}`);
|
|
47
|
-
console.log(`
|
|
47
|
+
console.log(` 评测:${target.evalsDirectory}`);
|
|
48
|
+
console.log(` 脚本:${target.scriptsDirectory}`);
|
|
49
|
+
console.log(` Hook:${target.hooksDirectory}`);
|
|
48
50
|
}
|
|
49
51
|
if (plan.conflicts.length) console.log(`将替换 ${plan.conflicts.length} 个已有内容;安装成功后清理旧文件,失败则恢复。`);
|
|
50
52
|
if (plan.reused.length) console.log(`将复用同版本的 ${plan.reused.length} 个未修改内容。`);
|
package/docs/codebuddy-setup.md
CHANGED
|
@@ -11,7 +11,8 @@ npx @givolt/i3-composer-agent --codebuddy
|
|
|
11
11
|
向导预选 CodeBuddy,可增加其他工具,再选择项目或全局范围。
|
|
12
12
|
项目安装提供 `.codebuddy/skills/`(25 个技能)、`references/`、
|
|
13
13
|
`commands/`(9 个命令)和 `agents/`(4 个角色)。
|
|
14
|
-
同级 `i3-composer-agent/`
|
|
14
|
+
同级 `evals/`、`hooks/`、`scripts/`、`docs/`、`references/` 各自通过 `i3-composer-agent/` 分组资料,
|
|
15
|
+
只有一份实际技能、命令和角色,评测与宿主共用。
|
|
15
16
|
全局使用 `~/.codebuddy/` 的相同结构。默认中文说明和回复;技能/命令标识不改名。
|
|
16
17
|
安装成功清理旧内容,失败恢复;设置与自定义命令保留。
|
|
17
18
|
|
|
@@ -40,8 +41,8 @@ CodeBuddy 与 WorkBuddy 项目共用 `.codebuddy/`;同版本追加客户端会
|
|
|
40
41
|
|
|
41
42
|
## 配套检查
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
在业务项目运行 `node .codebuddy/scripts/i3-composer-agent/run-evals.cjs --min-rank1 95`,
|
|
45
|
+
可检查中英文触发,不调用模型;全局安装使用脚本的全局绝对路径。五项校验、行为评测和样例用法见
|
|
45
46
|
[评测说明](../evals/README.md)。Hook 文件已安装,需要按宿主协议单独启用。
|
|
46
47
|
|
|
47
48
|
## 通过 CodeBuddy Code 插件管理器安装
|
package/docs/codex-setup.md
CHANGED
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
npx @givolt/i3-composer-agent --codex
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
项目范围写入 `.agents/skills/`,全局写入 `~/.agents/skills/`,并安装同级 `references/`。
|
|
9
|
+
项目范围写入 `.agents/skills/`,全局写入 `~/.agents/skills/`,并安装同级 `references/i3-composer-agent/`。
|
|
10
10
|
提供全部 25 个 `i3-` 技能,中文选择说明与默认中文回复在每个入口独立生效。
|
|
11
|
-
同级 `i3-composer-agent/`
|
|
12
|
-
|
|
11
|
+
同级 `evals/`、`hooks/`、`scripts/`、`docs/` 各自以 `i3-composer-agent/` 分组资料。
|
|
12
|
+
命令与角色文件也会提供,供按需阅读,其自动发现由宿主决定。
|
|
13
|
+
从项目目录执行 `node .agents/scripts/i3-composer-agent/run-evals.cjs --min-rank1 95`
|
|
14
|
+
检查实际安装技能的中英文触发,不调用模型;五项结构校验详见
|
|
13
15
|
[评测说明](../evals/README.md)。原生调用使用技能 ID,Hook 文件需按宿主能力单独启用。
|
|
14
16
|
|
|
15
17
|
## 通过插件管理器安装
|
package/docs/workbuddy-setup.md
CHANGED
|
@@ -13,9 +13,11 @@ npx @givolt/i3-composer-agent --agents codebuddy,workbuddy --scope global --yes
|
|
|
13
13
|
- `~/.workbuddy/skills/`:25 个 `i3-` 技能,选择说明和默认回复中文。
|
|
14
14
|
- `~/.workbuddy/commands/`:9 个 `/i3-*` 短命令。
|
|
15
15
|
- `~/.workbuddy/agents/`:4 个专业角色。
|
|
16
|
-
- `~/.workbuddy/references
|
|
17
|
-
- `~/.workbuddy/docs/agents.md`:角色说明。
|
|
18
|
-
- `~/.workbuddy/i3-composer-agent
|
|
16
|
+
- `~/.workbuddy/references/i3-composer-agent/`:共享参考。
|
|
17
|
+
- `~/.workbuddy/docs/i3-composer-agent/agents.md`:角色说明。
|
|
18
|
+
- `~/.workbuddy/evals/i3-composer-agent/`:中英文用例、样例与评测结果。
|
|
19
|
+
- `~/.workbuddy/hooks/i3-composer-agent/`:Hook 文件与说明。
|
|
20
|
+
- `~/.workbuddy/scripts/i3-composer-agent/`:评测、校验与依赖库。
|
|
19
21
|
- `~/.workbuddy/.i3-composer-agent.json`:安装内容所有权及客户端清单。
|
|
20
22
|
|
|
21
23
|
自定义 profile 可设置 `WORKBUDDY_CONFIG_DIR`,安装后打开对应 profile。
|
|
@@ -23,8 +25,8 @@ WorkBuddy 的目录选择使用自己的配置,不借用 `CODEBUDDY_CONFIG_DIR
|
|
|
23
25
|
|
|
24
26
|
## 配套检查
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
运行 `node ~/.workbuddy/scripts/i3-composer-agent/run-evals.cjs --min-rank1 95`,检查实际安装技能的中英文触发,
|
|
29
|
+
不会调用模型。项目安装将 `~/.workbuddy/` 换成 `.codebuddy/`。五项校验、行为评测用例、样例和
|
|
28
30
|
脚本用法见 [评测说明](../evals/README.md)。Hook 文件默认提供,启用需适配宿主事件协议。
|
|
29
31
|
|
|
30
32
|
## 发现和调用
|
|
@@ -72,7 +74,7 @@ npx @givolt/i3-composer-agent --workbuddy --scope global --dry-run
|
|
|
72
74
|
npx @givolt/i3-composer-agent --workbuddy --scope global --yes --force
|
|
73
75
|
```
|
|
74
76
|
|
|
75
|
-
|
|
77
|
+
升级和已登记文件修改需确认;未归属的资料冲突或不同内容的同名评测结果需要先处理;成功替换后清理旧文件与所属历史备份,失败恢复。
|
|
76
78
|
原生安装同时提供 Skills、Commands、Agents 和完整 evals/hooks/scripts 配套。
|
|
77
79
|
`--prepare --workbuddy` 不支持,原生安装不会启用插件 Hook。
|
|
78
80
|
|
package/evals/README.md
CHANGED
|
@@ -6,32 +6,39 @@
|
|
|
6
6
|
|
|
7
7
|
## 运行位置
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
WorkBuddy
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
宿主实际使用的原生入口仍位于它自己的 `skills/`、`commands/`、`agents/`。
|
|
9
|
+
原生安装的技能位于宿主基址的 `skills/`;评测资料位于 `evals/i3-composer-agent/`,
|
|
10
|
+
脚本位于 `scripts/i3-composer-agent/`。安装清单记录预期技能和文件,评测只读取这份实际安装内容。
|
|
11
|
+
例如 CodeBuddy 项目基址是 `.codebuddy/`,WorkBuddy 全局基址是 `~/.workbuddy/`。
|
|
12
|
+
下面原生示例从业务项目根目录运行;从其他位置运行时,将脚本路径换成绝对路径即可。
|
|
13
|
+
Node.js 20 或以上,无需额外 npm 依赖;`.cjs` 入口兼容业务项目的 ESM/CommonJS 设置。
|
|
15
14
|
|
|
16
15
|
## 不调用模型的检查
|
|
17
16
|
|
|
18
|
-
需要 Node.js 20 或以上,无需额外 npm 依赖。
|
|
19
|
-
|
|
20
17
|
```bash
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
node .codebuddy/scripts/i3-composer-agent/validate-skills.cjs
|
|
19
|
+
node .codebuddy/scripts/i3-composer-agent/validate-versions.cjs
|
|
20
|
+
node .codebuddy/scripts/i3-composer-agent/validate-commands.cjs
|
|
21
|
+
node .codebuddy/scripts/i3-composer-agent/validate-reference-links.cjs
|
|
22
|
+
node .codebuddy/scripts/i3-composer-agent/validate-artifact-paths.cjs
|
|
23
|
+
node .codebuddy/scripts/i3-composer-agent/run-evals.cjs --locale zh-CN --min-rank1 95
|
|
24
|
+
node .codebuddy/scripts/i3-composer-agent/run-evals.cjs --locale en --min-rank1 95
|
|
25
|
+
```
|
|
23
26
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
五项校验分别检查技能格式、安装版本及登记文件、实际命令和角色格式、引用锚点、规格/计划产物路径。
|
|
28
|
+
缺少安装清单、已登记技能或必需资源会报错;其他插件和用户新增技能不进入本包的评测目录项。
|
|
29
|
+
`cases/` 保留英文用例,`zh-CN/cases/` 提供中文用例,`fixtures/` 是行为评测的真实输入,
|
|
30
|
+
`plugin/` 保留插件评测提示与评分标准。`skill-impact.md` 记录因评测未通过而放弃的技能改动。
|
|
27
31
|
|
|
28
|
-
|
|
32
|
+
若使用 `--prepare` / `--extract` 的独立插件,进入导出目录运行原有入口:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
29
35
|
npm test
|
|
36
|
+
npm run validate
|
|
37
|
+
node scripts/run-evals.js --locale zh-CN --min-rank1 95
|
|
30
38
|
```
|
|
31
39
|
|
|
32
|
-
|
|
33
|
-
`
|
|
34
|
-
`evals/fixtures/` 是执行型评测使用的测试项目样例,`evals/plugin/` 是插件级评测用例。
|
|
40
|
+
独立插件的校验还会检查插件清单和三种命令格式的一致性。原生安装不复制这些注册清单,
|
|
41
|
+
不需要在业务项目或宿主基址执行 `npm test`。
|
|
35
42
|
|
|
36
43
|
触发评测使用词法评分检查正例、负例、描述冲突、用例结构及样例是否齐全。
|
|
37
44
|
中英文各自满足指定门槛;这不能证明模型在实际宿主中一定选择正确技能。
|
|
@@ -42,13 +49,13 @@ npm test
|
|
|
42
49
|
先预览,不调用模型、不生成评测结果:
|
|
43
50
|
|
|
44
51
|
```bash
|
|
45
|
-
node scripts/run-evals.
|
|
52
|
+
node .codebuddy/scripts/i3-composer-agent/run-evals.cjs --behavioral i3-test-driven-development --locale zh-CN --dry-run
|
|
46
53
|
```
|
|
47
54
|
|
|
48
55
|
确认需要后,移除 `--dry-run` 才会调用已登录的 Claude Code,并消耗该账户的模型额度:
|
|
49
56
|
|
|
50
57
|
```bash
|
|
51
|
-
node scripts/run-evals.
|
|
58
|
+
node .codebuddy/scripts/i3-composer-agent/run-evals.cjs --behavioral i3-test-driven-development --locale zh-CN
|
|
52
59
|
```
|
|
53
60
|
|
|
54
61
|
执行型用例需要 Git,并在临时 Git 项目中复制 `fixtures/` 的真实输入;
|
|
@@ -59,13 +66,15 @@ node scripts/run-evals.js --behavioral i3-test-driven-development --locale zh-CN
|
|
|
59
66
|
|
|
60
67
|
`--locale en` 运行英文用例,省略该参数运行两种语言。可通过 `I3_EVAL_MODEL`
|
|
61
68
|
和 `I3_EVAL_GRADER_MODEL` 指定执行/评分模型;报告同时记录宿主和模型信息。
|
|
62
|
-
|
|
69
|
+
原生结果写入 `evals/i3-composer-agent/results/`;独立插件写入 `evals/results/`。
|
|
70
|
+
结果不会进入发行包和文件替换清单,升级保留;旧配套目录的结果会迁入新位置,同名异内容时停止迁移。
|
|
63
71
|
|
|
64
72
|
## 插件级评测
|
|
65
73
|
|
|
66
74
|
插件清单中的 `experimental.evals` 指向随包提供的 `evals/plugin/`。
|
|
75
|
+
原生安装也保留这些用例作为资料;要运行依赖插件清单的命令,需要独立插件导出。
|
|
67
76
|
它包含整体插件的触发/不触发提示和评分规则;支持 `plugin eval` 的 Claude Code
|
|
68
|
-
|
|
77
|
+
可从 `--prepare` / `--extract` 的独立插件导出目录主动运行:
|
|
69
78
|
|
|
70
79
|
```bash
|
|
71
80
|
claude plugin eval . --no-publish
|
|
@@ -77,7 +86,7 @@ claude plugin eval . --no-publish
|
|
|
77
86
|
|
|
78
87
|
## Hooks
|
|
79
88
|
|
|
80
|
-
`hooks
|
|
89
|
+
原生的 `hooks/i3-composer-agent/`(独立插件为 `hooks/`)默认交付会话注入、文档缓存、代码块保护脚本及说明。
|
|
81
90
|
安装文件不会自动注册事件。中文回复与普通技能调用不依赖启用 Hook。
|
|
82
91
|
会话注入仅适用于缺少原生技能路由的宿主;已有路由时不要重复注入。
|
|
83
92
|
缓存及保护的当前配置示例针对 Claude Code,详见
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Rejected Skill Changes
|
|
2
|
+
|
|
3
|
+
This append-only ledger records skill and description changes rejected on eval evidence so contributors can review prior attempts before proposing overlapping work. Add one concise row per rejected proposal; do not record accepted changes here.
|
|
4
|
+
|
|
5
|
+
| Date | Affected skill | Attempted change | Rank-1 score (before → after) | Rejected PR and outcome |
|
|
6
|
+
|---|---|---|---:|---|
|
package/package.json
CHANGED
|
@@ -113,6 +113,7 @@
|
|
|
113
113
|
"evals/plugin/code-review-stays-quiet/graders/not-fired.md",
|
|
114
114
|
"evals/plugin/code-review-stays-quiet/graders/tdd-fired.md",
|
|
115
115
|
"evals/plugin/code-review-stays-quiet/prompt.md",
|
|
116
|
+
"evals/skill-impact.md",
|
|
116
117
|
"evals/zh-CN/cases/i3-api-and-interface-design.json",
|
|
117
118
|
"evals/zh-CN/cases/i3-browser-testing-with-devtools.json",
|
|
118
119
|
"evals/zh-CN/cases/i3-ci-cd-and-automation.json",
|
|
@@ -274,6 +275,7 @@
|
|
|
274
275
|
"evals/plugin/code-review-stays-quiet/graders/not-fired.md",
|
|
275
276
|
"evals/plugin/code-review-stays-quiet/graders/tdd-fired.md",
|
|
276
277
|
"evals/plugin/code-review-stays-quiet/prompt.md",
|
|
278
|
+
"evals/skill-impact.md",
|
|
277
279
|
"evals/zh-CN/cases/i3-api-and-interface-design.json",
|
|
278
280
|
"evals/zh-CN/cases/i3-browser-testing-with-devtools.json",
|
|
279
281
|
"evals/zh-CN/cases/i3-ci-cd-and-automation.json",
|
|
@@ -327,7 +329,7 @@
|
|
|
327
329
|
"LICENSE"
|
|
328
330
|
]
|
|
329
331
|
},
|
|
330
|
-
"version": "2.2.
|
|
332
|
+
"version": "2.2.2",
|
|
331
333
|
"repository": {
|
|
332
334
|
"type": "git",
|
|
333
335
|
"url": "https://github.com/49780522/i3-composer-agent.git"
|
package/plugin.json
CHANGED