claude2codex 0.3.2 → 0.3.3
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/README.md +51 -10
- package/README.zh-CN.md +51 -10
- package/dist/server.js +63 -2
- package/package.json +4 -5
- package/c2c.skill.md +0 -58
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ In 2025, AI-assisted coding meant writing detailed prompts that told the model *
|
|
|
18
18
|
|
|
19
19
|
That has changed. In 2026, models are [strong enough at implementation](https://www.anthropic.com/institute/recursive-self-improvement) that micromanaging the how is no longer the best use of a human's time. The bottleneck has shifted: when implementation is cheap, the expensive mistakes are **defining the wrong problem** and **failing to catch a bad result**. Getting the implementation steps right matters far less than getting the goal right.
|
|
20
20
|
|
|
21
|
-
This is why Goal Contracts are structured the way they are. They don't explain how to write the code — they define **what the code must do** (the Goal) and **how to prove it worked** (Success Conditions). The engineer's role becomes problem definition, context provision, and verification — the same things that make a good engineering manager effective at delegation.
|
|
21
|
+
This is why Goal Contracts are structured the way they are. They don't explain how to write the code — they define **what the code must do** (the Goal), **what to avoid** (Constraints), and **how to prove it worked** (Success Conditions). The engineer's role becomes problem definition, context provision, and verification — the same things that make a good engineering manager effective at delegation.
|
|
22
22
|
|
|
23
23
|
This project is built on that premise: split planning and review (where human judgment still dominates) from implementation (where models now excel), and connect them with a contract format that forces clarity on the parts that matter most.
|
|
24
24
|
|
|
@@ -130,22 +130,63 @@ Add to your Claude Code MCP settings:
|
|
|
130
130
|
}
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
-
###
|
|
133
|
+
### Workflow Prompt (automatic)
|
|
134
134
|
|
|
135
|
-
The
|
|
135
|
+
The server registers an MCP Prompt (`c2c-workflow`) that teaches Claude the full contract workflow — role assignment, Goal/Delta Contract formats, review protocol. **This is loaded automatically when the MCP server is connected.** No extra installation needed.
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
### Project Setup: CLAUDE.md and AGENTS.md
|
|
138
|
+
|
|
139
|
+
The MCP server handles the workflow protocol. Your project files only need to carry **project-specific context** — don't repeat what the server already provides.
|
|
140
|
+
|
|
141
|
+
**`CLAUDE.md`** (for Claude — the architect/reviewer):
|
|
142
|
+
|
|
143
|
+
```markdown
|
|
144
|
+
# Claude Code Guidelines
|
|
145
|
+
|
|
146
|
+
The contract workflow is delivered by the MCP Prompt `c2c-workflow`.
|
|
147
|
+
|
|
148
|
+
## Session Startup
|
|
149
|
+
Read README.md and docs/design.md at session start.
|
|
150
|
+
|
|
151
|
+
## Review Additions
|
|
152
|
+
- Flag security issues (OWASP top 10).
|
|
153
|
+
- Run integration tests against staging after each task.
|
|
154
|
+
|
|
155
|
+
## Constraints
|
|
156
|
+
- Do not modify migrations without explicit approval.
|
|
140
157
|
```
|
|
141
158
|
|
|
142
|
-
|
|
159
|
+
**`AGENTS.md`** (for Codex — the implementer):
|
|
143
160
|
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
|
|
161
|
+
```markdown
|
|
162
|
+
# Codex Guidelines
|
|
163
|
+
|
|
164
|
+
You are the implementer. The contract protocol is delivered by the c2c bridge.
|
|
165
|
+
|
|
166
|
+
## Toolchain
|
|
167
|
+
Python 3.12, Poetry. Run from project root.
|
|
168
|
+
- `poetry run pytest` — test suite
|
|
169
|
+
- `poetry run ruff check .` — lint
|
|
170
|
+
- `poetry run mypy .` — typecheck
|
|
171
|
+
|
|
172
|
+
## Boundaries
|
|
173
|
+
- Do not modify alembic migrations directly.
|
|
174
|
+
- Do not add runtime dependencies without a contract constraint.
|
|
147
175
|
```
|
|
148
176
|
|
|
177
|
+
**What goes where:**
|
|
178
|
+
|
|
179
|
+
| | MCP server (automatic) | CLAUDE.md | AGENTS.md |
|
|
180
|
+
|---|---|---|---|
|
|
181
|
+
| Role definition | ✓ | — | — |
|
|
182
|
+
| Workflow steps | ✓ | — | — |
|
|
183
|
+
| Contract formats | ✓ | — | — |
|
|
184
|
+
| Review protocol | ✓ | — | — |
|
|
185
|
+
| Session startup | — | ✓ | ✓ |
|
|
186
|
+
| Project-specific review rules | — | ✓ | — |
|
|
187
|
+
| Toolchain & build commands | — | — | ✓ |
|
|
188
|
+
| File/dependency boundaries | — | — | ✓ |
|
|
189
|
+
|
|
149
190
|
## Tools Provided
|
|
150
191
|
|
|
151
192
|
| Tool | Description |
|
package/README.zh-CN.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
这已经变了。2026 年,模型的[实现能力已经足够强](https://www.anthropic.com/institute/recursive-self-improvement),事无巨细地指挥"怎么写"不再是人最好的时间投入方式。瓶颈转移了:当实现变得廉价,真正昂贵的错误是**定义了错误的问题**和**没有验收出坏的结果**。把实现步骤写对,远不如把目标定义对重要。
|
|
20
20
|
|
|
21
|
-
这就是为什么 Goal Contract 被设计成这样。它不解释怎么写代码——它定义**代码必须做到什么**(Goal)和**怎么证明做对了**(Success Conditions)。工程师的角色变成了问题定义、上下文补充和验收——和一个好的工程管理者委派任务时做的事情一样。
|
|
21
|
+
这就是为什么 Goal Contract 被设计成这样。它不解释怎么写代码——它定义**代码必须做到什么**(Goal),**要避免做什么**(Constraints)和**怎么证明做对了**(Success Conditions)。工程师的角色变成了问题定义、上下文补充和验收——和一个好的工程管理者委派任务时做的事情一样。
|
|
22
22
|
|
|
23
23
|
这个项目建立在这个前提上:把规划和审查(人的判断力仍然占主导)与实现(模型已经足够强)分开,用一种契约格式把它们连接起来,迫使工程师在最重要的部分(问题定义和验收标准)上做到清晰。
|
|
24
24
|
|
|
@@ -130,22 +130,63 @@ npx claude2codex
|
|
|
130
130
|
}
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
-
###
|
|
133
|
+
### 工作流 Prompt(自动)
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
服务器注册了一个 MCP Prompt(`c2c-workflow`),教 Claude 完整的契约工作流——角色分配、Goal/Delta Contract 格式、审查协议。**连接 MCP 服务器后自动加载。** 无需额外安装。
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
### 项目配置:CLAUDE.md 和 AGENTS.md
|
|
138
|
+
|
|
139
|
+
MCP 服务器负责工作流协议。你的项目文件只需要放**项目特有的上下文**——不要重复服务器已经提供的内容。
|
|
140
|
+
|
|
141
|
+
**`CLAUDE.md`**(给 Claude——架构师/审查者):
|
|
142
|
+
|
|
143
|
+
```markdown
|
|
144
|
+
# Claude Code Guidelines
|
|
145
|
+
|
|
146
|
+
契约工作流由 MCP Prompt `c2c-workflow` 提供。
|
|
147
|
+
|
|
148
|
+
## 会话启动
|
|
149
|
+
开始时阅读 README.md 和 docs/design.md。
|
|
150
|
+
|
|
151
|
+
## 审查补充
|
|
152
|
+
- 标记安全问题(OWASP top 10)。
|
|
153
|
+
- 每个任务完成后跑一遍 staging 的集成测试。
|
|
154
|
+
|
|
155
|
+
## 约束
|
|
156
|
+
- 未经明确批准不得修改 migrations。
|
|
140
157
|
```
|
|
141
158
|
|
|
142
|
-
|
|
159
|
+
**`AGENTS.md`**(给 Codex——实现者):
|
|
143
160
|
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
|
|
161
|
+
```markdown
|
|
162
|
+
# Codex Guidelines
|
|
163
|
+
|
|
164
|
+
你是实现者。契约协议由 c2c bridge 提供。
|
|
165
|
+
|
|
166
|
+
## 工具链
|
|
167
|
+
Python 3.12,Poetry。从项目根目录运行。
|
|
168
|
+
- `poetry run pytest` — 测试套件
|
|
169
|
+
- `poetry run ruff check .` — 代码检查
|
|
170
|
+
- `poetry run mypy .` — 类型检查
|
|
171
|
+
|
|
172
|
+
## 边界
|
|
173
|
+
- 不要直接修改 alembic migrations。
|
|
174
|
+
- 未经合同约束不得添加运行时依赖。
|
|
147
175
|
```
|
|
148
176
|
|
|
177
|
+
**什么放哪里:**
|
|
178
|
+
|
|
179
|
+
| | MCP 服务器(自动) | CLAUDE.md | AGENTS.md |
|
|
180
|
+
|---|---|---|---|
|
|
181
|
+
| 角色定义 | ✓ | — | — |
|
|
182
|
+
| 工作流步骤 | ✓ | — | — |
|
|
183
|
+
| 契约格式 | ✓ | — | — |
|
|
184
|
+
| 审查协议 | ✓ | — | — |
|
|
185
|
+
| 会话启动 | — | ✓ | ✓ |
|
|
186
|
+
| 项目特有的审查规则 | — | ✓ | — |
|
|
187
|
+
| 工具链与构建命令 | — | — | ✓ |
|
|
188
|
+
| 文件/依赖边界 | — | — | ✓ |
|
|
189
|
+
|
|
149
190
|
## 提供的工具
|
|
150
191
|
|
|
151
192
|
| 工具 | 说明 |
|
package/dist/server.js
CHANGED
|
@@ -262,7 +262,7 @@ var CodexAppServer = class {
|
|
|
262
262
|
*/
|
|
263
263
|
async initialize() {
|
|
264
264
|
const result = await this.request("initialize", {
|
|
265
|
-
clientInfo: { name: "claude2codex", title: "Claude\u2194Codex Contract Bridge", version: "0.3.
|
|
265
|
+
clientInfo: { name: "claude2codex", title: "Claude\u2194Codex Contract Bridge", version: "0.3.3" },
|
|
266
266
|
capabilities: { experimentalApi: true }
|
|
267
267
|
});
|
|
268
268
|
this.notify("initialized", {});
|
|
@@ -930,7 +930,7 @@ function textResult(obj, isError = false) {
|
|
|
930
930
|
isError
|
|
931
931
|
};
|
|
932
932
|
}
|
|
933
|
-
var server = new McpServer({ name: "c2c-codex", version: "0.3.
|
|
933
|
+
var server = new McpServer({ name: "c2c-codex", version: "0.3.3" });
|
|
934
934
|
var reasoningEffort = z.enum(["low", "medium", "high", "xhigh", "max", "ultra"]);
|
|
935
935
|
var contextFiles = z.array(z.object({
|
|
936
936
|
path: z.string().min(1),
|
|
@@ -1183,5 +1183,66 @@ server.registerTool(
|
|
|
1183
1183
|
});
|
|
1184
1184
|
}
|
|
1185
1185
|
);
|
|
1186
|
+
server.registerPrompt("c2c-workflow", {
|
|
1187
|
+
description: "Delegate implementation to Codex via Goal Contracts. Draft, send, poll, review, rework."
|
|
1188
|
+
}, () => ({
|
|
1189
|
+
messages: [{
|
|
1190
|
+
role: "user",
|
|
1191
|
+
content: { type: "text", text: `
|
|
1192
|
+
You are the **architect and reviewer**. Codex is the **implementer**. You draft contracts, delegate via the \`codex\` MCP server, and review the output. You do not implement the task yourself.
|
|
1193
|
+
|
|
1194
|
+
If \`codex_config\` errors, tell the user to install the MCP server (npm: \`claude2codex\`).
|
|
1195
|
+
|
|
1196
|
+
## Workflow
|
|
1197
|
+
|
|
1198
|
+
1. **User decides** what to build or fix.
|
|
1199
|
+
2. **You draft a Goal Contract** (format below). Show it to the user for approval.
|
|
1200
|
+
3. **You send it** \u2014 \`codex_estimate\` to check budget, then \`codex_implement\`.
|
|
1201
|
+
4. **You poll** \u2014 \`codex_status\` until terminal. Report progress to the user.
|
|
1202
|
+
5. **You review** \u2014 \`codex_result\` for the handoff, then verify independently (see Review below).
|
|
1203
|
+
6. **User approves** your findings.
|
|
1204
|
+
|
|
1205
|
+
If review fails \u2192 draft a **Delta Contract** \u2192 \`codex_rework\` (same \`job_id\`, thread resumes) \u2192 re-enter at step 4.
|
|
1206
|
+
|
|
1207
|
+
## Goal Contract
|
|
1208
|
+
|
|
1209
|
+
\`\`\`
|
|
1210
|
+
### Goal
|
|
1211
|
+
What the code must do. First sentence = acceptance test in prose.
|
|
1212
|
+
|
|
1213
|
+
### Constraints
|
|
1214
|
+
Only what Codex would get wrong without being told. One line of
|
|
1215
|
+
"only modify files needed for this task" covers the rest.
|
|
1216
|
+
|
|
1217
|
+
### Success Conditions
|
|
1218
|
+
- [ ] Assertions, not paragraphs. At least one is a command whose exit code decides.
|
|
1219
|
+
- [ ] Handoff includes: Changed Files, Validation, Success Conditions, Risks & Deviations.
|
|
1220
|
+
\`\`\`
|
|
1221
|
+
|
|
1222
|
+
**Write lean contracts.** Goal and Success Conditions are what Codex acts on. Constraints are for genuine risks only \u2014 don't front-load your review checklist into the contract.
|
|
1223
|
+
|
|
1224
|
+
## Delta Contract
|
|
1225
|
+
|
|
1226
|
+
\`\`\`
|
|
1227
|
+
### Findings
|
|
1228
|
+
- What is wrong, with file/line references.
|
|
1229
|
+
|
|
1230
|
+
### Failed Success Conditions
|
|
1231
|
+
- [ ] The specific conditions that did not pass.
|
|
1232
|
+
|
|
1233
|
+
### Constraints
|
|
1234
|
+
- Original constraints still apply. Fix only the findings; do not touch work that passed.
|
|
1235
|
+
\`\`\`
|
|
1236
|
+
|
|
1237
|
+
## Review
|
|
1238
|
+
|
|
1239
|
+
1. Handoff must be complete (all four sections). Missing handoff = review failure.
|
|
1240
|
+
2. Re-run every verification command yourself \u2014 do not trust the handoff's claims.
|
|
1241
|
+
3. Run the project's own typecheck/build/test/lint.
|
|
1242
|
+
4. Flag security issues and constraint violations.
|
|
1243
|
+
5. Report findings to the user. Fix small issues (typos, imports) directly; do not rewrite the implementation.
|
|
1244
|
+
` }
|
|
1245
|
+
}]
|
|
1246
|
+
}));
|
|
1186
1247
|
var transport = new StdioServerTransport();
|
|
1187
1248
|
await server.connect(transport);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude2codex",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MCP server bridging Claude (architect/reviewer) and Codex (implementer) via Goal/Delta Contracts and Codex's thread-goal loop.",
|
|
6
6
|
"bin": {
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"dist",
|
|
11
11
|
"PATTERNS.md",
|
|
12
|
-
"PATTERNS.zh-CN.md"
|
|
13
|
-
"c2c.skill.md"
|
|
12
|
+
"PATTERNS.zh-CN.md"
|
|
14
13
|
],
|
|
15
14
|
"keywords": [
|
|
16
15
|
"mcp",
|
|
@@ -31,8 +30,8 @@
|
|
|
31
30
|
"start": "bun src/server.ts",
|
|
32
31
|
"build": "tsup",
|
|
33
32
|
"test": "bun test",
|
|
34
|
-
"prepack": "cp ../README.md ../README.zh-CN.md ../PATTERNS.md ../PATTERNS.zh-CN.md
|
|
35
|
-
"postpack": "rm -f README.md README.zh-CN.md PATTERNS.md PATTERNS.zh-CN.md
|
|
33
|
+
"prepack": "cp ../README.md ../README.zh-CN.md ../PATTERNS.md ../PATTERNS.zh-CN.md .",
|
|
34
|
+
"postpack": "rm -f README.md README.zh-CN.md PATTERNS.md PATTERNS.zh-CN.md"
|
|
36
35
|
},
|
|
37
36
|
"dependencies": {
|
|
38
37
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
package/c2c.skill.md
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: c2c
|
|
3
|
-
description: Delegate implementation to Codex via Goal Contracts. Draft, send, poll, review, rework.
|
|
4
|
-
trigger: When the user wants to delegate implementation work to Codex, or types /c2c.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
You are the **architect and reviewer**. Codex is the **implementer**. You draft contracts, delegate via the `codex` MCP server, and review the output. You do not implement the task yourself.
|
|
8
|
-
|
|
9
|
-
If `codex_config` errors, tell the user to install the MCP server (npm: `claude2codex`).
|
|
10
|
-
|
|
11
|
-
## Workflow
|
|
12
|
-
|
|
13
|
-
1. **User decides** what to build or fix.
|
|
14
|
-
2. **You draft a Goal Contract** (format below). Show it to the user for approval.
|
|
15
|
-
3. **You send it** — `codex_estimate` to check budget, then `codex_implement`.
|
|
16
|
-
4. **You poll** — `codex_status` until terminal. Report progress to the user.
|
|
17
|
-
5. **You review** — `codex_result` for the handoff, then verify independently (see Review below).
|
|
18
|
-
6. **User approves** your findings.
|
|
19
|
-
|
|
20
|
-
If review fails → draft a **Delta Contract** → `codex_rework` (same `job_id`, thread resumes) → re-enter at step 4.
|
|
21
|
-
|
|
22
|
-
## Goal Contract
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
### Goal
|
|
26
|
-
What the code must do. First sentence = acceptance test in prose.
|
|
27
|
-
|
|
28
|
-
### Constraints
|
|
29
|
-
Only what Codex would get wrong without being told. One line of
|
|
30
|
-
"only modify files needed for this task" covers the rest.
|
|
31
|
-
|
|
32
|
-
### Success Conditions
|
|
33
|
-
- [ ] Assertions, not paragraphs. At least one is a command whose exit code decides.
|
|
34
|
-
- [ ] Handoff includes: Changed Files, Validation, Success Conditions, Risks & Deviations.
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
**Write lean contracts.** Goal and Success Conditions are what Codex acts on. Constraints are for genuine risks only — don't front-load your review checklist into the contract.
|
|
38
|
-
|
|
39
|
-
## Delta Contract
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
### Findings
|
|
43
|
-
- What is wrong, with file/line references.
|
|
44
|
-
|
|
45
|
-
### Failed Success Conditions
|
|
46
|
-
- [ ] The specific conditions that did not pass.
|
|
47
|
-
|
|
48
|
-
### Constraints
|
|
49
|
-
- Original constraints still apply. Fix only the findings; do not touch work that passed.
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Review
|
|
53
|
-
|
|
54
|
-
1. Handoff must be complete (all four sections). Missing handoff = review failure.
|
|
55
|
-
2. Re-run every verification command yourself — do not trust the handoff's claims.
|
|
56
|
-
3. Run the project's own typecheck/build/test/lint.
|
|
57
|
-
4. Flag security issues and constraint violations.
|
|
58
|
-
5. Report findings to the user. Fix small issues (typos, imports) directly; do not rewrite the implementation.
|