Already in IMPLEMENTATION (agents already selected)
Task is pure research (no file modifications)
Resuming existing task (agents already assigned)
Quick Selection Guide
By File Type
Files Modified
Risk Level
Required Agents
src/main/java/**
HIGH
architect, formatter, engineer, tester, builder
src/test/java/**
MEDIUM
architect, engineer, tester
pom.xml, build.gradle
HIGH
architect, builder
.github/**, CI/CD
HIGH
architect, builder, security
docs/**/*.md
LOW
(none, or architect for technical docs)
CLAUDE.md, protocol docs
HIGH
architect, formatter
checkstyle.xml, style configs
HIGH
architect, formatter, builder
By Task Type
Task Type
Required Agents
New feature implementation
architect, formatter, engineer, tester, builder
Bug fix
architect, tester
Refactoring
architect, engineer
Performance optimization
architect, performance
Security enhancement
architect, security
Documentation only
(none)
Test additions
architect, tester
Style/formatting
architect, formatter, builder
Risk Classification Algorithm
Step 1: Analyze Files to be Modified
# List files that will be modified
FILES_TO_MODIFY=(
# Add file paths here
)
# Classify each file
HIGH_RISK=false
MEDIUM_RISK=false
LOW_RISK=truefor file in"${FILES_TO_MODIFY[@]}"; docase"$file"in
src/main/java/*|src/*/main/java/*)
HIGH_RISK=true
;;
pom.xml|*/pom.xml|build.gradle)
HIGH_RISK=true
;;
.github/*|CLAUDE.md|**/task-protocol*.md)
HIGH_RISK=true
;;
checkstyle*.xml|pmd*.xml)
HIGH_RISK=true
;;
src/test/java/*|src/*/test/java/*)
MEDIUM_RISK=true
;;
docs/code-style/*|**/resources/*.properties)
MEDIUM_RISK=true
;;
*.md|*.txt|README*)
# Already LOW_RISK
;;
esacdoneif$HIGH_RISK; then
RISK_LEVEL="HIGH"elif$MEDIUM_RISK; then
RISK_LEVEL="MEDIUM"else
RISK_LEVEL="LOW"fiecho"Risk Level: $RISK_LEVEL"
Step 2: Check Escalation Triggers
TASK_DESCRIPTION="$TASK_DESCRIPTION"# Set task description# Keywords that force escalation to HIGH
ESCALATION_KEYWORDS="security|authentication|authorization|encryption|breaking|architecture|api|database|concurrent|performance"ifecho"$TASK_DESCRIPTION" | grep -qiE "$ESCALATION_KEYWORDS"; thenecho"Escalation trigger detected - forcing HIGH risk"
RISK_LEVEL="HIGH"fi
Step 3: Select Agents Based on Risk Level
case"$RISK_LEVEL"in"HIGH")
AGENTS=("architect") # Always required# Add based on task typeifecho"$TASK_DESCRIPTION" | grep -qi "implement\|feature\|add\|create"; then
AGENTS+=("formatter""engineer""tester""builder")
fiifecho"$TASK_DESCRIPTION" | grep -qi "security\|auth"; then
AGENTS+=("security")
fiifecho"$TASK_DESCRIPTION" | grep -qi "performance\|optim\|speed\|memory"; then
AGENTS+=("performance")
fiifecho"$TASK_DESCRIPTION" | grep -qi "user\|interface\|ux\|ui"; then
AGENTS+=("usability")
fi
;;
"MEDIUM")
AGENTS=("architect""engineer")
ifecho"$TASK_DESCRIPTION" | grep -qi "test"; then
AGENTS+=("tester")
fiifecho"$TASK_DESCRIPTION" | grep -qi "style\|format"; then
AGENTS+=("formatter")
fi
;;
"LOW")
AGENTS=() # No agents for low-risk tasks
;;
esacecho"Selected agents: ${AGENTS[*]}"
❌ Wrong: Including performance agent for simple CRUD operations
❌ Wrong: Including security agent for internal utility class
❌ Wrong: Including usability agent for backend-only changes
Under-Selection (Missing Agents)
❌ Wrong: New feature without tester agent
❌ Wrong: API changes without architect agent
❌ Wrong: Style configuration changes without formatter agent
Correct Selection Examples
Task: "Implement user authentication"
✅ architect (API design)
✅ security (auth handling)
✅ tester (auth test cases)
✅ formatter (code style)
✅ builder (build verification)
Task: "Fix typo in README"
✅ No agents needed (LOW risk)
Task: "Add unit tests for Calculator class"
✅ architect (test strategy)
✅ tester (test implementation)
❌ No formatter (not changing production code)
Output Format
After selection, update task.json with selected agents: