Review working directory changes for code quality, security, and best practices before creating a PR. Use when: "review my code", "check before PR", "code review", "コードレビュー", "PR作成前チェック".
Conducts iterative code reviews with AI agents to fix critical and important issues before PR creation.
/plugin marketplace add signalcompose/claude-tools/plugin install code@claude-toolsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/review-criteria.mdIterative team-based code review with quality assurance loop.
Changed files: !git diff HEAD --stat
If no changes, report "No changes to review" and exit.
MANDATORY: Spawn a review team with the Task tool.
Team structure:
Team Lead (yourself)
├─ Reviewer (code-reviewer agent)
└─ Fixer (code-fixer agent)
MANDATORY: Always specify an explicit model parameter when spawning each agent. Choose the appropriate model based on task complexity (haiku for lightweight, sonnet for standard, opus for complex reasoning). Never omit model (default inherit may fail in parallel spawning).
Reviewer Agent:
git diff HEADFixer Agent:
For detailed review criteria, read ${CLAUDE_PLUGIN_ROOT}/skills/review-commit/references/review-criteria.md.
MANDATORY: Run up to 5 review iterations.
WARNING: The Fixer's "completion" report is NOT a review result. It does not update critical_count or important_count. Counts are ONLY valid when produced by the Reviewer in step 1-2 of the current iteration. Never carry counts forward across iterations.
Loop logic:
FOR iteration = 1 TO 5:
SET fresh_critical_count = UNSET
SET fresh_important_count = UNSET
1. Invoke Reviewer agent to analyze current working directory changes (re-invoke even if Reviewer ran in a prior iteration; do NOT reuse prior analysis)
2. Reviewer reports and ASSIGNS: fresh_critical_count, fresh_important_count, minor_count
3. MUST VERIFY: fresh_critical_count and fresh_important_count are SET (not UNSET).
If either is UNSET, step 1 was skipped — go back to step 1.
IF fresh_critical_count = 0 AND fresh_important_count = 0:
→ BREAK (quality target achieved)
4. Fixer receives issue list from Reviewer
5. Fixer fixes critical and important issues
6. Fixer reports completion to Team Lead (this is a work-done signal only; Team Lead MUST NOT use this report to evaluate exit condition — proceed to next iteration's step 1 instead)
7. CONTINUE to next iteration
END FOR
IF iteration limit reached AND (fresh_critical_count is UNSET OR fresh_critical_count > 0 OR fresh_important_count is UNSET OR fresh_important_count > 0):
→ Report failure to user
→ Do NOT create flag
→ Exit
Success condition: fresh_critical_count = 0 AND fresh_important_count = 0 as reported by Reviewer in the current iteration
Only execute if Step 3 succeeds (critical = 0, important = 0).
Create flag:
REPO_ROOT=$(git rev-parse --show-toplevel)
REPO_HASH=$(echo "$REPO_ROOT" | shasum -a 256 | cut -c1-16)
FLAG_FILE="/tmp/claude/review-approved-${REPO_HASH}"
mkdir -p /tmp/claude || {
echo "Error: Cannot create /tmp/claude directory" >&2
exit 1
}
touch "$FLAG_FILE" || {
echo "Error: Cannot create review flag file: $FLAG_FILE" >&2
exit 1
}
echo "✅ Code review completed in ${iteration} iteration(s)."
echo "All critical/important issues resolved."
echo "Ready to create PR: gh pr create --title '...' --body '...'"
MANDATORY: Send shutdown request to both agents.
Use SendMessage tool:
type: "shutdown_request"
recipient: "reviewer"
content: "Review complete, shutting down team"
type: "shutdown_request"
recipient: "fixer"
content: "Review complete, shutting down team"
Wait for both agents to approve shutdown before exiting.
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.