review-code by catlog22/claude-code-workflow
npx skills add https://github.com/catlog22/claude-code-workflow --skill review-code多维代码审查技能,从6个关键维度分析代码,并生成包含可操作建议的结构化审查报告。
┌─────────────────────────────────────────────────────────────────┐
│ ⚠️ Phase 0: Specification Study (强制前置) │
│ → 阅读 specs/review-dimensions.md │
│ → 理解审查维度和问题分类标准 │
└───────────────┬─────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ Orchestrator (状态驱动决策) │
│ → 读取状态 → 选择审查动作 → 执行 → 更新状态 │
└───────────────┬─────────────────────────────────────────────────┘
│
┌───────────┼───────────┬───────────┬───────────┐
↓ ↓ ↓ ↓ ↓
┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐
│ Collect │ │ Quick │ │ Deep │ │ Report │ │Complete │
│ Context │ │ Scan │ │ Review │ │ Generate│ │ │
└─────────┘ └─────────┘ └─────────┘ └─────────┘ └─────────┘
↓ ↓ ↓ ↓
┌─────────────────────────────────────────────────────────────────┐
│ Review Dimensions │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │Correctness│ │Readability│ │Performance│ │ Security │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ ┌──────────┐ ┌──────────┐ │
│ │ Testing │ │Architecture│ │
│ └──────────┘ └──────────┘ │
└─────────────────────────────────────────────────────────────────┘
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
⛔ 禁止跳过 : 在执行任何审查操作之前,必须 完整阅读以下文档。
| 文档 | 目的 | 优先级 |
|---|---|---|
| specs/review-dimensions.md | 审查维度定义和检查点 | P0 - 最高 |
| specs/issue-classification.md | 问题分类和严重程度标准 | P0 - 最高 |
| specs/quality-standards.md | 审查质量标准 | P1 |
| 文档 | 目的 |
|---|---|
| templates/review-report.md | 审查报告模板 |
| templates/issue-template.md | 问题记录模板 |
┌─────────────────────────────────────────────────────────────────┐
│ Phase 0: Specification Study (强制前置 - 禁止跳过) │
│ → Read: specs/review-dimensions.md │
│ → Read: specs/issue-classification.md │
│ → 理解审查标准和问题分类 │
├─────────────────────────────────────────────────────────────────┤
│ Action: collect-context │
│ → 收集目标文件/目录 │
│ → 识别技术栈和语言 │
│ → Output: state.context (files, language, framework) │
├─────────────────────────────────────────────────────────────────┤
│ Action: quick-scan │
│ → 快速扫描整体结构 │
│ → 识别高风险区域 │
│ → Output: state.risk_areas, state.scan_summary │
├─────────────────────────────────────────────────────────────────┤
│ Action: deep-review (per dimension) │
│ → 逐维度深入审查 │
│ → 记录发现的问题 │
│ → Output: state.findings[] │
├─────────────────────────────────────────────────────────────────┤
│ Action: generate-report │
│ → 汇总所有发现 │
│ → 生成结构化报告 │
│ → Output: review-report.md │
├─────────────────────────────────────────────────────────────────┤
│ Action: complete │
│ → 保存最终状态 │
│ → 输出审查摘要 │
└─────────────────────────────────────────────────────────────────┘
const timestamp = new Date().toISOString().slice(0,19).replace(/[-:T]/g, '');
const workDir = `.workflow/.scratchpad/review-code-${timestamp}`;
Bash(`mkdir -p "${workDir}"`);
Bash(`mkdir -p "${workDir}/findings"`);
.workflow/.scratchpad/review-code-{timestamp}/
├── state.json # 审查状态
├── context.json # 目标上下文
├── findings/ # 问题发现
│ ├── correctness.json
│ ├── readability.json
│ ├── performance.json
│ ├── security.json
│ ├── testing.json
│ └── architecture.json
└── review-report.md # 最终审查报告
| 维度 | 关注领域 | 关键检查点 |
|---|---|---|
| Correctness | 逻辑正确性 | 边界条件、错误处理、null 检查 |
| Readability | 代码可读性 | 命名规范、函数长度、注释质量 |
| Performance | 性能效率 | 算法复杂度、I/O 优化、资源使用 |
| Security | 安全性 | 注入风险、敏感信息、权限控制 |
| Testing | 测试覆盖 | 测试充分性、边界覆盖、可维护性 |
| Architecture | 架构一致性 | 设计模式、分层结构、依赖管理 |
| 级别 | 前缀 | 描述 | 所需操作 |
|---|---|---|---|
| Critical | [C] | 阻塞性问题,必须立即修复 | 合并前必须修复 |
| High | [H] | 重要问题,需要修复 | 应该修复 |
| Medium | [M] | 建议改进 | 考虑修复 |
| Low | [L] | 可选优化 | 有则更好 |
| Info | [I] | 信息性建议 | 供参考 |
每周安装次数
76
代码仓库
GitHub 星标数
1.5K
首次出现
2026年1月24日
安全审计
安装于
opencode67
claude-code66
gemini-cli64
cursor63
codex63
github-copilot60
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
44,900 周安装