@givolt/i3-composer-agent 2.1.0 → 2.2.0
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 +2 -2
- package/.claude/commands/i3-build.md +13 -1
- package/.claude/commands/i3-code-simplify.md +13 -1
- package/.claude/commands/i3-constraints.md +13 -1
- package/.claude/commands/i3-plan.md +13 -1
- package/.claude/commands/i3-review.md +13 -1
- package/.claude/commands/i3-ship.md +18 -2
- package/.claude/commands/i3-spec.md +13 -1
- package/.claude/commands/i3-test.md +13 -1
- package/.claude/commands/i3-webperf.md +13 -1
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +2 -2
- package/.codex-plugin/plugin.json +7 -6
- package/.gemini/commands/i3-build.toml +13 -1
- package/.gemini/commands/i3-code-simplify.toml +13 -1
- package/.gemini/commands/i3-constraints.toml +13 -1
- package/.gemini/commands/i3-planning.toml +13 -1
- package/.gemini/commands/i3-review.toml +13 -1
- package/.gemini/commands/i3-ship.toml +13 -1
- package/.gemini/commands/i3-spec.toml +13 -1
- package/.gemini/commands/i3-test.toml +13 -1
- package/.gemini/commands/i3-webperf.toml +13 -1
- package/README.md +101 -101
- package/agents/code-reviewer.md +13 -1
- package/agents/security-auditor.md +13 -1
- package/agents/test-engineer.md +13 -1
- package/agents/web-performance-auditor.md +13 -1
- package/bin/i3-composer-agent.cjs +56 -53
- package/bin/install.cjs +23 -15
- package/bin/native-content.cjs +26 -17
- package/bin/tool-menu.cjs +9 -0
- package/bin/wizard.cjs +52 -25
- package/commands/i3-build.toml +13 -1
- package/commands/i3-code-simplify.toml +13 -1
- package/commands/i3-constraints.toml +13 -1
- package/commands/i3-planning.toml +13 -1
- package/commands/i3-review.toml +13 -1
- package/commands/i3-ship.toml +13 -1
- package/commands/i3-spec.toml +13 -1
- package/commands/i3-test.toml +13 -1
- package/commands/i3-webperf.toml +13 -1
- package/docs/adoption-guide.md +8 -0
- package/docs/agents.md +8 -0
- package/docs/antigravity-setup.md +8 -0
- package/docs/codebuddy-setup.md +26 -60
- package/docs/codex-setup.md +15 -29
- package/docs/commandcode-setup.md +8 -0
- package/docs/copilot-cli-setup.md +8 -0
- package/docs/copilot-setup.md +8 -0
- package/docs/cursor-setup.md +8 -0
- package/docs/gemini-cli-setup.md +8 -0
- package/docs/getting-started.md +8 -0
- package/docs/opencode-setup.md +8 -0
- package/docs/other-hosts.md +8 -0
- package/docs/windsurf-setup.md +8 -0
- package/docs/workbuddy-setup.md +46 -63
- package/hooks/SDD-CACHE.md +8 -0
- package/hooks/SIMPLIFY-IGNORE.md +8 -0
- package/hooks/sdd-cache-pre.sh +5 -5
- package/hooks/session-start-test.sh +1 -1
- package/hooks/session-start.sh +3 -3
- package/hooks/simplify-ignore.sh +8 -8
- package/package.json +2 -2
- package/plugin.json +2 -2
- package/references/accessibility-checklist.md +8 -0
- package/references/definition-of-done.md +8 -0
- package/references/observability-checklist.md +8 -0
- package/references/orchestration-patterns.md +8 -0
- package/references/performance-checklist.md +8 -0
- package/references/security-checklist.md +8 -0
- package/references/testing-patterns.md +8 -0
- package/skills/i3-api-and-interface-design/SKILL.md +13 -1
- package/skills/i3-browser-testing-with-devtools/SKILL.md +13 -1
- package/skills/i3-ci-cd-and-automation/SKILL.md +13 -1
- package/skills/i3-code-review-and-quality/SKILL.md +13 -1
- package/skills/i3-code-simplification/SKILL.md +13 -1
- package/skills/i3-constraint-driven-development/SKILL.md +13 -1
- package/skills/i3-constraint-driven-development/references/floor-guard.md +8 -0
- package/skills/i3-context-engineering/SKILL.md +13 -1
- package/skills/i3-debugging-and-error-recovery/SKILL.md +13 -1
- package/skills/i3-deprecation-and-migration/SKILL.md +13 -1
- package/skills/i3-documentation-and-adrs/SKILL.md +13 -1
- package/skills/i3-doubt-driven-development/SKILL.md +13 -1
- package/skills/i3-frontend-ui-engineering/SKILL.md +13 -1
- package/skills/i3-git-workflow-and-versioning/SKILL.md +13 -1
- package/skills/i3-idea-refine/SKILL.md +13 -1
- package/skills/i3-idea-refine/examples.md +8 -0
- package/skills/i3-idea-refine/frameworks.md +8 -0
- package/skills/i3-idea-refine/refinement-criteria.md +8 -0
- package/skills/i3-idea-refine/scripts/idea-refine.sh +2 -2
- package/skills/i3-incremental-implementation/SKILL.md +13 -1
- package/skills/i3-interview-me/SKILL.md +13 -1
- package/skills/i3-observability-and-instrumentation/SKILL.md +13 -1
- package/skills/i3-performance-optimization/SKILL.md +13 -1
- package/skills/i3-performance-optimization/references/optimization-patterns.md +8 -0
- package/skills/i3-planning-and-task-breakdown/SKILL.md +13 -1
- package/skills/i3-security-and-hardening/SKILL.md +13 -1
- package/skills/i3-security-and-hardening/references/hardening-patterns.md +8 -0
- package/skills/i3-shipping-and-launch/SKILL.md +13 -1
- package/skills/i3-source-driven-development/SKILL.md +13 -1
- package/skills/i3-spec-driven-development/SKILL.md +13 -1
- package/skills/i3-test-driven-development/SKILL.md +13 -1
- package/skills/i3-using-agent-skills/SKILL.md +13 -1
package/README.md
CHANGED
|
@@ -1,71 +1,63 @@
|
|
|
1
|
-
# i3 Composer Agent v2.
|
|
1
|
+
# i3 Composer Agent v2.2.0
|
|
2
2
|
|
|
3
3
|
**Intelligence. Integration. Innovation.**
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
面向中文环境的软件工程工作流:需求、规格、计划、开发、测试、审查与发布。
|
|
6
|
+
包名为 `@givolt/i3-composer-agent`,插件/市场标识为 `i3-composer-agent`。
|
|
7
|
+
Skill 和命令使用 `i3-` 前缀。默认简体中文交互;用户明确要求时可切换语言。
|
|
8
|
+
代码标识、路径、参数、工具协议和机器状态保持原样。
|
|
7
9
|
|
|
8
|
-
##
|
|
10
|
+
## 通过向导安装
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
在要使用技能的项目中运行:
|
|
11
13
|
|
|
12
14
|
```bash
|
|
13
15
|
npx @givolt/i3-composer-agent
|
|
14
|
-
# Preselect a tool; the wizard still allows multiple selections:
|
|
15
16
|
npx @givolt/i3-composer-agent --codebuddy
|
|
16
|
-
npx @givolt/i3-composer-agent --workbuddy
|
|
17
|
+
npx @givolt/i3-composer-agent --workbuddy --scope global
|
|
17
18
|
```
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
首屏依次为 CodeBuddy、WorkBuddy、Codex、Claude Code、Cursor、Gemini CLI,
|
|
21
|
+
WorkBuddy 在第 2 项。选 `7`/`更多` 打开其余工具,每页 10 项;`n` 下一页、`p` 上一页、
|
|
22
|
+
`b` 返回,`/关键词` 搜索全部 80 个工具。编号在分页和搜索中保持一致。
|
|
23
|
+
输入编号或 ID(中英文逗号均可)累积多选,跨页保留;`-编号/ID` 移除选择。
|
|
24
|
+
回车或 `done`/`完成` 确认已选工具,随后选择项目/全局范围并确认安装;`q`/`取消` 退出。
|
|
25
|
+
通过参数预选的工具会保留,仍可继续多选。
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
CodeBuddy
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Reload the IDE window or start a new session after installation. See
|
|
32
|
-
[CodeBuddy setup](docs/codebuddy-setup.md), [WorkBuddy setup](docs/workbuddy-setup.md)
|
|
33
|
-
and [Codex setup](docs/codex-setup.md).
|
|
27
|
+
全部目标均安装 25 个技能和共享参考资料。
|
|
28
|
+
CodeBuddy、WorkBuddy、Claude Code 另安装 9 个短命令和 4 个 Agent 角色。
|
|
29
|
+
其他工具通过其原生 Skills 机制使用;短命令支持取决于宿主。
|
|
30
|
+
目录预设来自固定的 [Skills CLI 工具登记](https://github.com/vercel-labs/skills/blob/48dc9e8eb8aa19040e91cb90ba0b642c9cbad57e/src/agents.ts)
|
|
31
|
+
并增加 WorkBuddy。目录预设验证与每个宿主的实际执行验收分别记录。
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
安装后重新加载 IDE 或新建会话。详见 [CodeBuddy](docs/codebuddy-setup.md)、
|
|
34
|
+
[WorkBuddy](docs/workbuddy-setup.md) 和 [Codex](docs/codex-setup.md) 安装说明。
|
|
35
|
+
|
|
36
|
+
无需交互时,明确选择工具和范围:
|
|
36
37
|
|
|
37
38
|
```bash
|
|
38
39
|
npx @givolt/i3-composer-agent --agents codebuddy,codex --scope project --yes
|
|
39
|
-
npx @givolt/i3-composer-agent --workbuddy --scope project --yes
|
|
40
|
-
npx @givolt/i3-composer-agent --agents codebuddy,workbuddy --scope project --yes
|
|
41
40
|
npx @givolt/i3-composer-agent --workbuddy --scope global --yes
|
|
41
|
+
npx @givolt/i3-composer-agent --agents codebuddy,workbuddy --scope global --yes
|
|
42
42
|
npx @givolt/i3-composer-agent --claude --scope global --yes
|
|
43
43
|
npx @givolt/i3-composer-agent --codebuddy --scope project --dry-run
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
CodeBuddy
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
adding a client merges its ID into the shared installation manifest. Modified
|
|
52
|
-
files, unowned collisions and version upgrades require confirmation; use
|
|
53
|
-
`--force` with noninteractive installs after reviewing the dry run.
|
|
54
|
-
After successful installation, replaced files and installer-owned historical
|
|
55
|
-
backups are removed. A failed installation restores the previous files.
|
|
56
|
-
`npx -y` accepts npm's package download prompt; the package's own `--yes` flag
|
|
57
|
-
accepts the explicit installation plan.
|
|
46
|
+
CodeBuddy 和 WorkBuddy 的项目安装共用 `.codebuddy/`,相同目标只安装一次,
|
|
47
|
+
保留已有 `.workbuddy/` 项目设置。全局分别使用 `~/.codebuddy/` 和 `~/.workbuddy/`。
|
|
48
|
+
**WorkBuddy 桌面版建议全局安装**:已观察到 5.7.7 的技能列表扫描 `.workbuddy/skills/`,
|
|
49
|
+
共用的项目 `.codebuddy/skills/` 可能不显示,但项目命令仍可发现。
|
|
50
|
+
可让 CodeBuddy 项目安装、WorkBuddy 全局安装,或让两者都全局安装。
|
|
58
51
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
52
|
+
同版本、同范围的清单所属未修改内容会复用,新增客户端合并到清单。
|
|
53
|
+
升级、修改过的内容及未登记同名冲突需确认替换;非交互使用 `--force` 前可先看 dry-run。
|
|
54
|
+
安装成功后清理替换掉的旧内容及本安装器所属历史备份,失败则恢复原文件。
|
|
55
|
+
迁移只清理旧清单所属的无前缀 Skill/命令路径,保留自定义内容。
|
|
56
|
+
标准 MIT 许可随共享参考资料安装。`npx -y` 确认 npm 下载;包的 `--yes` 确认安装计划。
|
|
64
57
|
|
|
65
|
-
##
|
|
58
|
+
## 注册完整插件
|
|
66
59
|
|
|
67
|
-
|
|
68
|
-
persistent `./i3-composer-agent/` bundle:
|
|
60
|
+
完整插件包含 Skills、Commands、Agents、Hooks 和 references。准备持久目录:
|
|
69
61
|
|
|
70
62
|
```bash
|
|
71
63
|
npx @givolt/i3-composer-agent --prepare --codebuddy
|
|
@@ -73,80 +65,86 @@ npx @givolt/i3-composer-agent --prepare --codex
|
|
|
73
65
|
npx @givolt/i3-composer-agent --prepare --claude
|
|
74
66
|
```
|
|
75
67
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
mode does not install native skills or choose the host plugin manager's scope.
|
|
79
|
-
|
|
80
|
-
CodeBuddy Code (terminal) / Claude Code:
|
|
68
|
+
此模式准备 `./i3-composer-agent/` 并输出宿主注册命令。
|
|
69
|
+
在 CodeBuddy Code(终端)或 Claude Code 中执行:
|
|
81
70
|
|
|
82
71
|
```text
|
|
83
72
|
/plugin marketplace add ./i3-composer-agent
|
|
84
73
|
/plugin install i3-composer-agent@i3-composer-agent
|
|
85
74
|
```
|
|
86
75
|
|
|
87
|
-
Codex
|
|
76
|
+
Codex 中执行:
|
|
88
77
|
|
|
89
78
|
```bash
|
|
90
79
|
codex plugin marketplace add ./i3-composer-agent
|
|
91
80
|
codex plugin add i3-composer-agent@i3-composer-agent
|
|
92
81
|
```
|
|
93
82
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
is maintained separately.
|
|
83
|
+
按宿主管理器选择安装范围,启用后新建会话。原生文件安装与完整插件注册是两种入口。
|
|
84
|
+
原生安装不自动启用插件 Hook;无需 Hook,入口本身也要求默认中文回复。
|
|
97
85
|
|
|
98
|
-
##
|
|
86
|
+
## 命令
|
|
99
87
|
|
|
100
|
-
|
|
101
|
-
`/i3-
|
|
102
|
-
commands load the same workflows under the plugin namespace:
|
|
88
|
+
CodeBuddy、WorkBuddy、Claude Code 原生安装使用 `/i3-spec`、`/i3-plan`、
|
|
89
|
+
`/i3-build`、`/i3-ship` 等短命令。支持兼容插件命令的宿主使用插件命名空间:
|
|
103
90
|
|
|
104
|
-
|
|
|
91
|
+
| 命令 | 中文说明 |
|
|
105
92
|
| --- | --- |
|
|
106
|
-
| /i3-composer-agent:i3-build |
|
|
107
|
-
| /i3-composer-agent:i3-code-simplify |
|
|
108
|
-
| /i3-composer-agent:i3-constraints |
|
|
109
|
-
| /i3-composer-agent:i3-plan |
|
|
110
|
-
| /i3-composer-agent:i3-review |
|
|
111
|
-
| /i3-composer-agent:i3-ship |
|
|
112
|
-
| /i3-composer-agent:i3-spec |
|
|
113
|
-
| /i3-composer-agent:i3-test |
|
|
114
|
-
| /i3-composer-agent:i3-webperf |
|
|
115
|
-
|
|
116
|
-
`/i3-build auto`
|
|
117
|
-
|
|
93
|
+
| /i3-composer-agent:i3-build | 按任务增量实现、构建、测试、验证并提交;添加 auto 可按已获批准的完整计划执行。 |
|
|
94
|
+
| /i3-composer-agent:i3-code-simplify | 简化代码,降低复杂度,提高可读性与维护性,并保持既有行为不变。 |
|
|
95
|
+
| /i3-composer-agent:i3-constraints | 访谈并定义项目质量门槛,提供合理默认值,写入 CONSTRAINTS.md 并落实约束。 |
|
|
96
|
+
| /i3-composer-agent:i3-plan | 把工作拆成带验收标准、验证步骤和依赖顺序的小任务。 |
|
|
97
|
+
| /i3-composer-agent:i3-review | 从正确性、可读性、架构、安全和性能五个维度审查代码。 |
|
|
98
|
+
| /i3-composer-agent:i3-ship | 并行调用三个专业角色执行发布前检查,主会话汇总 GO/NO-GO 决策与回滚计划。 |
|
|
99
|
+
| /i3-composer-agent:i3-spec | 先编写结构化规格、目标、范围与验收标准,再进入实现。 |
|
|
100
|
+
| /i3-composer-agent:i3-test | 执行 TDD:先编写失败测试,再实现和验证;缺陷使用 Prove-It 模式复现。 |
|
|
101
|
+
| /i3-composer-agent:i3-webperf | 调用 web-performance-auditor 角色审查网页性能与 Core Web Vitals。 |
|
|
102
|
+
|
|
103
|
+
`/i3-build auto` 按已获批准的任务计划执行完整流程。
|
|
104
|
+
插件调用为 `/i3-composer-agent:i3-build auto`,原审批边界和验证条件仍有效。
|
|
105
|
+
`/i3-ship` 在宿主支持时并行运行三个专业角色;不可用时读取角色提示依次审查,
|
|
106
|
+
由主会话汇总 GO/NO-GO 决策,回滚计划必需,严重问题默认阻止发布。
|
|
118
107
|
|
|
119
108
|
## Skills
|
|
120
109
|
|
|
121
|
-
|
|
|
110
|
+
| 技能 | 中文说明 |
|
|
122
111
|
| --- | --- |
|
|
123
|
-
| [i3-api-and-interface-design](skills/i3-api-and-interface-design/SKILL.md) |
|
|
124
|
-
| [i3-browser-testing-with-devtools](skills/i3-browser-testing-with-devtools/SKILL.md) |
|
|
125
|
-
| [i3-ci-cd-and-automation](skills/i3-ci-cd-and-automation/SKILL.md) |
|
|
126
|
-
| [i3-code-review-and-quality](skills/i3-code-review-and-quality/SKILL.md) |
|
|
127
|
-
| [i3-code-simplification](skills/i3-code-simplification/SKILL.md) |
|
|
128
|
-
| [i3-constraint-driven-development](skills/i3-constraint-driven-development/SKILL.md) |
|
|
129
|
-
| [i3-context-engineering](skills/i3-context-engineering/SKILL.md) |
|
|
130
|
-
| [i3-debugging-and-error-recovery](skills/i3-debugging-and-error-recovery/SKILL.md) |
|
|
131
|
-
| [i3-deprecation-and-migration](skills/i3-deprecation-and-migration/SKILL.md) |
|
|
132
|
-
| [i3-documentation-and-adrs](skills/i3-documentation-and-adrs/SKILL.md) |
|
|
133
|
-
| [i3-doubt-driven-development](skills/i3-doubt-driven-development/SKILL.md) |
|
|
134
|
-
| [i3-frontend-ui-engineering](skills/i3-frontend-ui-engineering/SKILL.md) |
|
|
135
|
-
| [i3-git-workflow-and-versioning](skills/i3-git-workflow-and-versioning/SKILL.md) |
|
|
136
|
-
| [i3-idea-refine](skills/i3-idea-refine/SKILL.md) |
|
|
137
|
-
| [i3-incremental-implementation](skills/i3-incremental-implementation/SKILL.md) |
|
|
138
|
-
| [i3-interview-me](skills/i3-interview-me/SKILL.md) |
|
|
139
|
-
| [i3-observability-and-instrumentation](skills/i3-observability-and-instrumentation/SKILL.md) |
|
|
140
|
-
| [i3-performance-optimization](skills/i3-performance-optimization/SKILL.md) |
|
|
141
|
-
| [i3-planning-and-task-breakdown](skills/i3-planning-and-task-breakdown/SKILL.md) |
|
|
142
|
-
| [i3-security-and-hardening](skills/i3-security-and-hardening/SKILL.md) |
|
|
143
|
-
| [i3-shipping-and-launch](skills/i3-shipping-and-launch/SKILL.md) |
|
|
144
|
-
| [i3-source-driven-development](skills/i3-source-driven-development/SKILL.md) |
|
|
145
|
-
| [i3-spec-driven-development](skills/i3-spec-driven-development/SKILL.md) |
|
|
146
|
-
| [i3-test-driven-development](skills/i3-test-driven-development/SKILL.md) |
|
|
147
|
-
| [i3-using-agent-skills](skills/i3-using-agent-skills/SKILL.md) |
|
|
148
|
-
|
|
149
|
-
##
|
|
112
|
+
| [i3-api-and-interface-design](skills/i3-api-and-interface-design/SKILL.md) | 设计稳定的 API、模块接口和类型契约。适用于 REST/GraphQL 端点、模块边界、前后端接口及公共 API 设计。 |
|
|
113
|
+
| [i3-browser-testing-with-devtools](skills/i3-browser-testing-with-devtools/SKILL.md) | 通过 Chrome DevTools MCP 在真实浏览器测试。适用于网页开发或排错、检查 DOM、控制台错误、网络请求、性能及视觉结果;需要配置 chrome-devtools MCP。 |
|
|
114
|
+
| [i3-ci-cd-and-automation](skills/i3-ci-cd-and-automation/SKILL.md) | 配置 CI/CD 构建与部署流水线。适用于每次 PR 自动执行 lint 和测试、失败阻止合并,配置持续集成质量门禁与部署策略。 |
|
|
115
|
+
| [i3-code-review-and-quality](skills/i3-code-review-and-quality/SKILL.md) | 按正确性、可读性、架构、安全与性能审查代码。适用于合并前审查自己、其他代理或人工编写的改动,包括 diff、PR 和内联代码评审。 |
|
|
116
|
+
| [i3-code-simplification](skills/i3-code-simplification/SKILL.md) | 在保持行为不变的前提下简化代码。适用于简化现有代码结构、重构复杂逻辑、保留全部现有行为,并提高可读性、维护性与可扩展性。 |
|
|
117
|
+
| [i3-constraint-driven-development](skills/i3-constraint-driven-development/SKILL.md) | 把项目质量标准写入 CONSTRAINTS.md 并落实为约束。适用于制定无障碍、性能、覆盖率等门槛,选择合理默认值,防止跳过测试、削弱断言、压低阈值、屏蔽错误或以空实现通过检查。 |
|
|
118
|
+
| [i3-context-engineering](skills/i3-context-engineering/SKILL.md) | 优化代理上下文与项目规则。适用于新会话、输出质量下降、任务切换,以及配置项目规则文件、上下文和提示。 |
|
|
119
|
+
| [i3-debugging-and-error-recovery](skills/i3-debugging-and-error-recovery/SKILL.md) | 系统复现故障、定位根因并验证修复。适用于测试失败、构建损坏、运行崩溃、功能回归、异常报错或行为不符合预期。 |
|
|
120
|
+
| [i3-deprecation-and-migration](skills/i3-deprecation-and-migration/SKILL.md) | 管理废弃与迁移。适用于替换旧系统、API 或功能、迁移用户、生产数据库无停机扩展/收缩,以及决定维护或退役现有代码。 |
|
|
121
|
+
| [i3-documentation-and-adrs](skills/i3-documentation-and-adrs/SKILL.md) | 记录文档、架构决策与设计理由。适用于编写 ADR、公共 API 发生变化时补充文档、交付功能,以及保存后续工程师和代理理解设计取舍所需的背景。 |
|
|
122
|
+
| [i3-doubt-driven-development](skills/i3-doubt-driven-development/SKILL.md) | 对非平凡决策进行独立的对抗式审查。适用于核查假设、压力测试计划、寻找隐藏失败模式、陌生代码、安全敏感功能、生产认证或高风险不可逆迁移。 |
|
|
123
|
+
| [i3-frontend-ui-engineering](skills/i3-frontend-ui-engineering/SKILL.md) | 实现可访问、响应式、具有生产质量的前端界面。适用于页面/组件开发、布局、状态管理、WCAG 无障碍、交互与视觉质量改进。 |
|
|
124
|
+
| [i3-git-workflow-and-versioning](skills/i3-git-workflow-and-versioning/SKILL.md) | 组织 Git 分支、提交、冲突处理、PR 与版本发布。适用于任何代码改动、拆分工作区改动、并行开发、推送、合并、语义化版本、标签及变更日志。 |
|
|
125
|
+
| [i3-idea-refine](skills/i3-idea-refine/SKILL.md) | 通过发散与收敛思考完善模糊想法。适用于创意探索、细化方案、验证假设、压力测试计划,以及确定方向前比较更多选项。 |
|
|
126
|
+
| [i3-incremental-implementation](skills/i3-incremental-implementation/SKILL.md) | 把改动拆成小而完整、可验证的实现切片。适用于涉及多个文件的功能、领取计划中的下一任务、特性开关发布,以及避免一次落地过大的改动。 |
|
|
127
|
+
| [i3-interview-me](skills/i3-interview-me/SKILL.md) | 通过一次一个问题的访谈或采访明确真实意图,直到约 95% 把握并确信理解用户想要什么。适用于需求不充分、缺少目标用户或目的、用户要求访谈/质询,或在提出方案、规格与计划前发现关键需求仍在猜测。 |
|
|
128
|
+
| [i3-observability-and-instrumentation](skills/i3-observability-and-instrumentation/SKILL.md) | 为生产行为增加日志、指标、链路追踪与告警。适用于新增可观测性、交付生产功能并提供运行证据,以及无法从已有数据定位生产故障。 |
|
|
129
|
+
| [i3-performance-optimization](skills/i3-performance-optimization/SKILL.md) | 优化前端、后端、查询和数据库性能。适用于性能指标、回归、Core Web Vitals、慢加载、N+1 查询或性能剖析发现瓶颈。 |
|
|
130
|
+
| [i3-planning-and-task-breakdown](skills/i3-planning-and-task-breakdown/SKILL.md) | 把规格和明确需求拆成有顺序的任务。适用于实施计划、验收条件、验证步骤、依赖排序、范围估算,以及大任务或并行工作安排。 |
|
|
131
|
+
| [i3-security-and-hardening](skills/i3-security-and-hardening/SKILL.md) | 分析漏洞、威胁与安全加固。适用于不可信输入、webhook URL 服务端请求与 SSRF 防护、认证授权、会话、数据存储、外部集成、OWASP Top Ten、依赖 CVE、供应链、个人数据与隐私合规。 |
|
|
132
|
+
| [i3-shipping-and-launch](skills/i3-shipping-and-launch/SKILL.md) | 检查生产发布条件与回滚策略。适用于上线准备、发布清单、监控、分阶段部署和回滚方案,确保风险有依据且可恢复。 |
|
|
133
|
+
| [i3-source-driven-development](skills/i3-source-driven-development/SKILL.md) | 以官方文档和权威来源支撑实现决策。适用于核对框架/库用法、验证方案、查证 API 和避免过时实现,并保留来源证据。 |
|
|
134
|
+
| [i3-spec-driven-development](skills/i3-spec-driven-development/SKILL.md) | 在实现前形成结构化规格。适用于新项目、功能或重大改动、PRD、需求澄清、目标与范围、场景和验收标准,以及将需求拆为独立可测试能力。 |
|
|
135
|
+
| [i3-test-driven-development](skills/i3-test-driven-development/SKILL.md) | 执行测试先行的红绿重构循环。适用于实现逻辑、修复缺陷、修改行为、复现报错及证明改动有效;缺陷修复使用先证明失败的 Prove-It 模式。 |
|
|
136
|
+
| [i3-using-agent-skills](skills/i3-using-agent-skills/SKILL.md) | 发现并调用合适的工程技能。适用于开始会话、判断任务意图、选择技能或工作流;作为元技能协调其他技能的发现和调用。 |
|
|
137
|
+
|
|
138
|
+
## Agent 角色
|
|
139
|
+
|
|
140
|
+
| 角色 | 中文说明 |
|
|
141
|
+
| --- | --- |
|
|
142
|
+
| [code-reviewer](agents/code-reviewer.md) | 高级代码审查角色,评估正确性、可读性、架构、安全和性能。适用于合并前完整代码评审,并输出有严重程度和证据的问题报告。 |
|
|
143
|
+
| [security-auditor](agents/security-auditor.md) | 安全工程角色,分析漏洞、威胁模型与安全编码。适用于安全审查、认证授权、威胁分析和加固建议,并输出审计报告。 |
|
|
144
|
+
| [test-engineer](agents/test-engineer.md) | 质量工程角色,设计测试策略、编写测试并分析覆盖率。适用于测试套件设计、现有代码测试、边界/错误/并发路径与测试质量评估。 |
|
|
145
|
+
| [web-performance-auditor](agents/web-performance-auditor.md) | 网页性能角色,分析 Core Web Vitals、加载、渲染与网络。适用于性能审计、CWV 分析和识别结构性性能反模式。 |
|
|
146
|
+
|
|
147
|
+
## 导出与升级
|
|
150
148
|
|
|
151
149
|
```bash
|
|
152
150
|
npx @givolt/i3-composer-agent --extract --dir /path/to/plugin
|
|
@@ -154,6 +152,8 @@ npx @givolt/i3-composer-agent --codebuddy --dir /path/to/plugin --dry-run
|
|
|
154
152
|
npx @givolt/i3-composer-agent --codebuddy --dir /path/to/plugin --force
|
|
155
153
|
```
|
|
156
154
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
AGENTS.md
|
|
155
|
+
明确 `--dir` 保持完整插件准备行为。成功替换后清理旧插件和所属历史备份。
|
|
156
|
+
升级时重新运行安装命令并确认替换,完成后重新加载宿主。
|
|
157
|
+
仓库维护用的 AGENTS.md、CLAUDE.md 不复制进业务项目。
|
|
158
|
+
Codex 通过 `$i3-spec-driven-development` 等技能名调用;其原生 `/plan` 是宿主计划模式。
|
|
159
|
+
中文语言策略、工程方法、审批要求与工具限制在各入口独立生效。
|
package/agents/code-reviewer.md
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: code-reviewer
|
|
3
|
-
description:
|
|
3
|
+
description: "高级代码审查角色,评估正确性、可读性、架构、安全和性能。适用于合并前完整代码评审,并输出有严重程度和证据的问题报告。"
|
|
4
|
+
# i3-description-source: "description: Senior code reviewer that evaluates changes across five dimensions — correctness, readability, architecture, security, and performance. Use for thorough code review before merge."
|
|
4
5
|
---
|
|
5
6
|
|
|
7
|
+
<!-- i3:zh-CN:start -->
|
|
8
|
+
## 中文交互与输出
|
|
9
|
+
|
|
10
|
+
默认使用简体中文回复,包括追问、选项说明、阶段进度、分析、规格、计划、验收、代码审查与发布报告。只有用户明确要求其他语言时才切换;输入中出现英文术语、代码或引用不构成切换语言的要求。
|
|
11
|
+
下文的工程步骤、审批要求、退出条件和工具约束完整有效。英文示例中的人类可读标题、说明和占位内容在实际输出时应译为中文;保留原有信息与验证标准,不删减方法。
|
|
12
|
+
Skill/Command/Agent 标识、文件路径、命令参数、代码/API 名称、工具调用参数、JSON 键/类型/枚举、机器状态、测试期望字面量及引用原文保持原样。生成文档正文用中文,SPEC.md、tasks/plan.md、tasks/todo.md、CONSTRAINTS.md 等约定路径不改名。
|
|
13
|
+
严重程度按原规则判断,面向用户可写“严重(Critical)”“必须修复(Required)”“小问题(Nit)”“可选(Optional)”“建议考虑(Consider)”“仅供参考(FYI)”;High/Medium/Low、APPROVE/REQUEST CHANGES 和 GO/NO-GO 保留其原始语义与机器值。不得因翻译降低门槛,角色不能互相委派。
|
|
14
|
+
|
|
15
|
+
适用说明:高级代码审查角色,评估正确性、可读性、架构、安全和性能。适用于合并前完整代码评审,并输出有严重程度和证据的问题报告。
|
|
16
|
+
<!-- i3:zh-CN:end -->
|
|
17
|
+
|
|
6
18
|
# Senior Code Reviewer
|
|
7
19
|
|
|
8
20
|
You are an experienced Staff Engineer conducting a thorough code review. Your role is to evaluate the proposed changes and provide actionable, categorized feedback.
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: security-auditor
|
|
3
|
-
description:
|
|
3
|
+
description: "安全工程角色,分析漏洞、威胁模型与安全编码。适用于安全审查、认证授权、威胁分析和加固建议,并输出审计报告。"
|
|
4
|
+
# i3-description-source: "description: Security engineer focused on vulnerability detection, threat modeling, and secure coding practices. Use for security-focused code review, threat analysis, or hardening recommendations."
|
|
4
5
|
---
|
|
5
6
|
|
|
7
|
+
<!-- i3:zh-CN:start -->
|
|
8
|
+
## 中文交互与输出
|
|
9
|
+
|
|
10
|
+
默认使用简体中文回复,包括追问、选项说明、阶段进度、分析、规格、计划、验收、代码审查与发布报告。只有用户明确要求其他语言时才切换;输入中出现英文术语、代码或引用不构成切换语言的要求。
|
|
11
|
+
下文的工程步骤、审批要求、退出条件和工具约束完整有效。英文示例中的人类可读标题、说明和占位内容在实际输出时应译为中文;保留原有信息与验证标准,不删减方法。
|
|
12
|
+
Skill/Command/Agent 标识、文件路径、命令参数、代码/API 名称、工具调用参数、JSON 键/类型/枚举、机器状态、测试期望字面量及引用原文保持原样。生成文档正文用中文,SPEC.md、tasks/plan.md、tasks/todo.md、CONSTRAINTS.md 等约定路径不改名。
|
|
13
|
+
严重程度按原规则判断,面向用户可写“严重(Critical)”“必须修复(Required)”“小问题(Nit)”“可选(Optional)”“建议考虑(Consider)”“仅供参考(FYI)”;High/Medium/Low、APPROVE/REQUEST CHANGES 和 GO/NO-GO 保留其原始语义与机器值。不得因翻译降低门槛,角色不能互相委派。
|
|
14
|
+
|
|
15
|
+
适用说明:安全工程角色,分析漏洞、威胁模型与安全编码。适用于安全审查、认证授权、威胁分析和加固建议,并输出审计报告。
|
|
16
|
+
<!-- i3:zh-CN:end -->
|
|
17
|
+
|
|
6
18
|
# Security Auditor
|
|
7
19
|
|
|
8
20
|
You are an experienced Security Engineer conducting a security review. Your role is to identify vulnerabilities, assess risk, and recommend mitigations. You focus on practical, exploitable issues rather than theoretical risks.
|
package/agents/test-engineer.md
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: test-engineer
|
|
3
|
-
description:
|
|
3
|
+
description: "质量工程角色,设计测试策略、编写测试并分析覆盖率。适用于测试套件设计、现有代码测试、边界/错误/并发路径与测试质量评估。"
|
|
4
|
+
# i3-description-source: "description: QA engineer specialized in test strategy, test writing, and coverage analysis. Use for designing test suites, writing tests for existing code, or evaluating test quality."
|
|
4
5
|
---
|
|
5
6
|
|
|
7
|
+
<!-- i3:zh-CN:start -->
|
|
8
|
+
## 中文交互与输出
|
|
9
|
+
|
|
10
|
+
默认使用简体中文回复,包括追问、选项说明、阶段进度、分析、规格、计划、验收、代码审查与发布报告。只有用户明确要求其他语言时才切换;输入中出现英文术语、代码或引用不构成切换语言的要求。
|
|
11
|
+
下文的工程步骤、审批要求、退出条件和工具约束完整有效。英文示例中的人类可读标题、说明和占位内容在实际输出时应译为中文;保留原有信息与验证标准,不删减方法。
|
|
12
|
+
Skill/Command/Agent 标识、文件路径、命令参数、代码/API 名称、工具调用参数、JSON 键/类型/枚举、机器状态、测试期望字面量及引用原文保持原样。生成文档正文用中文,SPEC.md、tasks/plan.md、tasks/todo.md、CONSTRAINTS.md 等约定路径不改名。
|
|
13
|
+
严重程度按原规则判断,面向用户可写“严重(Critical)”“必须修复(Required)”“小问题(Nit)”“可选(Optional)”“建议考虑(Consider)”“仅供参考(FYI)”;High/Medium/Low、APPROVE/REQUEST CHANGES 和 GO/NO-GO 保留其原始语义与机器值。不得因翻译降低门槛,角色不能互相委派。
|
|
14
|
+
|
|
15
|
+
适用说明:质量工程角色,设计测试策略、编写测试并分析覆盖率。适用于测试套件设计、现有代码测试、边界/错误/并发路径与测试质量评估。
|
|
16
|
+
<!-- i3:zh-CN:end -->
|
|
17
|
+
|
|
6
18
|
# Test Engineer
|
|
7
19
|
|
|
8
20
|
You are an experienced QA Engineer focused on test strategy and quality assurance. Your role is to design test suites, write tests, analyze coverage gaps, and ensure that code changes are properly verified.
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: web-performance-auditor
|
|
3
|
-
description:
|
|
3
|
+
description: "网页性能角色,分析 Core Web Vitals、加载、渲染与网络。适用于性能审计、CWV 分析和识别结构性性能反模式。"
|
|
4
|
+
# i3-description-source: "description: Web performance engineer focused on Core Web Vitals, loading, rendering, and network optimization. Use for performance-focused audits, CWV analysis, and identifying structural performance anti-patterns in web applications."
|
|
4
5
|
---
|
|
5
6
|
|
|
7
|
+
<!-- i3:zh-CN:start -->
|
|
8
|
+
## 中文交互与输出
|
|
9
|
+
|
|
10
|
+
默认使用简体中文回复,包括追问、选项说明、阶段进度、分析、规格、计划、验收、代码审查与发布报告。只有用户明确要求其他语言时才切换;输入中出现英文术语、代码或引用不构成切换语言的要求。
|
|
11
|
+
下文的工程步骤、审批要求、退出条件和工具约束完整有效。英文示例中的人类可读标题、说明和占位内容在实际输出时应译为中文;保留原有信息与验证标准,不删减方法。
|
|
12
|
+
Skill/Command/Agent 标识、文件路径、命令参数、代码/API 名称、工具调用参数、JSON 键/类型/枚举、机器状态、测试期望字面量及引用原文保持原样。生成文档正文用中文,SPEC.md、tasks/plan.md、tasks/todo.md、CONSTRAINTS.md 等约定路径不改名。
|
|
13
|
+
严重程度按原规则判断,面向用户可写“严重(Critical)”“必须修复(Required)”“小问题(Nit)”“可选(Optional)”“建议考虑(Consider)”“仅供参考(FYI)”;High/Medium/Low、APPROVE/REQUEST CHANGES 和 GO/NO-GO 保留其原始语义与机器值。不得因翻译降低门槛,角色不能互相委派。
|
|
14
|
+
|
|
15
|
+
适用说明:网页性能角色,分析 Core Web Vitals、加载、渲染与网络。适用于性能审计、CWV 分析和识别结构性性能反模式。
|
|
16
|
+
<!-- i3:zh-CN:end -->
|
|
17
|
+
|
|
6
18
|
# Web Performance Auditor
|
|
7
19
|
|
|
8
20
|
You are an experienced Web Performance Engineer conducting a performance audit. Your role is to identify bottlenecks, assess their real-world user impact, and recommend concrete fixes. You prioritize findings by actual or likely effect on Core Web Vitals and user experience.
|
|
@@ -13,38 +13,41 @@ const identity = `i3 Composer Agent v${pkg.version}`;
|
|
|
13
13
|
const help = `${identity}
|
|
14
14
|
${pkg.name}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
通过多工具安装向导安装软件工程技能,默认中文回复。
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
用法:
|
|
19
19
|
npx ${pkg.name}
|
|
20
20
|
npx ${pkg.name} --codebuddy
|
|
21
|
-
npx ${pkg.name} --workbuddy
|
|
22
|
-
npx ${pkg.name} --agents codebuddy,workbuddy --scope
|
|
21
|
+
npx ${pkg.name} --workbuddy --scope global
|
|
22
|
+
npx ${pkg.name} --agents codebuddy,workbuddy --scope global --yes
|
|
23
23
|
npx ${pkg.name} --agents codebuddy,codex --scope project --yes
|
|
24
24
|
npx ${pkg.name} --prepare --claude --dir <directory>
|
|
25
25
|
npx ${pkg.name} --extract --dir <directory>
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
--agents <ids>
|
|
29
|
-
--codebuddy
|
|
30
|
-
--workbuddy
|
|
31
|
-
--codex
|
|
32
|
-
--claude
|
|
33
|
-
--scope <scope> project
|
|
34
|
-
--project-dir <dir>
|
|
35
|
-
--yes
|
|
36
|
-
--list-agents
|
|
37
|
-
--prepare
|
|
38
|
-
--
|
|
39
|
-
--
|
|
40
|
-
--
|
|
41
|
-
--
|
|
42
|
-
--
|
|
27
|
+
选项:
|
|
28
|
+
--agents <ids> 工具 ID,逗号分隔,可同时选择多个
|
|
29
|
+
--codebuddy 预选 CodeBuddy 桌面 IDE / CodeBuddy Code
|
|
30
|
+
--workbuddy 预选 WorkBuddy(桌面版建议全局安装)
|
|
31
|
+
--codex 预选 Codex
|
|
32
|
+
--claude 预选 Claude Code
|
|
33
|
+
--scope <scope> project 项目 / global 全局(也可 --global / --local)
|
|
34
|
+
--project-dir <dir> 项目安装根目录,默认当前目录
|
|
35
|
+
--yes 确认明确指定的非交互安装
|
|
36
|
+
--list-agents 列出全部支持的工具目录
|
|
37
|
+
--prepare 准备完整插件,供宿主原生插件管理器注册
|
|
38
|
+
--extract 导出完整插件内容
|
|
39
|
+
--dir <directory> 插件输出目录;隐含 --prepare
|
|
40
|
+
--dry-run 显示安装/导出计划,不写入文件
|
|
41
|
+
--force 确认替换已有内容,成功后清理旧文件
|
|
42
|
+
--version 输出包版本
|
|
43
|
+
--help 显示帮助
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
终端向导先显示常用工具,WorkBuddy 在第 2 项;选择“更多”可分页/搜索全部工具。
|
|
46
|
+
编号或 ID 支持多选,跨页保留选择;回车或 done/完成确认,q/取消退出。
|
|
47
|
+
CodeBuddy、WorkBuddy、Claude Code 同时安装短命令和 Agent 角色。
|
|
48
|
+
其他工具获得 Skills 与参考资料,短命令支持取决于宿主。
|
|
49
|
+
WorkBuddy 桌面版建议全局安装,便于技能列表和输入补全发现。
|
|
50
|
+
完整插件及 Hook 注册使用 --prepare。
|
|
48
51
|
`;
|
|
49
52
|
|
|
50
53
|
function quote(value) { return "'" + value.replaceAll("'", "'\\''") + "'"; }
|
|
@@ -54,7 +57,7 @@ function realDestination(target) {
|
|
|
54
57
|
while (!fs.existsSync(existing)) {
|
|
55
58
|
suffix.unshift(path.basename(existing));
|
|
56
59
|
const parent = path.dirname(existing);
|
|
57
|
-
if (parent === existing) throw new Error(
|
|
60
|
+
if (parent === existing) throw new Error(`无法解析输出目录: ${target}`);
|
|
58
61
|
existing = parent;
|
|
59
62
|
}
|
|
60
63
|
return path.join(fs.realpathSync(existing), ...suffix);
|
|
@@ -67,29 +70,29 @@ function prepare() {
|
|
|
67
70
|
for (let i = 0; i < args.length; i++) {
|
|
68
71
|
const arg = args[i];
|
|
69
72
|
if (arg === '--prepare') continue;
|
|
70
|
-
if (arg === '--workbuddy') throw new Error('
|
|
73
|
+
if (arg === '--workbuddy') throw new Error('安装 WorkBuddy 原生技能请使用 --workbuddy --scope project|global --yes,移除 --prepare 和 --dir。');
|
|
71
74
|
if (['--codebuddy', '--codex', '--claude', '--extract'].includes(arg)) {
|
|
72
|
-
if (host) throw new Error('
|
|
75
|
+
if (host) throw new Error('请选择一个宿主参数或 --extract。');
|
|
73
76
|
host = arg.slice(2);
|
|
74
77
|
} else if (arg === '--dir') {
|
|
75
|
-
if (!args[i + 1] || args[i + 1].startsWith('--')) throw new Error('--dir
|
|
78
|
+
if (!args[i + 1] || args[i + 1].startsWith('--')) throw new Error('--dir 需要指定目录。');
|
|
76
79
|
directory = path.resolve(args[++i]);
|
|
77
80
|
} else if (arg === '--dry-run') dryRun = true;
|
|
78
81
|
else if (arg === '--force') force = true;
|
|
79
|
-
else throw new Error(
|
|
82
|
+
else throw new Error(`未知选项: ${arg}`);
|
|
80
83
|
}
|
|
81
|
-
if (!host) throw new Error('
|
|
84
|
+
if (!host) throw new Error('请选择 --codebuddy、--codex、--claude 或 --extract。');
|
|
82
85
|
directory = realDestination(directory);
|
|
83
86
|
const sourceRoot = fs.realpathSync(root);
|
|
84
87
|
if (directory === sourceRoot || directory.startsWith(sourceRoot + path.sep) || sourceRoot.startsWith(directory + path.sep)) {
|
|
85
|
-
throw new Error('
|
|
88
|
+
throw new Error('输出目录必须位于包目录之外。');
|
|
86
89
|
}
|
|
87
90
|
let exists = false;
|
|
88
91
|
try { fs.lstatSync(directory); exists = true; } catch (error) { if (error.code !== 'ENOENT') throw error; }
|
|
89
92
|
if (exists) {
|
|
90
|
-
if (!force) throw new Error(
|
|
93
|
+
if (!force) throw new Error(`输出目录已存在: ${directory}. 请选择新目录,或对已有 i3 插件使用 --force。`);
|
|
91
94
|
const manifest = JSON.parse(fs.readFileSync(path.join(directory, 'plugin.json'), 'utf8'));
|
|
92
|
-
if (manifest.name !== name) throw new Error('
|
|
95
|
+
if (manifest.name !== name) throw new Error('不能替换属于其他插件的目录。');
|
|
93
96
|
}
|
|
94
97
|
if (dryRun) {
|
|
95
98
|
console.log(JSON.stringify({ name, version: pkg.version, directory, host, files: pkg.i3ComposerAgent.pluginFiles, replacesExisting: exists }, null, 2));
|
|
@@ -108,7 +111,7 @@ function prepare() {
|
|
|
108
111
|
recursive: true,
|
|
109
112
|
filter: file => {
|
|
110
113
|
if (path.basename(file) === '.DS_Store') return false;
|
|
111
|
-
if (fs.lstatSync(file).isSymbolicLink()) throw new Error(
|
|
114
|
+
if (fs.lstatSync(file).isSymbolicLink()) throw new Error(`插件内容中包含符号链接: ${file}`);
|
|
112
115
|
return !/(?:^|[\\/])(?:results|node_modules|\.git)(?:[\\/]|$)/.test(path.relative(root, file));
|
|
113
116
|
},
|
|
114
117
|
});
|
|
@@ -130,18 +133,18 @@ function prepare() {
|
|
|
130
133
|
});
|
|
131
134
|
}
|
|
132
135
|
console.log(identity);
|
|
133
|
-
console.log(
|
|
136
|
+
console.log(`已在 ${directory} 准备好 ${name}`);
|
|
134
137
|
if (host === 'extract') return;
|
|
135
|
-
console.log('\
|
|
138
|
+
console.log('\n请在目标宿主中执行以下原生命令注册并启用插件:');
|
|
136
139
|
const selector = `${name}@${name}`;
|
|
137
140
|
if (host === 'codex') {
|
|
138
141
|
console.log(`codex plugin marketplace add ${quote(directory)}`);
|
|
139
142
|
console.log(`codex plugin add ${selector}`);
|
|
140
|
-
console.log('
|
|
143
|
+
console.log('请新建 Codex 会话,通过 $i3- 开头的技能名称调用;生命周期短命令由宿主适配决定。');
|
|
141
144
|
} else {
|
|
142
145
|
console.log(`/plugin marketplace add ${quote(directory)}`);
|
|
143
146
|
console.log(`/plugin install ${selector}`);
|
|
144
|
-
console.log(
|
|
147
|
+
console.log(`在目标宿主使用 /${name}:i3-spec、/${name}:i3-plan、/${name}:i3-build 和 /${name}:i3-ship: ${host === 'claude' ? 'Claude Code' : 'CodeBuddy'}.`);
|
|
145
148
|
}
|
|
146
149
|
}
|
|
147
150
|
async function main() {
|
|
@@ -150,7 +153,7 @@ async function main() {
|
|
|
150
153
|
if (args.some(arg => ['--extract', '--prepare', '--dir'].includes(arg))) { prepare(); return; }
|
|
151
154
|
const installer = require('./install.cjs');
|
|
152
155
|
if (args.length === 1 && args[0] === '--list-agents') {
|
|
153
|
-
for (const agent of
|
|
156
|
+
for (const agent of require('./tool-menu.cjs').orderedAgents) console.log(`${agent.id.padEnd(20)} ${agent.label}${agent.globalSkillsDir ? '' : '(仅项目安装)'}`);
|
|
154
157
|
return;
|
|
155
158
|
}
|
|
156
159
|
const options = { agents: [], projectDir: process.cwd() };
|
|
@@ -158,27 +161,27 @@ async function main() {
|
|
|
158
161
|
const arg = args[i];
|
|
159
162
|
if (['--codebuddy', '--workbuddy', '--codex', '--claude'].includes(arg)) options.agents.push(arg.slice(2));
|
|
160
163
|
else if (['--agents', '--scope', '--project-dir'].includes(arg)) {
|
|
161
|
-
if (!args[i + 1] || args[i + 1].startsWith('--')) throw new Error(`${arg}
|
|
164
|
+
if (!args[i + 1] || args[i + 1].startsWith('--')) throw new Error(`${arg} 需要指定值。`);
|
|
162
165
|
const value = args[++i];
|
|
163
166
|
if (arg === '--agents') options.agents.push(value);
|
|
164
|
-
else if (arg === '--scope') { if (options.scope && options.scope !== value) throw new Error('
|
|
167
|
+
else if (arg === '--scope') { if (options.scope && options.scope !== value) throw new Error('请选择一个安装范围。'); options.scope = value; }
|
|
165
168
|
else options.projectDir = path.resolve(value);
|
|
166
169
|
} else if (arg === '--global' || arg === '--local') {
|
|
167
170
|
const scope = arg === '--global' ? 'global' : 'project';
|
|
168
|
-
if (options.scope && options.scope !== scope) throw new Error('
|
|
171
|
+
if (options.scope && options.scope !== scope) throw new Error('请选择一个安装范围。');
|
|
169
172
|
options.scope = scope;
|
|
170
173
|
} else if (arg === '--yes') options.yes = true;
|
|
171
174
|
else if (arg === '--force') options.force = true;
|
|
172
175
|
else if (arg === '--dry-run') options.dryRun = true;
|
|
173
|
-
else throw new Error(
|
|
176
|
+
else throw new Error(`未知选项: ${arg}`);
|
|
174
177
|
}
|
|
175
178
|
options.agents = installer.selectAgents(options.agents);
|
|
176
179
|
if (process.stdin.isTTY && process.stdout.isTTY && !options.yes && !options.dryRun) {
|
|
177
180
|
const selection = await require('./wizard.cjs').choose(options, identity);
|
|
178
|
-
if (!selection) { console.log('
|
|
181
|
+
if (!selection) { console.log('安装已取消,未修改文件。'); return; }
|
|
179
182
|
Object.assign(options, selection);
|
|
180
183
|
} else if (!options.agents.length || !options.scope || (!options.yes && !options.dryRun)) {
|
|
181
|
-
throw new Error('
|
|
184
|
+
throw new Error('请在交互终端使用向导,或明确指定 --agents <ids> --scope project|global --yes。');
|
|
182
185
|
}
|
|
183
186
|
const plan = installer.planInstallation(options);
|
|
184
187
|
if (options.dryRun) {
|
|
@@ -187,19 +190,19 @@ async function main() {
|
|
|
187
190
|
}
|
|
188
191
|
if (!options.yes) {
|
|
189
192
|
const confirmed = await require('./wizard.cjs').confirm(plan);
|
|
190
|
-
if (!confirmed) { console.log('
|
|
193
|
+
if (!confirmed) { console.log('安装已取消,未修改文件。'); return; }
|
|
191
194
|
options.force = plan.conflicts.length > 0;
|
|
192
195
|
}
|
|
193
196
|
installer.executeInstallation(plan, { force: options.force });
|
|
194
197
|
console.log(identity);
|
|
195
|
-
if (plan.reused.length) console.log(
|
|
198
|
+
if (plan.reused.length) console.log(`已复用同版本的 ${plan.reused.length} 个未修改内容。`);
|
|
196
199
|
for (const target of plan.targets) {
|
|
197
|
-
console.log(
|
|
198
|
-
if (target.commandsDirectory) console.log(
|
|
200
|
+
console.log(`已为 ${target.agents.join(', ')} 安装技能:${target.skillsDirectory}`);
|
|
201
|
+
if (target.commandsDirectory) console.log(`命令:/i3-spec、/i3-plan、/i3-build、/i3-ship(共 ${fs.readdirSync(target.commandsDirectory).filter(file => file.endsWith('.md')).length} 个工作流):${target.commandsDirectory}`);
|
|
199
202
|
}
|
|
200
|
-
console.log('
|
|
201
|
-
if (plan.agents.some(id => !['codebuddy', 'workbuddy', 'claude-code'].includes(id))) console.log('
|
|
202
|
-
console.log('
|
|
203
|
-
if (plan.agents.some(id => ['codebuddy', 'codex', 'claude-code'].includes(id))) console.log('
|
|
203
|
+
console.log('请重新加载 IDE 窗口或新建宿主会话以发现安装内容。');
|
|
204
|
+
if (plan.agents.some(id => !['codebuddy', 'workbuddy', 'claude-code'].includes(id))) console.log('这些工具通过技能 ID 调用;生命周期短命令支持取决于宿主。');
|
|
205
|
+
console.log('原生技能安装完成;插件 Hook 需按宿主方式注册和启用。');
|
|
206
|
+
if (plan.agents.some(id => ['codebuddy', 'codex', 'claude-code'].includes(id))) console.log('如需 CodeBuddy、Codex 或 Claude Code 完整插件,请使用 --prepare 和对应宿主参数。');
|
|
204
207
|
}
|
|
205
208
|
main().catch(error => { console.error(`${name}: ${error.message}`); process.exitCode = 1; });
|