cc10x Router
EXECUTION ENGINE. When loaded: Detect intent → Load memory → Execute workflow → Update memory.
NEVER list capabilities. ALWAYS execute.
Decision Tree (FOLLOW IN ORDER)
| Priority |
Signal |
Keywords |
Workflow |
| 1 |
ERROR |
error, bug, fix, broken, crash, fail, debug, troubleshoot, issue, problem, doesn't work |
DEBUG |
| 2 |
PLAN |
plan, design, architect, roadmap, strategy, spec, "before we build", "how should we" |
PLAN |
| 3 |
REVIEW |
review, audit, check, analyze, assess, "what do you think", "is this good" |
REVIEW |
| 4 |
DEFAULT |
Everything else |
BUILD |
Conflict Resolution: ERROR signals always win. "fix the build" = DEBUG (not BUILD).
Agent Chains
| Workflow |
Agents |
| BUILD |
component-builder → [code-reviewer ∥ silent-failure-hunter] → integration-verifier |
| DEBUG |
bug-investigator → code-reviewer → integration-verifier |
| REVIEW |
code-reviewer |
| PLAN |
planner |
∥ = PARALLEL - code-reviewer and silent-failure-hunter run simultaneously (both read-only)
Memory (PERMISSION-FREE)
LOAD FIRST (Before routing):
Bash(command="mkdir -p .claude/cc10x")
Read(file_path=".claude/cc10x/activeContext.md")
Read(file_path=".claude/cc10x/patterns.md")
Read(file_path=".claude/cc10x/progress.md")
UPDATE LAST (After workflow): Use Edit tool on activeContext.md (permission-free).
Check Active Workflow Tasks
After loading memory, check for active tasks:
TaskList() # Check for pending/in-progress workflow tasks
If active CC10x workflow task exists (subject starts with BUILD/DEBUG/REVIEW/PLAN):
- Resume from task state (read task description for context)
- Skip workflow selection - continue execution from where it stopped
- Check blockedBy to determine which agent to run next
If no active tasks:
- Proceed with workflow selection below
Task-Based Orchestration
At workflow start, create task hierarchy using TaskCreate/TaskUpdate:
BUILD Workflow Tasks
# 1. Parent workflow task
TaskCreate({
subject: "BUILD: {feature_summary}",
description: "User request: {request}\n\nWorkflow: BUILD\nChain: component-builder → [code-reviewer ∥ silent-failure-hunter] → integration-verifier",
activeForm: "Building {feature}"
})
# Returns workflow_task_id
# 2. Agent tasks with dependencies
TaskCreate({ subject: "component-builder: Implement {feature}", description: "Build the feature per user request", activeForm: "Building components" })
# Returns builder_task_id
TaskCreate({ subject: "code-reviewer: Review implementation", description: "Review code quality, patterns, security", activeForm: "Reviewing code" })
TaskUpdate({ taskId: reviewer_task_id, addBlockedBy: [builder_task_id] })
TaskCreate({ subject: "silent-failure-hunter: Hunt edge cases", description: "Find silent failures and edge cases", activeForm: "Hunting failures" })
TaskUpdate({ taskId: hunter_task_id, addBlockedBy: [builder_task_id] })
TaskCreate({ subject: "integration-verifier: Verify integration", description: "Run tests, verify E2E functionality", activeForm: "Verifying integration" })
TaskUpdate({ taskId: verifier_task_id, addBlockedBy: [reviewer_task_id, hunter_task_id] })
DEBUG Workflow Tasks
TaskCreate({ subject: "DEBUG: {error_summary}", description: "User request: {request}\n\nWorkflow: DEBUG\nChain: bug-investigator → code-reviewer → integration-verifier", activeForm: "Debugging {error}" })
TaskCreate({ subject: "bug-investigator: Investigate {error}", description: "Find root cause and fix", activeForm: "Investigating bug" })
TaskCreate({ subject: "code-reviewer: Review fix", description: "Review the fix quality", activeForm: "Reviewing fix" })
TaskUpdate({ taskId: reviewer_task_id, addBlockedBy: [investigator_task_id] })
TaskCreate({ subject: "integration-verifier: Verify fix", description: "Verify fix works E2E", activeForm: "Verifying fix" })
TaskUpdate({ taskId: verifier_task_id, addBlockedBy: [reviewer_task_id] })
REVIEW Workflow Tasks
TaskCreate({ subject: "REVIEW: {target_summary}", description: "User request: {request}\n\nWorkflow: REVIEW\nChain: code-reviewer (single agent)", activeForm: "Reviewing {target}" })
TaskCreate({ subject: "code-reviewer: Review {target}", description: "Comprehensive code review", activeForm: "Reviewing code" })
PLAN Workflow Tasks
TaskCreate({ subject: "PLAN: {feature_summary}", description: "User request: {request}\n\nWorkflow: PLAN\nChain: planner (single agent)", activeForm: "Planning {feature}" })
TaskCreate({ subject: "planner: Create plan for {feature}", description: "Create comprehensive implementation plan", activeForm: "Creating plan" })
Workflow Execution
BUILD
- Load memory → Check if already done in progress.md
- Clarify requirements (DO NOT SKIP) → Use AskUserQuestion
- Create task hierarchy (see Task-Based Orchestration above)
- Start chain execution (see Chain Execution Loop below)
- Update memory when all tasks completed
DEBUG
- Load memory → Check patterns.md Common Gotchas
- Clarify: What error? Expected vs actual? When started?
- If github-research detected (external service error OR explicit request):
- Execute research FIRST using octocode tools directly
- Search for error patterns, PRs with similar issues
- Create task hierarchy (see Task-Based Orchestration above)
- Start chain execution (see Chain Execution Loop below)
- Update memory → Add to Common Gotchas when all tasks completed
REVIEW
- Load memory
- Create task hierarchy (see Task-Based Orchestration above)
- Start chain execution (see Chain Execution Loop below)
- Update memory when task completed
PLAN
- Load memory
- If github-research detected (external tech OR explicit request):
- Execute research FIRST using octocode tools directly (NOT as hint)
- Use:
mcp__octocode__packageSearch, mcp__octocode__githubSearchCode, etc.
- Summarize findings before invoking planner
- Create task hierarchy (see Task-Based Orchestration above)
- Start chain execution (pass research results in prompt if step 2 was executed)
- Update memory → Reference saved plan when task completed
TWO-PHASE for External Research (MANDATORY):
If SKILL_HINTS includes github-research:
→ FIRST: Execute research using octocode tools
→ THEN: Task(cc10x:planner, prompt="...Research findings: {results}...")
Research is a PREREQUISITE, not a hint. Planner cannot skip it.
Agent Invocation
Pass task ID and context to each agent (see Chain Execution Loop for full pattern):
Task(subagent_type="cc10x:component-builder", prompt="
Your task ID: {taskId}
User request: {request}
Requirements: {from AskUserQuestion}
Memory: {from activeContext.md}
Patterns: {from patterns.md}
SKILL_HINTS: {detected skills from table below - agent MUST load these}
")
TASK ID is REQUIRED. Agent MUST call TaskUpdate(taskId, status="completed") when done.
SKILL_HINTS are MANDATORY. Agent MUST call Skill(skill="...") for each hint immediately after loading memory.
Skill triggers for agents (DETECT AND PASS AS SKILL_HINTS):
| Detected Pattern |
Skill |
Agents |
| Frontend: components/, ui/, pages/, .tsx, .jsx, CSS, styling, "button", "form", "modal" |
cc10x:frontend-patterns |
planner, component-builder, code-reviewer, integration-verifier |
| API/Backend: api/, routes/, services/, "endpoint", "REST", "GraphQL" |
cc10x:architecture-patterns |
planner, bug-investigator, code-reviewer |
| Vague: "not sure", "maybe", "options", "ideas", unclear requirements |
cc10x:brainstorming |
planner |
| External: new tech (post-2024), unfamiliar library, complex integration (auth, payments) |
cc10x:github-research |
planner, bug-investigator |
| Debug exhausted: 3+ local attempts failed, external service error |
cc10x:github-research |
bug-investigator |
| User explicitly requests: "research", "github", "octocode", "find on github", "how do others", "best practices" |
cc10x:github-research |
planner, bug-investigator |
Detection runs BEFORE agent invocation. Pass detected skills in SKILL_HINTS.
Gates (Must Pass)
- MEMORY_LOADED - Before routing
- TASKS_CHECKED - Check TaskList() for active workflow
- RESEARCH_EXECUTED - Before planner (if github-research detected)
- REQUIREMENTS_CLARIFIED - Before invoking agent (BUILD only)
- TASKS_CREATED - Workflow task hierarchy created
- ALL_TASKS_COMPLETED - All agent tasks status="completed"
- MEMORY_UPDATED - Before marking done
Chain Execution Loop (Task-Based)
NEVER stop after one agent. The workflow is NOT complete until ALL tasks are completed.
Execution Loop
1. Find runnable tasks:
TaskList() → Find tasks where:
- status = "pending"
- blockedBy is empty OR all blockedBy tasks are "completed"
2. Start agent(s):
- TaskUpdate(taskId, status="in_progress")
- If multiple tasks ready (e.g., code-reviewer + silent-failure-hunter):
→ Invoke BOTH in same message (parallel execution)
- Pass task ID in prompt:
Task(subagent_type="cc10x:{agent}", prompt="
Your task ID: {taskId}
User request: {request}
Requirements: {requirements}
Memory: {activeContext}
SKILL_HINTS: {detected skills}
")
3. After agent completes:
- Agent will have called TaskUpdate(taskId, status="completed")
- Router calls TaskList() to check state
4. Determine next:
- Find tasks where ALL blockedBy tasks are "completed"
- If multiple ready → Invoke ALL in parallel (same message)
- If one ready → Invoke sequentially
- If none ready AND uncompleted tasks exist → Wait (error state)
- If ALL tasks completed → Workflow complete
5. Repeat until:
- All tasks have status="completed"
- OR critical error detected (create error task, halt)
Parallel Execution
When multiple tasks become unblocked simultaneously (e.g., code-reviewer AND silent-failure-hunter after component-builder completes):
# Both ready after builder completes
TaskUpdate(taskId=reviewer_id, status="in_progress")
TaskUpdate(taskId=hunter_id, status="in_progress")
# Invoke BOTH in same message = parallel execution
Task(subagent_type="cc10x:code-reviewer", prompt="Your task ID: {reviewer_id}...")
Task(subagent_type="cc10x:silent-failure-hunter", prompt="Your task ID: {hunter_id}...")
CRITICAL: Both Task calls in same message = both complete before you continue.
Chain Completion Criteria
The workflow is complete ONLY when:
TaskList() shows ALL agent tasks with status="completed"
- OR a critical error prevents continuation
DO NOT update memory until ALL tasks are completed.
1---2name: cc10x-router3description: THE ONLY ENTRY POINT FOR CC10X - AUTO-LOAD AND EXECUTE for ANY development task. Triggers: build, implement, create, make, write, add, develop, code, feature, component, app, application, review, audit, check, analyze, debug, fix, error, bug, broken, troubleshoot, plan, design, architect, roadmap, strategy, memory, session, context, save, load, test, tdd, frontend, ui, backend, api, pattern, refactor, optimize, improve, enhance, update, modify, change, help, assist, work, start, begin, continue, research, cc10x, c10x. CRITICAL: Execute workflow. Never just describe capabilities.4---5
6# cc10x Router
7
8**EXECUTION ENGINE.** When loaded: Detect intent → Load memory → Execute workflow → Update memory.
9
10**NEVER** list capabilities. **ALWAYS** execute.
11
12## Decision Tree (FOLLOW IN ORDER)
13
14| Priority | Signal | Keywords | Workflow |
15|----------|--------|----------|----------|
16| 1 | ERROR | error, bug, fix, broken, crash, fail, debug, troubleshoot, issue, problem, doesn't work | **DEBUG** |
17| 2 | PLAN | plan, design, architect, roadmap, strategy, spec, "before we build", "how should we" | **PLAN** |
18| 3 | REVIEW | review, audit, check, analyze, assess, "what do you think", "is this good" | **REVIEW** |
19| 4 | DEFAULT | Everything else | **BUILD** |
20
21**Conflict Resolution:** ERROR signals always win. "fix the build" = DEBUG (not BUILD).
22
23## Agent Chains
24
25| Workflow | Agents |
26|----------|--------|
27| BUILD | component-builder → **[code-reviewer ∥ silent-failure-hunter]** → integration-verifier |
28| DEBUG | bug-investigator → code-reviewer → integration-verifier |
29| REVIEW | code-reviewer |
30| PLAN | planner |
31
32**∥ = PARALLEL** - code-reviewer and silent-failure-hunter run simultaneously (both read-only)
33
34## Memory (PERMISSION-FREE)
35
36**LOAD FIRST (Before routing):**
37```
38Bash(command="mkdir -p .claude/cc10x")
39Read(file_path=".claude/cc10x/activeContext.md")
40Read(file_path=".claude/cc10x/patterns.md")
41Read(file_path=".claude/cc10x/progress.md")
42```
43
44**UPDATE LAST (After workflow):** Use Edit tool on activeContext.md (permission-free).
45
46## Check Active Workflow Tasks
47
48**After loading memory, check for active tasks:**
49```
50TaskList() # Check for pending/in-progress workflow tasks
51```
52
53**If active CC10x workflow task exists (subject starts with BUILD/DEBUG/REVIEW/PLAN):**
54- Resume from task state (read task description for context)
55- Skip workflow selection - continue execution from where it stopped
56- Check blockedBy to determine which agent to run next
57
58**If no active tasks:**
59- Proceed with workflow selection below
60
61## Task-Based Orchestration
62
63**At workflow start, create task hierarchy using TaskCreate/TaskUpdate:**
64
65### BUILD Workflow Tasks
66```
67# 1. Parent workflow task
68TaskCreate({
69 subject: "BUILD: {feature_summary}",
70 description: "User request: {request}\n\nWorkflow: BUILD\nChain: component-builder → [code-reviewer ∥ silent-failure-hunter] → integration-verifier",
71 activeForm: "Building {feature}"
72})
73# Returns workflow_task_id
74
75# 2. Agent tasks with dependencies
76TaskCreate({ subject: "component-builder: Implement {feature}", description: "Build the feature per user request", activeForm: "Building components" })
77# Returns builder_task_id
78
79TaskCreate({ subject: "code-reviewer: Review implementation", description: "Review code quality, patterns, security", activeForm: "Reviewing code" })
80TaskUpdate({ taskId: reviewer_task_id, addBlockedBy: [builder_task_id] })
81
82TaskCreate({ subject: "silent-failure-hunter: Hunt edge cases", description: "Find silent failures and edge cases", activeForm: "Hunting failures" })
83TaskUpdate({ taskId: hunter_task_id, addBlockedBy: [builder_task_id] })
84
85TaskCreate({ subject: "integration-verifier: Verify integration", description: "Run tests, verify E2E functionality", activeForm: "Verifying integration" })
86TaskUpdate({ taskId: verifier_task_id, addBlockedBy: [reviewer_task_id, hunter_task_id] })
87```
88
89### DEBUG Workflow Tasks
90```
91TaskCreate({ subject: "DEBUG: {error_summary}", description: "User request: {request}\n\nWorkflow: DEBUG\nChain: bug-investigator → code-reviewer → integration-verifier", activeForm: "Debugging {error}" })
92
93TaskCreate({ subject: "bug-investigator: Investigate {error}", description: "Find root cause and fix", activeForm: "Investigating bug" })
94TaskCreate({ subject: "code-reviewer: Review fix", description: "Review the fix quality", activeForm: "Reviewing fix" })
95TaskUpdate({ taskId: reviewer_task_id, addBlockedBy: [investigator_task_id] })
96TaskCreate({ subject: "integration-verifier: Verify fix", description: "Verify fix works E2E", activeForm: "Verifying fix" })
97TaskUpdate({ taskId: verifier_task_id, addBlockedBy: [reviewer_task_id] })
98```
99
100### REVIEW Workflow Tasks
101```
102TaskCreate({ subject: "REVIEW: {target_summary}", description: "User request: {request}\n\nWorkflow: REVIEW\nChain: code-reviewer (single agent)", activeForm: "Reviewing {target}" })
103
104TaskCreate({ subject: "code-reviewer: Review {target}", description: "Comprehensive code review", activeForm: "Reviewing code" })
105```
106
107### PLAN Workflow Tasks
108```
109TaskCreate({ subject: "PLAN: {feature_summary}", description: "User request: {request}\n\nWorkflow: PLAN\nChain: planner (single agent)", activeForm: "Planning {feature}" })
110
111TaskCreate({ subject: "planner: Create plan for {feature}", description: "Create comprehensive implementation plan", activeForm: "Creating plan" })
112```
113
114## Workflow Execution
115
116### BUILD
1171. Load memory → Check if already done in progress.md
1182. **Clarify requirements** (DO NOT SKIP) → Use AskUserQuestion
1193. **Create task hierarchy** (see Task-Based Orchestration above)
1204. **Start chain execution** (see Chain Execution Loop below)
1215. Update memory when all tasks completed
122
123### DEBUG
1241. Load memory → Check patterns.md Common Gotchas
1252. Clarify: What error? Expected vs actual? When started?
1263. **If github-research detected (external service error OR explicit request):**
127 - Execute research FIRST using octocode tools directly
128 - Search for error patterns, PRs with similar issues
1294. **Create task hierarchy** (see Task-Based Orchestration above)
1305. **Start chain execution** (see Chain Execution Loop below)
1316. Update memory → Add to Common Gotchas when all tasks completed
132
133### REVIEW
1341. Load memory
1352. **Create task hierarchy** (see Task-Based Orchestration above)
1363. **Start chain execution** (see Chain Execution Loop below)
1374. Update memory when task completed
138
139### PLAN
1401. Load memory
1412. **If github-research detected (external tech OR explicit request):**
142 - Execute research FIRST using octocode tools directly (NOT as hint)
143 - Use: `mcp__octocode__packageSearch`, `mcp__octocode__githubSearchCode`, etc.
144 - Summarize findings before invoking planner
1453. **Create task hierarchy** (see Task-Based Orchestration above)
1464. **Start chain execution** (pass research results in prompt if step 2 was executed)
1475. Update memory → Reference saved plan when task completed
148
149**TWO-PHASE for External Research (MANDATORY):**
150```
151If SKILL_HINTS includes github-research:
152 → FIRST: Execute research using octocode tools
153 → THEN: Task(cc10x:planner, prompt="...Research findings: {results}...")
154```
155Research is a PREREQUISITE, not a hint. Planner cannot skip it.
156
157## Agent Invocation
158
159**Pass task ID and context to each agent (see Chain Execution Loop for full pattern):**
160```
161Task(subagent_type="cc10x:component-builder", prompt="
162Your task ID: {taskId}
163User request: {request}
164Requirements: {from AskUserQuestion}
165Memory: {from activeContext.md}
166Patterns: {from patterns.md}
167SKILL_HINTS: {detected skills from table below - agent MUST load these}
168")
169```
170
171**TASK ID is REQUIRED.** Agent MUST call `TaskUpdate(taskId, status="completed")` when done.
172**SKILL_HINTS are MANDATORY.** Agent MUST call `Skill(skill="...")` for each hint immediately after loading memory.
173
174**Skill triggers for agents (DETECT AND PASS AS SKILL_HINTS):**
175
176| Detected Pattern | Skill | Agents |
177|------------------|-------|--------|
178| Frontend: components/, ui/, pages/, .tsx, .jsx, CSS, styling, "button", "form", "modal" | cc10x:frontend-patterns | planner, component-builder, code-reviewer, integration-verifier |
179| API/Backend: api/, routes/, services/, "endpoint", "REST", "GraphQL" | cc10x:architecture-patterns | planner, bug-investigator, code-reviewer |
180| Vague: "not sure", "maybe", "options", "ideas", unclear requirements | cc10x:brainstorming | planner |
181| External: new tech (post-2024), unfamiliar library, complex integration (auth, payments) | cc10x:github-research | planner, bug-investigator |
182| Debug exhausted: 3+ local attempts failed, external service error | cc10x:github-research | bug-investigator |
183| User explicitly requests: "research", "github", "octocode", "find on github", "how do others", "best practices" | cc10x:github-research | planner, bug-investigator |
184
185**Detection runs BEFORE agent invocation. Pass detected skills in SKILL_HINTS.**
186
187## Gates (Must Pass)
188
1891. **MEMORY_LOADED** - Before routing
1902. **TASKS_CHECKED** - Check TaskList() for active workflow
1913. **RESEARCH_EXECUTED** - Before planner (if github-research detected)
1924. **REQUIREMENTS_CLARIFIED** - Before invoking agent (BUILD only)
1935. **TASKS_CREATED** - Workflow task hierarchy created
1946. **ALL_TASKS_COMPLETED** - All agent tasks status="completed"
1957. **MEMORY_UPDATED** - Before marking done
196
197## Chain Execution Loop (Task-Based)
198
199**NEVER stop after one agent.** The workflow is NOT complete until ALL tasks are completed.
200
201### Execution Loop
202
203```
2041. Find runnable tasks:
205 TaskList() → Find tasks where:
206 - status = "pending"
207 - blockedBy is empty OR all blockedBy tasks are "completed"
208
2092. Start agent(s):
210 - TaskUpdate(taskId, status="in_progress")
211 - If multiple tasks ready (e.g., code-reviewer + silent-failure-hunter):
212 → Invoke BOTH in same message (parallel execution)
213 - Pass task ID in prompt:
214 Task(subagent_type="cc10x:{agent}", prompt="
215 Your task ID: {taskId}
216 User request: {request}
217 Requirements: {requirements}
218 Memory: {activeContext}
219 SKILL_HINTS: {detected skills}
220 ")
221
2223. After agent completes:
223 - Agent will have called TaskUpdate(taskId, status="completed")
224 - Router calls TaskList() to check state
225
2264. Determine next:
227 - Find tasks where ALL blockedBy tasks are "completed"
228 - If multiple ready → Invoke ALL in parallel (same message)
229 - If one ready → Invoke sequentially
230 - If none ready AND uncompleted tasks exist → Wait (error state)
231 - If ALL tasks completed → Workflow complete
232
2335. Repeat until:
234 - All tasks have status="completed"
235 - OR critical error detected (create error task, halt)
236```
237
238### Parallel Execution
239
240When multiple tasks become unblocked simultaneously (e.g., code-reviewer AND silent-failure-hunter after component-builder completes):
241
242```
243# Both ready after builder completes
244TaskUpdate(taskId=reviewer_id, status="in_progress")
245TaskUpdate(taskId=hunter_id, status="in_progress")
246
247# Invoke BOTH in same message = parallel execution
248Task(subagent_type="cc10x:code-reviewer", prompt="Your task ID: {reviewer_id}...")
249Task(subagent_type="cc10x:silent-failure-hunter", prompt="Your task ID: {hunter_id}...")
250```
251
252**CRITICAL:** Both Task calls in same message = both complete before you continue.
253
254### Chain Completion Criteria
255
256The workflow is complete ONLY when:
257- `TaskList()` shows ALL agent tasks with status="completed"
258- OR a critical error prevents continuation
259
260**DO NOT update memory until ALL tasks are completed.**