بنقرة واحدة
ce-review
Perform exhaustive code reviews using multi-agent analysis, ultra-thinking, and worktrees
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Perform exhaustive code reviews using multi-agent analysis, ultra-thinking, and worktrees
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | ce:review |
| description | Perform exhaustive code reviews using multi-agent analysis, ultra-thinking, and worktrees |
| argument-hint | [PR number, GitHub URL, branch name, or latest] [--serial] |
<command_purpose> Perform exhaustive code reviews using multi-agent analysis, ultra-thinking, and Git worktrees for deep local inspection. </command_purpose>
Senior Code Review Architect with expertise in security, performance, architecture, and quality assurance
<review_target> #$ARGUMENTS </review_target>
First, I need to determine the review target type and set up the code for analysis.<task_list>
skill: git-worktree with branch name"gh pr view --json for title, body, files, linked issuesEnsure that the code is ready for analysis (either in worktree or on current branch). ONLY then proceed to the next step.
</task_list>
<protected_artifacts> The following paths are compound-engineering pipeline artifacts and must never be flagged for deletion, removal, or gitignore by any review agent:
docs/brainstorms/*-requirements.md — Requirements documents created by /ce:brainstorm. These are the product-definition artifacts that planning depends on.docs/plans/*.md — Plan files created by /ce:plan. These are living documents that track implementation progress (checkboxes are checked off by /ce:work).docs/solutions/*.md — Solution documents created during the pipeline.If a review agent flags any file in these directories for cleanup or removal, discard that finding during synthesis. Do not create a todo for it. </protected_artifacts>
Read compound-engineering.local.md in the project root. If found, use review_agents from YAML frontmatter. If the markdown body contains review context, pass it to each agent as additional instructions.
If no settings file exists, invoke the setup skill to create one. Then read the newly created file and continue.
<execution_mode>
Before launching review agents, check for context constraints:
If --serial flag is passed OR conversation is in a long session:
Run agents ONE AT A TIME in sequence. Wait for each agent to complete before starting the next. This uses less context but takes longer.
Default (parallel):
Run all agents simultaneously for speed. If you hit context limits, retry with --serial flag.
Auto-detect: If more than 5 review agents are configured, automatically switch to serial mode and inform the user: "Running review agents in serial mode (6+ agents configured). Use --parallel to override."
</execution_mode>
<parallel_tasks>
Parallel mode (default for ≤5 agents):
Run all configured review agents in parallel using Task tool. For each agent in the review_agents list:
Task {agent-name}(PR content + review context from settings body)
Serial mode (--serial flag, or auto for 6+ agents):
Run configured review agents ONE AT A TIME. For each agent in the review_agents list, wait for it to complete before starting the next:
For each agent in review_agents:
1. Task {agent-name}(PR content + review context)
2. Wait for completion
3. Collect findings
4. Proceed to next agent
Always run these last regardless of mode:
</parallel_tasks>
<conditional_agents>
These agents are run ONLY when the PR matches specific criteria. Check the PR files list to determine if they apply:
MIGRATIONS: If PR contains database migrations, schema.rb, or data backfills:
When to run:
db/migrate/*.rb or db/schema.rbWhat these agents check:
schema-drift-detector: Cross-references schema.rb changes against PR migrations to catch unrelated columns/indexes from local database statedata-migration-expert: Verifies hard-coded mappings match production reality (prevents swapped IDs), checks for orphaned associations, validates dual-write patternsdeployment-verification-agent: Produces executable pre/post-deploy checklists with SQL queries, rollback procedures, and monitoring plans</conditional_agents>
<ultrathink_instruction> For each phase below, spend maximum cognitive effort. Think step by step. Consider all angles. Question assumptions. And bring all reviews in a synthesis to the user.</ultrathink_instruction>
Complete system context map with component interactions<thinking_prompt> ULTRA-THINK: Put yourself in each stakeholder's shoes. What matters to them? What are their pain points? </thinking_prompt>
<stakeholder_perspectives>
Developer Perspective
Operations Perspective
End User Perspective
Security Team Perspective
Business Perspective
<thinking_prompt> ULTRA-THINK: Explore edge cases and failure scenarios. What could go wrong? How does the system behave under stress? </thinking_prompt>
<scenario_checklist>
Run the Task compound-engineering:review:code-simplicity-reviewer() to see if we can simplify the code.
<critical_requirement> ALL findings MUST be stored as todo files using the file-todos skill. Load the file-todos skill for the canonical directory path, naming convention, and template. Create todo files immediately after synthesis - do NOT present findings for user approval first. </critical_requirement>
<synthesis_tasks>
docs/brainstorms/, docs/plans/, or docs/solutions/ (see Protected Artifacts above)</synthesis_tasks>
<critical_instruction> Use the file-todos skill to create todo files for ALL findings immediately. Do NOT present findings one-by-one asking for user approval. Create all todo files in parallel using the skill, then summarize results to user. </critical_instruction>
Implementation Options:
Option A: Direct File Creation (Fast)
file-todos skill's todo-template.md{issue_id}-pending-{priority}-{description}.mdOption B: Sub-Agents in Parallel (Recommended for Scale) For large PRs with 15+ findings, use sub-agents to create finding files in parallel:
# Launch multiple finding-creator agents in parallel
Task() - Create todos for first finding
Task() - Create todos for second finding
Task() - Create todos for third finding
etc. for each finding.
Sub-agents can:
Execution Strategy:
Process (Using file-todos Skill):
For each finding:
Use file-todos skill for structured todo management:
skill: file-todos
The skill provides:
file-todos skill's todo-template.md{issue_id}-{status}-{priority}-{description}.mdCreate todo files in parallel:
{next_id}-pending-{priority}-{description}.md
Examples:
001-pending-p1-path-traversal-vulnerability.md
002-pending-p1-api-response-validation.md
003-pending-p2-concurrency-limit.md
004-pending-p3-unused-parameter.md
Follow template structure from file-todos skill: the file-todos skill's todo-template.md
Todo File Structure (from template):
Each todo must include:
File naming convention:
{issue_id}-{status}-{priority}-{description}.md
Examples:
- 001-pending-p1-security-vulnerability.md
- 002-pending-p2-performance-optimization.md
- 003-pending-p3-code-cleanup.md
Status values:
pending - New findings, needs triage/decisionready - Approved by manager, ready to workcomplete - Work finishedPriority values:
p1 - Critical (blocks merge, security/data issues)p2 - Important (should fix, architectural/performance)p3 - Nice-to-have (enhancements, cleanup)Tagging: Always add code-review tag, plus: security, performance, architecture, rails, quality, etc.
After creating all todo files, present comprehensive summary:
## ✅ Code Review Complete
**Review Target:** PR #XXXX - [PR Title] **Branch:** [branch-name]
### Findings Summary:
- **Total Findings:** [X]
- **🔴 CRITICAL (P1):** [count] - BLOCKS MERGE
- **🟡 IMPORTANT (P2):** [count] - Should Fix
- **🔵 NICE-TO-HAVE (P3):** [count] - Enhancements
### Created Todo Files:
**P1 - Critical (BLOCKS MERGE):**
- `001-pending-p1-{finding}.md` - {description}
- `002-pending-p1-{finding}.md` - {description}
**P2 - Important:**
- `003-pending-p2-{finding}.md` - {description}
- `004-pending-p2-{finding}.md` - {description}
**P3 - Nice-to-Have:**
- `005-pending-p3-{finding}.md` - {description}
### Review Agents Used:
- kieran-rails-reviewer
- security-sentinel
- performance-oracle
- architecture-strategist
- agent-native-reviewer
- [other agents]
### Next Steps:
1. **Address P1 Findings**: CRITICAL - must be fixed before merge
- Review each P1 todo in detail
- Implement fixes or request exemption
- Verify fixes before merging PR
2. **Triage All Todos**:
```bash
ls .context/compound-engineering/todos/*-pending-*.md todos/*-pending-*.md 2>/dev/null # View all pending todos
/triage # Use slash command for interactive triage
```
3. **Work on Approved Todos**:
```bash
/resolve-todo-parallel # Fix all approved items efficiently
```
4. **Track Progress**:
- Rename file when status changes: pending → ready → complete
- Update Work Log as you work
- Commit review findings and status updates
### Severity Breakdown:
**🔴 P1 (Critical - Blocks Merge):**
- Security vulnerabilities
- Data corruption risks
- Breaking changes
- Critical architectural issues
**🟡 P2 (Important - Should Fix):**
- Performance issues
- Significant architectural concerns
- Major code quality problems
- Reliability issues
**🔵 P3 (Nice-to-Have):**
- Minor improvements
- Code cleanup
- Optimization opportunities
- Documentation updates
<detect_project_type>
First, detect the project type from PR files:
| Indicator | Project Type |
|---|---|
*.xcodeproj, *.xcworkspace, Package.swift (iOS) | iOS/macOS |
Gemfile, package.json, app/views/*, *.html.* | Web |
| Both iOS files AND web files | Hybrid (test both) |
</detect_project_type>
<offer_testing>
After presenting the Summary Report, offer appropriate testing based on project type:
For Web Projects:
**"Want to run browser tests on the affected pages?"**
1. Yes - run `/test-browser`
2. No - skip
For iOS Projects:
**"Want to run Xcode simulator tests on the app?"**
1. Yes - run `/xcode-test`
2. No - skip
For Hybrid Projects (e.g., Rails + Hotwire Native):
**"Want to run end-to-end tests?"**
1. Web only - run `/test-browser`
2. iOS only - run `/xcode-test`
3. Both - run both commands
4. No - skip
</offer_testing>
Spawn a subagent to run browser tests (preserves main context):
Task general-purpose("Run /test-browser for PR #[number]. Test all affected pages, check for console errors, handle failures by creating todos and fixing.")
The subagent will:
Standalone: /test-browser [PR number]
Spawn a subagent to run Xcode tests (preserves main context):
Task general-purpose("Run /xcode-test for scheme [name]. Build for simulator, install, launch, take screenshots, check for crashes.")
The subagent will:
Standalone: /xcode-test [scheme]
Any 🔴 P1 (CRITICAL) findings must be addressed before merging the PR. Present these prominently and ensure they're resolved before accepting the PR.
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.
Run comprehensive agent-native architecture review with scored principles
Explore requirements and approaches through collaborative dialogue before writing a right-sized requirements document and planning implementation. Use for feature ideas, problem framing, when the user says 'let's brainstorm', or when they want to think through options before deciding what to build. Also use when a user describes a vague or ambitious feature request, asks 'what should we build', 'help me think through X', presents a problem with multiple valid solutions, or seems unsure about scope or direction — even if they don't explicitly ask to brainstorm.
Refresh stale or drifting learnings and pattern docs in docs/solutions/ by reviewing, updating, replacing, or archiving them against the current codebase. Use after refactors, migrations, dependency upgrades, or when a retrieved learning feels outdated or wrong. Also use when reviewing docs/solutions/ for accuracy, when a recently solved problem contradicts an existing learning, or when pattern docs no longer reflect current code.
Document a recently solved problem to compound your team's knowledge
Generate and critically evaluate grounded improvement ideas for the current project. Use when asking what to improve, requesting idea generation, exploring surprising improvements, or wanting the AI to proactively suggest strong project directions before brainstorming one in depth. Triggers on phrases like 'what should I improve', 'give me ideas', 'ideate on this project', 'surprise me with improvements', 'what would you change', or any request for AI-generated project improvement suggestions rather than refining the user's own idea.