ワンクリックで
review
Universal code review - auto-detects scope from git changes, spec, commit, or brief
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Universal code review - auto-detects scope from git changes, spec, commit, or brief
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Orchestrate the /dev methodology across ALL phases of a feature spec via a background ultracode run, one fresh agent per bounded (sub-)phase, sequentially. Handles the DB migration itself, splits oversized phases, monitors progress, recovers from agent overruns, independently certifies each block, and reconciles the spec. Encodes the failure modes seen in practice so they do not recur.
Develop phase with exploration and plan validation
Deep codebase exploration to answer specific questions
Fix bugs or modify existing features with deep exploration, root-cause analysis, and quality-first long-term solutions
Quick implementation without a full spec file
Create complete development plan with parallel exploration
| name | review |
| description | Universal code review - auto-detects scope from git changes, spec, commit, or brief |
| argument-hint | [scope=frontend|backend|all] [feature=name] [spec=path] [mode=pushed|local] [commit=hash] |
| hooks | {"PostToolUse":[{"matcher":"Edit|Write","hooks":[{"type":"command","command":"if [[ -d \"backend\" ]]; then\n cd backend && go build ./... 2>&1 | head -10 && golangci-lint run ./... 2>&1 | head -20 || true\nfi\n","once":true}]}]} |
YOU ARE EXECUTING THE /review SKILL. The user triggered this skill. Follow ALL instructions below step by step. Do NOT treat this as a freeform conversation - execute the skill workflow.
Think carefully for code review. Follow CLAUDE.md rules.
YOU MUST use the Task tool with subagent_type to launch agents. NEVER read or analyze code files directly yourself. Agents do the heavy lifting - you orchestrate and aggregate their results.
Use Task tool with these subagent_type values:
explore-docs - Documentation lookupexplore-codebase - Code pattern searchexplore-db - Database schema explorationbackend-code-optimizer - Go code quality analysis (returns score + issues)frontend-code-reviewer - React/TS code quality analysis (returns score + issues)/review spec:file.md): Extract file list FROM the spec (exclusive source)/review spec:file.md mode:local): Spec provides CONTEXT, other source determines files$ARGUMENTS.feature -> Search codebase for feature-related files$ARGUMENTS.commit -> git show --name-only $ARGUMENTS.commit$ARGUMENTS.mode -> Git diff (pushed or local)$ARGUMENTS.spec alone -> Extract files from specmode=local (uncommitted changes)git log origin/$(git rev-parse --abbrev-ref HEAD) -1 --format="%H %s"
git show --name-only --format="" HEAD
git show HEAD
git diff origin/$(git rev-parse --abbrev-ref HEAD)...HEAD --name-only
git status --porcelain
git diff HEAD
git show --name-only $ARGUMENTS.commit
git show $ARGUMENTS.commit
This is a feature-based review, independent of git changes.
Task(subagent_type="explore-codebase") to find all files related to the featurebackend/**/*.go, frontend -> frontend/src/**/*.{ts,tsx})| Pattern | Domain |
|---|---|
backend/**/*.go | Backend |
frontend/src/**/*.{ts,tsx} | Frontend |
| Other | Config/Docs |
Apply forced scope if provided: $ARGUMENTS.scope
## Review Scope
**Source**: [feature/mode/spec/commit]
**Feature**: [feature name if provided, otherwise "N/A"]
**Spec Context**: [spec file path if provided, otherwise "None"]
**Commit**: [hash if applicable]
**Detected Scope**: [backend/frontend/both]
### Backend ([count] files)
- [file list]
### Frontend ([count] files)
- [file list]
### Other ([count] files)
- [file list]
MANDATORY: Use Task tool with subagent_type for each agent. Do NOT read files directly.
CRITICAL: Launch ALL applicable agents in a SINGLE message with MULTIPLE tool calls (parallel execution). Do NOT launch one agent, wait for it, then launch the next. Every matching condition below = one agent in the SAME message.
Scale agent count to the actual breadth of the diff and the review dimensions that apply. No upper limit, and do not gate on file counts. Assess the real scope and spawn accordingly:
Task(subagent_type="backend-code-optimizer", prompt="Read and review these Go files for correctness and safety: [file list]. Focus on: error handling, nil safety, context propagation, edge cases, bugs, business logic errors. Spec context: [spec summary if available]. Provide quality score and categorized issues.")Task(subagent_type="backend-code-optimizer", prompt="Read these Go files: [file list]. Then search for similar existing patterns in backend/ to compare against. Focus on: Clean Architecture compliance, layer boundaries, dependency direction, naming conventions, DRY principle. Spec context: [spec summary if available]. Provide quality score and categorized issues.")Task(subagent_type="backend-code-optimizer", prompt="Read and review these Go files for performance: [file list]. Focus on: concurrency patterns, query efficiency, N+1 queries, memory allocation, unnecessary copies, context cancellation. Provide categorized issues.")Task(subagent_type="backend-code-optimizer", prompt="Read these new Go files: [new file list]. Then search backend/ for existing code that duplicates the same functionality. Check for reusable helpers, services, and patterns that already exist. Report any duplications found.")Task(subagent_type="backend-code-optimizer", prompt="Check test coverage for these Go files: [file list]. For each file, check if a corresponding *_test.go exists. Verify tests cover happy path + error cases. Check if tests follow project patterns (testify, hand-written mocks, *Env struct). Report missing tests and inadequate coverage.")Task(subagent_type="frontend-code-reviewer", prompt="Read and review these React/TypeScript files for correctness: [file list]. Focus on: React patterns, hook dependency arrays, state management, unnecessary re-renders, Shadcn UI usage, error handling. Spec context: [spec summary if available]. Provide quality score and categorized issues.")Task(subagent_type="frontend-code-reviewer", prompt="Read these React/TypeScript files: [file list]. Then search for similar existing components/hooks in frontend/src/ to compare against. Focus on: type safety, conventions, naming, DRY principle, consistent patterns. Spec context: [spec summary if available]. Provide quality score and categorized issues.")Task(subagent_type="frontend-code-reviewer", prompt="Read and review these UI files: [file list]. Focus on: responsive design, loading/error states, accessibility, useTranslations (from next-intl) usage for all user-facing text, proper Shadcn component usage. Provide categorized issues.")Task(subagent_type="frontend-code-reviewer", prompt="Read these new files: [new file list]. Then search frontend/src/ for existing components, hooks, or utilities that duplicate the same functionality. Report any duplications found.")| Condition | Task tool call |
|---|---|
| Database changes | Task(subagent_type="explore-db", prompt="dev - Check tables related to [feature]. Verify schema, constraints, RLS") |
| External library | Task(subagent_type="explore-docs", prompt="[library] [specific API] best practices") |
scope=frontend -> skip all backend agents entirelyscope=backend -> skip all frontend agents entirelyAgent outputs to integrate:
Aggregate and format the results from section 2 agents. Do NOT re-analyze files yourself.
Use the analysis format from checklists/backend-checklist.md and checklists/frontend-checklist.md.
## Code Review Analysis
### Files Reviewed (from agent reports)
- `path/to/file` - [purpose of changes]
Aggregate scores from specialized agents (section 2). Skip domains with no agent output.
Use scoring criteria from checklists.
Weighted average based on file count per domain.
## Global Quality Score: X/100
Formula: (Backend Score x backend_files + Frontend Score x frontend_files) / total_files
[1-2 sentence overall assessment]
## Recommended Fixes
### Critical (must fix)
1. **[Issue]**
- File: `path:line`
- Problem: [description]
- Fix: [how to fix]
### Important (should fix)
1. ...
### Nice-to-have
1. ...
Ask with AskUserQuestion: "Code review complete. What would you like to do?"
Options:
This is the core purpose of the review command: identify issues AND fix them.
After user validation, implement fixes directly using Edit tool. Do NOT just report - actually modify the files.
Order:
Implementation approach:
Rules:
Run verification based on scope:
# Backend (if backend files changed)
cd backend && go build ./... && go vet ./... && golangci-lint run ./... && go test ./...
# Frontend (if frontend files changed)
cd frontend && npm run test:run && npm run build
Backend and frontend tests are MANDATORY: All existing tests must pass (zero regressions).
Database (if schema changes): run get_advisors via explore-db (dev/prod).
Use the summary format from templates/review-report.md.
useTranslations (from next-intl) for all frontend text