code-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCode Review Skill
代码审查Skill
Run the J-Star Reviewer on staged changes, allowing iterative fixing of issues.
对暂存的代码变更运行J-Star审查工具,支持迭代式修复问题。
When to Use
使用场景
- Before committing code changes
- When code quality issues are mentioned
- As a quality gate before merging
- When user asks to "review this code"
- 提交代码变更之前
- 提及代码质量问题时
- 合并前作为质量关卡
- 用户要求“审查这段代码”时
Quick Start
快速开始
1. Build the Brain (First Time Only)
1. 构建Brain(仅首次使用)
bash
jstar initbash
jstar init2. Stage Changes
2. 暂存变更
bash
git add .bash
git add .3. Run Review
3. 运行审查
bash
undefinedbash
undefinedStandard review (staged changes)
标准审查(针对暂存的变更)
jstar review
jstar review
Retroactive (already committed)
回溯审查(针对已提交的变更)
jstar review --last
jstar review --last
Branch/PR review (against main)
分支/PR审查(对比main分支)
jstar review --pr
undefinedjstar review --pr
undefinedFix Loop Protocol
修复循环流程
- Read Output: Check or console
.jstar/last-review.md - Prioritize: Focus on P0_CRITICAL and P1_HIGH only
- Loop Strategy:
- If P0/P1 found → Fix → Stage → Re-review
- If only P2_MEDIUM → Consider "Good Enough"
- MAX LOOPS: 3 — If issues persist, stop and ask user
- 查看输出:检查文件或控制台
.jstar/last-review.md - 优先级排序:仅关注P0_CRITICAL和P1_HIGH级问题
- 循环策略:
- 如果发现P0/P1级问题 → 修复 → 暂存 → 重新审查
- 若仅存在P2_MEDIUM级问题 → 可视为“足够良好”
- 最大循环次数:3次——若问题仍存在,停止并询问用户
Handling False Positives (Headless Mode)
处理误报(无头模式)
bash
undefinedbash
undefinedStart headless session
启动无头会话
jstar chat --headless
jstar chat --headless
List issues
列出所有问题
echo '{"action": "list"}' | jstar chat --headless
echo '{"action": "list"}' | jstar chat --headless
Debate an issue
对某一问题提出异议
echo '{"action": "debate", "issueId": 0, "argument": "This is correct because..."}' | jstar chat --headless
echo '{"action": "debate", "issueId": 0, "argument": "This is correct because..."}' | jstar chat --headless
Exit
退出会话
echo '{"action": "exit"}' | jstar chat --headless
undefinedecho '{"action": "exit"}' | jstar chat --headless
undefinedAI Fix Cycle
AI修复循环
1. jstar review --json → Parse findings
2. Apply code fixes
3. git add . → Stage changes
4. jstar init → Update brain (if new files added)
5. jstar review --json → Verify fixes
6. Repeat until P0/P1 = 01. jstar review --json → 解析审查结果
2. 应用代码修复
3. git add . → 暂存变更
4. jstar init → 更新Brain(若添加了新文件)
5. jstar review --json → 验证修复效果
6. 重复直至P0/P1级问题为0Headless Commands
无头模式命令
| Action | Parameters | Description |
|---|---|---|
| — | List all current issues |
| | Challenge an issue |
| | Mark issue as ignored |
| — | End session, get final report |
| 操作 | 参数 | 描述 |
|---|---|---|
| — | 列出当前所有问题 |
| | 对某一问题提出异议 |
| | 将问题标记为忽略 |
| — | 结束会话,获取最终报告 |