.claude/skills/openspec-sp-code-review/SKILL.md
基于审查清单的代码审查流程。Use when requesting code review after implementation or before merge.
npx skillsauth add cenmiao/openspec-pro openspec-sp-code-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
核心原则:Review early, review often.
阻止合并的严重问题:
应该修复但不阻止合并:
可选的改进建议:
## Code Review: <file/change>
### Summary
简要概述审查结果
### Critical Issues(必须修复)
1. **问题描述**
- 位置:`file.ts:123`
- 影响:...
- 建议:...
### Important Issues(应该修复)
1. **问题描述**
- 位置:`file.ts:456`
- 建议:...
### Suggestions(建议改进)
1. **问题描述**
- 建议:...
### What Was Done Well
- ...
┌─────────────────────────────────────────────────────────┐
│ Code Review Process │
├─────────────────────────────────────────────────────────┤
│ │
│ 1. 准备阶段 │
│ - 确定审查范围 │
│ - 准备审查清单 │
│ │
│ 2. 审查阶段 │
│ - 按维度检查 │
│ - 记录问题 │
│ │
│ 3. 分类阶段 │
│ - Critical / Important / Suggestion │
│ │
│ 4. 输出阶段 │
│ - 结构化报告 │
│ - 具体建议 │
│ │
│ 5. 跟进阶段 │
│ - 确认修复 │
│ - 重新审查(如需要) │
│ │
└─────────────────────────────────────────────────────────┘
用户:我完成了用户认证模块的实现
助手:我使用 openspec-sp-code-review 技能来审查代码。
**审查范围**: 用户认证模块
**审查维度**: Plan Alignment, Code Quality, Architecture, Documentation, Testing, Security, Performance
**审查结果:**
### Critical Issues
[无]
### Important Issues
1. **缺少密码强度验证**
- 位置:`auth.service.ts:45`
- 建议:添加密码强度检查
### Suggestions
1. **命名可以更具描述性**
- `handleLogin` → `authenticateUserWithCredentials`
**后续步骤**: 修复 Important 问题后重新审查
testing
Verify implementation matches change artifacts. Use when the user wants to validate that implementation is complete, correct, and coherent before archiving.
data-ai
Sync delta specs from a change to main specs. Use when the user wants to update main specs with changes from a delta spec, without archiving the change.
testing
完成前必须有验证证据。Proof precedes assertion. Use before reporting any task completion.
tools
TDD 红/绿/重构循环。铁律:先失败测试后实现。Use when implementing any new functionality.