This guide explains how to use the common AI rules (.ai-rules/) in Claude Code (Claude.ai Projects / Claude Desktop).
Claude Code uses the .claude/ directory for project-specific custom instructions, referencing the common rules from .ai-rules/.
The activate MCP tool is the one-shot entry point for collective intelligence workflows in Claude Code. It replaces the multi-step parse_mode + dispatch_agents ceremony with a single call.
activate({ prompt: "design auth feature", mode: "PLAN" })
Returns:
mode— resolved workflow moderules— loaded rules for the modeprimaryAgent— agent name + full system promptspecialists— recommended specialists with full promptsdiscussion— format guide for approve/concern/reject consensusnativeIntegration— guidance for Teams, Memory, orchestration
When activate returns specialists, use Claude native Teams for real-time debate:
1. activate({ prompt }) → get specialists
2. TeamCreate({ team_name: "plan-council" })
3. For each specialist: Agent({ team_name, name: specialist.name, prompt: specialist.prompt })
4. Specialists analyze independently → cross-review → consensus
5. Collect findings → summarize to user
Use Claude Code native features instead of legacy codingbuddy tools:
| Need | Use This | Instead of |
|---|---|---|
| Workflow entry | activate |
parse_mode + dispatch_agents |
| Cross-session context | Claude Code Memory | update_context / create_briefing / resume_session |
| Specialist execution | Claude native Teams | subagent dispatch |
| Task exploration | /dream |
analyze_task |
| Planning approval | EnterPlanMode |
planning stage routing |
| Repeated execution | /loop |
AUTO mode repetition |
| Clarification | AskUserQuestion |
clarification gate |
Note:
parse_moderemains available for non-Claude Code hosts (Cursor, Codex, etc.).
CodingBuddy now automatically enforces project code conventions from config files:
get_code_conventions: Parses and exposes project conventions from:
tsconfig.json- TypeScript strict mode, compiler optionseslint.config.js/.eslintrc.json- Linting rules.prettierrc- Formatting rules (quotes, semicolons, indentation).editorconfig- Editor settings (indent style/size, line endings, charset).markdownlint.json- Markdown linting rules
ACT Mode: Call get_code_conventions before implementing to verify code follows project conventions.
EVAL Mode: The conventions checklist domain is automatically included in code reviews.
// In ACT mode
const conventions = await get_code_conventions();
// Verify TypeScript strict mode
if (conventions.typescript.strict) {
// Ensure no implicit any types
}
// Check Prettier formatting
if (conventions.prettier.singleQuote) {
// Use single quotes
}Create .claude/rules/custom-instructions.md:
# Custom Instructions for Claude Code
## Project Rules
Follow the common rules defined in `.ai-rules/` for consistency across all AI coding assistants.
### Core Workflow
See `.ai-rules/rules/core.md` for:
- PLAN/ACT/EVAL workflow modes
- Agent activation rules
- Mode indicators and transitions
### Project Context
See `.ai-rules/rules/project.md` for:
- Tech stack (see project package.json)
- Project structure (app → widgets → features → entities → shared)
- Development rules and file naming conventions
- Domain knowledge
### Code Quality
See `.ai-rules/rules/augmented-coding.md` for:
- TDD cycle (Red → Green → Refactor)
- SOLID principles and code quality standards
- Testing best practices (90%+ coverage goal)
- Commit discipline
### Specialist Agents
See `.ai-rules/agents/README.md` for available specialist agents and their expertise areas.
## Claude Code Specific
- Follow project's configured language setting
- Use structured markdown formatting
- Provide clear, actionable feedback
- Reference project context from `.ai-rules/rules/project.md`In Claude.ai Projects:
- Create a new Project for this codebase
- Add "Custom Instructions" with content from
.claude/rules/custom-instructions.md - Attach relevant files from
.ai-rules/as project knowledge
In Claude Desktop:
- Set project-specific instructions
- Reference
.claude/rules/directory
.claude/
├── rules/
│ └── custom-instructions.md # References .ai-rules
└── config.json # Claude project config (optional)
.ai-rules/
├── rules/
│ ├── core.md
│ ├── project.md
│ └── augmented-coding.md
├── agents/
│ └── *.json
└── adapters/
└── claude-code.md # This guide
User: Build a new feature
Claude: # Mode: PLAN
[Following .ai-rules/rules/core.md workflow]
User: ACT
Claude: # Mode: ACT
[Execute with .ai-rules guidelines]
Claude can directly read and reference:
.ai-rules/rules/*.mdfiles.ai-rules/agents/*.jsonfiles- Project-specific patterns from
.ai-rules/rules/project.md
- ✅ Consistent rules across all AI tools
- ✅ Claude's strong reasoning applied to your project standards
- ✅ Easy updates: modify
.ai-rules/once - ✅ Project knowledge persists across sessions
- Update
.ai-rules/rules/*.mdfor universal changes - Update
.claude/rules/custom-instructions.mdfor Claude-specific features - Sync Claude Project instructions when rules change significantly
CodingBuddy skills are accessible via MCP tools:
Use list_skills MCP tool to see all available skills.
Use get_skill MCP tool with skill name:
get_skill("brainstorming")- Explore requirements before implementationget_skill("test-driven-development")- TDD workflowget_skill("systematic-debugging")- Debug methodicallyget_skill("writing-plans")- Create implementation plansget_skill("executing-plans")- Execute plans with checkpointsget_skill("subagent-driven-development")- In-session plan executionget_skill("dispatching-parallel-agents")- Handle parallel tasksget_skill("frontend-design")- Build production-grade UI
- brainstorming: Before any creative work or new features
- test-driven-development: Before implementing features or bugfixes
- systematic-debugging: When encountering bugs or test failures
- writing-plans: For multi-step tasks with specs
- executing-plans: Following written implementation plans
- frontend-design: Building web components or pages
Use recommend_skills MCP tool to get skill recommendations based on user prompt:
// AI can call this to get skill recommendations
recommend_skills({ prompt: "There is a bug in the login" })
// => recommends: systematic-debugging
recommend_skills({ prompt: "There is a bug in the login" })
// => recommends: systematic-debugging (multi-language support)
recommend_skills({ prompt: "Build a dashboard component" })
// => recommends: frontend-designSupported Languages: English, Korean, Japanese, Chinese, Spanish
The tool returns skill recommendations with confidence levels (high/medium) and matched patterns for transparency.
CodingBuddy uses a layered agent hierarchy for different types of tasks:
| Mode | Agents | Description |
|---|---|---|
| PLAN | solution-architect, technical-planner | Design and planning tasks |
| ACT | tooling-engineer, frontend-developer, backend-developer, devops-engineer, agent-architect | Implementation tasks |
| EVAL | code-reviewer | Code review and evaluation |
Note:
tooling-engineerhas highest priority for config/build tool tasks (tsconfig, eslint, vite.config, package.json, etc.)
Specialist agents can be invoked by any Primary Agent as needed:
- security-specialist
- accessibility-specialist
- performance-specialist
- test-strategy-specialist
- documentation-specialist
- architecture-specialist
- code-quality-specialist
- seo-specialist
- design-system-specialist
- PLAN mode: Always uses
solution-architectortechnical-plannerbased on prompt analysis - ACT mode: Resolution priority:
- Explicit agent request in prompt (e.g., "work with backend-developer")
recommended_agentparameter (from PLAN mode recommendation)- Tooling pattern matching (config files, build tools →
tooling-engineer) - Project configuration (
primaryAgentsetting) - Context inference (file extension/path)
- Default:
frontend-developer
- EVAL mode: Always uses
code-reviewer
When transitioning from PLAN to ACT mode, pass the recommended agent:
// After PLAN mode returns recommended_act_agent
const planResult = await parse_mode({ prompt: "PLAN design auth API" });
// planResult.recommended_act_agent = { agentName: "backend-developer", ... }
// Pass to ACT mode for context preservation
const actResult = await parse_mode({
prompt: "ACT implement the API",
recommended_agent: planResult.recommended_act_agent.agentName
});
// actResult.delegates_to = "backend-developer" (uses the recommendation)This enables seamless agent context passing across PLAN → ACT workflow transitions.
When agents or skills are activated, CodingBuddy displays activation messages for transparency:
🤖 solution-architect [Primary Agent]
👤 security-specialist [Specialist] (by solution-architect)
⚡ brainstorming [Specialist] (by technical-planner)
| Icon | Meaning |
|---|---|
| 🤖 | Primary Agent |
| 👤 | Specialist Agent |
| ⚡ | Skill |
The parse_mode MCP tool returns these agent-related fields:
{
"mode": "PLAN",
"delegates_to": "solution-architect",
"primary_agent_source": "intent",
"activation_message": {
"formatted": "🤖 solution-architect [Primary Agent]",
"activations": [
{
"type": "agent",
"name": "solution-architect",
"tier": "primary",
"timestamp": "2024-01-06T12:00:00Z"
}
]
},
"recommended_act_agent": {
"agentName": "backend-developer",
"reason": "API implementation task detected",
"confidence": 0.9
}
}AI assistants should display the activation_message.formatted field at the start of their response:
🤖 solution-architect [Primary Agent]
# Mode: PLAN
...
CodingBuddy supports parallel execution of multiple specialist agents for comprehensive analysis.
In Claude Code environments, use Claude native Teams as the primary execution strategy for specialist councils. The activate tool returns specialist prompts ready for Teams execution. See the "Collective Intelligence with activate" section above for the full workflow.
For non-Claude Code hosts or when Teams is not available, parallel execution is recommended when parse_mode returns a parallelAgentsRecommendation field:
| Mode | Default Specialists | Use Case |
|---|---|---|
| PLAN | architecture-specialist, test-strategy-specialist | Validate architecture and test approach |
| ACT | code-quality-specialist, test-strategy-specialist | Verify implementation quality |
| EVAL | security-specialist, accessibility-specialist, performance-specialist, code-quality-specialist | Comprehensive multi-dimensional review |
The parse_mode MCP tool returns this field to recommend parallel specialist execution:
{
"mode": "EVAL",
"parallelAgentsRecommendation": {
"specialists": [
"security-specialist",
"accessibility-specialist",
"performance-specialist",
"code-quality-specialist"
],
"hint": "Use Task tool with subagent_type=\"general-purpose\" and run_in_background=true for each specialist. Call prepare_parallel_agents MCP tool to get ready-to-use prompts."
}
}When parse_mode returns dispatchReady, use it directly with the Task tool — no extra tool calls needed:
Call parse_mode
↓
Check dispatchReady
↓ (if exists)
Use dispatchReady.primaryAgent.dispatchParams with Task tool
↓
Use dispatchReady.parallelAgents[].dispatchParams with Task tool (run_in_background: true)
↓
Collect results with TaskOutput
↓
Display consolidated results to user
// Step 1: parse_mode returns dispatchReady with Task-tool-ready params
const parseModeResult = await parse_mode({ prompt: "EVAL review auth implementation" });
if (parseModeResult.dispatchReady) {
const { primaryAgent, parallelAgents } = parseModeResult.dispatchReady;
// Step 2: Dispatch primary agent (if present)
if (primaryAgent) {
Task({
subagent_type: primaryAgent.dispatchParams.subagent_type,
prompt: primaryAgent.dispatchParams.prompt,
description: primaryAgent.dispatchParams.description,
});
}
// Step 3: Dispatch parallel agents (if present)
const tasks = [];
if (parallelAgents) {
for (const agent of parallelAgents) {
tasks.push(Task({
subagent_type: agent.dispatchParams.subagent_type,
prompt: agent.dispatchParams.prompt,
description: agent.dispatchParams.description,
run_in_background: true,
}));
}
}
// Step 4: Collect results
const results = await Promise.all(tasks.map(task => TaskOutput(task.id)));
// Step 5: Display summary
console.log("Specialist Analysis Complete:");
results.forEach(result => console.log(result.summary));
}For cases outside the parse_mode flow, use the dispatch_agents tool directly:
const result = await dispatch_agents({
mode: "EVAL",
primaryAgent: "security-specialist",
specialists: ["accessibility-specialist", "performance-specialist"],
includeParallel: true,
taskDescription: "Review auth implementation",
targetFiles: ["src/auth/login.tsx"]
});
// result.primaryAgent.dispatchParams → ready for Task tool
// result.parallelAgents[].dispatchParams → ready for Task tool with run_in_backgroundThe prepare_parallel_agents tool is still available for backward compatibility:
Call parse_mode
↓
Check parallelAgentsRecommendation
↓ (if exists)
Display start message to user
↓
Call prepare_parallel_agents MCP
↓
Call each agent.taskPrompt via Task tool in parallel:
- subagent_type: "general-purpose"
- run_in_background: true
- prompt: agent.taskPrompt
↓
Collect results with TaskOutput
↓
Display consolidated results to user
When executing parallel specialists, display clear status messages:
Start Message:
🚀 Dispatching N specialist agents in parallel...
→ 🔒 security-specialist
→ ♿ accessibility-specialist
→ ⚡ performance-specialist
→ 📏 code-quality-specialist
Completion Message:
📊 Specialist Analysis Complete:
🔒 Security Specialist:
[findings summary]
♿ Accessibility Specialist:
[findings summary]
⚡ Performance Specialist:
[findings summary]
📏 Code Quality Specialist:
[findings summary]
| Icon | Specialist |
|---|---|
| 🔒 | security-specialist |
| ♿ | accessibility-specialist |
| ⚡ | performance-specialist |
| 📏 | code-quality-specialist |
| 🧪 | test-strategy-specialist |
| 🏛️ | architecture-specialist |
| 📚 | documentation-specialist |
| 🔍 | seo-specialist |
| 🎨 | design-system-specialist |
When prepare_parallel_agents returns failedAgents:
⚠️ Some agents failed to load:
✗ performance-specialist: Profile not found
Continuing with 3/4 agents...
Strategy:
- Continue with successfully loaded agents
- Report failures clearly to user
- Document which agents couldn't be loaded in final report
Each workflow mode activates different specialist agents:
- PLAN mode: Architecture and test strategy specialists validate design
- ACT mode: Code quality and test strategy specialists verify implementation
- EVAL mode: Security, accessibility, performance, and code quality specialists provide comprehensive review
Important: Specialists from one mode do NOT carry over to the next mode. Each mode has its own recommended specialist set.
When parse_mode returns dispatch="auto" or dispatchReady with specialist agents, dispatching is mandatory — not optional.
Rule: Every listed specialist MUST be dispatched. Skipping any specialist is a protocol violation.
| Thought | Reality |
|---|---|
| "I can handle this analysis myself" | Specialists have domain expertise. Dispatch them. |
| "It's just a small change" | dispatch="auto" means the system determined specialists are needed. |
| "I'll save time by skipping" | Skipping causes missed issues that cost more later. |
| "I'll dispatch later" | Dispatch IMMEDIATELY when dispatch="auto" is returned. |
CodingBuddy uses a nested execution model with two distinct layers:
| Layer | Role | Tool | Scope |
|---|---|---|---|
| Outer transport | Parallel task execution across isolated environments | TaskMaestro (tmux + git worktree) or SubAgent (background agents) | One pane/agent per issue or task |
| Inner coordination | Specialist collaboration within a single session | Teams (experimental) | Multiple specialists within one pane/session |
Key distinction: TaskMaestro and SubAgent are alternatives for the outer layer. Teams is an inner layer that can optionally run inside either outer strategy.
Example 1: TaskMaestro (outer) + Teams (inner)
TaskMaestro session (outer)
├── Pane 1: Issue #101 (auth feature)
│ └── Teams session (inner, optional)
│ ├── security-specialist → reviews auth impl
│ └── test-strategy-specialist → validates test coverage
├── Pane 2: Issue #102 (dashboard UI)
│ └── Single agent (no inner Teams needed)
└── Pane 3: Issue #103 (API refactor)
└── Teams session (inner, optional)
├── architecture-specialist → validates API design
└── performance-specialist → checks query efficiency
Example 2: SubAgent (outer) without inner Teams
SubAgent dispatch (outer)
├── Agent 1: security-specialist (run_in_background)
├── Agent 2: accessibility-specialist (run_in_background)
└── Agent 3: performance-specialist (run_in_background)
→ Collect results via TaskOutput
Example 3: TaskMaestro (outer) + SubAgent (inner, within worker)
TaskMaestro session (outer, conductor)
├── Pane 1: Worker for Issue #101 (auth feature)
│ ├── Explore subAgent → researches existing auth patterns
│ ├── Plan subAgent → drafts TDD test plan
│ ├── [Worker writes code directly in its own worktree]
│ └── [Worker commits, pushes, creates PR, writes RESULT.json]
├── Pane 2: Worker for Issue #102 (dashboard UI)
│ └── Worker uses sub-agents for component research
│ (no cross-pane interference because each worker owns its worktree)
└── Pane 3: Review Agent (from review cycle protocol)
└── EVAL mode reviewer for completed PRs
This is the recommended pattern for complex worker tasks where parallel research or context protection would benefit the worker. The conductor still uses TaskMaestro for the outer dispatch — only the worker's internal orchestration uses sub-agents.
Key invariant: Sub-agents dispatched by a worker operate inside that worker's git worktree. Cross-pane file conflicts are impossible because each pane's worker owns its own isolated worktree.
See ../rules/parallel-execution.md "Conductor vs Worker Context" section for the authoritative rule.
When parse_mode returns availableStrategies, select the outer transport strategy:
- Check
availableStrategiesin the response - If both strategies available (
["subagent", "taskmaestro"]), ask user with AskUserQuestion:- Option A: "SubAgent (background agents, fast)" (Recommended)
- Option B: "TaskMaestro (tmux parallel panes, visual monitoring)"
- If only
["subagent"]andtaskmaestroInstallHintpresent:- Ask: "TaskMaestro is not installed. Would you like to install it for tmux-based parallel execution?"
- Yes → invoke
/taskmaestroskill to guide installation, then re-check - No → proceed with subagent
- Call
dispatch_agentswith chosenexecutionStrategyparameter:dispatch_agents({ mode, specialists, executionStrategy: "subagent" })— Agent tool flowdispatch_agents({ mode, specialists, executionStrategy: "taskmaestro" })— tmux pane assignments
- Execute based on strategy:
- subagent: Use
dispatchParamswith Agent tool (run_in_background: true) - taskmaestro: Follow
executionHint— start panes, assign prompts, monitor, collect results
- subagent: Use
When executionStrategy: "taskmaestro" is chosen, dispatch_agents returns:
{
"taskmaestro": {
"sessionName": "eval-specialists",
"paneCount": 5,
"assignments": [
{ "name": "security-specialist", "displayName": "Security Specialist", "prompt": "..." },
{ "name": "performance-specialist", "displayName": "Performance Specialist", "prompt": "..." }
]
},
"executionHint": "1. /taskmaestro start --panes 5\n2. ..."
}Execute by following the executionHint commands sequentially.
Capability gate: Teams-based coordination is experimental and depends on Claude Code native Teams support being available at runtime. If Teams APIs (
TeamCreate,SendMessage, etc.) are not available, fall back to the SubAgent dispatch pattern.
Teams provide structured specialist coordination within a single session or TaskMaestro pane. Use Teams when a task benefits from multiple specialists collaborating and reporting back to a coordinator, rather than running independently.
- A single task (or pane) needs input from 2+ specialists who should coordinate
- Specialist findings need to be collected and consolidated by a team lead
- The task requires structured message-based reporting between specialists
- Each specialist can run independently with no cross-specialist dependencies
- You are dispatching specialists across separate issues/tasks (use outer transport instead)
- Teams APIs are not available at runtime
1. TeamCreate({ team_name: "<task>-specialists" })
2. Spawn specialists as teammates:
Agent({ team_name, name: "security-specialist", subagent_type: "general-purpose", prompt: ... })
Agent({ team_name, name: "code-quality-specialist", subagent_type: "general-purpose", prompt: ... })
3. Create and assign tasks:
TaskCreate({ subject: "Security review of auth module" })
TaskUpdate({ taskId, owner: "security-specialist" })
4. Specialists work autonomously, report via SendMessage:
SendMessage({ to: "team-lead", message: "## Security Findings\n- ...", summary: "Security review done" })
5. Team lead collects all findings
6. Shutdown: SendMessage({ to: "security-specialist", message: { type: "shutdown_request" } })
Specialists report findings through SendMessage to the team lead. This enables:
- Structured collection of all specialist outputs
- Consolidated summary for the user
- Clear audit trail of what each specialist found
Report format:
## [Specialist Name] Findings
### Critical
- [finding]
### High
- [finding]
### Medium
- [finding]
### Recommendations
- [recommendation]If Teams APIs are unavailable or Teams-based dispatch fails:
- Use SubAgent with
run_in_background: truefor each specialist - Collect results via
TaskOutput - Document the fallback reason in your response
Unified commit and PR workflow that:
- Auto-commits uncommitted changes (grouped logically)
- Creates or updates PRs with smart issue linking
- Supports multiple languages (en/ko/bilingual)
/pr-all-in-one [target-branch] [issue-id]
Examples:
/pr-all-in-one- PR to default branch, issue from branch name/pr-all-in-one develop- PR to develop branch/pr-all-in-one PROJ-123- PR with specific issue ID/pr-all-in-one main PROJ-123- PR to main with issue ID
Create .claude/pr-config.json in your project root. Required settings:
defaultTargetBranch: Target branch for PRsissueTracker:jira,github,linear,gitlab, orcustomissuePattern: Regex pattern for issue ID extractionprLanguage:en,ko, orbilingual
See packages/rules/.ai-rules/skills/pr-all-in-one/configuration-guide.md for all options.
If no config file exists, the skill guides you through interactive setup:
- Select PR target branch
- Choose issue tracker
- Set PR description language
- (Optional) Configure issue URL template
SKILL.md- Main workflow documentationconfiguration-guide.md- Detailed config optionsissue-patterns.md- Supported issue tracker patternspr-templates.md- PR description templates
Use MCP tool get_skill("pr-all-in-one") to access skill documentation.
AUTO mode enables autonomous iteration through PLAN -> ACT -> EVAL cycles until quality criteria are met.
Use the AUTO keyword (or localized versions) at the start of your message:
| Language | Keyword |
|---|---|
| English | AUTO |
| Korean | AUTO |
| Japanese | 自動 |
| Chinese | 自动 |
| Spanish | AUTOMATICO |
AUTO implement user authentication with JWT tokens
AUTO implement user authentication with JWT
- Initial PLAN: Creates implementation plan with quality criteria
- ACT Iteration: Executes implementation following TDD workflow
- EVAL Check: Evaluates quality against exit criteria
- Loop or Exit:
- If quality met (Critical=0, High=0): Exits with success summary
- If max iterations reached: Exits with failure summary and remaining issues
- Otherwise: Returns to PLAN with improvement focus
- Success:
Critical = 0 AND High = 0severity issues - Failure: Max iterations reached (default: 3, configurable via
auto.maxIterations)
Severity and review-cycle canonical sources: The
Critical/Highlevels above are the Code Review Severity scale defined in../rules/severity-classification.md. The approval loop Claude Code runs over a PR (CI gate → review → fix → re-review → approve) is specified in../rules/pr-review-cycle.md. Follow those canonical sources rather than re-deriving severity or approval criteria from this adapter.
Configure AUTO mode in codingbuddy.config.json:
module.exports = {
auto: {
maxIterations: 3 // Default: 3
}
};# Mode: AUTO (Iteration 1/3)
## Phase: PLAN
[Planning content...]
## Phase: ACT
[Implementation content...]
## Phase: EVAL
[Evaluation content...]
### Quality Status
- Critical: 0
- High: 0
✅ AUTO mode completed successfully!
- Large feature implementations that require multiple refinement cycles
- Complex refactoring where quality verification is critical
- Bug fixes that need comprehensive testing and validation
- Code quality improvements with measurable success criteria
| Aspect | Manual Mode | AUTO Mode |
|---|---|---|
| Transition | User triggers each mode | Automatic cycling |
| Iterations | Single pass per mode | Multiple cycles until quality met |
| Exit | User decides completion | Quality criteria or max iterations |
| Intervention | Required for each step | Only when requested or on failure |
Canonical template for review agents that evaluate PRs in EVAL mode. Use this when a conductor, review pane, or solo workflow needs to generate a structured review prompt.
- Conductor review: The conductor generates this prompt for itself or a dedicated review pane
- TaskMaestro review pane: The review agent receives this prompt as its
TASK.md - Solo workflow: A developer enters EVAL mode to review their own PR before requesting human review
The review agent prompt follows this structure:
EVAL: review PR #<PR_NUMBER> for issue #<ISSUE_NUMBER>
Review the PR against the linked issue's acceptance criteria.
Use review_pr MCP tool, dispatch recommended specialists, and follow pr-review-cycle.md protocol.
Approve only when Critical = 0 AND High = 0.
When the review agent receives the prompt above, it MUST execute these steps in order:
const result = await parse_mode({
prompt: "EVAL: review PR #<PR_NUMBER> for issue #<ISSUE_NUMBER>"
});This returns:
mode: "EVAL"with code-reviewer as primary agentparallelAgentsRecommendationwith EVAL-mode specialistsdispatchReady(if auto-dispatch is enabled)
const reviewData = await review_pr({
pr_number: <PR_NUMBER>,
issue_number: <ISSUE_NUMBER> // optional, for spec compliance
});The review_pr tool returns:
- PR metadata (title, author, base/head branches)
- Diff summary and changed files list
- Auto-generated checklists for changed file domains
- Recommended specialist agents based on file patterns
Use the specialists from parse_mode or review_pr response:
// Option A: Auto-dispatch from parse_mode (preferred)
if (result.dispatchReady?.parallelAgents) {
for (const agent of result.dispatchReady.parallelAgents) {
Agent({
subagent_type: agent.dispatchParams.subagent_type,
prompt: agent.dispatchParams.prompt,
description: agent.dispatchParams.description,
run_in_background: true,
});
}
}
// Option B: Manual dispatch from review_pr recommendations
const dispatch = await dispatch_agents({
mode: "EVAL",
specialists: reviewData.recommendedSpecialists,
taskDescription: `Review PR #${prNumber}`,
targetFiles: reviewData.changedFiles,
});Typical EVAL-mode specialists: security-specialist, accessibility-specialist, performance-specialist, code-quality-specialist.
Collect all specialist results and classify each finding using the Code Review Severity scale:
| Severity | Meaning | Merge Gate |
|---|---|---|
critical |
Blocks approval, must fix | BLOCKED |
high |
Should fix before merge | BLOCKED (unless explicitly deferred) |
medium |
Worth addressing, does not gate merge | APPROVED with comments |
low |
Style/polish suggestions | APPROVED |
Post the structured review on the PR:
gh pr review <PR_NUMBER> --comment --body "<structured review>"Review body format (per pr-review-cycle.md):
## Review: [APPROVE | CHANGES_REQUESTED]
### CI Status: [PASS | FAIL]
### Issues Found:
- [critical]: <description> — <file:line>
- [high]: <description> — <file:line>
- [medium]: <description> — <file:line>
### Recommendation: [APPROVE | REQUEST_CHANGES]Follow the approval criteria from pr-review-cycle.md:
- Approve when: CI green, Critical = 0, High = 0 (or explicitly deferred with ticket)
- Request changes when: any Critical or High finding remains unresolved
# Approve (when reviewer is not the PR author)
gh pr review <PR_NUMBER> --approve --body "LGTM - all review comments addressed"
# Request changes
gh pr review <PR_NUMBER> --request-changes --body "<structured review>"For a conductor generating a review agent task:
EVAL: review PR #42 for issue #40
Review the PR against the linked issue's acceptance criteria.
Use review_pr MCP tool, dispatch recommended specialists, and follow pr-review-cycle.md protocol.
Approve only when Critical = 0 AND High = 0.- Severity scale:
severity-classification.md— Critical/High/Medium/Low definitions - Review protocol:
pr-review-cycle.md— CI gate, review steps, approval criteria, commit hygiene - MCP tool:
review_pr(pr_number, issue_number?, timeout?)— structured PR review data