ai-engineering-init 1.13.0 → 1.14.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.
@@ -29,7 +29,7 @@ description: |
29
29
  │ - 用户已给出完整字段列表
30
30
 
31
31
  └─ 复杂需求? ──→ Agent 路径(启动 requirements-analyzer)
32
- - 提供了 Axure 原型链接或截图
32
+ - 提供了 Axure 原型截图
33
33
  - 提供了云效任务编号
34
34
  - 多页面/多模块联动
35
35
  - 业务流程复杂,需要状态流转设计
@@ -45,34 +45,12 @@ description: |
45
45
 
46
46
  ## Agent 路径(复杂需求)
47
47
 
48
- ### Axure 链接处理(重要)
49
-
50
- > **Axure 是 SPA 应用,WebFetch 必定失败(TLS/JS 渲染问题)。禁止用 WebFetch 访问 Axure 链接。**
51
-
52
- 当用户提供 Axure 链接时,必须用 Playwright 截图:
53
-
54
- ```bash
55
- # 1. 先用 Playwright 截图(每个页面单独截)
56
- npx playwright screenshot --wait-for-timeout 3000 "https://xxx.axure.cloud/page1" /tmp/axure-1.png
57
- npx playwright screenshot --wait-for-timeout 3000 "https://xxx.axure.cloud/page2" /tmp/axure-2.png
58
-
59
- # 2. 截图完成后,将文件路径传给 image-reader Agent 分析
60
- # 3. 如果原型有多个页面,URL 通常带 #page 参数,逐页截图
61
- ```
62
-
63
- **判断规则**:
64
- - URL 包含 `axure.cloud` 或 `.axshare.com` → Playwright 截图
65
- - 用户说"Axure 链接" → Playwright 截图
66
- - 本地截图文件(.png/.jpg) → 直接 image-reader 分析
67
-
68
- ### 完整流程
69
-
70
48
  ```
71
49
  步骤 1:收集信息(从用户消息中提取)
72
- - Axure 原型链接 → Playwright 截图 → image-reader 分析
73
- - Axure 原型截图文件 → 直接 image-reader 分析
74
- - 云效任务编号 → task-fetcher 获取详情
50
+ - Axure 原型截图路径
51
+ - 云效任务编号
75
52
  - 需求描述文字
53
+ - 关联模块信息
76
54
 
77
55
  步骤 2:启动 requirements-analyzer Agent
78
56
  └── requirements-analyzer(Opus) 内部自动编排:
@@ -91,23 +69,13 @@ npx playwright screenshot --wait-for-timeout 3000 "https://xxx.axure.cloud/page2
91
69
  |---------------|---------|
92
70
  | 只有文字描述 | 快速路径(不启动 Agent) |
93
71
  | 文字 + 原型截图 | requirements-analyzer → 内部调 image-reader |
94
- | 文字 + Axure 链接 | Playwright 截图 → requirements-analyzer → image-reader |
95
72
  | 文字 + 云效任务号 | requirements-analyzer → 内部调 task-fetcher |
96
73
  | 原型截图 + 云效任务号 | requirements-analyzer → 内部并行调 image-reader + task-fetcher |
97
74
 
98
75
  ### 启动示例
99
76
 
100
77
  ```
