/aimi-engineering:aimi:review [PR number, GitHub URL, branch name, or latest]from aimi-engineering
Performs code reviews using parallel AI agents with findings synthesis. Accepts a PR number, GitHub URL, branch name, or no argument to review the current branch.
Ships in aimi-engineering. Installing the plugin adds it to Claude Code.
Perform code reviews using parallel aimi-native review agents with findings synthesis.
<review_target> #$ARGUMENTS </review_target>
Before any diff commands, detect the repository's default branch:
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||')
if [ -z "$DEFAULT_BRANCH" ]; then
DEFAULT_BRANCH="main"
fi
Use $DEFAULT_BRANCH in all subsequent git diff commands instead of a hardcoded branch name.
gh pr view $ARGUMENTS --json title,body,files,headRefName,baseRefNamegit diff $DEFAULT_BRANCH...$ARGUMENTS --name-only# Get changed files
gh pr view [number] --json files --jq '.files[].path'
# OR for branch comparison:
git diff $DEFAULT_BRANCH...HEAD --name-only
Read the changed files to understand the PR content. Collect the diff for agent context.
If the PR's branch has a matching brainstorm document under .aimi/brainstorms/ (semantic match on feature name, within 30 days) or the current branch name appears in a tasks file with a metadata.brainstormPath, parse the brainstorm for prototype references and load them as design context for reviewers:
prototype: key (path string or YAML list).## Prototype heading and extract .html paths..aimi/brainstorms/prototypes/<topic-slug>-tokens.json if present.<design_reference> block. Reviewers compare the implementation's visual/structural fidelity against the chosen variant and the target-project tokens.If no matching brainstorm is found, skip this step silently — it is additive context, never a precondition.
These paths must never be flagged for deletion or removal by any review agent:
.aimi/plans/*.md — Plan files.aimi/solutions/*.md — Solution documents.aimi/tasks/*.json — Task files.aimi/brainstorms/*.md — Brainstorm documents.aimi/research/*.md — Research output filesRead and follow the Resolve Agent Models section of commands/references/cli-path-resolution.md to populate AGENT_MODELS. When resolution fails, treat every category as "inherit" and continue.
Run these agents in parallel using the Task tool:
Task subagent_type="aimi-engineering:review:aimi-architecture-strategist"
[model: <AGENT_MODELS.review when not "inherit">]
prompt: "Review this code for architectural compliance:
[PR content / diff summary]"
Task subagent_type="aimi-engineering:review:aimi-security-sentinel"
[model: <AGENT_MODELS.review when not "inherit">]
prompt: "Perform security audit on this code:
[PR content / diff summary]"
Task subagent_type="aimi-engineering:review:aimi-code-simplicity-reviewer"
[model: <AGENT_MODELS.review when not "inherit">]
prompt: "Review this code for simplicity and minimalism:
[PR content / diff summary]"
Task subagent_type="aimi-engineering:review:aimi-performance-oracle"
[model: <AGENT_MODELS.review when not "inherit">]
prompt: "Analyze this code for performance issues:
[PR content / diff summary]"
Task subagent_type="aimi-engineering:review:aimi-agent-native-reviewer"
[model: <AGENT_MODELS.review when not "inherit">]
prompt: "Verify new features are agent-accessible:
[PR content / diff summary]"
Task subagent_type="aimi-engineering:research:aimi-learnings-researcher"
[model: <AGENT_MODELS.research when not "inherit">]
prompt: "Search .aimi/solutions/ for past issues related to this PR:
[PR content / diff summary]"
Run ONLY when PR contains database migrations, schema changes, or data backfills.
Detection: Check if changed files include db/migrate/*.rb, db/schema.rb, migration scripts, or data backfill tasks.
Task subagent_type="aimi-engineering:review:aimi-schema-drift-detector"
[model: <AGENT_MODELS.review when not "inherit">]
prompt: "Detect unrelated schema.rb changes:
[PR content / diff summary]"
Task subagent_type="aimi-engineering:review:aimi-data-migration-expert"
[model: <AGENT_MODELS.review when not "inherit">]
prompt: "Validate ID mappings and migration safety:
[PR content / diff summary]"
Task subagent_type="aimi-engineering:review:aimi-deployment-verification-agent"
[model: <AGENT_MODELS.review when not "inherit">]
prompt: "Create deployment checklist with verification queries:
[PR content / diff summary]"
Detect primary language from changed files and run the appropriate reviewer:
| File Extensions | Agent |
|---|---|
*.rb, Gemfile, *.erb | aimi-engineering:review:aimi-kieran-rails-reviewer |
*.ts, *.tsx, *.js | aimi-engineering:review:aimi-kieran-typescript-reviewer |
*.py | aimi-engineering:review:aimi-kieran-python-reviewer |
For Rails projects, also consider running:
aimi-engineering:review:aimi-dhh-rails-reviewer for Rails convention checksaimi-engineering:review:aimi-julik-frontend-races-reviewer for Stimulus/JS race conditionsAutomatically invoke the design-implementation reviewer when the tasks file signals a visual story with prototype references.
Trigger gate — both conditions must be true:
jq -r '.metadata.prototypePaths // empty' $TASKS_FILE returns a non-empty valuejq -r '[.userStories[] | select(.verification.strategy == "visual")] | length' $TASKS_FILE returns a value greater than 0If either condition fails (e.g., pre-1.73.0 tasks files that lack metadata.prototypePaths, or no story uses verification.strategy: "visual"), skip this section entirely — no agent is spawned.
agent-browser availability check — before spawning any Task, verify the browser tool is installed:
command -v agent-browser
If the command returns non-zero, log the following warning and skip all invocations in this section:
Design fidelity review skipped: agent-browser not installed
Per-visual-story invocation — when the gate passes and agent-browser is available, spawn one Task per visual story (stories where verification.strategy == "visual"):
prototype_path: use story.implementation.prototypeAnchor if present; otherwise use the first prototype path cited in the story's acceptance criteria; otherwise fall back to the first entry of metadata.prototypePaths.live_url: use story.verification.url when present; omit the field otherwise.Task subagent_type="aimi-engineering:design:aimi-design-implementation-reviewer"
[model: <AGENT_MODELS.design when not "inherit">]
prompt: "Compare the implementation against the design prototype and report visual fidelity drift.
Story ID: [story.id]
Story title: [story.title]
prototype_path: [resolved prototype_path — see derivation rule above]
live_url: [story.verification.url or omit if absent]"
Findings from this agent are emitted at the same severity levels (P1/P2/P3) as all other review agents.
For each finding: Small (< 30 min), Medium (30 min - 2 hours), Large (> 2 hours)
## Review Complete
**Review Target:** [PR title or branch name]
**Branch:** [branch-name]
### Findings Summary
- **Total Findings:** [X]
- **P1 CRITICAL:** [count] - BLOCKS MERGE
- **P2 IMPORTANT:** [count] - Should Fix
- **P3 NICE-TO-HAVE:** [count] - Enhancements
### P1 - Critical (Must Fix Before Merge)
1. **[Finding title]** — [description]
- Location: [file:line]
- Impact: [what breaks]
- Fix: [how to fix]
- Effort: [Small/Medium/Large]
### P2 - Important (Should Fix)
1. **[Finding title]** — [description]
- Location: [file:line]
- Recommendation: [how to improve]
- Effort: [Small/Medium/Large]
### P3 - Nice-to-Have
1. **[Finding title]** — [description]
- Suggestion: [improvement]
### Review Agents Used
- aimi-architecture-strategist
- aimi-security-sentinel
- aimi-code-simplicity-reviewer
- aimi-performance-oracle
- aimi-agent-native-reviewer
- aimi-learnings-researcher
- Design Fidelity (conditional)
- [other conditional agents if run]
### Next Steps
1. **Address P1 findings** — Critical issues must be fixed before merge
2. **Run `/aimi:execute`** — Continue autonomous execution
3. **Run `/aimi:status`** — Check current task progress
| Failure | Action |
|---|---|
| No review target found | Ask user to specify PR number or branch |
| Agent fails | Proceed with available results, note in report |
| No changed files | Report "No changes to review" |
| gh CLI not installed | Fall back to git diff for branch comparison |
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
21 commands in this plugin
/aimi:brainstormExplore ideas through guided brainstorming with batched questions and codebase research/aimi:deepenEnrich tasks.json stories with research insights/design:aimi:design:auditaimi:design:auditTechnical quality audit for frontend interfaces — accessibility (a11y), performance, theming, responsive design, and anti-pattern detection. Dedicated home for WCAG/a11y checks. Use when you need a systematic, code-level quality report before release./design:aimi:design:craftaimi:design:craftBuild a feature with high-quality UX and UI through a structured process: shape the design, land the visual direction, build real production code, then inspect and improve in-browser until the result meets a high-end studio bar. Use when you have a confirmed design brief and are ready to implement, or when the user wants the full discovery-then-build flow in one step. Trigger phrases: build the design, craft the UI, implement the design brief, build this feature with good design./design:aimi:design:critiqueaimi:design:critiqueDesign critique for frontend interfaces — visual hierarchy, information architecture, anti-patterns, and Nielsen's heuristics scoring. Use when you want a design director's honest assessment of a UI./design:aimi:design:polishaimi:design:polishFinal-pass polish for frontend interfaces — catches the small details that separate good work from great work. Use after a feature is functionally complete and you want to align it to the design system, fix visual inconsistencies, and bring everything to a consistent quality level.npx claudepluginhub romulo-banhe/aimi-eng --plugin aimi-engineeringOther plugins' commands for the same job