一键导入
review-codebase
Analyze codebase for optimization and refactoring opportunities. Use for periodic quality checks, identifying tech debt, and planning improvements.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Analyze codebase for optimization and refactoring opportunities. Use for periodic quality checks, identifying tech debt, and planning improvements.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Bootstrap new projects or add the agents-workflow system to existing projects. Use for new project scaffolding (Next.js, Python, Rust) or adding workflow capabilities to any git repository.
Generate an actionable retro from Pi session logs + orchestration artifacts, and propose concrete doc/template improvements.
Entry point for feature planning workflow. Guides users through PRD creation, spec generation, and swarm design with automatic context management.
Execute implementation plans with parallel worker agents in git worktrees. Spawns agents, monitors progress, coordinates merges. Use after /skill:plan completes.
Implement features using worktree-based development with TDD. Use after spec approval to build features in isolated git worktrees with quality gates.
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
| name | review-codebase |
| description | Analyze codebase for optimization and refactoring opportunities. Use for periodic quality checks, identifying tech debt, and planning improvements. |
Perform comprehensive codebase analysis to identify optimization opportunities, technical debt, and refactoring needs.
/skill:review-codebase # Full codebase review
/skill:review-codebase src/components # Review specific directory
/skill:review-codebase --focus security # Focus on security issues
/skill:review-codebase --focus performance # Focus on performance issues
Available focus modes:
security - Security vulnerabilities and hardening opportunitiesperformance - Performance bottlenecks and optimization opportunitiesquality - Code quality, complexity, and maintainabilitytesting - Test coverage gaps and testing improvementsdocs - Documentation completeness and accuracyIf no scope provided, analyze full codebase:
src/ # Application code
lib/ # Shared libraries
components/ # UI components
Exclude by default:
node_modules/dist/, build/, .next/.git/Analyze the codebase for:
Complexity:
Duplication:
Dependencies:
Patterns:
Check documentation health:
Create comprehensive review document:
docs/reviews/_template.mddocs/reviews/{date}-review.mdFor actionable items, create task files:
docs/tasks/refactor-{component}.md
docs/tasks/fix-{issue}.md
docs/tasks/upgrade-{dependency}.md
Priority based on:
Output summary with:
Based on findings, recommend appropriate actions:
| Finding Type | Recommended Action |
|---|---|
| Quick fixes (< 1 hour) | Implement directly or plan mode |
| Medium improvements | Plan mode with docs/tasks/ |
| Major refactoring | /skill:plan {feature} --spec --from-review {review-file} |
| New capability needed | /skill:plan {feature} |
For significant improvements:
This review identified major improvements for {area}.
Consider running: /skill:plan {area-name} --spec --from-review docs/reviews/{date}-review.md
docs/reviews/{date}-review.mddocs/tasks/*.md (generated tasks)| Metric | Good | Warning | Critical |
|---|---|---|---|
| Cyclomatic Complexity | <10 | 10-20 | >20 |
| Cognitive Complexity | <15 | 15-30 | >30 |
| File Length | <300 | 300-500 | >500 |
| Function Length | <50 | 50-100 | >100 |
Each category scored 1-5:
Overall health = average of category scores
Apply these patterns when improvements are needed:
User: /skill:review-codebase src/components --focus quality
Pi: Starting codebase review of src/components...
[Analyzing code...]
[Checking documentation...]
Review complete.
## Summary
**Overall Health**: 3.4 / 5 (Acceptable)
| Category | Score |
|----------|-------|
| Code Quality | 3 |
| Test Coverage | 4 |
| Documentation | 3 |
| Architecture | 4 |
| Security | 3 |
## Critical Issues
1. **High complexity in UserDashboard.tsx** (cyclomatic: 32)
- Extract sub-components for widget rendering
- Pattern: Extract Function
2. **Outdated react-query** (v3 -> v5)
- Breaking changes require migration
- Security advisory in v3
## Quick Wins
1. Remove 12 unused imports across 8 files
2. Add missing error boundaries to 3 components
3. Enable strict TypeScript in 2 config files
Full report: docs/reviews/2024-01-15-review.md
Generated tasks: 7 task files in docs/tasks/
## Suggested Next Steps
For the high-complexity UserDashboard, consider:
/skill:plan dashboard-refactor --spec --from-review docs/reviews/2024-01-15-review.md
/skill:feature - Implement improvements/skill:plan - Planning workflow (PRD → Spec → Tasks)