cc10x-router
cc10x Router
Runtime contract only. v10 restores trust-first orchestration: route intent, hydrate workflow state, write workflow artifacts, execute the task graph, validate agent output, and fail closed on ambiguity, skipped work, or missing persistence.
1. Intent Routing
Route using the first matching signal:
| Priority | Signal | Keywords | Workflow | Chain |
|---|---|---|---|---|
| 1 | ERROR | error, bug, fix, broken, crash, fail, debug, troubleshoot, issue | DEBUG | bug-investigator -> code-reviewer -> integration-verifier |
| 2 | PLAN | plan, design, architect, roadmap, strategy, spec, brainstorm | PLAN | brainstorming -> planner |
| 3 | REVIEW | review, audit, analyze, assess, "is this good" | REVIEW | code-reviewer |
| 4 | DEFAULT | Everything else | BUILD | component-builder -> [code-reviewer |
Rules:
- ERROR always wins over BUILD.
- REVIEW is advisory only. Never let REVIEW create code-changing tasks.
- BUILD always uses the full chain. The old QUICK path is retired.
- Before execution, output one line:
-> {WORKFLOW} workflow (signals: {matched keywords})
2. Memory Load And Template Validation
Always run this before routing or resuming:
1. Bash("mkdir -p .claude/cc10x/v10")
2. Read(".claude/cc10x/v10/activeContext.md")
3. Read(".claude/cc10x/v10/patterns.md")
4. Read(".claude/cc10x/v10/progress.md")
Do not parallelize step 1 with reads.
If a memory file is missing:
- Create it using the
cc10x:session-memorytemplate. - Read it before continuing.
Required sections:
| File | Required Sections |
|---|---|
activeContext.md |
## Current Focus, ## Recent Changes, ## Next Steps, ## Decisions, ## Learnings, ## References, ## Blockers, ## Session Settings, ## Last Updated |
progress.md |
## Current Workflow, ## Tasks, ## Completed, ## Verification, ## Last Updated |
patterns.md |
## User Standards, ## Common Gotchas, ## Project SKILL_HINTS, ## Last Updated |
Auto-heal rule:
- Insert missing sections before
## Last Updated. - After every
Edit(...), immediatelyRead(...)and verify the new section exists.
JUST_GO:
- Read
activeContext.md ## Session Settings. - If
AUTO_PROCEED: true, setJUST_GO=true. - While
JUST_GO=true, auto-default all non-REVERT AskUserQuestion gates to the recommended option and log the choice in## Decisions.
v10 trust rule:
JUST_GOnever overrides explicit user/project standards, open plan decisions, or failure-stop gates.- If a plan still has unresolved
Open Decisions, BUILD may not start, even inJUST_GO.
2a. Workflow Artifact And Hook Policy
CC10X durable orchestration state lives in:
.claude/cc10x/v10/workflows/{workflow_uuid}.json
Artifact schema must include:
workflow_uuidworkflow_idworkflow_typestate_rootuser_requestplan_filedesign_fileresearch_filesapproved_decisionsintentcapabilitiesphase_cursornormalized_phasesresearch_roundsresearch_backend_historyresearch_qualitytask_idsphase_statusresultsevidencequalitymemory_notespending_gatestatus_historyremediation_historycreated_atupdated_at
Rules:
- Router creates the workflows directory before the first workflow artifact write.
- Router writes or updates the artifact after workflow creation, every agent completion, every remediation decision, every clarification answer, every phase completion, every blocking stop, and memory finalization.
- Resume uses task metadata first, then workflow artifact, then memory markdown.
- Verifier handoff and memory finalization read structured data from the workflow artifact, not transient conversation recovery.
- The workflow UUID is generated independently of Claude task ids and is the canonical workflow identifier everywhere in v10.
workflow_idremains as a compatibility alias and must equalworkflow_uuidin new artifacts.state_rootmust equal.claude/cc10x/v10.phase_cursorpoints at the only BUILD phase that may run next.normalized_phasesstores planner-approved executable phases with:phase_idtitleobjectivefileschecksexit_criteria
- Bright Data MCP and Octocode MCP are optional accelerators. Base CC10X installs must continue to work with built-in Claude Code tools only.
- When optional user-configured Claude Code MCP servers are available, use the server names
brightdataandoctocodeso the research agents can auto-detect them without prompt edits. capabilitiesrecords the session-level research backend availability model:brightdata_availableoctocode_availablewebsearch_availablewebfetch_available
results.researchmust be structured asweb,github, andsynthesis.intentstores the durable spec header for the workflow:goalnon_goalsconstraintsacceptance_criteriaopen_decisions
approved_decisionsstores decisions explicitly approved by the user or already fixed in the saved plan.evidencestores proof-of-work grouped by agent:builderinvestigatorreviewerhunterverifier
qualitystores convergence state:confidenceevidence_completescenario_coverageresearch_qualityconvergence_state
pending_gateis required whenever BUILD/PLAN/DEBUG is waiting on user clarification, scope selection, or persistence repair.status_historyandremediation_historyare append-only summaries of major router decisions.
v10 router gates:
plan_trust_gatephase_exit_gatefailure_stop_gatememory_sync_gateskill_precedence_gate
These are router-owned checks, not advisory hints.
Workflow event log:
- For every workflow, keep a lightweight append-only companion file:
.claude/cc10x/v10/workflows/{workflow_uuid}.events.jsonl
- Append event objects with at least:
tswfeventphasetask_idagentdecisionreason
- Event types:
workflow_startedagent_startedagent_completedcontract_parsedremediation_createdscope_decision_requestedscope_decision_resolvedmemory_finalizedworkflow_completedworkflow_failed
Hook policy:
- CC10X plugin hooks live in the plugin bundle under
hooks/hooks.jsonand should stay minimal:PreToolUsefor protected writesSessionStartfor resume contextPostToolUsefor workflow artifact integrity auditTaskCompletedfor task metadata checks
- Default mode is audit-only. Do not rely on hooks as the only source of truth; the router still owns orchestration decisions.
- Repo-local
.claude/settings.jsonis not part of the shipped CC10X product. - Optional accelerator MCPs are user-configured in Claude Code. CC10X assumes the names
brightdataandoctocodeif they are available, but must degrade to built-in research paths when they are absent.
3. Task Metadata Contract
Every CC10X task description starts with normalized metadata lines:
wf:{workflow_uuid}
kind:{workflow|agent|remfix|memory|reverify|research}
origin:{router|component-builder|bug-investigator|code-reviewer|silent-failure-hunter|integration-verifier|planner}
phase:{build|build-implement|build-review|build-hunt|build-verify|debug|debug-investigate|debug-review|debug-verify|review|review-audit|plan|plan-create|memory-finalize|re-review|re-hunt|re-verify|re-plan|research-web|research-github}
plan:{path|N/A}
scope:{ALL_ISSUES|CRITICAL_ONLY|N/A}
reason:{short reason or N/A}
Rules:
wf:is mandatory on every child task.- Router must generate
workflow_uuidbeforeTaskCreate()and use it from the first write.wf:PENDING_SELFis retired in v10. kind:is mandatory and drives resume, routing, and counting logic.origin:is mandatory on everykind:remfixtask.plan:is required on workflow, agent, reverify, and memory tasks.reason:is required on remediation and research tasks.- The router must never depend on loose prose when metadata can answer the question.
4. Resume And Hydration
After memory load:
TaskList()
Hydration rules:
- Find active parent workflow tasks by subject prefix
CC10X BUILD:,CC10X DEBUG:,CC10X REVIEW:,CC10X PLAN:. - If more than one active workflow exists, scope by the current conversation and matching
wf:markers. Do not resume a workflow you cannot scope confidently. - Reconstruct runnable tasks from
TaskList()andTaskGet()usingwf:+kind:+phase:. Do not rely on stored task IDs for correctness. - Read and write only the v10 namespace. Ignore legacy
.claude/cc10x/*.mdand.claude/cc10x/workflows/*state during hydration. [cc10x-internal] memory_task_idinactiveContext.mdis only a transient optimization. If it is missing, stale, or points to a differentwf:, ignore it and reconstruct the memory task from the current workflow scope.- Never use an unscoped fallback like "first pending Memory Update task".
Resume algorithm:
- Identify the active parent workflow.
- Extract
workflow_uuidfrom thewf:line. - Read all CC10X tasks whose descriptions contain that
wf:. - Derive runnable tasks from
statusandblockedBy. - Reconstruct the memory task as the unique pending/in_progress
kind:memorytask in the samewf:.
Scope-decision resume:
- Before normal routing, check
activeContext.md ## Decisionsfor a live marker:[SCOPE-DECISION-PENDING: wf:{workflow_uuid} reason:{...}]
- If present, treat the current user reply as the answer to that pending BUILD scope gate:
critical only-> create the pending REM-FIX withscope:CRITICAL_ONLYall issues-> create the pending REM-FIX withscope:ALL_ISSUES- anything else -> ask again with the same two options and stop
- After consuming a valid answer:
- remove the pending marker from
## Decisions - create the scoped REM-FIX
- block downstream re-review / re-hunt / verifier tasks as normal
- stop after task creation so the next turn resumes from task state, not from repeated prose parsing
- remove the pending marker from
Safety rules:
- If a task list is shared across sessions, always scope by
wf:before resuming. - If a task has
status=in_progressand unresolved blockers, treat it as waiting on remediation, not as a free-running orphan. - If a task has
status=in_progressand no blockers, ask the user whether to resume, delete, or mark complete. - If legacy tasks exist with subjects starting
BUILD:,DEBUG:,REVIEW:, orPLAN:without theCC10Xprefix, ask whether to resume the legacy workflow or start a fresh CC10X workflow.
5. Workflow Preparation
Shared preparation
Before creating a new workflow:
- Read
activeContext.md ## Referencesto discoverPlan,Design, and priorResearchfiles. - Read
activeContext.md ## Decisionsfor prior planner/build clarifications. - Read
progress.md ## Current Workflowand## Tasksfor pending work that should resume instead of duplicating. - Read the latest
.claude/cc10x/v10/workflows/*.jsonartifact if one exists for the current conversation.
Router-owned interface fields:
plan_mode:direct|execution_plan|decision_rfcverification_rigor:standard|critical_pathcheckpoint_type:none|human_verify|decision|human_actionproof_status:passed|gaps_found|human_needed
BUILD preparation
- Read
- Plan:fromactiveContext.md ## References. - If plan path is not
N/A,Read(...)the plan file before creating tasks. - Run
plan_trust_gatebefore BUILD:Open Decisionsmust be empty or explicitly marked approved.Differences from agreementmust be present, even if empty.plan_modemust be explicit when a plan artifact exists.verification_rigormust be explicit when a plan artifact exists.- If either condition fails, ask for clarification and do not start BUILD.
- If plan path is
N/A, use an adaptive gate:- obviously trivial, low-risk work -> continue directly to BUILD
- complex, ambiguous, multi-step, or cross-cutting work -> ask:
Plan first (Recommended)orBuild directly Plan first-> switch to PLAN workflow.Build directly-> continue without a plan.
- If the referenced plan file is missing:
- Ask:
Build without planorRe-plan first (Recommended). Build without plan-> continue withplan:N/ARe-plan first-> switch to PLAN workflow
- Ask:
- Normalize planner phases into executable
normalized_phasesand initializephase_cursorto the first incomplete phase. - Persist the approved
plan_modeandverification_rigorfrom the planner contract into the workflow artifact. - Every normalized phase must carry:
objectiveinputsfiles/surfacesexpected_artifactsrequired_checkscheckpoint_typeexit_criteria
- Initialize workflow
proof_statustogaps_founduntil the current phase is independently verified. - Clarify missing requirements before builder only when the plan and memory do not already answer them.
- Persist pre-answered clarifications in
activeContext.md ## DecisionsusingBuild clarification [{topic}]: {answer}. - Builder may execute only the phase at
phase_cursor.
DEBUG preparation
- If the user explicitly asks for research or the bug clearly depends on external post-2024 behavior, allow a research round before the first investigator run.
- Immediately write
[DEBUG-RESET: wf:{workflow_uuid}]once the workflow id exists. - Preserve failed attempt counting semantics: the investigator counts
[DEBUG-N]:entries after the most recent reset marker.
REVIEW preparation
- REVIEW is advisory only.
- Never create REM-FIX or implementation tasks directly from a REVIEW workflow.
- If the final review verdict is
CHANGES_REQUESTED, the router may offerStart BUILD to fix (Recommended)as a follow-up user choice.
PLAN preparation
- Restore design enrichment:
- Read
- Design:fromactiveContext.md ## References. - If a design path exists, verify it with
Glob(...)and pass it under## Design File.
- Read
- Restore mandatory brainstorming:
- If no valid design file exists, run
Skill(skill="cc10x:brainstorming")in the main context before planner. - Brainstorming may ask the user questions and may save a
*-design.mdfile. After it completes, re-readactiveContext.md ## Referencesand refresh the design path. - Brainstorming should ask only unresolved, high-impact questions and stop as soon as the intent contract is complete.
- If no valid design file exists, run
- Optional research before planning:
- Ask whether to run web + GitHub research for external/unfamiliar technology when it would materially improve the plan.
- Planner receives
## Research Filesonly when research files actually exist. - Planner is agreement-first:
- If a requirement is materially ambiguous, planner returns
STATUS=NEEDS_CLARIFICATION. - Planner never treats its own defaults as approved implementation.
- If a requirement is materially ambiguous, planner returns
- Planner must choose one
plan_mode:directfor trivial low-risk workexecution_planfor standard implementation workdecision_rfcfor architecture or multi-option work
- Planner must choose one
verification_rigor:standardby defaultcritical_pathfor security, money, state-machine, concurrency, or irreversible-migration work
6. Workflow Task Graphs
Parent workflow creation
Use this pattern for every new workflow:
- Generate a stable workflow UUID before
TaskCreate():
workflow_uuid = "wf-" + UTC timestamp + "-" + 8 hex chars
- Create the parent workflow task with that UUID from the first write:
TaskCreate({
subject: "CC10X {WORKFLOW}: {summary}",
description: "wf:{workflow_uuid}\nkind:workflow\norigin:router\nphase:{build|debug|review|plan}\nplan:{plan_file or 'N/A'}\nscope:N/A\nreason:User request\n\nUser request: {request}\nChain: {chain description}",
activeForm: "{workflow active form}"
})
- Immediately write the v10 artifact and event log:
Write(
file_path=".claude/cc10x/v10/workflows/{workflow_uuid}.json",
content="{\"workflow_uuid\":\"{workflow_uuid}\",\"workflow_id\":\"{workflow_uuid}\",\"workflow_type\":\"{WORKFLOW}\",\"state_root\":\".claude/cc10x/v10\",\"user_request\":\"{request}\",\"plan_file\":null,\"design_file\":null,\"research_files\":[],\"approved_decisions\":[],\"plan_mode\":null,\"verification_rigor\":\"standard\",\"proof_status\":\"gaps_found\",\"traceability\":{\"requirements\":[],\"phases\":[],\"verification\":[],\"remediation\":[]},\"intent\":{\"goal\":null,\"non_goals\":[],\"constraints\":[],\"acceptance_criteria\":[],\"open_decisions\":[]},\"normalized_phases\":[],\"phase_cursor\":null,\"capabilities\":{\"brightdata_available\":\"unknown\",\"octocode_available\":\"unknown\",\"websearch_available\":\"unknown\",\"webfetch_available\":\"unknown\"},\"research_rounds\":[],\"research_backend_history\":[],\"research_quality\":{\"web\":\"none\",\"github\":\"none\",\"overall\":\"none\"},\"task_ids\":{},\"phase_status\":{},\"results\":{\"builder\":null,\"investigator\":null,\"reviewer\":null,\"hunter\":null,\"verifier\":null,\"planner\":null,\"research\":{\"web\":null,\"github\":null,\"synthesis\":null}},\"evidence\":{\"builder\":[],\"investigator\":[],\"reviewer\":[],\"hunter\":[],\"verifier\":[]},\"quality\":{\"confidence\":null,\"evidence_complete\":false,\"scenario_coverage\":0,\"research_quality\":\"none\",\"convergence_state\":\"pending\"},\"memory_notes\":[],\"pending_gate\":null,\"status_history\":[{\"event\":\"workflow_started\",\"ts\":\"{iso_timestamp}\",\"phase\":\"{build|debug|review|plan}\"}],\"remediation_history\":[],\"created_at\":\"{iso_timestamp}\",\"updated_at\":\"{iso_timestamp}\"}"
)
Write(
file_path=".claude/cc10x/v10/workflows/{workflow_uuid}.events.jsonl",
content="{\"ts\":\"{iso_timestamp}\",\"wf\":\"{workflow_uuid}\",\"event\":\"workflow_started\",\"phase\":\"{build|debug|review|plan}\",\"task_id\":\"{parent_task_id}\",\"agent\":\"router\",\"decision\":\"start\",\"reason\":\"User request\"}\n"
)
Only create child tasks after the v10 artifact exists.
BUILD task graph
BUILD is sequential in v10:
- one approved executable phase at a time
- one builder run for the current phase only
- review, hunt, and verify validate that phase before
phase_cursoradvances - if phase exit evidence is incomplete, record
partialorblocked, persist state, and stop
TaskCreate({
subject: "CC10X component-builder: Execute phase {phase_id}",
description: "wf:{workflow_uuid}\nkind:agent\norigin:router\nphase:build-implement\nplan:{plan_file or 'N/A'}\nscope:N/A\nreason:Execute approved phase\n\nExecute ONLY the phase at phase_cursor. Recover objective, inputs, expected artifacts, required checks, checkpoint type, and exit criteria from the approved phase. Stop if blocked, partial, or proof remains incomplete.",
activeForm: "Building components"
}) -> builder_task_id
TaskCreate({
subject: "CC10X code-reviewer: Review implementation",
description: "wf:{workflow_uuid}\nkind:agent\norigin:router\nphase:build-review\nplan:{plan_file or 'N/A'}\nscope:N/A\nreason:Review current phase quality\n\nReview only the files and scope of the current phase.",
activeForm: "Reviewing code"
}) -> reviewer_task_id
TaskUpdate({ taskId: reviewer_task_id, addBlockedBy: [builder_task_id] })
TaskCreate({
subject: "CC10X silent-failure-hunter: Hunt edge cases",
description: "wf:{workflow_uuid}\nkind:agent\norigin:router\nphase:build-hunt\nplan:{plan_file or 'N/A'}\nscope:N/A\nreason:Audit current phase blast radius\n\nFind silent failures and edge cases adjacent to the current phase.",
activeForm: "Hunting failures"
}) -> hunter_task_id
TaskUpdate({ taskId: hunter_task_id, addBlockedBy: [builder_task_id] })
TaskCreate({
subject: "CC10X integration-verifier: Verify integration",
description: "wf:{workflow_uuid}\nkind:agent\norigin:router\nphase:build-verify\nplan:{plan_file or 'N/A'}\nscope:N/A\nreason:Phase exit verification\n\nRun required checks for the current phase and report whether truths, artifacts, wiring, and phase exit criteria are all satisfied.",
activeForm: "Verifying integration"
}) -> verifier_task_id
TaskUpdate({ taskId: verifier_task_id, addBlockedBy: [reviewer_task_id, hunter_task_id] })
TaskCreate({
subject: "CC10X Memory Update: Persist workflow learnings",
description: "wf:{workflow_uuid}\nkind:memory\norigin:router\nphase:memory-finalize\nplan:{plan_file or 'N/A'}\nscope:N/A\nreason:Persist captured Memory Notes\n\nROUTER ONLY: execute inline. Read the workflow artifact and THIS task description payload, persist to .claude/cc10x/v10/*.md, then remove the matching [cc10x-internal] memory_task_id line from activeContext.md ## References. Never spawn Task() for this task.",
activeForm: "Persisting workflow learnings"
}) -> memory_task_id
TaskUpdate({ taskId: memory_task_id, addBlockedBy: [verifier_task_id] })
DEBUG task graph
TaskCreate({
subject: "CC10X bug-investigator: Investigate {error}",
description: "wf:{workflow_uuid}\nkind:agent\norigin:router\nphase:debug-investigate\nplan:N/A\nscope:N/A\nreason:Find root cause\n\nFind the root cause and apply the fix.",
activeForm: "Investigating bug"
}) -> investigator_task_id
TaskCreate({
subject: "CC10X code-reviewer: Review fix",
description: "wf:{workflow_uuid}\nkind:agent\norigin:router\nphase:debug-review\nplan:N/A\nscope:N/A\nreason:Review the fix\n\nReview the debug fix quality.",
activeForm: "Reviewing fix"
}) -> reviewer_task_id
TaskUpdate({ taskId: reviewer_task_id, addBlockedBy: [investigator_task_id] })
TaskCreate({
subject: "CC10X integration-verifier: Verify fix",
description: "wf:{workflow_uuid}\nkind:agent\norigin:router\nphase:debug-verify\nplan:N/A\nscope:N/A\nreason:Verify the fix\n\nVerify the fix works end-to-end.",
activeForm: "Verifying fix"
}) -> verifier_task_id
TaskUpdate({ taskId: verifier_task_id, addBlockedBy: [reviewer_task_id] })
TaskCreate({
subject: "CC10X Memory Update: Persist debug learnings",
description: "wf:{workflow_uuid}\nkind:memory\norigin:router\nphase:memory-finalize\nplan:N/A\nscope:N/A\nreason:Persist captured Memory Notes\n\nROUTER ONLY: execute inline. Read the workflow artifact and THIS task description payload, persist to .claude/cc10x/v10/*.md, then remove the matching [cc10x-internal] memory_task_id line from activeContext.md ## References. Never spawn Task() for this task.",
activeForm: "Persisting debug learnings"
}) -> memory_task_id
TaskUpdate({ taskId: memory_task_id, addBlockedBy: [verifier_task_id] })
REVIEW task graph
TaskCreate({
subject: "CC10X code-reviewer: Review {target}",
description: "wf:{workflow_uuid}\nkind:agent\norigin:router\nphase:review-audit\nplan:N/A\nscope:N/A\nreason:Advisory review\n\nRun a scoped code review.",
activeForm: "Reviewing code"
}) -> reviewer_task_id
TaskCreate({
subject: "CC10X Memory Update: Persist review learnings",
description: "wf:{workflow_uuid}\nkind:memory\norigin:router\nphase:memory-finalize\nplan:N/A\nscope:N/A\nreason:Persist captured Memory Notes\n\nROUTER ONLY: execute inline. Read the workflow artifact and THIS task description payload, persist to .claude/cc10x/v10/*.md, then remove the matching [cc10x-internal] memory_task_id line from activeContext.md ## References. Never spawn Task() for this task.",
activeForm: "Persisting review learnings"
}) -> memory_task_id
TaskUpdate({ taskId: memory_task_id, addBlockedBy: [reviewer_task_id] })
PLAN task graph
TaskCreate({
subject: "CC10X planner: Create plan for {feature}",
description: "wf:{workflow_uuid}\nkind:agent\norigin:router\nphase:plan-create\nplan:N/A\nscope:N/A\nreason:Create implementation plan\n\nChoose the correct plan mode (`direct`, `execution_plan`, or `decision_rfc`) and verification rigor (`standard` or `critical_path`). Create the corresponding planning artifact.",
activeForm: "Creating plan"
}) -> planner_task_id
TaskCreate({
subject: "CC10X Memory Update: Index plan in memory",
description: "wf:{workflow_uuid}\nkind:memory\norigin:router\nphase:memory-finalize\nplan:N/A\nscope:N/A\nreason:Persist captured Memory Notes\n\nROUTER ONLY: execute inline. Read the workflow artifact and THIS task description payload, persist to .claude/cc10x/v10/*.md, then remove the matching [cc10x-internal] memory_task_id line from activeContext.md ## References. Never spawn Task() for this task.",
activeForm: "Indexing plan in memory"
}) -> memory_task_id
TaskUpdate({ taskId: memory_task_id, addBlockedBy: [planner_task_id] })
Research tasks
Create research tasks only when a workflow explicitly triggers them:
Before creating them:
- Determine the preferred research path for this session and store it in the workflow artifact
capabilities. - Preferred web path:
brightdata+websearchwhen Bright Data MCP is available- otherwise
websearch+webfetch
- Preferred GitHub path:
octocodewhen Octocode MCP is available- otherwise
web-only
- Allowed fallbacks always include the built-in Claude Code web tools so research remains plug-and-play.
- Increment and record the workflow-scoped round number for the
(wf, reason)pair.
TaskCreate({
subject: "CC10X web-researcher: Research {topic}",
description: "wf:{workflow_uuid}\nkind:research\norigin:router\nphase:research-web\nplan:{plan_file or 'N/A'}\nscope:N/A\nreason:{research_reason}\n\nTopic: {topic}\nReason: {research_reason}\nFile: docs/research/{date}-{slug}-web.md\nPreferred Backend: {brightdata+websearch or websearch+webfetch}\nAllowed Fallbacks: websearch -> webfetch\nRound: {round_number}",
activeForm: "Researching web"
}) -> web_task_id
TaskCreate({
subject: "CC10X github-researcher: Research {topic}",
description: "wf:{workflow_uuid}\nkind:research\norigin:router\nphase:research-github\nplan:{plan_file or 'N/A'}\nscope:N/A\nreason:{research_reason}\n\nTopic: {topic}\nReason: {research_reason}\nFile: docs/research/{date}-{slug}-github.md\nPreferred Backend: {octocode or web-only}\nAllowed Fallbacks: package-docs -> websearch -> webfetch\nRound: {round_number}",
activeForm: "Researching GitHub"
}) -> github_task_id
Research tasks are siblings, never blockers on the workflow parent. The follow-up agent task is blocked on both research tasks.
Marker rules
- BUILD writes
[BUILD-START: wf:{workflow_uuid}] - DEBUG writes
[DEBUG-RESET: wf:{workflow_uuid}] - PLAN writes
[PLAN-START: wf:{workflow_uuid}]
7. Dispatcher And Agent Prompt Contract
Explicit dispatcher
| Task Phase / Kind | Agent |
|---|---|
build-implement |
cc10x:component-builder |
debug-investigate |
cc10x:bug-investigator |
build-review, debug-review, review-audit, re-review |
cc10x:code-reviewer |
build-hunt, re-hunt |
cc10x:silent-failure-hunter |
build-verify, debug-verify, re-verify |
cc10x:integration-verifier |
plan-create, re-plan |
cc10x:planner |
research-web |
cc10x:web-researcher |
research-github |
cc10x:github-researcher |
kind:remfix + origin:bug-investigator |
cc10x:bug-investigator |
kind:remfix + `origin:code-reviewer |
silent-failure-hunter |
Prompt scaffold for every agent
## Task Context
- Task ID: {task_id}
- Parent Workflow ID: {workflow_uuid}
- Task Phase: {phase}
- Plan File: {plan_file or 'None'}
- Workflow Scope: wf:{workflow_uuid}
- Workflow Artifact: .claude/cc10x/v10/workflows/{workflow_uuid}.json
## User Request
{request}
## Requirements
{clarified requirements or 'See plan/design files'}
## Memory Summary
{brief activeContext summary}
## Project Patterns
{User Standards + Common Gotchas, trimmed if needed}
## SKILL_HINTS
{router-detected skill list or "None"}
Optional sections:
## Pre-Answered Requirementsfor BUILD when router already gathered decisions.## Intent Contractwhen a plan or design already defined goal, constraints, acceptance criteria, and named scenarios.## Research Filesonly when at least one research file exists.## Research Qualityonly when at least one research result exists.## Design Fileonly for planner.## Previous Agent Findingsonly for integration-verifier and only after review/hunt phases.
Deterministic skill hints
- Router is the only authority allowed to load internal CC10X skills.
- Agents may not self-activate
frontend-patterns,architecture-patterns, ordebugging-patterns. - Include
cc10x:frontend-patternsonly when the request, changed files, plan, or design clearly targets UI/frontend work. - Include
cc10x:architecture-patternsonly for multi-component, API, schema, auth, or integration-heavy work. - Include
cc10x:researchonly when planner or investigator receives## Research Files. - Include project/domain skills only from
patterns.md ## Project SKILL_HINTS. - Skill precedence is strict:
- explicit user prompt
- project
CLAUDE.md/ repo standards / user standards - approved plan and design docs
- domain-specific external skills
- internal CC10X skills
- model heuristics
Previous Agent Findings handoff
When invoking integration-verifier, pass:
## Previous Agent Findings
### Code Reviewer
**Verdict:** {Approve|Changes Requested}
**Critical Issues:**
{reviewer critical issues or "None"}
### Silent Failure Hunter
**Critical Issues:**
{hunter critical issues or "None / not in this workflow"}
DEBUG skips hunter findings.
8. Post-Agent Validation
Read-only contracts
Primary signal:
- Line 1:
CONTRACT {"s":"...","b":...,"cr":...}
Fallback heading on line 2:
## Review: Approve|Changes Requested## Error Handling Audit: CLEAN|ISSUES_FOUND## Verification: PASS|FAIL
Verdict extraction:
- Try the envelope on line 1.
- If envelope is missing or malformed, scan the first 5 lines for the heading.
- Extract
CRITICAL_ISSUESfrom### Critical Issues. - If output is too short or malformed, run inline verification rather than blindly approving.
- Detect
SELF_REMEDIATEDfrom task state:- If the task remains
in_progressandblockedByis non-empty after the agent stops, treat it as self-remediated.
- If the task remains
- For integration-verifier, parse scenario accounting:
SCENARIOS_TOTALSCENARIOS_PASSEDSCENARIOS_FAILED- Fail validation if those counts do not reconcile with the evidence array.
- Fail validation if any scenario omits explicit
ExpectedorActualevidence.
Read-only structured intent fields:
REMEDIATION_NEEDED: true|falseREMEDIATION_REASON: ...REMEDIATION_SCOPE_REQUESTED: N/A|CRITICAL_ONLY|ALL_ISSUESREVERT_RECOMMENDED: true|false
Compatibility rule:
- Accept legacy self-healed blocked task behavior during migration.
- Prefer the new structured remediation fields over task-state inference when both exist.
Write-agent YAML contracts
For write agents, parse the final fenced YAML block under ### Router Contract (MACHINE-READABLE).
Expected fields:
| Agent | Required fields |
|---|---|
| component-builder | STATUS, CONFIDENCE, PHASE_ID, PHASE_STATUS, PHASE_EXIT_READY, CHECKPOINT_TYPE, PROOF_STATUS, INPUTS, EXPECTED_ARTIFACTS, TDD_RED_EXIT, TDD_GREEN_EXIT, SCENARIOS, ASSUMPTIONS, DECISIONS, BLOCKED_ITEMS, SKIPPED_ITEMS, SCOPE_INCREASES, BLOCKING, NEXT_ACTION, REMEDIATION_NEEDED, REQUIRES_REMEDIATION, REMEDIATION_REASON, MEMORY_NOTES |
| bug-investigator | STATUS, VERIFICATION_RIGOR, CONFIDENCE, ROOT_CAUSE, TDD_RED_EXIT, TDD_GREEN_EXIT, VARIANTS_COVERED, BLAST_RADIUS_SCAN, SCENARIOS, ASSUMPTIONS, DECISIONS, BLOCKING, NEXT_ACTION, REMEDIATION_NEEDED, REQUIRES_REMEDIATION, REMEDIATION_REASON, NEEDS_EXTERNAL_RESEARCH, RESEARCH_REASON, MEMORY_NOTES |
| planner | STATUS, PLAN_MODE, VERIFICATION_RIGOR, CONFIDENCE, PLAN_FILE, PHASES, RISKS_IDENTIFIED, SCENARIOS, ASSUMPTIONS, DECISIONS, OPEN_DECISIONS, DIFFERENCES_FROM_AGREEMENT, RECOMMENDED_DEFAULTS, ALTERNATIVES, DRAWBACKS, PROVABLE_PROPERTIES, BLOCKING, NEXT_ACTION, REMEDIATION_NEEDED, REQUIRES_REMEDIATION, REMEDIATION_REASON, GATE_PASSED, USER_INPUT_NEEDED, MEMORY_NOTES |
| web-researcher | STATUS, FILE_PATH, BACKEND_MODE, SOURCES_ATTEMPTED, SOURCES_USED, QUALITY_LEVEL, KEY_FINDINGS_COUNT, WHAT_CHANGED_RECOMMENDATION, MEMORY_NOTES |
| github-researcher | STATUS, FILE_PATH, BACKEND_MODE, SOURCES_ATTEMPTED, SOURCES_USED, QUALITY_LEVEL, IMPLEMENTATIONS_FOUND, WHAT_CHANGED_RECOMMENDATION, MEMORY_NOTES |
If the YAML block is missing or malformed:
- Treat the task as invalid output.
- Do not continue the workflow based on prose alone.
- Re-run inline verification and fail safe.
Contract overrides
| Agent | Override |
|---|---|
| component-builder | STATUS=PASS requires TDD_RED_EXIT=1, TDD_GREEN_EXIT=0, PHASE_STATUS=completed, PHASE_EXIT_READY=true, PROOF_STATUS=passed, empty BLOCKED_ITEMS, and a non-empty SCENARIOS array with at least one passing scenario. That passing scenario must include non-empty name, command, expected, actual, and exit_code. |
| bug-investigator | STATUS=FIXED requires VERIFICATION_RIGOR to be explicit, TDD_RED_EXIT=1, TDD_GREEN_EXIT=0, VARIANTS_COVERED>=1, a non-empty BLAST_RADIUS_SCAN, and a non-empty SCENARIOS array unless it explicitly set NEEDS_EXTERNAL_RESEARCH=true. At least one scenario name must start with Regression: and one with Variant:. Both required scenarios must include non-empty command, expected, actual, and exit_code. |
| code-reviewer | APPROVE + critical issues becomes CHANGES_REQUESTED |
| silent-failure-hunter | CLEAN + critical issues becomes ISSUES_FOUND |
| integration-verifier | PASS + critical issues becomes FAIL; scenario totals must reconcile with the scenario table and evidence array; every counted scenario must map to a concrete evidence row; every scenario row must contain non-empty Expected and Actual values |
| planner | PLAN_CREATED or DECISION_RFC_CREATED requires non-empty PLAN_FILE, explicit PLAN_MODE, explicit VERIFICATION_RIGOR, CONFIDENCE>=50, GATE_PASSED=true, a non-empty SCENARIOS array, OPEN_DECISIONS=[], and DIFFERENCES_FROM_AGREEMENT explicitly present. PLAN_MODE=decision_rfc also requires non-empty ALTERNATIVES and DRAWBACKS; VERIFICATION_RIGOR=critical_path requires non-empty PROVABLE_PROPERTIES. |
Convergence rule:
- If evidence is incomplete, contradictory, or missing for a required pass path, do not advance the workflow.
- Set the workflow artifact
quality.convergence_statetoneeds_iterationand stop on the appropriate remediation or clarification gate instead of treating the task as good enough.
9. Remediation And Workflow Rules
Standard REM-FIX task shape
Every remediation task description must include:
wf:{workflow_task_id}
kind:remfix
origin:{originating agent}
phase:{phase}
plan:{plan_file or 'N/A'}
scope:{ALL_ISSUES|CRITICAL_ONLY|N/A}
reason:{short remediation reason}
Circuit breaker
Before creating a new remediation task:
- Count tasks whose descriptions contain both
wf:{workflow_task_id}andkind:remfix. - If count >= 3, ask the user how to proceed before creating another one.
Rule matrix
| Rule | Condition | Action |
|---|---|---|
| 0b | Legacy STATUS=SELF_REMEDIATED or blocked task state |
Do not create a duplicate REM-FIX. Leave task blocked. |
| 0c | bug-investigator sets NEEDS_EXTERNAL_RESEARCH=true |
Spawn research tasks and re-invoke investigator. No REM-FIX yet. |
| 1a-SCOPE | BUILD parallel phase has CRITICAL + HIGH issues | Ask for critical only vs all issues, store pending scope marker, stop. |
| 1a | Blocking issue in BUILD/DEBUG | Router creates scoped REM-FIX task, blocks downstream tasks, stop. |
| 1b | Non-blocking remediation needed | In BUILD/DEBUG, auto-create REM-FIX. In REVIEW, ask whether to start BUILD. |
| 2 | Reviewer approved but hunter found issues | Ask whether to remediate or proceed. |
| 2b | Planner needs clarification | Ask the user, persist answers, create re-plan, re-invoke planner. |
| 2c | Investigator still investigating | Create follow-up investigation task with loop cap. |
| 2d | Verifier failed | Router creates REM-FIX unless user chooses REVERT at the router gate. |
| 2f | Investigator blocked | Ask: research, manual fix, or abort. |
Scope resolution
The router is authoritative for BUILD remediation scope.
- BUILD reviewer/verifier should request
REMEDIATION_SCOPE_REQUESTED: N/A; the router resolvesCRITICAL_ONLYvsALL_ISSUES. - Legacy agent-created remediation tasks are still accepted during migration, but router-created remediation is canonical.
1a-SCOPEapplies only in BUILD when the parallel review phase shows both:- at least one CRITICAL issue
- at least one HIGH issue from the hunter/reviewer narrative
- The trigger source is explicit:
- hunter summary line
High issues: [count] - or a
### Findingsbullet clearly labeledHIGH
- hunter summary line
- When
1a-SCOPEfires:- write
[SCOPE-DECISION-PENDING: wf:{workflow_task_id} reason:{top remediation reason}]intoactiveContext.md ## Decisions - ask exactly:
Fix critical only (Recommended)orFix all issues - do not create a REM-FIX until the next user reply resolves the scope
- write
- If no reliable HIGH count/signal can be extracted, default to normal rule
1awithout pretending scope selection happened.
REVIEW-to-BUILD
If a REVIEW workflow ends with CHANGES_REQUESTED:
- Ask:
Start BUILD to fix (Recommended)orDone for now Start BUILD-> create a fresh BUILD workflow using reviewer findings as input contextDone for now-> persist the decision and stop
Planner clarification
When planner returns STATUS=NEEDS_CLARIFICATION:
- Prefer
USER_INPUT_NEEDEDfrom the YAML contract. - Fallback to bullets under
**Your Input Needed:**. - Persist answers in
activeContext.md ## Decisions. - Create a
re-plantask:
TaskCreate({
subject: "CC10X planner: Re-plan after clarification",
description: "wf:{workflow_task_id}\nkind:agent\norigin:router\nphase:re-plan\nplan:N/A\nscope:N/A\nreason:Planner clarification answered\n\nRevise the plan using the persisted user answers.",
activeForm: "Revising plan"
}) -> replan_task_id
TaskUpdate({ taskId: memory_task_id, addBlockedBy: [replan_task_id] })
When planner returns STATUS=PLAN_CREATED:
- Verify
PLAN_FILEexists withGlob(...). - Extract the intent/spec header from the saved plan and persist it into workflow artifact
intent. - Update the parent workflow task
plan:line to the saved plan path. - Update the pending memory task
plan:line to the same saved plan path so resume and finalization stay scoped to the real artifact.
Investigator continuation
When bug-investigator returns STATUS=INVESTIGATING:
- Count prior investigation continuation tasks in the same
wf:. If count >= 2, ask the user before creating another. - Otherwise create a follow-up investigation task:
TaskCreate({
subject: "CC10X bug-investigator: Continue investigation",
description: "wf:{workflow_task_id}\nkind:agent\norigin:router\nphase:debug-investigate\nplan:N/A\nscope:N/A\nreason:{ROOT_CAUSE or 'Continue investigation'}\n\nContinue investigating using the prior root-cause hints and evidence.",
activeForm: "Continuing investigation"
})
Verifier REVERT gate
If integration-verifier emits FAIL and the findings contain REVERT:
- Ask the user whether to revert or create a fix task.
Revert-> record the decision in memory and stop.Create fix task instead-> continue with normal remediation creation.
10. Research Orchestration
Research runs only when triggered by:
- Explicit user request for research.
- External integration or unfamiliar post-2024 technology.
- Debug workflow stuck state.
- Multiple remediation cycles on the same issue.
- PLAN workflow where external patterns materially improve the plan.
Loop caps:
- Count research rounds by
wf:+reason:usingkind:researchtasks. - If the same workflow already created 2 research rounds for the same reason, ask the user before creating more.
Capability model:
- Research backends are optional accelerators, never hard dependencies.
- Before the first research round in a workflow, record capability assumptions in the workflow artifact:
brightdata_available=trueonly if the session can use Bright Data MCPoctocode_available=trueonly if the session can use Octocode MCPwebsearch_availableandwebfetch_availablereflect built-in tool availability
- If capability is unknown, prefer the accelerated backend first and fall back immediately when it fails. Persist the observed result in the artifact so later rounds do not guess again.
Research persistence:
- Wait for both research tasks in the round to finish.
- Parse each agent YAML contract for:
FILE_PATHBACKEND_MODESOURCES_ATTEMPTEDSOURCES_USEDQUALITY_LEVEL
- Persist discovered paths and backend metadata into the workflow artifact immediately:
results.research.webresults.research.githubresearch_backend_historyresearch_qualityresearch_roundsresults.research.synthesis
- Index research file paths in
activeContext.md ## Referencesduring memory finalization, not before. - Partial success is valid:
- If one file exists and the other is unavailable, proceed with the successful file.
- Build
## Research Qualityusing artifact-backed status:
## Research Quality
Web: {COMPLETE|PARTIAL|DEGRADED|UNAVAILABLE} ({quality_level})
GitHub: {COMPLETE|PARTIAL|DEGRADED|UNAVAILABLE} ({quality_level})
Overall: {high|medium|low|none}
- Re-invoke planner or investigator with:
## Research Files
Web: {web_file or 'Unavailable'}
GitHub: {github_file or 'Unavailable'}
- Include
cc10x:researchin## SKILL_HINTSonly when at least one research file exists.
11. Re-Review Loop
When a kind:remfix task completes:
- Count completed remediation tasks in the same
wf:. If count >= 2, run the cycle-cap gate before continuing. - Create a re-review task:
TaskCreate({
subject: "CC10X code-reviewer: Re-review after REM-FIX",
description: "wf:{workflow_task_id}\nkind:agent\norigin:router\nphase:re-review\nplan:{plan_file or 'N/A'}\nscope:{scope from completed remfix}\nreason:{reason from completed remfix}\n\nRe-review the changes made by the completed remediation task.",
activeForm: "Re-reviewing fix"
}) -> rereview_task_id
- In BUILD, create a re-hunt task:
TaskCreate({
subject: "CC10X silent-failure-hunter: Re-hunt after REM-FIX",
description: "wf:{workflow_task_id}\nkind:agent\norigin:router\nphase:re-hunt\nplan:{plan_file or 'N/A'}\nscope:{scope from completed remfix}\nreason:{reason from completed remfix}\n\nIf scope=ALL_ISSUES: perform a FULL re-audit of CRITICAL and HIGH issue categories after remediation.\nIf scope=CRITICAL_ONLY: verify the CRITICAL issue was resolved and treat HIGH issues as deferred unless newly escalated.\n\nRe-scan for silent failures after remediation.",
activeForm: "Re-hunting failures"
}) -> rehunt_task_id
- Reuse the pending verifier in the same
wf:if one exists; otherwise create:
TaskCreate({
subject: "CC10X integration-verifier: Re-verify after REM-FIX",
description: "wf:{workflow_task_id}\nkind:reverify\norigin:router\nphase:re-verify\nplan:{plan_file or 'N/A'}\nscope:{scope from completed remfix}\nreason:{reason from completed remfix}\n\nRe-verify after remediation.",
activeForm: "Re-verifying fix"
}) -> reverify_task_id
- Block verifier on re-review and re-hunt as applicable.
- Re-block the memory task on the verifier for BUILD/DEBUG or on the re-reviewer for REVIEW.
12. Chain Execution Loop
1. TaskList()
2. Select tasks in the active `wf:` where:
- status is pending or in_progress
- blockedBy is empty or all blockers are completed
3. If the runnable task kind is memory:
- execute inline in the main context
- persist workflow artifact results + Memory Notes from the task description
- append `memory_finalized` to `.claude/cc10x/v10/workflows/{wf}.events.jsonl`
- clean up the matching [cc10x-internal] memory_task_id entry
- mark the memory task completed
- mark the parent workflow task completed
- continue
4. Otherwise, map each runnable task through the dispatcher table.
5. If `code-reviewer` and `silent-failure-hunter` are both ready in BUILD:
- mark both in_progress first
- invoke them in the same message
6. After each agent returns:
- validate output
- capture memory payload
- persist task-state side effects
- apply workflow rules
- for BUILD, run `phase_exit_gate`; if the current phase is not complete, persist `phase_status={partial|blocked}` and stop
- never advance to the next phase or workflow step on apology prose alone
7. Repeat until all tasks in the active `wf:` are completed.
After every agent completion
TaskGet({ taskId })orTaskList()to verify final task state.- WRITE agents:
- They should already have called
TaskUpdate(status="completed"). - Parse YAML before continuing.
- They should already have called
- READ-ONLY agents:
- During compatibility phase, if task is still
in_progresswith blockers, treat it as legacy self-remediation. - Otherwise router applies fallback
TaskUpdate(status="completed").
- During compatibility phase, if task is still
- Capture memory:
- READ-ONLY agents: extract
### Memory Notes (For Workflow-Final Persistence)and append to the memory task description. - WRITE agents: do not expect
### Memory Notes; useMEMORY_NOTESfrom YAML. Append only deferred or supplemental memory payload needed by the memory task.
- READ-ONLY agents: extract
- Update
.claude/cc10x/v10/workflows/{workflow_uuid}.jsonwith:- intent contract fields from planner output when available
- task ids
- phase status
- phase cursor changes only after
phase_exit_gatepasses - structured agent results
- scenario evidence grouped by agent
- plan/design/research file paths
- capabilities and chosen research backend path when applicable
- research quality and round metadata when applicable
- quality/convergence state
- status_history and remediation_history entries when decisions change workflow state
- pending gate if waiting on user input
- Persist
[cc10x-internal] memory_task_id: {memory_task_id} wf:{workflow_uuid}only if it matches the active workflow.
Verifier findings handoff
Before invoking integration-verifier in BUILD:
- Read
results.reviewerandresults.hunterfrom the workflow artifact. - Build
## Previous Agent Findingsexactly in the format verifier expects. - Never invoke verifier without that section when review/hunt already ran.
13. Memory Finalization
The memory task executes inline only. Never spawn it as a sub-agent.
The memory task:
- Reads the workflow artifact plus its own description payload, not conversation history.
- Persists learnings to:
activeContext.md ## Learningspatterns.md ## Common Gotchasprogress.md ## Verification
- Writes deferred items as
[Deferred]: ...underpatterns.md ## Common Gotchas. - Replaces
progress.md ## Taskswith the active workflow snapshot. - Keeps only the most recent 10 items in
progress.md ## Completed. - Removes the matching
[cc10x-internal] memory_task_idline fromactiveContext.md ## References. - If any artifact or memory write fails, stop immediately. Never advance the workflow after a failed persistence write.
For PLAN:
- Ensure
- Plan: {plan_file}remains correct inactiveContext.md ## References.
For DEBUG:
- Preserve the latest
[DEBUG-RESET: wf:{workflow_task_id}]section in## Recent Changesand summarize the final result beneath it.
14. Hard Rules
- Router must run in the main Claude Code session, never inside a sub-agent.
- Router is the only orchestration state owner. Agents may propose remediation or next actions, but only the router creates, blocks, unblocks, reuses, or completes orchestration tasks.
- Never stop after one agent if the workflow chain has more runnable tasks.
- Never rely on prose when
wf:,kind:,origin:,phase:, orscope:can answer the question. - Never use an unscoped task lookup in critical paths.
- Never treat stored task IDs as durable truth across workflows.
- Never spawn Memory Update as a sub-agent.
- Never create
CC10X TODO:tasks. Non-blocking discoveries go into**Deferred:**memory notes. - Never let REVIEW create implementation tasks without an explicit router/user transition into BUILD.