Skill v1.0.0
currentAutomated scan100/100name: multi-review description: Perform a comprehensive code review using multiple specialized sub-agents in parallel. Covers logical correctness, performance, readability, and security. Creates tk tickets if tk is available, otherwise writes a report to .code-review/final-report.md. disable-model-invocation: true metadata: version: "1.0.0"
Multiple Code Reviewers
This command performs a comprehensive code review using specialized sub-agents.
Step 1: Setup and detect tk
Run these commands sequentially in a single Bash call to prepare the environment and detect tk:
mkdir -p .code-reviewrm -f .code-review/*.mdtouch .code-review/changed-files.txtTK_AVAILABLE=falseif command -v tk >/dev/null 2>&1; thenTK_AVAILABLE=truefiecho "TK_AVAILABLE=$TK_AVAILABLE"
Step 2: Determine review scope
Parse $ARGUMENTS to determine what to review. Set two variables: the file list in .code-review/changed-files.txt and REVIEW_CMD (passed to reviewers).
- No arguments (default): Review uncommitted changes
``bash git status --porcelain | awk '{print $NF}' > .code-review/changed-files.txt ` REVIEW_CMD=git diff`
- Commit references (e.g., "last 3 commits", "since abc123", "HEAD~5"):
Determine the appropriate base ref from the user's intent, then: ``bash git diff --name-only <base-ref> > .code-review/changed-files.txt ` REVIEW_CMD=git diff <base-ref> --`
- Specific files (e.g., "Review src/auth.py src/models.py"):
Write the specified file paths to .code-review/changed-files.txt (one per line). REVIEW_CMD=FULL_FILE
It's CRUCIAL that reviewers ONLY analyze files listed in .code-review/changed-files.txt and NOTHING ELSE.
Step 3: Collect CLAUDE.md context
Collect CLAUDE.md files from the project root and from directories containing changed files. This content is passed to reviewers so they can check for project convention violations.
Run this to build .code-review/claude-md-context.txt:
> .code-review/claude-md-context.txt[ -f CLAUDE.md ] && { echo "=== CLAUDE.md (root) ==="; cat CLAUDE.md; echo; } >> .code-review/claude-md-context.txtwhile IFS= read -r file; dodir=$(dirname "$file")if [ "$dir" != "." ] && [ -f "$dir/CLAUDE.md" ]; thenecho "=== CLAUDE.md ($dir) ===" >> .code-review/claude-md-context.txtcat "$dir/CLAUDE.md" >> .code-review/claude-md-context.txtecho >> .code-review/claude-md-context.txtfidone < .code-review/changed-files.txt
If the resulting file is empty (no CLAUDE.md files found), delete it so reviewers know there is no context:
[ ! -s .code-review/claude-md-context.txt ] && rm -f .code-review/claude-md-context.txt
Step 4: tk mode setup (if TK_AVAILABLE)
If TK_AVAILABLE is true:
- Examine the changed files list and generate a short, descriptive title summarizing what's being reviewed (e.g., "Review: Auth module refactor" or "Review: API endpoint updates and test fixes").
- Create an epic with a timestamp for uniqueness:
EPIC_ID=$(tk create "<generated title> (<YYYY-MM-DD HH:MM>)" -t epic -p 2 --tags code-review -d "<brief summary of changes being reviewed>")
- Note the
EPIC_IDfor passing to sub-agents.
Step 5: Launch reviewers
If there are files to review, use the Task tool to invoke these specialized reviewers in parallel.
Include REVIEW_CMD=<command> in each prompt so reviewers know how to examine files.
tk mode (TK_AVAILABLE=true)
Pass the epic ID and review command to each sub-agent via the prompt string:
- Invoke the code-reviewer-1 sub-agent:
Task: Review code for logical correctnessPrompt: TK_MODE=true EPIC_ID=<epic_id> REVIEW_CMD=<review_cmd> -- Review ONLY files in .code-review/changed-files.txt - do NOT examine any other filesSubagentType: code-reviewer-1
- Invoke the code-reviewer-2 sub-agent:
Task: Review code for performancePrompt: TK_MODE=true EPIC_ID=<epic_id> REVIEW_CMD=<review_cmd> -- Review ONLY files in .code-review/changed-files.txt - do NOT examine any other filesSubagentType: code-reviewer-2
- Invoke the code-reviewer-3 sub-agent:
Task: Review code for readabilityPrompt: TK_MODE=true EPIC_ID=<epic_id> REVIEW_CMD=<review_cmd> -- Review ONLY files in .code-review/changed-files.txt - do NOT examine any other filesSubagentType: code-reviewer-3
- Invoke the security-reviewer sub-agent:
Task: Review code for security issuesPrompt: TK_MODE=true EPIC_ID=<epic_id> REVIEW_CMD=<review_cmd> -- Review ONLY files in .code-review/changed-files.txt - do NOT examine any other filesSubagentType: security-reviewer
File mode (TK_AVAILABLE=false)
Pass the review command without tk parameters:
- Invoke the code-reviewer-1 sub-agent:
Task: Review code for logical correctnessPrompt: REVIEW_CMD=<review_cmd> -- Review ONLY files in .code-review/changed-files.txt - do NOT examine any other filesSubagentType: code-reviewer-1
- Invoke the code-reviewer-2 sub-agent:
Task: Review code for performancePrompt: REVIEW_CMD=<review_cmd> -- Review ONLY files in .code-review/changed-files.txt - do NOT examine any other filesSubagentType: code-reviewer-2
- Invoke the code-reviewer-3 sub-agent:
Task: Review code for readabilityPrompt: REVIEW_CMD=<review_cmd> -- Review ONLY files in .code-review/changed-files.txt - do NOT examine any other filesSubagentType: code-reviewer-3
- Invoke the security-reviewer sub-agent:
Task: Review code for security issuesPrompt: REVIEW_CMD=<review_cmd> -- Review ONLY files in .code-review/changed-files.txt - do NOT examine any other filesSubagentType: security-reviewer
Step 6: Coordination
After all reviewers complete their analysis, invoke the review-coordinator sub-agent:
tk mode
Task: Compile review findingsPrompt: TK_MODE=true EPIC_ID=<epic_id> -- Aggregate review findings, deduplicate, and present summarySubagentType: review-coordinator
File mode
Task: Compile review findingsPrompt: Combine all reviewer findings, combine duplicates, and write the final report to .code-review/final-report.mdSubagentType: review-coordinator
Step 7: Completion
tk mode
When complete, inform the user that the review is finished and provide the epic ID. Tell them they can browse tickets with:
tk show <id>- View details of a specific tickettk query '.[] | select(.parent=="<epic_id>")'- List all review tickets
File mode
When complete, inform the user that the review is finished and present the final report from .code-review/final-report.md.