claude-codex-code-review 0.1.0 → 0.2.1
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 +134 -15
- package/bin/codex-review +7 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,38 +1,101 @@
|
|
|
1
1
|
# claude-codex-code-review
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
Codex CLI review on current uncommitted changes, writes the review to
|
|
5
|
-
`.ai-review/codex-review.md`, and lets Claude ask which findings to fix.
|
|
3
|
+
在 Claude Code 里安装一个项目级 `/codex-review` 命令,让你可以用 Codex CLI 审查 Claude 刚写完的代码,再由 Claude 读取 review 结果并按你的选择修复问题。
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
典型流程:
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
1. 你在 Claude Code 里让 Claude 写代码。
|
|
8
|
+
2. 写完后手动运行 `/codex-review`。
|
|
9
|
+
3. Codex CLI review 当前项目的未提交改动。
|
|
10
|
+
4. review 结果保存到 `.ai-review/codex-review.md`。
|
|
11
|
+
5. Claude 读取结果,列出问题,并询问你要修复哪些。
|
|
12
|
+
6. 你确认后,Claude 只修复选中的问题。
|
|
13
|
+
|
|
14
|
+
## 安装
|
|
15
|
+
|
|
16
|
+
### 使用 curl
|
|
17
|
+
|
|
18
|
+
在目标项目根目录执行:
|
|
10
19
|
|
|
11
20
|
```bash
|
|
12
21
|
curl -fsSL https://raw.githubusercontent.com/lkkwxy/claude-codex-claude-codex-review-claude/main/scripts/install.sh | bash
|
|
13
22
|
```
|
|
14
23
|
|
|
15
|
-
|
|
16
|
-
`curl | bash`.
|
|
24
|
+
注意:`curl | bash` 必须使用 `raw.githubusercontent.com` 地址,不能使用 GitHub 页面里的 `blob/main` 地址。
|
|
17
25
|
|
|
18
|
-
|
|
26
|
+
### 使用 npx
|
|
19
27
|
|
|
20
|
-
|
|
28
|
+
发布到 npm 后,可以在目标项目根目录执行:
|
|
21
29
|
|
|
22
30
|
```bash
|
|
23
31
|
npx claude-codex-code-review install
|
|
24
32
|
```
|
|
25
33
|
|
|
26
|
-
|
|
34
|
+
也可以指定安装目录:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx claude-codex-code-review install -- --target-dir /path/to/project
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
如果需要覆盖已有文件:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npx claude-codex-code-review install -- --force
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 使用
|
|
47
|
+
|
|
48
|
+
安装后,在目标项目里打开 Claude Code,运行:
|
|
27
49
|
|
|
28
50
|
```text
|
|
29
51
|
/codex-review
|
|
30
52
|
```
|
|
31
53
|
|
|
32
|
-
|
|
54
|
+
也可以临时传入策略参数:
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
/codex-review --mode severity --auto-fix-severities P0,P1
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## 安装内容
|
|
61
|
+
|
|
62
|
+
安装器会写入这些文件:
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
.claude/commands/codex-review.md
|
|
66
|
+
scripts/codex-review.sh
|
|
67
|
+
.codex-review.yml
|
|
68
|
+
.gitignore
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
运行 `/codex-review` 后,会生成:
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
.ai-review/codex-review.md
|
|
75
|
+
.ai-review/codex-review.log
|
|
76
|
+
.ai-review/effective-config.env
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`.ai-review/` 会被加入 `.gitignore`。
|
|
80
|
+
|
|
81
|
+
## 配置
|
|
82
|
+
|
|
83
|
+
默认配置文件是 `.codex-review.yml`:
|
|
84
|
+
|
|
85
|
+
```yaml
|
|
86
|
+
mode: ask
|
|
87
|
+
review_scope: uncommitted
|
|
88
|
+
max_fix_rounds: 1
|
|
89
|
+
auto_fix_severities: []
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
配置优先级:
|
|
33
93
|
|
|
34
|
-
|
|
35
|
-
|
|
94
|
+
1. `/codex-review` 命令参数
|
|
95
|
+
2. `.codex-review.yml`
|
|
96
|
+
3. 内置默认值
|
|
97
|
+
|
|
98
|
+
如果没有 `.codex-review.yml`,也没有传任何参数,会使用以下默认值:
|
|
36
99
|
|
|
37
100
|
```yaml
|
|
38
101
|
mode: ask
|
|
@@ -41,8 +104,64 @@ max_fix_rounds: 1
|
|
|
41
104
|
auto_fix_severities: []
|
|
42
105
|
```
|
|
43
106
|
|
|
44
|
-
|
|
107
|
+
### 参数说明
|
|
45
108
|
|
|
46
109
|
```text
|
|
47
|
-
|
|
110
|
+
--mode ask|auto|severity
|
|
111
|
+
--review-scope uncommitted
|
|
112
|
+
--max-fix-rounds 1
|
|
113
|
+
--auto-fix-severities P0,P1
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
`mode` 含义:
|
|
117
|
+
|
|
118
|
+
- `ask`:默认模式。每次 review 后都询问你是否修复、修复哪些。
|
|
119
|
+
- `auto`:自动修复 Codex 明确指出的 actionable findings。
|
|
120
|
+
- `severity`:只自动修复 `auto_fix_severities` 中指定级别的问题,其他问题继续询问。
|
|
121
|
+
|
|
122
|
+
当前 `review_scope` 只支持 `uncommitted`,也就是 review staged、unstaged 和 untracked changes。
|
|
123
|
+
|
|
124
|
+
## 依赖
|
|
125
|
+
|
|
126
|
+
使用前需要本机已经安装并登录:
|
|
127
|
+
|
|
128
|
+
- Git
|
|
129
|
+
- Claude Code
|
|
130
|
+
- Codex CLI
|
|
131
|
+
|
|
132
|
+
可以用下面的命令检查 Codex CLI:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
codex --help
|
|
48
136
|
```
|
|
137
|
+
|
|
138
|
+
## 设计原则
|
|
139
|
+
|
|
140
|
+
- Codex review 阶段只审查,不修改代码。
|
|
141
|
+
- Claude 修复阶段只处理 Codex 明确指出的问题。
|
|
142
|
+
- 默认不自动修复,先由用户判断。
|
|
143
|
+
- 不自动 commit,最终提交仍由开发者确认。
|
|
144
|
+
- 最多执行配置允许的修复轮次,避免自动循环。
|
|
145
|
+
|
|
146
|
+
## 发布到 npm
|
|
147
|
+
|
|
148
|
+
包名:
|
|
149
|
+
|
|
150
|
+
```text
|
|
151
|
+
claude-codex-code-review
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
发布前检查:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
npm test
|
|
158
|
+
npm pack --dry-run
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
发布:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
npm publish
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
如果 npm 要求 2FA 或 token,请按 npm 当前账号策略配置 security key 或 granular access token。
|
package/bin/codex-review
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
set -u
|
|
3
3
|
set -o pipefail
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
SOURCE="${BASH_SOURCE[0]}"
|
|
6
|
+
while [ -L "$SOURCE" ]; do
|
|
7
|
+
SCRIPT_DIR="$(cd "$(dirname "$SOURCE")" && pwd -P)"
|
|
8
|
+
SOURCE="$(readlink "$SOURCE")"
|
|
9
|
+
[[ "$SOURCE" != /* ]] && SOURCE="$SCRIPT_DIR/$SOURCE"
|
|
10
|
+
done
|
|
11
|
+
PACKAGE_ROOT="$(cd "$(dirname "$SOURCE")/.." && pwd -P)"
|
|
6
12
|
TARGET_DIR="$(pwd)"
|
|
7
13
|
FORCE=0
|
|
8
14
|
|
package/package.json
CHANGED