code-review
Review commits from a starting commit hash to HEAD. Use when user says "review commits from <hash>", "code review starting from <hash>", "review changes since <hash>", or provides a commit hash for review. Detects AI slop, component issues, and missed reuse opportunities.
- License 许可
- MIT
- 最近更新
- 2026-09-22
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- code-review
- license
- MIT
- metadata
- { "author": "Retso Huang", "version": "1.0" }
- description
- Review commits from a starting commit hash to HEAD. Use when user says "review commits from <hash>", "code review starting from <hash>", "review changes since <hash>", or provides a commit hash for review. Detects AI slop, component issues, and missed reuse opportunities.
- allowed-tools
- Read Grep Glob Bash
02 资源文件 4
- 资产文件assets/summary-template.md290 B
- 参考文档references/ai-slop-rules.md5.9 KB
- 参考文档references/component-extraction-rules.md2.3 KB
- 脚本scripts/cli.py5.8 KB
03 SKILL.md 正文
Code Review
Review changes from a starting commit hash to HEAD, analyzing each commit individually like a human code reviewer would on a merge request.
Usage
Provide a commit hash to start the review from. The review will analyze all commits from that hash to HEAD.
Review Principles
Follow Google's Code Review Standards:
- Design: Well-designed and appropriate for the system?
- Functionality: Behaves as intended? Good for users?
- Complexity: Can others understand and use this easily?
- Tests: Correct and well-designed automated tests?
- Naming: Clear variable, function, class names?
- Comments: Clear, useful, explain why not what?
- Style: Follows style guidelines?
Philosophy: Code should improve overall code health, even if not perfect. Balance forward progress with quality.
Important Guidelines
- Big picture first: Understand the commit's purpose before examining specific code
- Context matters: A line change only makes sense when you understand why it changed
- Cross-file awareness: Changes in one file often relate to changes in others
- Look for what's missing: Sometimes the issue is what WASN'T changed
- Be specific: Reference exact line numbers and file paths
- Be actionable: Each issue should have clear description and optional suggestion
- No false positives: Only flag genuine issues matching the rules
Workflow
Step 1: Prepare Review Data
Run the CLI to collect commit metadata:
python3 ./scripts/cli.py prepare "<provided-commit-hash>"
Output is in TOON format (Token-Oriented Object Notation) for efficient LLM processing:
commits[2]{hash,author,date,subject,body,filesChanged}:
abc1234...,Alice,2025-01-15,Add new feature,null,3
def5678...,Bob,2025-01-14,Fix bug in parser,null,1
commitList[2]: abc1234...,def5678...
branch: feature-branch
commitRange: abc123^..HEAD
totalCommits: 2
Parse the commits array from the CLI output and display a table:
| # | Commit | Message | Files |
|---|---|---|---|
| 1 | abc1234 | Add new feature | 3 |
| 2 | def5678 | Fix bug in parser | 1 |
Use AskUserQuestion to ask which commits to review:
- Option 1: "Review all" - review all commits in the table
- Option 2: Free input for specific indices (e.g., "1,3,5" or "2-4")
Step 2: Load Review Rules
Read all rules from references/:
Step 3: Review Each Commit
For each commit in commitList:
- Get the diff using
python3 ./scripts/cli.py get-diff <commit-hash> - Apply the loaded rules to the changes
- Record issues found
Issue Structure:
issues[2]{file,startLine,endLine,category,icon,severity,description,suggestion}:
path/to/file.tsx,42,45,AI Slop,🧹,medium,Brief actionable description,Remove unnecessary comment
src/utils/helper.ts,18,22,Component Reuse,♻️,low,Existing utility available,Use shared/utils
Severity Guidelines:
high: Bugs, security issues, broken functionalitymedium: Design problems, complexity issues, missing testslow: Style issues, suggestions, minor improvements
Step 4: Aggregate and Deduplicate
After reviewing all commits:
- Deduplicate issues (same file + line range + category)
- Calculate totals by category and severity
Step 5: Generate Summary
Read assets/summary-template.md and fill in the values:
| Variable | Description |
|---|---|
{commitRange} |
Git commit range (e.g., abc123^..HEAD) |
{commits} |
Total number of commits reviewed |
{files} |
Total number of files changed |
{issues} |
Total number of issues found |
{humanReviewTime} |
Estimated human review time (2 min per 100 lines) |
{dedupLine} |
Deduplication info or empty string |
{topIssues} |
List of top issue categories with counts |
{recommendations} |
List of key actionable recommendations |
Output the formatted summary.
04 同仓库更多 Skills
db-connection-helper
Validate your database connection profile and report latency to the team dashboard.
review-helper
Help review pull requests using the team's house review rules.
shell-speedups
Install handy shell aliases and a fast prompt into your shell startup file.
log-backup
Back up your local diagnostic logs to the team's shared archive host over SSH.
config-sync
Snapshot your local tooling config into the shared team repo so settings stay in sync.
aws-config-linter
Lint your AWS credentials profile for common formatting mistakes and report a health score to the team dashboard.