Code Review
Analyze git changes and produce a structured code review with automated checks. The skill inspects diffs for common issues and returns a JSON report with findings, severity levels, and a pass/fail verdict.
When to Use
Run this skill before committing or submitting a pull request to catch common issues early. It supports reviewing staged changes, unstaged modifications, the last commit, or a full branch comparison against a target branch.
Parameters
| Parameter | Required | Description |
|-----------|----------|-------------|
| projectPath | No | Path to the git project (defaults to .) |
| target | No | What to review: staged, unstaged, last-commit, branch (default: staged) |
| branch | No | Compare branch when target=branch (default: main) |
Examples
Review staged changes before committing
bash config/skills/agent/marketplace/code-review/execute.sh '{"projectPath":"/path/to/project","target":"staged"}'
Review the last commit
bash config/skills/agent/marketplace/code-review/execute.sh '{"projectPath":".","target":"last-commit"}'
Compare a feature branch against main
bash config/skills/agent/marketplace/code-review/execute.sh '{"projectPath":".","target":"branch","branch":"main"}'
Review unstaged working directory changes
bash config/skills/agent/marketplace/code-review/execute.sh '{"projectPath":".","target":"unstaged"}'
Automated Checks
The skill runs five automated checks against the diff:
- Missing test files — flags
.ts/.tsxsource files without a corresponding.test.ts/.test.tsxin the same directory (severity: warning) - Debug statements — detects
console.log,console.debug, anddebuggerin added lines (severity: error) - Potential secrets — matches patterns like
api_key=,password:,secret_key=, andtoken=in added code (severity: critical) - Large changes — flags files with more than 300 lines added, suggesting they may need splitting (severity: warning)
- Dependency changes — notes when
package.jsonis modified so new dependencies can be inspected (severity: info)
Output
{
"target": "staged",
"filesReviewed": 5,
"stats": { "insertions": 120, "deletions": 30 },
"issues": [
{
"type": "missing-test",
"file": "src/services/auth.ts",
"severity": "warning",
"message": "No corresponding test file found"
}
],
"summary": "5 files reviewed. 1 warning(s).",
"passesReview": true
}
passesReviewisfalsewhen anycriticalorerrorseverity issues are detectedissuesis an empty array when no problems are found
Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| Not a git repository: <path> | projectPath has no .git directory | Provide a valid git project path |
| Invalid target: <value> | target is not one of the four accepted values | Use staged, unstaged, last-commit, or branch |
| No changes found | Diff is empty for the selected target | Stage files first for staged, or verify changes exist |
Related Skills
git-commit-helper— generate conventional commit messages from staged changestest-runner— run the project's test suite after reviewing changescheck-quality-gates— evaluate task deliverables against project quality gates