101
- # 有 Axure 链接(先截图再分析)
102
- Bash: npx playwright screenshot --wait-for-timeout 3000 "https://xxx.axure.cloud/page1" /tmp/axure-1.png
103
- Bash: npx playwright screenshot --wait-for-timeout 3000 "https://xxx.axure.cloud/page2" /tmp/axure-2.png
104
-
105
- Agent(subagent_type="requirements-analyzer",
106
- prompt="分析以下 Axure 原型截图,输出需求分析报告和开发任务清单:
107
- 截图路径:/tmp/axure-1.png, /tmp/axure-2.png
108
- 需求描述:xxx")
109
-
110
- # 有原型截图文件
78
+ # 有原型截图
111
79
  Agent(subagent_type="requirements-analyzer",
112
80
  prompt="分析以下 Axure 原型截图,输出需求分析报告和开发任务清单:
113
81
  截图路径:/path/to/image1.png, /path/to/image2.png
@@ -142,4 +110,3 @@ Agent(subagent_type="requirements-analyzer",
142
110
  - 与 `bug-detective` / `fix-bug` 的区别:本技能面向**新功能开发前的需求分析**,不涉及 Bug 排查
143
111
  - 数据库设计必须遵循项目规范(雪花 ID、审计字段、del_flag=2 正常)
144
112
  - 如果需求信息不完整,主动列出需要确认的点,而不是猜测
145
- - **Axure 链接必须用 Playwright 截图,禁止 WebFetch**
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: collaborating-with-codex
3
3
  description: |
4
- OpenAI Codex CLI 协同开发。支持 MCP 原生集成和桥接脚本两种模式。
5
- 默认模型:gpt-5.3-codex
4
+ 与 Codex MCP 协同开发。通过 GuDaStudio/codexmcp 集成,使用 mcp__codex__codex 工具。
5
+ 默认沙箱:read-only(严禁 codex 修改真实代码)。
6
6
 
7
7
  触发场景:
8
8
  - 需要算法实现或复杂逻辑分析
@@ -14,110 +14,128 @@ description: |
14
14
  触发词:Codex、协作、多模型、原型、Diff、算法分析、代码审查、codex协同
15
15
 
16
16
  前置要求:
17
- - 已安装 Codex CLI (npm install -g @openai/codex)
18
- - 已配置 OpenAI API Key (codex auth login)
17
+ - 已通过 `claude mcp add codex -s user --transport stdio -- uvx --from git+https://github.com/GuDaStudio/codexmcp.git codexmcp` 注册
18
+ - ~/.claude/settings.json permissions.allow 已加入 mcp__codex__codex
19
19
  ---
20
20
 
21
- # 与 Codex CLI 协同开发
21
+ # 与 Codex MCP 协同开发
22
22
 
23
- > 两种调用方式:**MCP 原生集成**(推荐)和桥接脚本。默认模型 `gpt-5.3-codex`。
23
+ > 通过 `mcp__codex__codex` 工具直接调用,无需命令行。始终使用 `read-only` 沙箱,要求 codex 只输出 unified diff patch。
24
24
 
25
25
  ---
26
26
 
27
- ## 方式一:MCP 原生集成(推荐)
27
+ ## MCP 工具说明
28
28
 
29
- 已通过 `codex-mcp-server` 注册为 Claude Code 的 MCP 工具,可直接在对话中使用。
29
+ ### 工具名
30
+ `mcp__codex__codex`
30
31
 
31
- ### MCP 工具列表
32
+ ### 参数
32
33
 
33
- | 工具 | 用途 | 示例指令 |
34
- |------|------|---------|
35
- | `codex` | AI 编码助手,支持会话、模型选择 | "用 codex 分析这个函数" |
36
- | `review` | 代码审查(未提交代码、分支、提交) | "用 codex review 检查 main 分支差异" |
37
- | `listSessions` | 查看活跃会话 | "列出 codex 会话" |
38
- | `ping` | 测试连接 | "ping codex" |
39
-
40
- ### MCP 使用示例
34
+ | 参数 | 类型 | 必填 | 默认值 | 说明 |
35
+ |------|------|------|--------|------|
36
+ | `PROMPT` | string | | - | 发送给 Codex 的任务指令(建议用英语) |
37
+ | `cd` | Path | | - | 工作目录根路径(必须存在) |
38
+ | `sandbox` | string | | `read-only` | `read-only` / `workspace-write` / `danger-full-access` |
39
+ | `SESSION_ID` | UUID | | None | 继续之前的会话,保持上下文 |
40
+ | `return_all_messages` | bool | ❌ | False | 是否返回推理过程和工具调用详情 |
41
+ | `model` | string | ❌ | None | 指定模型(None 使用用户默认配置) |
42
+ | `image` | List[Path] | ❌ | None | 附加图片文件 |
43
+ | `yolo` | bool | ❌ | False | 跳过沙箱审批(危险,不推荐) |
44
+ | `profile` | string | ❌ | None | 从 `~/.codex/config.toml` 加载的配置名 |
45
+ | `skip_git_repo_check` | bool | ❌ | False | 允许在非 Git 仓库中运行 |
46
+
47
+ ### 返回值
48
+
49
+ ```json
50
+ // 成功
51
+ {
52
+ "success": true,
53
+ "SESSION_ID": "uuid-string", // 必须保存,用于多轮交互
54
+ "agent_messages": "codex回复内容"
55
+ }
56
+
57
+ // 失败
58
+ {
59
+ "success": false,
60
+ "error": "错误信息"
61
+ }
62
+ ```
41
63
 
42
- **基础调用**:直接在 Claude Code 对话中说:
43
- - "用 codex 工具分析 OrderInfoService 的业务逻辑"
44
- - "用 codex review 检查当前未提交的代码变更"
45
- - "用 codex 生成这个方法的单元测试,模型用 gpt-5.3-codex"
64
+ ---
46
65
 
47
- **多轮会话**:codex 工具支持 `sessionId` 参数,自动维持上下文。
66
+ ## 标准协作流程
48
67
 
49
- **模型指定**:调用时传入 `model: "gpt-5.3-codex"` 参数(已配置为默认)。
68
+ ```
69
+ 1. 需求分析阶段
70
+ Claude 形成初步分析 → 告知 codex → codex 完善方案
50
71
 
51
- ### MCP 配置位置
72
+ 2. 编码前(原型阶段)
73
+ 调用 codex(read-only)→ 要求输出 unified diff patch
74
+ Claude 以 diff 为逻辑参考 → 重写为生产级代码
52
75
 
53
- ```
54
- ~/.claude.json projects mcpServers codex-cli
55
- ~/.codex/config.toml → profiles(review/analyze/prototype)
76
+ 3. 编码后(审查阶段)
77
+ 调用 codex review 改动验证需求完成度和代码质量
56
78
  ```
57
79
 
58
80
  ---
59
81
 
60
- ## 方式二:桥接脚本
82
+ ## 调用示例
61
83
 
62
- 适用于需要精细控制参数或后台批量执行的场景。
84
+ ### 场景一:需求分析完善
63
85
 
64
- ### 快速开始
86
+ ```
87
+ PROMPT: "Here is my requirement: [需求描述]. My initial approach: [初步思路].
88
+ Please review and improve the analysis and implementation plan.
89
+ Output: structured analysis with potential risks."
65
90
 
66
- ```bash
67
- python .claude/skills/collaborating-with-codex/scripts/codex_bridge.py \
68
- --cd . --model gpt-5.3-codex --PROMPT "Your task"
91
+ cd: /path/to/project
92
+ sandbox: read-only
69
93
  ```
70
94
 
71
- ### 参数说明
95
+ ### 场景二:获取代码原型(Diff)
72
96
 
73
- | 参数 | 类型 | 必填 | 默认值 | 说明 |
74
- |------|------|------|--------|------|
75
- | `--PROMPT` | str | ✅ | - | 发送给 Codex 的任务指令(使用英语) |
76
- | `--cd` | Path | ✅ | - | 工作目录根路径 |
77
- | `--model` | str | ❌ | `gpt-5.3-codex` | 指定模型 |
78
- | `--sandbox` | Literal | ❌ | `read-only` | 沙箱策略 |
79
- | `--SESSION_ID` | UUID | ❌ | `None` | 会话 ID(继续之前的对话) |
80
- | `--profile` | str | ❌ | `None` | Codex profile(review/analyze/prototype) |
81
- | `--return-all-messages` | bool | ❌ | `False` | 返回完整推理信息 |
82
- | `--image` | List[Path] | ❌ | `None` | 附加图片 |
83
- | `--yolo` | bool | ❌ | `False` | 跳过审批(危险) |
84
-
85
- ### 使用示例
97
+ ```
98
+ PROMPT: "Generate a unified diff patch to implement [功能描述].
99
+ File: [目标文件路径]
100
+ Requirements:
101
+ - [要求1]
102
+ - [要求2]
86
103
 
87
- ```bash
88
- # 代码分析(只读)
89
- python .claude/skills/collaborating-with-codex/scripts/codex_bridge.py \
90
- --cd . --model gpt-5.3-codex --profile analyze \
91
- --PROMPT "Analyze the four-layer architecture in OrderInfoWebController"
92
-
93
- # 代码审查
94
- python .claude/skills/collaborating-with-codex/scripts/codex_bridge.py \
95
- --cd . --model gpt-5.3-codex --profile review \
96
- --PROMPT "Review OrderWebBusiness.java for bugs. OUTPUT: Review with line numbers."
97
-
98
- # 生成 Diff 补丁
99
- python .claude/skills/collaborating-with-codex/scripts/codex_bridge.py \
100
- --cd . --model gpt-5.3-codex \
101
- --PROMPT "Generate unified diff to add logging. OUTPUT: Unified Diff Patch ONLY."
102
-
103
- # 多轮会话
104
- python .claude/skills/collaborating-with-codex/scripts/codex_bridge.py \
105
- --cd . --model gpt-5.3-codex \
106
- --SESSION_ID "uuid-from-previous" \
107
- --PROMPT "Now write unit tests for the method we discussed"
104
+ IMPORTANT: Output unified diff patch ONLY. Do NOT modify any real files.
105
+ IMPORTANT: All Java comments and SQL COMMENTs MUST be in Chinese."
106
+
107
+ cd: /path/to/project
108
+ sandbox: read-only
108
109
  ```
109
110
 
110
- ---
111
+ ### 场景三:代码审查
112
+
113
+ ```
114
+ PROMPT: "Review the following code changes for correctness, performance, and security.
115
+ [粘贴代码或说明文件路径]
116
+
117
+ Check:
118
+ 1. Logic correctness
119
+ 2. Edge cases
120
+ 3. Performance issues
121
+ 4. Security vulnerabilities
122
+
123
+ Output: review with line numbers and severity (CRITICAL/WARNING/INFO)."
124
+
125
+ cd: /path/to/project
126
+ sandbox: read-only
127
+ ```
111
128
 
112
- ## Codex Profile 配置
129
+ ### 场景四:多轮交互(继续会话)
113
130
 
114
- 已在 `~/.codex/config.toml` 中预设 3 个 profile:
131
+ ```
132
+ // 第一轮
133
+ SESSION_ID: None → 保存返回的 SESSION_ID
115
134
 
116
- | Profile | 模型 | 沙箱 | 推理强度 | 适用场景 |
117
- |---------|------|------|---------|---------|
118
- | `review` | gpt-5.3-codex | read-only | medium | 快速代码审查 |
119
- | `analyze` | gpt-5.3-codex | read-only | high | 深度逻辑分析 |
120
- | `prototype` | gpt-5.3-codex | workspace-write | high | 原型生成 |
135
+ // 第二轮
136
+ SESSION_ID: "上一轮返回的 uuid"
137
+ PROMPT: "Now refine the diff based on the feedback: [反馈内容]"
138
+ ```
121
139
 
122
140
  ---
123
141
 
@@ -125,24 +143,18 @@ python .claude/skills/collaborating-with-codex/scripts/codex_bridge.py \
125
143
 
126
144
  | 角色 | Claude Code 负责 | Codex 负责 |
127
145
  |------|-----------------|-----------|
128
- | **架构** | 设计、决策、审校 | 分析现有代码 |
129
- | **开发** | 规范重构、最终代码 | 原型生成(Diff) |
130
- | **审查** | 规范检查、最终判定 | 逐文件审查、安全扫描 |
131
- | **调试** | 日志分析、定位 | 深度代码分析、补丁 |
146
+ | **架构** | 设计决策、规范审校 | 分析现有代码结构 |
147
+ | **开发** | 规范重写、最终代码实施 | 输出原型 diff(只读参考) |
148
+ | **审查** | 规范检查、最终判定 | 逐文件逻辑审查 |
149
+ | **调试** | 日志分析、问题定位 | 深度代码分析、补丁建议 |
132
150
 
133
151
  ### 重要约束
134
152
 
135
- 1. **只读优先**: 默认 `read-only`,仅原型生成用 `workspace-write`
136
- 2. **英语 Prompt**: Codex 交互用英语
137
- 3. **中文强制**: 每次 PROMPT 末尾追加:
138
- ```
139
- IMPORTANT LANGUAGE RULES:
140
- - All SQL COMMENT values MUST be in Chinese
141
- - All Java/code comments MUST be in Chinese
142
- - Variable names and class names remain in English
143
- ```
144
- 4. **脏原型思维**: Codex 输出视为草稿,Claude 按项目规范重构
145
- 5. **后台运行**: 长时间任务用 subagent `run_in_background`
153
+ 1. **只读优先**:始终使用 `sandbox="read-only"`
154
+ 2. **英语 Prompt**:与 codex 交互用英语,代码注释要求中文
155
+ 3. **脏原型思维**:codex 输出视为草稿,Claude 按项目规范重构
156
+ 4. **保存 SESSION_ID**:每次调用后记录,多轮对话时传入
157
+ 5. **质疑 codex**:codex 仅供参考,必须有独立判断
146
158
 
147
159
  ---
148
160
 
@@ -150,8 +162,19 @@ python .claude/skills/collaborating-with-codex/scripts/codex_bridge.py \
150
162
 
151
163
  | 问题 | 解决方案 |
152
164
  |------|---------|
153
- | MCP 工具未出现 | 重启 Claude Code 会话,检查 `~/.claude.json` |
154
- | `codex: command not found` | `npm i -g @openai/codex` 并确认 PATH |
155
- | 模型不对 | 调用时显式传 `model: "gpt-5.3-codex"` |
156
- | MCP 连接超时 | `npx -y codex-mcp-server` 手动测试 |
157
- | 桥接脚本 SESSION_ID 失败 | 检查网络和 API Key |
165
+ | 工具未出现 | 重启 Claude Code,检查 `~/.claude.json` 中 codex 配置 |
166
+ | `cd` 参数报错 | 确认目录存在,使用绝对路径 |
167
+ | 连接超时 | 检查网络,`uvx --from git+https://github.com/GuDaStudio/codexmcp.git codexmcp` 手动测试 |
168
+ | SESSION_ID 失效 | 重新开启新会话(不传 SESSION_ID) |
169
+ | codex 修改了文件 | 确认 `sandbox="read-only"` 已设置 |
170
+
171
+ ## 安装验证
172
+
173
+ ```bash
174
+ # 查看 MCP 配置
175
+ cat ~/.claude.json | python3 -c "import json,sys; d=json.load(sys.stdin); print(d.get('mcpServers', {}).get('codex', 'not found'))"
176
+
177
+ # 重启后运行
178
+ claude mcp list
179
+ # 期望看到: codex: uvx ... - ✓ Connected
180
+ ```
@@ -29,7 +29,7 @@ description: |
29
29
  │ - 用户已给出完整字段列表
30
30
 
31
31
  └─ 复杂需求? ──→ Agent 路径(启动 requirements-analyzer)
32
- - 提供了 Axure 原型链接或截图
32
+ - 提供了 Axure 原型截图
33
33
  - 提供了云效任务编号
34
34
  - 多页面/多模块联动
35
35
  - 业务流程复杂,需要状态流转设计
@@ -45,34 +45,12 @@ description: |
45
45
 
46
46
  ## Agent 路径(复杂需求)
47
47
 
48
- ### Axure 链接处理(重要)
49
-
50
- > **Axure 是 SPA 应用,WebFetch 必定失败(TLS/JS 渲染问题)。禁止用 WebFetch 访问 Axure 链接。**
51
-
52
- 当用户提供 Axure 链接时,必须用 Playwright 截图:
53
-
54
- ```bash
55
- # 1. 先用 Playwright 截图(每个页面单独截)
56
- npx playwright screenshot --wait-for-timeout 3000 "https://xxx.axure.cloud/page1" /tmp/axure-1.png
57
- npx playwright screenshot --wait-for-timeout 3000 "https://xxx.axure.cloud/page2" /tmp/axure-2.png
58
-
59
- # 2. 截图完成后,将文件路径传给 image-reader Agent 分析
60
- # 3. 如果原型有多个页面,URL 通常带 #page 参数,逐页截图
61
- ```
62
-
63
- **判断规则**:
64
- - URL 包含 `axure.cloud` 或 `.axshare.com` → Playwright 截图
65
- - 用户说"Axure 链接" → Playwright 截图
66
- - 本地截图文件(.png/.jpg) → 直接 image-reader 分析
67
-
68
- ### 完整流程
69
-
70
48
  ```
71
49
  步骤 1:收集信息(从用户消息中提取)
72
- - Axure 原型链接 → Playwright 截图 → image-reader 分析
73
- - Axure 原型截图文件 → 直接 image-reader 分析
74
- - 云效任务编号 → task-fetcher 获取详情
50
+ - Axure 原型截图路径
51
+ - 云效任务编号
75
52
  - 需求描述文字
53
+ - 关联模块信息
76
54
 
77
55
  步骤 2:启动 requirements-analyzer Agent
78
56
  └── requirements-analyzer(Opus) 内部自动编排:
@@ -91,23 +69,13 @@ npx playwright screenshot --wait-for-timeout 3000 "https://xxx.axure.cloud/page2
91
69
  |---------------|---------|
92
70
  | 只有文字描述 | 快速路径(不启动 Agent) |
93
71
  | 文字 + 原型截图 | requirements-analyzer → 内部调 image-reader |
94
- | 文字 + Axure 链接 | Playwright 截图 → requirements-analyzer → image-reader |
95
72
  | 文字 + 云效任务号 | requirements-analyzer → 内部调 task-fetcher |
96
73
  | 原型截图 + 云效任务号 | requirements-analyzer → 内部并行调 image-reader + task-fetcher |
97
74
 
98
75
  ### 启动示例
99
76
 
100
77
  ```
101
- # 有 Axure 链接(先截图再分析)
102
- Bash: npx playwright screenshot --wait-for-timeout 3000 "https://xxx.axure.cloud/page1" /tmp/axure-1.png
103
- Bash: npx playwright screenshot --wait-for-timeout 3000 "https://xxx.axure.cloud/page2" /tmp/axure-2.png
104
-
105
- Agent(subagent_type="requirements-analyzer",
106
- prompt="分析以下 Axure 原型截图,输出需求分析报告和开发任务清单:
107
- 截图路径:/tmp/axure-1.png, /tmp/axure-2.png
108
- 需求描述:xxx")
109
-
110
- # 有原型截图文件
78
+ # 有原型截图
111
79
  Agent(subagent_type="requirements-analyzer",
112
80
  prompt="分析以下 Axure 原型截图,输出需求分析报告和开发任务清单:
113
81
  截图路径:/path/to/image1.png, /path/to/image2.png
@@ -142,4 +110,3 @@ Agent(subagent_type="requirements-analyzer",
142
110
  - 与 `bug-detective` / `fix-bug` 的区别:本技能面向**新功能开发前的需求分析**,不涉及 Bug 排查
143
111
  - 数据库设计必须遵循项目规范(雪花 ID、审计字段、del_flag=2 正常)
144
112
  - 如果需求信息不完整,主动列出需要确认的点,而不是猜测
145
- - **Axure 链接必须用 Playwright 截图,禁止 WebFetch**