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 -> bounded fresh review loop |
| 3 |
REVIEW |
review, audit, analyze, assess, "is this good" |
REVIEW |
code-reviewer |
| 4 |
DEFAULT |
Everything else |
BUILD |
component-builder -> [code-reviewer |
Rules:
- NEVER use Claude Code's native plan mode (EnterPlanMode). CC10x owns planning. All "plan", "design", "architect", "brainstorm" requests route to the CC10x PLAN workflow — not to the built-in plan mode tool. EnterPlanMode bypasses CC10x orchestration, memory, workflow artifacts, and verification entirely.
- 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-memory template.
- 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(...), immediately Read(...) and verify the new section exists.
JUST_GO:
- Read
activeContext.md ## Session Settings.
- If
AUTO_PROCEED: true, set JUST_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_GO never 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 in JUST_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_uuid
workflow_id
workflow_type
state_root
user_request
plan_file
design_file
research_files
approved_decisions
intent
capabilities
phase_cursor
normalized_phases
research_rounds
research_backend_history
research_quality
task_ids
phase_status
results
evidence
telemetry
quality
planning_review_runs
planning_review_findings
planning_review_status
memory_notes
pending_gate
status_history
remediation_history
created_at
updated_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_id remains as a compatibility alias and must equal workflow_uuid in new artifacts.
state_root must equal .claude/cc10x/v10.
phase_cursor points at the only BUILD phase that may run next.
normalized_phases stores planner-approved executable phases with:
phase_id
title
objective
files
checks
exit_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
brightdata and octocode so the research agents can auto-detect them without prompt edits.
capabilities records the session-level research backend availability model:
brightdata_available
octocode_available
websearch_available
webfetch_available
results.research must be structured as web, github, and synthesis.
intent stores the durable spec header for the workflow:
goal
non_goals
constraints
acceptance_criteria
open_decisions
approved_decisions stores decisions explicitly approved by the user or already fixed in the saved plan.
evidence stores proof-of-work grouped by agent:
builder
investigator
reviewer
hunter
verifier
quality stores convergence state:
confidence
evidence_complete
scenario_coverage
research_quality
convergence_state
- PLAN-local fresh review tracking stores:
planning_review_runs
planning_review_findings
planning_review_status
telemetry is informational only and must never drive routing decisions:
task_metrics_available
workflow_wall_clock_seconds
agent_wall_clock_seconds
loop_counts
verifier
telemetry.agent_wall_clock_seconds stores per-agent wall-clock timings when task metrics or explicit telemetry are available:
builder
investigator
reviewer
hunter
verifier
planner
telemetry.loop_counts stores:
re_review
re_hunt
re_verify
telemetry.verifier stores:
phase_exit_proof_runs
extended_audit_runs
workload_seconds
telemetry.verifier.workload_seconds stores:
tests
build
scan
reconcile
reasoning
pending_gate is required whenever BUILD/PLAN/DEBUG is waiting on user clarification, scope selection, or persistence repair.
status_history and remediation_history are append-only summaries of major router decisions.
v10 router gates:
plan_trust_gate
phase_exit_gate
failure_stop_gate
memory_sync_gate
skill_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:
ts
wf
event
phase
task_id
agent
decision
reason
- Optionally append:
duration_seconds
work_category
details
- Event types:
workflow_started
agent_started
agent_completed
contract_parsed
remediation_created
scope_decision_requested
scope_decision_resolved
memory_finalized
workflow_completed
workflow_failed
Hook policy:
- CC10X plugin hooks live in the plugin bundle under
hooks/hooks.json and should stay minimal:
PreToolUse for protected writes
SessionStart for resume context (fires on startup|resume|compact)
PostToolUse for workflow artifact integrity audit
TaskCompleted for task metadata checks
PostCompact for compaction event capture in workflow event log (audit only)
SubagentStop for agent contract presence audit (telemetry only)
PreCompact for workflow state snapshot before compaction (persistence only)
Stop for workflow state snapshot on session stop (persistence only, never blocks)
StopFailure for API error logging to workflow event log (async, telemetry only)
InstructionsLoaded for instruction file load audit trail (async, telemetry only)
- 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.json is not part of the shipped CC10X product.
- Optional accelerator MCPs are user-configured in Claude Code. CC10X assumes the names
brightdata and octocode if 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|plan-review-gap-1|plan-review-gap-2|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_uuid before TaskCreate() and use it from the first write. wf:PENDING_SELF is retired in v10.
kind: is mandatory and drives resume, routing, and counting logic.
origin: is mandatory on every kind:remfix task.
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() and TaskGet() using wf: + kind: + phase:. Do not rely on stored task IDs for correctness.
- Read and write only the v10 namespace. Ignore legacy
.claude/cc10x/*.md and .claude/cc10x/workflows/* state during hydration.
[cc10x-internal] memory_task_id in activeContext.md is only a transient optimization. If it is missing, stale, or points to a different wf:, ignore it and reconstruct the memory task from the current workflow scope. [EASY TO MISS: stale memory_task_id is the #1 cause of cross-workflow pollution]
- Never use an unscoped fallback like "first pending Memory Update task". [EASY TO MISS: unscoped lookups silently pick up orphan tasks from prior workflows]
Resume algorithm:
- Identify the active parent workflow.
- Extract
workflow_uuid from the wf: line.
- Read all CC10X tasks whose descriptions contain that
wf:.
- Derive runnable tasks from
status and blockedBy.
- Reconstruct the memory task as the unique pending/in_progress
kind:memory task in the same wf:.
Scope-decision resume:
- Before normal routing, check
activeContext.md ## Decisions for 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 with scope:CRITICAL_ONLY
all issues -> create the pending REM-FIX with scope: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
- [EASY TO MISS: When persisting user decisions, use the user's exact words. Paraphrasing introduces drift that compounds across resume cycles.]
Safety rules:
- If a task list is shared across sessions, always scope by
wf: before resuming.
- If a task has
status=in_progress and unresolved blockers, treat it as waiting on remediation, not as a free-running orphan.
- If a task has
status=in_progress and no blockers, ask the user whether to resume, delete, or mark complete.
- If legacy tasks exist with subjects starting
BUILD:, DEBUG:, REVIEW:, or PLAN: without the CC10X prefix, 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 ## References to discover Plan, Design, and prior Research files.
- Read
activeContext.md ## Decisions for prior planner/build clarifications.
- Read
progress.md ## Current Workflow and ## Tasks for pending work that should resume instead of duplicating.
- Read the latest
.claude/cc10x/v10/workflows/*.json artifact if one exists for the current conversation.
Intent Readiness Gate (MANDATORY before PLAN or BUILD):
Before dispatching to planner or builder, verify the intent contract meets three conditions:
- Context-bounded: The full intent (goal + constraints + acceptance criteria) fits within the agent's prompt scaffold without truncation. If the intent requires loading more than 5 source files to be understood, decompose first (switch to PLAN).
- Contradiction-free: No acceptance criterion contradicts a stated constraint or non-goal. If contradictions exist, halt and persist
pending_gate="intent_contradiction".
- Sufficiently specific: Every acceptance criterion maps to at least one verifiable scenario. If a criterion is unverifiable ("make it better" without a metric), halt and ask for specificity.
Router-owned interface fields:
plan_mode: direct | execution_plan | decision_rfc
verification_rigor: standard | critical_path
checkpoint_type: none | human_verify | decision | human_action
proof_status: passed | gaps_found | human_needed
BUILD preparation
- Read
- Plan: from activeContext.md ## References.
- If plan path is not
N/A, Read(...) the plan file before creating tasks.
- Run
plan_trust_gate before BUILD:
Open Decisions must be empty or explicitly marked approved.
Differences from agreement must be present, even if empty.
plan_mode must be explicit when a plan artifact exists.
verification_rigor must be explicit when a plan artifact exists.
- If
plan_mode is execution_plan or decision_rfc: every phase in normalized_phases must carry non-empty exit_criteria, and intent.acceptance_criteria must be non-empty. Field presence is not enough — field completeness is required.
- Cross-check
intent.constraints against approved decisions. If any approved decision explicitly contradicts an intent.constraint, emit NOGO with the contradiction and ask the user to resolve before BUILD starts.
- If any condition fails, ask for clarification and do not start BUILD.
- If plan path is
N/A, assess scope before dispatch:
- Trivial (single concern, one file group, one failure mode) → continue directly to BUILD.
Heuristic signals: touches 1-2 files, single logical change, one testable outcome, no cross-module wiring.
[EASY TO MISS: When the task is clearly trivial, do not ask clarifying questions or suggest planning. Execute directly. Analysis paralysis on trivial work is a net negative.]
- Non-trivial (spans multiple independent file groups, has separable concerns, or involves distinct failure modes) → ask:
Plan first (Recommended) or Build directly.
Heuristic signals: touches 3+ files across different directories, multiple independent concerns that could fail separately, changes to both interface and implementation, or new cross-module dependencies.
Plan first -> switch to PLAN workflow.
Build directly -> continue without a plan.
- If the referenced plan file is missing:
- Ask:
Build without plan or Re-plan first (Recommended).
Build without plan -> continue with plan:N/A
Re-plan first -> switch to PLAN workflow
- Normalize planner phases into executable
normalized_phases and initialize phase_cursor to the first incomplete phase.
- Persist the approved
plan_mode and verification_rigor from the planner contract into the workflow artifact.
- Every normalized phase must carry:
objective
inputs
files/surfaces
expected_artifacts
required_checks
checkpoint_type
exit_criteria
- Initialize workflow
proof_status to gaps_found until 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 ## Decisions using Build 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 offer Start BUILD to fix (Recommended) as a follow-up user choice.
PLAN preparation
- Restore design enrichment:
- Read
- Design: from activeContext.md ## References.
- If a design path exists, verify it with
Glob(...) and pass it under ## Design File.
- Mandatory brainstorming (ALWAYS runs for PLAN workflows):
- ALWAYS run
Skill(skill="cc10x:brainstorming") in the main context before planner. Brainstorming is how the user explores and clarifies intent — skipping it means the planner works from assumptions instead of understanding.
- If a valid design file exists from step 1: brainstorming uses it as a foundation (the skill's Spec File Workflow reads and expands the existing design rather than starting from scratch).
- If no design file exists: brainstorming starts from the user's request and explores the idea space.
- Brainstorming may ask the user questions and may save a
*-design.md file. After it completes, re-read activeContext.md ## References and refresh the design path.
- Brainstorming should ask only unresolved, high-impact questions and stop as soon as the intent contract is complete.
- 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 Files only 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.
- Planner must choose one
plan_mode:
direct for trivial low-risk work
execution_plan for standard implementation work
decision_rfc for architecture or multi-option work
- Planner must choose one
verification_rigor:
standard by default (covers most work; keeps verification proportional to risk)
critical_path for security, money, state-machine, concurrency, or irreversible-migration work (failure in these domains is irreversible or high-blast-radius; justifies extended scenario coverage)
- PLAN fresh-review loop:
- Every PLAN workflow pre-creates a bounded review DAG:
plan-create -> plan-review-gap-1 -> re-plan -> plan-review-gap-2 -> memory-finalize.
- Every saved plan artifact enters that DAG, including
direct, execution_plan, and decision_rfc.
- If pass 1 succeeds, the router prunes the unused
re-plan and pass 2 branch explicitly.
- If pass 1 finds blocking issues, the router keeps the pre-created
re-plan and pass 2 branch alive.
- Maximum fresh-review passes: 2.
- Planner remains the only plan writer.
- The existing inline
plan-review-gate inside planner remains the final fail-closed boundary on each planner pass.
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\":{\"planner_create\":null,\"planning_review_pass1\":null,\"planner_replan\":null,\"planning_review_pass2\":null,\"memory_finalize\":null},\"phase_status\":{},\"results\":{\"builder\":null,\"investigator\":null,\"reviewer\":null,\"hunter\":null,\"verifier\":null,\"planner\":null,\"planning_reviewer\":null,\"research\":{\"web\":null,\"github\":null,\"synthesis\":null}},\"evidence\":{\"builder\":[],\"investigator\":[],\"reviewer\":[],\"hunter\":[],\"verifier\":[],\"planning_reviewer\":[]},\"telemetry\":{\"task_metrics_available\":\"unknown\",\"workflow_wall_clock_seconds\":0,\"agent_wall_clock_seconds\":{\"builder\":0,\"investigator\":0,\"reviewer\":0,\"hunter\":0,\"verifier\":0,\"planner\":0},\"loop_counts\":{\"re_review\":0,\"re_hunt\":0,\"re_verify\":0},\"verifier\":{\"phase_exit_proof_runs\":0,\"extended_audit_runs\":0,\"workload_seconds\":{\"tests\":0,\"build\":0,\"scan\":0,\"reconcile\":0,\"reasoning\":0}}},\"quality\":{\"confidence\":null,\"evidence_complete\":false,\"scenario_coverage\":0,\"research_quality\":\"none\",\"convergence_state\":\"pending\"},\"planning_review_runs\":0,\"planning_review_findings\":[],\"planning_review_status\":\"not_started\",\"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_cursor advances
- if phase exit evidence is incomplete, record
partial or blocked, 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 plan-gap-reviewer: Fresh review pass 1",
description: "wf:{workflow_uuid}\nkind:agent\norigin:router\nphase:plan-review-gap-1\nplan:N/A\nscope:N/A\nreason:Fresh anti-anchoring review of saved plan (pass 1)\n\nWait for the planner to save a plan artifact, then review it against the original user request and any approved design/research files.",
activeForm: "Fresh-reviewing plan"
}) -> planning_review_pass1_task_id
TaskUpdate({ taskId: planning_review_pass1_task_id, addBlockedBy: [planner_task_id] })
TaskCreate({
subject: "CC10X planner: Revise plan after fresh review",
description: "wf:{workflow_uuid}\nkind:agent\norigin:router\nphase:re-plan\nplan:N/A\nscope:N/A\nreason:Revise plan if fresh review finds blocking issues\n\nOnly run if pass 1 finds blocking issues. Revise the existing saved plan using structured planning review findings.",
activeForm: "Revising plan"
}) -> planner_replan_task_id
TaskUpdate({ taskId: planner_replan_task_id, addBlockedBy: [planning_review_pass1_task_id] })
TaskCreate({
subject: "CC10X plan-gap-reviewer: Fresh review pass 2",
description: "wf:{workflow_uuid}\nkind:agent\norigin:router\nphase:plan-review-gap-2\nplan:N/A\nscope:N/A\nreason:Fresh anti-anchoring review of saved plan (pass 2)\n\nOnly run if the re-plan task produces a revised saved plan after pass 1 findings.",
activeForm: "Fresh-reviewing revised plan"
}) -> planning_review_pass2_task_id
TaskUpdate({ taskId: planning_review_pass2_task_id, addBlockedBy: [planner_replan_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, planning_review_pass1_task_id, planner_replan_task_id, planning_review_pass2_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+websearch when Bright Data MCP is available
- otherwise
websearch+webfetch
- Preferred GitHub path:
octocode when 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 |
plan-review-gap-1, plan-review-gap-2 |
cc10x:plan-gap-reviewer |
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}
## Domain Context
{If UBIQUITOUS_LANGUAGE.md, DOMAIN_GLOSSARY.md, docs/domain/*.md, or project-context.md exist, include content. Otherwise omit section.}
## SKILL_HINTS
{router-detected skill list or "None"}
Optional sections:
## Pre-Answered Requirements for BUILD when router already gathered decisions.
## Intent Contract when a plan or design already defined goal, constraints, acceptance criteria, and named scenarios.
## Research Files only when at least one research file exists.
## Research Quality only when at least one research result exists.
## Design File only for planner.
## Planning Review Findings only for re-plan.
## Original User Request only for plan-gap-reviewer.
## Approved Context Files only for plan-gap-reviewer.
## Previous Agent Findings only 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, or debugging-patterns.
- Include
cc10x:frontend-patterns only when the request, changed files, plan, or design clearly targets UI/frontend work.
- Include
cc10x:architecture-patterns only for multi-component, API, schema, auth, or integration-heavy work.
- Include
cc10x:research only 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.
Task metrics and timing telemetry
- Timing telemetry is measurement only. It must never bypass gates, phase exit, or remediation rules.
- After
TaskGet() / TaskList(), if Claude Code exposes task duration metrics, persist them into:
telemetry.workflow_wall_clock_seconds
telemetry.agent_wall_clock_seconds.{agent}
- If task metrics are unavailable, keep
task_metrics_available="unknown" and continue. Missing telemetry is never a reason to advance or block a workflow.
- When
integration-verifier reports a ### Timing & Workload section, persist:
telemetry.verifier.phase_exit_proof_runs
telemetry.verifier.extended_audit_runs
telemetry.verifier.workload_seconds
- Use telemetry to explain latency. Do not use it to auto-reduce verification scope.
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
## Planning Review: Pass|Findings
Verdict extraction:
- Try the envelope on line 1.
- If envelope is missing or malformed, scan the first 5 lines for the heading.
- Extract
CRITICAL_ISSUES from ### Critical Issues.
- If output is too short or malformed, run inline verification rather than blindly approving.
- Detect
SELF_REMEDIATED from task state:
- If the task remains
in_progress and blockedBy is non-empty after the agent stops, treat it as self-remediated.
- For integration-verifier, parse scenario accounting:
SCENARIOS_TOTAL
SCENARIOS_PASSED
SCENARIOS_FAILED
- Fail validation if those counts do not reconcile with the evidence array.
- Fail validation if any scenario omits explicit
Expected or Actual evidence.
Read-only structured intent fields:
REMEDIATION_NEEDED: true|false
- `REMEDIATION_REASON:
…(truncated)
1---2name: romiluz13-cc10x-cc10x-router3description: cc10x Router4---56# cc10x Router78**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.910## 1. Intent Routing1112Route using the first matching signal:1314| Priority | Signal | Keywords | Workflow | Chain |15|----------|--------|----------|----------|-------|16| 1 | ERROR | error, bug, fix, broken, crash, fail, debug, troubleshoot, issue | DEBUG | bug-investigator -> code-reviewer -> integration-verifier |17| 2 | PLAN | plan, design, architect, roadmap, strategy, spec, brainstorm | PLAN | brainstorming -> planner -> bounded fresh review loop |18| 3 | REVIEW | review, audit, analyze, assess, "is this good" | REVIEW | code-reviewer |19| 4 | DEFAULT | Everything else | BUILD | component-builder -> [code-reviewer || silent-failure-hunter] -> integration-verifier |2021Rules:22- NEVER use Claude Code's native plan mode (EnterPlanMode). CC10x owns planning. All "plan", "design", "architect", "brainstorm" requests route to the CC10x PLAN workflow — not to the built-in plan mode tool. EnterPlanMode bypasses CC10x orchestration, memory, workflow artifacts, and verification entirely.23- ERROR always wins over BUILD.24- REVIEW is advisory only. Never let REVIEW create code-changing tasks.25- BUILD always uses the full chain. The old QUICK path is retired.26- Before execution, output one line: `-> {WORKFLOW} workflow (signals: {matched keywords})`2728## 2. Memory Load And Template Validation2930Always run this before routing or resuming:3132```text331. Bash("mkdir -p .claude/cc10x/v10")342. Read(".claude/cc10x/v10/activeContext.md")353. Read(".claude/cc10x/v10/patterns.md")364. Read(".claude/cc10x/v10/progress.md")37```3839Do not parallelize step 1 with reads.4041If a memory file is missing:42- Create it using the `cc10x:session-memory` template.43- Read it before continuing.4445Required sections:4647| File | Required Sections |48|------|-------------------|49| `activeContext.md` | `## Current Focus`, `## Recent Changes`, `## Next Steps`, `## Decisions`, `## Learnings`, `## References`, `## Blockers`, `## Session Settings`, `## Last Updated` |50| `progress.md` | `## Current Workflow`, `## Tasks`, `## Completed`, `## Verification`, `## Last Updated` |51| `patterns.md` | `## User Standards`, `## Common Gotchas`, `## Project SKILL_HINTS`, `## Last Updated` |5253Auto-heal rule:54- Insert missing sections before `## Last Updated`.55- After every `Edit(...)`, immediately `Read(...)` and verify the new section exists.5657JUST_GO:58- Read `activeContext.md ## Session Settings`.59- If `AUTO_PROCEED: true`, set `JUST_GO=true`.60- While `JUST_GO=true`, auto-default all non-REVERT AskUserQuestion gates to the recommended option and log the choice in `## Decisions`.6162v10 trust rule:63- `JUST_GO` never overrides explicit user/project standards, open plan decisions, or failure-stop gates.64- If a plan still has unresolved `Open Decisions`, BUILD may not start, even in `JUST_GO`.6566## 2a. Workflow Artifact And Hook Policy6768CC10X durable orchestration state lives in:6970```text71.claude/cc10x/v10/workflows/{workflow_uuid}.json72```7374Artifact schema must include:75 - `workflow_uuid`76- `workflow_id`77- `workflow_type`78- `state_root`79- `user_request`80- `plan_file`81- `design_file`82- `research_files`83- `approved_decisions`84- `intent`85- `capabilities`86- `phase_cursor`87- `normalized_phases`88- `research_rounds`89- `research_backend_history`90- `research_quality`91- `task_ids`92- `phase_status`93- `results`94- `evidence`95- `telemetry`96- `quality`97- `planning_review_runs`98- `planning_review_findings`99- `planning_review_status`100- `memory_notes`101- `pending_gate`102- `status_history`103- `remediation_history`104- `created_at`105- `updated_at`106107Rules:108- Router creates the workflows directory before the first workflow artifact write.109- 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.110- Resume uses task metadata first, then workflow artifact, then memory markdown.111- Verifier handoff and memory finalization read structured data from the workflow artifact, not transient conversation recovery.112- The workflow UUID is generated independently of Claude task ids and is the canonical workflow identifier everywhere in v10.113- `workflow_id` remains as a compatibility alias and must equal `workflow_uuid` in new artifacts.114- `state_root` must equal `.claude/cc10x/v10`.115- `phase_cursor` points at the only BUILD phase that may run next.116- `normalized_phases` stores planner-approved executable phases with:117 - `phase_id`118 - `title`119 - `objective`120 - `files`121 - `checks`122 - `exit_criteria`123- Bright Data MCP and Octocode MCP are optional accelerators. Base CC10X installs must continue to work with built-in Claude Code tools only.124- When optional user-configured Claude Code MCP servers are available, use the server names `brightdata` and `octocode` so the research agents can auto-detect them without prompt edits.125- `capabilities` records the session-level research backend availability model:126 - `brightdata_available`127 - `octocode_available`128 - `websearch_available`129 - `webfetch_available`130- `results.research` must be structured as `web`, `github`, and `synthesis`.131- `intent` stores the durable spec header for the workflow:132 - `goal`133 - `non_goals`134 - `constraints`135 - `acceptance_criteria`136 - `open_decisions`137- `approved_decisions` stores decisions explicitly approved by the user or already fixed in the saved plan.138- `evidence` stores proof-of-work grouped by agent:139 - `builder`140 - `investigator`141 - `reviewer`142 - `hunter`143 - `verifier`144- `quality` stores convergence state:145 - `confidence`146 - `evidence_complete`147 - `scenario_coverage`148 - `research_quality`149 - `convergence_state`150- PLAN-local fresh review tracking stores:151 - `planning_review_runs`152 - `planning_review_findings`153 - `planning_review_status`154- `telemetry` is informational only and must never drive routing decisions:155 - `task_metrics_available`156 - `workflow_wall_clock_seconds`157 - `agent_wall_clock_seconds`158 - `loop_counts`159 - `verifier`160- `telemetry.agent_wall_clock_seconds` stores per-agent wall-clock timings when task metrics or explicit telemetry are available:161 - `builder`162 - `investigator`163 - `reviewer`164 - `hunter`165 - `verifier`166 - `planner`167- `telemetry.loop_counts` stores:168 - `re_review`169 - `re_hunt`170 - `re_verify`171- `telemetry.verifier` stores:172 - `phase_exit_proof_runs`173 - `extended_audit_runs`174 - `workload_seconds`175- `telemetry.verifier.workload_seconds` stores:176 - `tests`177 - `build`178 - `scan`179 - `reconcile`180 - `reasoning`181- `pending_gate` is required whenever BUILD/PLAN/DEBUG is waiting on user clarification, scope selection, or persistence repair.182- `status_history` and `remediation_history` are append-only summaries of major router decisions.183184v10 router gates:185- `plan_trust_gate`186- `phase_exit_gate`187- `failure_stop_gate`188- `memory_sync_gate`189- `skill_precedence_gate`190191These are router-owned checks, not advisory hints.192193Workflow event log:194- For every workflow, keep a lightweight append-only companion file:195196```text197.claude/cc10x/v10/workflows/{workflow_uuid}.events.jsonl198```199200- Append event objects with at least:201 - `ts`202 - `wf`203 - `event`204 - `phase`205 - `task_id`206 - `agent`207 - `decision`208 - `reason`209- Optionally append:210 - `duration_seconds`211 - `work_category`212 - `details`213- Event types:214 - `workflow_started`215 - `agent_started`216 - `agent_completed`217 - `contract_parsed`218 - `remediation_created`219 - `scope_decision_requested`220 - `scope_decision_resolved`221 - `memory_finalized`222 - `workflow_completed`223 - `workflow_failed`224225Hook policy:226- CC10X plugin hooks live in the plugin bundle under `hooks/hooks.json` and should stay minimal:227 - `PreToolUse` for protected writes228 - `SessionStart` for resume context (fires on startup|resume|compact)229 - `PostToolUse` for workflow artifact integrity audit230 - `TaskCompleted` for task metadata checks231 - `PostCompact` for compaction event capture in workflow event log (audit only)232 - `SubagentStop` for agent contract presence audit (telemetry only)233 - `PreCompact` for workflow state snapshot before compaction (persistence only)234 - `Stop` for workflow state snapshot on session stop (persistence only, never blocks)235 - `StopFailure` for API error logging to workflow event log (async, telemetry only)236 - `InstructionsLoaded` for instruction file load audit trail (async, telemetry only)237- Default mode is audit-only. Do not rely on hooks as the only source of truth; the router still owns orchestration decisions.238- Repo-local `.claude/settings.json` is not part of the shipped CC10X product.239- Optional accelerator MCPs are user-configured in Claude Code. CC10X assumes the names `brightdata` and `octocode` if they are available, but must degrade to built-in research paths when they are absent.240241## 3. Task Metadata Contract242243Every CC10X task description starts with normalized metadata lines:244245```text246wf:{workflow_uuid}247kind:{workflow|agent|remfix|memory|reverify|research}248origin:{router|component-builder|bug-investigator|code-reviewer|silent-failure-hunter|integration-verifier|planner}249phase:{build|build-implement|build-review|build-hunt|build-verify|debug|debug-investigate|debug-review|debug-verify|review|review-audit|plan|plan-create|plan-review-gap-1|plan-review-gap-2|memory-finalize|re-review|re-hunt|re-verify|re-plan|research-web|research-github}250plan:{path|N/A}251scope:{ALL_ISSUES|CRITICAL_ONLY|N/A}252reason:{short reason or N/A}253```254255Rules:256- `wf:` is mandatory on every child task.257- Router must generate `workflow_uuid` before `TaskCreate()` and use it from the first write. `wf:PENDING_SELF` is retired in v10.258- `kind:` is mandatory and drives resume, routing, and counting logic.259- `origin:` is mandatory on every `kind:remfix` task.260- `plan:` is required on workflow, agent, reverify, and memory tasks.261- `reason:` is required on remediation and research tasks.262- The router must never depend on loose prose when metadata can answer the question.263264## 4. Resume And Hydration265266After memory load:267268```text269TaskList()270```271272Hydration rules:273- Find active parent workflow tasks by subject prefix `CC10X BUILD:`, `CC10X DEBUG:`, `CC10X REVIEW:`, `CC10X PLAN:`.274- 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.275- Reconstruct runnable tasks from `TaskList()` and `TaskGet()` using `wf:` + `kind:` + `phase:`. Do not rely on stored task IDs for correctness.276- Read and write only the v10 namespace. Ignore legacy `.claude/cc10x/*.md` and `.claude/cc10x/workflows/*` state during hydration.277- `[cc10x-internal] memory_task_id` in `activeContext.md` is only a transient optimization. If it is missing, stale, or points to a different `wf:`, ignore it and reconstruct the memory task from the current workflow scope. [EASY TO MISS: stale memory_task_id is the #1 cause of cross-workflow pollution]278- Never use an unscoped fallback like "first pending Memory Update task". [EASY TO MISS: unscoped lookups silently pick up orphan tasks from prior workflows]279280Resume algorithm:2811. Identify the active parent workflow.2822. Extract `workflow_uuid` from the `wf:` line.2833. Read all CC10X tasks whose descriptions contain that `wf:`.2844. Derive runnable tasks from `status` and `blockedBy`.2855. Reconstruct the memory task as the unique pending/in_progress `kind:memory` task in the same `wf:`.286287Scope-decision resume:288- Before normal routing, check `activeContext.md ## Decisions` for a live marker:289 - `[SCOPE-DECISION-PENDING: wf:{workflow_uuid} reason:{...}]`290- If present, treat the current user reply as the answer to that pending BUILD scope gate:291 - `critical only` -> create the pending REM-FIX with `scope:CRITICAL_ONLY`292 - `all issues` -> create the pending REM-FIX with `scope:ALL_ISSUES`293 - anything else -> ask again with the same two options and stop294- After consuming a valid answer:295 - remove the pending marker from `## Decisions`296 - create the scoped REM-FIX297 - block downstream re-review / re-hunt / verifier tasks as normal298 - stop after task creation so the next turn resumes from task state, not from repeated prose parsing299 - [EASY TO MISS: When persisting user decisions, use the user's exact words. Paraphrasing introduces drift that compounds across resume cycles.]300301Safety rules:302- If a task list is shared across sessions, always scope by `wf:` before resuming.303- If a task has `status=in_progress` and unresolved blockers, treat it as waiting on remediation, not as a free-running orphan.304- If a task has `status=in_progress` and no blockers, ask the user whether to resume, delete, or mark complete.305- If legacy tasks exist with subjects starting `BUILD:`, `DEBUG:`, `REVIEW:`, or `PLAN:` without the `CC10X` prefix, ask whether to resume the legacy workflow or start a fresh CC10X workflow.306307## 5. Workflow Preparation308309### Shared preparation310311Before creating a new workflow:312- Read `activeContext.md ## References` to discover `Plan`, `Design`, and prior `Research` files.313- Read `activeContext.md ## Decisions` for prior planner/build clarifications.314- Read `progress.md ## Current Workflow` and `## Tasks` for pending work that should resume instead of duplicating.315- Read the latest `.claude/cc10x/v10/workflows/*.json` artifact if one exists for the current conversation.316317**Intent Readiness Gate (MANDATORY before PLAN or BUILD):**318Before dispatching to planner or builder, verify the intent contract meets three conditions:3191. **Context-bounded:** The full intent (goal + constraints + acceptance criteria) fits within the agent's prompt scaffold without truncation. If the intent requires loading more than 5 source files to be understood, decompose first (switch to PLAN).3202. **Contradiction-free:** No acceptance criterion contradicts a stated constraint or non-goal. If contradictions exist, halt and persist `pending_gate="intent_contradiction"`.3213. **Sufficiently specific:** Every acceptance criterion maps to at least one verifiable scenario. If a criterion is unverifiable ("make it better" without a metric), halt and ask for specificity.322323Router-owned interface fields:324- `plan_mode`: `direct` | `execution_plan` | `decision_rfc`325- `verification_rigor`: `standard` | `critical_path`326- `checkpoint_type`: `none` | `human_verify` | `decision` | `human_action`327- `proof_status`: `passed` | `gaps_found` | `human_needed`328329### BUILD preparation3303311. Read `- Plan:` from `activeContext.md ## References`.3322. If plan path is not `N/A`, `Read(...)` the plan file before creating tasks.3333. Run `plan_trust_gate` before BUILD:334 - `Open Decisions` must be empty or explicitly marked approved.335 - `Differences from agreement` must be present, even if empty.336 - `plan_mode` must be explicit when a plan artifact exists.337 - `verification_rigor` must be explicit when a plan artifact exists.338 - If `plan_mode` is `execution_plan` or `decision_rfc`: every phase in `normalized_phases` must carry non-empty `exit_criteria`, and `intent.acceptance_criteria` must be non-empty. Field presence is not enough — field completeness is required.339 - Cross-check `intent.constraints` against approved decisions. If any approved decision explicitly contradicts an `intent.constraint`, emit NOGO with the contradiction and ask the user to resolve before BUILD starts.340 - If any condition fails, ask for clarification and do not start BUILD.3414. If plan path is `N/A`, assess scope before dispatch:342 - **Trivial** (single concern, one file group, one failure mode) → continue directly to BUILD.343 Heuristic signals: touches 1-2 files, single logical change, one testable outcome, no cross-module wiring.344 [EASY TO MISS: When the task is clearly trivial, do not ask clarifying questions or suggest planning. Execute directly. Analysis paralysis on trivial work is a net negative.]345 - **Non-trivial** (spans multiple independent file groups, has separable concerns, or involves distinct failure modes) → ask: `Plan first (Recommended)` or `Build directly`.346 Heuristic signals: touches 3+ files across different directories, multiple independent concerns that could fail separately, changes to both interface and implementation, or new cross-module dependencies.347 - `Plan first` -> switch to PLAN workflow.348 - `Build directly` -> continue without a plan.3495. If the referenced plan file is missing:350 - Ask: `Build without plan` or `Re-plan first (Recommended)`.351 - `Build without plan` -> continue with `plan:N/A`352 - `Re-plan first` -> switch to PLAN workflow3536. Normalize planner phases into executable `normalized_phases` and initialize `phase_cursor` to the first incomplete phase.3547. Persist the approved `plan_mode` and `verification_rigor` from the planner contract into the workflow artifact.3558. Every normalized phase must carry:356 - `objective`357 - `inputs`358 - `files/surfaces`359 - `expected_artifacts`360 - `required_checks`361 - `checkpoint_type`362 - `exit_criteria`3639. Initialize workflow `proof_status` to `gaps_found` until the current phase is independently verified.36410. Clarify missing requirements before builder only when the plan and memory do not already answer them.36511. Persist pre-answered clarifications in `activeContext.md ## Decisions` using `Build clarification [{topic}]: {answer}`.36612. Builder may execute only the phase at `phase_cursor`.367368### DEBUG preparation3693701. 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.3712. Immediately write `[DEBUG-RESET: wf:{workflow_uuid}]` once the workflow id exists.3723. Preserve failed attempt counting semantics: the investigator counts `[DEBUG-N]:` entries after the most recent reset marker.373374### REVIEW preparation3753761. REVIEW is advisory only.3772. Never create REM-FIX or implementation tasks directly from a REVIEW workflow.3783. If the final review verdict is `CHANGES_REQUESTED`, the router may offer `Start BUILD to fix (Recommended)` as a follow-up user choice.379380### PLAN preparation3813821. Restore design enrichment:383 - Read `- Design:` from `activeContext.md ## References`.384 - If a design path exists, verify it with `Glob(...)` and pass it under `## Design File`.3852. Mandatory brainstorming (ALWAYS runs for PLAN workflows):386 - ALWAYS run `Skill(skill="cc10x:brainstorming")` in the main context before planner. Brainstorming is how the user explores and clarifies intent — skipping it means the planner works from assumptions instead of understanding.387 - If a valid design file exists from step 1: brainstorming uses it as a foundation (the skill's Spec File Workflow reads and expands the existing design rather than starting from scratch).388 - If no design file exists: brainstorming starts from the user's request and explores the idea space.389 - Brainstorming may ask the user questions and may save a `*-design.md` file. After it completes, re-read `activeContext.md ## References` and refresh the design path.390 - Brainstorming should ask only unresolved, high-impact questions and stop as soon as the intent contract is complete.3913. Optional research before planning:392 - Ask whether to run web + GitHub research for external/unfamiliar technology when it would materially improve the plan.3934. Planner receives `## Research Files` only when research files actually exist.3945. Planner is agreement-first:395 - If a requirement is materially ambiguous, planner returns `STATUS=NEEDS_CLARIFICATION`.396 - Planner never treats its own defaults as approved implementation.3976. Planner must choose one `plan_mode`:398 - `direct` for trivial low-risk work399 - `execution_plan` for standard implementation work400 - `decision_rfc` for architecture or multi-option work4017. Planner must choose one `verification_rigor`:402 - `standard` by default (covers most work; keeps verification proportional to risk)403 - `critical_path` for security, money, state-machine, concurrency, or irreversible-migration work (failure in these domains is irreversible or high-blast-radius; justifies extended scenario coverage)4048. PLAN fresh-review loop:405 - Every PLAN workflow pre-creates a bounded review DAG: `plan-create -> plan-review-gap-1 -> re-plan -> plan-review-gap-2 -> memory-finalize`.406 - Every saved plan artifact enters that DAG, including `direct`, `execution_plan`, and `decision_rfc`.407 - If pass 1 succeeds, the router prunes the unused `re-plan` and pass 2 branch explicitly.408 - If pass 1 finds blocking issues, the router keeps the pre-created `re-plan` and pass 2 branch alive.409 - Maximum fresh-review passes: 2.410 - Planner remains the only plan writer.411 - The existing inline `plan-review-gate` inside planner remains the final fail-closed boundary on each planner pass.412413## 6. Workflow Task Graphs414415### Parent workflow creation416417Use this pattern for every new workflow:4184191. Generate a stable workflow UUID before `TaskCreate()`:420421```text422workflow_uuid = "wf-" + UTC timestamp + "-" + 8 hex chars423```4244252. Create the parent workflow task with that UUID from the first write:426427```text428TaskCreate({429 subject: "CC10X {WORKFLOW}: {summary}",430 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}",431 activeForm: "{workflow active form}"432})433```4344353. Immediately write the v10 artifact and event log:436437```text438Write(439 file_path=".claude/cc10x/v10/workflows/{workflow_uuid}.json",440 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\":{\"planner_create\":null,\"planning_review_pass1\":null,\"planner_replan\":null,\"planning_review_pass2\":null,\"memory_finalize\":null},\"phase_status\":{},\"results\":{\"builder\":null,\"investigator\":null,\"reviewer\":null,\"hunter\":null,\"verifier\":null,\"planner\":null,\"planning_reviewer\":null,\"research\":{\"web\":null,\"github\":null,\"synthesis\":null}},\"evidence\":{\"builder\":[],\"investigator\":[],\"reviewer\":[],\"hunter\":[],\"verifier\":[],\"planning_reviewer\":[]},\"telemetry\":{\"task_metrics_available\":\"unknown\",\"workflow_wall_clock_seconds\":0,\"agent_wall_clock_seconds\":{\"builder\":0,\"investigator\":0,\"reviewer\":0,\"hunter\":0,\"verifier\":0,\"planner\":0},\"loop_counts\":{\"re_review\":0,\"re_hunt\":0,\"re_verify\":0},\"verifier\":{\"phase_exit_proof_runs\":0,\"extended_audit_runs\":0,\"workload_seconds\":{\"tests\":0,\"build\":0,\"scan\":0,\"reconcile\":0,\"reasoning\":0}}},\"quality\":{\"confidence\":null,\"evidence_complete\":false,\"scenario_coverage\":0,\"research_quality\":\"none\",\"convergence_state\":\"pending\"},\"planning_review_runs\":0,\"planning_review_findings\":[],\"planning_review_status\":\"not_started\",\"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}\"}"441)442Write(443 file_path=".claude/cc10x/v10/workflows/{workflow_uuid}.events.jsonl",444 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"445)446```447448Only create child tasks after the v10 artifact exists.449450### BUILD task graph451452BUILD is sequential in v10:453- one approved executable phase at a time454- one builder run for the current phase only455- review, hunt, and verify validate that phase before `phase_cursor` advances456- if phase exit evidence is incomplete, record `partial` or `blocked`, persist state, and stop457458```text459TaskCreate({460 subject: "CC10X component-builder: Execute phase {phase_id}",461 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.",462 activeForm: "Building components"463}) -> builder_task_id464465TaskCreate({466 subject: "CC10X code-reviewer: Review implementation",467 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.",468 activeForm: "Reviewing code"469}) -> reviewer_task_id470TaskUpdate({ taskId: reviewer_task_id, addBlockedBy: [builder_task_id] })471472TaskCreate({473 subject: "CC10X silent-failure-hunter: Hunt edge cases",474 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.",475 activeForm: "Hunting failures"476}) -> hunter_task_id477TaskUpdate({ taskId: hunter_task_id, addBlockedBy: [builder_task_id] })478479TaskCreate({480 subject: "CC10X integration-verifier: Verify integration",481 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.",482 activeForm: "Verifying integration"483}) -> verifier_task_id484TaskUpdate({ taskId: verifier_task_id, addBlockedBy: [reviewer_task_id, hunter_task_id] })485486TaskCreate({487 subject: "CC10X Memory Update: Persist workflow learnings",488 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.",489 activeForm: "Persisting workflow learnings"490}) -> memory_task_id491TaskUpdate({ taskId: memory_task_id, addBlockedBy: [verifier_task_id] })492```493494### DEBUG task graph495496```text497TaskCreate({498 subject: "CC10X bug-investigator: Investigate {error}",499 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.",500 activeForm: "Investigating bug"501}) -> investigator_task_id502503TaskCreate({504 subject: "CC10X code-reviewer: Review fix",505 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.",506 activeForm: "Reviewing fix"507}) -> reviewer_task_id508TaskUpdate({ taskId: reviewer_task_id, addBlockedBy: [investigator_task_id] })509510TaskCreate({511 subject: "CC10X integration-verifier: Verify fix",512 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.",513 activeForm: "Verifying fix"514}) -> verifier_task_id515TaskUpdate({ taskId: verifier_task_id, addBlockedBy: [reviewer_task_id] })516517TaskCreate({518 subject: "CC10X Memory Update: Persist debug learnings",519 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.",520 activeForm: "Persisting debug learnings"521}) -> memory_task_id522TaskUpdate({ taskId: memory_task_id, addBlockedBy: [verifier_task_id] })523```524525### REVIEW task graph526527```text528TaskCreate({529 subject: "CC10X code-reviewer: Review {target}",530 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.",531 activeForm: "Reviewing code"532}) -> reviewer_task_id533534TaskCreate({535 subject: "CC10X Memory Update: Persist review learnings",536 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.",537 activeForm: "Persisting review learnings"538}) -> memory_task_id539TaskUpdate({ taskId: memory_task_id, addBlockedBy: [reviewer_task_id] })540```541542### PLAN task graph543544```text545TaskCreate({546 subject: "CC10X planner: Create plan for {feature}",547 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.",548 activeForm: "Creating plan"549}) -> planner_task_id550551TaskCreate({552 subject: "CC10X plan-gap-reviewer: Fresh review pass 1",553 description: "wf:{workflow_uuid}\nkind:agent\norigin:router\nphase:plan-review-gap-1\nplan:N/A\nscope:N/A\nreason:Fresh anti-anchoring review of saved plan (pass 1)\n\nWait for the planner to save a plan artifact, then review it against the original user request and any approved design/research files.",554 activeForm: "Fresh-reviewing plan"555}) -> planning_review_pass1_task_id556TaskUpdate({ taskId: planning_review_pass1_task_id, addBlockedBy: [planner_task_id] })557558TaskCreate({559 subject: "CC10X planner: Revise plan after fresh review",560 description: "wf:{workflow_uuid}\nkind:agent\norigin:router\nphase:re-plan\nplan:N/A\nscope:N/A\nreason:Revise plan if fresh review finds blocking issues\n\nOnly run if pass 1 finds blocking issues. Revise the existing saved plan using structured planning review findings.",561 activeForm: "Revising plan"562}) -> planner_replan_task_id563TaskUpdate({ taskId: planner_replan_task_id, addBlockedBy: [planning_review_pass1_task_id] })564565TaskCreate({566 subject: "CC10X plan-gap-reviewer: Fresh review pass 2",567 description: "wf:{workflow_uuid}\nkind:agent\norigin:router\nphase:plan-review-gap-2\nplan:N/A\nscope:N/A\nreason:Fresh anti-anchoring review of saved plan (pass 2)\n\nOnly run if the re-plan task produces a revised saved plan after pass 1 findings.",568 activeForm: "Fresh-reviewing revised plan"569}) -> planning_review_pass2_task_id570TaskUpdate({ taskId: planning_review_pass2_task_id, addBlockedBy: [planner_replan_task_id] })571572TaskCreate({573 subject: "CC10X Memory Update: Index plan in memory",574 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.",575 activeForm: "Indexing plan in memory"576}) -> memory_task_id577TaskUpdate({ taskId: memory_task_id, addBlockedBy: [planner_task_id, planning_review_pass1_task_id, planner_replan_task_id, planning_review_pass2_task_id] })578```579580### Research tasks581582Create research tasks only when a workflow explicitly triggers them:583584Before creating them:585- Determine the preferred research path for this session and store it in the workflow artifact `capabilities`.586- Preferred web path:587 - `brightdata+websearch` when Bright Data MCP is available588 - otherwise `websearch+webfetch`589- Preferred GitHub path:590 - `octocode` when Octocode MCP is available591 - otherwise `web-only`592- Allowed fallbacks always include the built-in Claude Code web tools so research remains plug-and-play.593- Increment and record the workflow-scoped round number for the `(wf, reason)` pair.594595```text596TaskCreate({597 subject: "CC10X web-researcher: Research {topic}",598 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}",599 activeForm: "Researching web"600}) -> web_task_id601602TaskCreate({603 subject: "CC10X github-researcher: Research {topic}",604 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}",605 activeForm: "Researching GitHub"606}) -> github_task_id607```608609Research tasks are siblings, never blockers on the workflow parent. The follow-up agent task is blocked on both research tasks.610611### Marker rules612613- BUILD writes `[BUILD-START: wf:{workflow_uuid}]`614- DEBUG writes `[DEBUG-RESET: wf:{workflow_uuid}]`615- PLAN writes `[PLAN-START: wf:{workflow_uuid}]`616617## 7. Dispatcher And Agent Prompt Contract618619### Explicit dispatcher620621| Task Phase / Kind | Agent |622|-------------------|-------|623| `build-implement` | `cc10x:component-builder` |624| `debug-investigate` | `cc10x:bug-investigator` |625| `build-review`, `debug-review`, `review-audit`, `re-review` | `cc10x:code-reviewer` |626| `build-hunt`, `re-hunt` | `cc10x:silent-failure-hunter` |627| `build-verify`, `debug-verify`, `re-verify` | `cc10x:integration-verifier` |628| `plan-create`, `re-plan` | `cc10x:planner` |629| `plan-review-gap-1`, `plan-review-gap-2` | `cc10x:plan-gap-reviewer` |630| `research-web` | `cc10x:web-researcher` |631| `research-github` | `cc10x:github-researcher` |632| `kind:remfix` + `origin:bug-investigator` | `cc10x:bug-investigator` |633| `kind:remfix` + `origin:code-reviewer|silent-failure-hunter|integration-verifier|router` | `cc10x:component-builder` |634635### Prompt scaffold for every agent636637```text638## Task Context639- Task ID: {task_id}640- Parent Workflow ID: {workflow_uuid}641- Task Phase: {phase}642- Plan File: {plan_file or 'None'}643- Workflow Scope: wf:{workflow_uuid}644- Workflow Artifact: .claude/cc10x/v10/workflows/{workflow_uuid}.json645646## User Request647{request}648649## Requirements650{clarified requirements or 'See plan/design files'}651652## Memory Summary653{brief activeContext summary}654655## Project Patterns656{User Standards + Common Gotchas, trimmed if needed}657658## Domain Context659{If UBIQUITOUS_LANGUAGE.md, DOMAIN_GLOSSARY.md, docs/domain/*.md, or project-context.md exist, include content. Otherwise omit section.}660661## SKILL_HINTS662{router-detected skill list or "None"}663```664665Optional sections:666- `## Pre-Answered Requirements` for BUILD when router already gathered decisions.667- `## Intent Contract` when a plan or design already defined goal, constraints, acceptance criteria, and named scenarios.668- `## Research Files` only when at least one research file exists.669- `## Research Quality` only when at least one research result exists.670- `## Design File` only for planner.671- `## Planning Review Findings` only for `re-plan`.672- `## Original User Request` only for `plan-gap-reviewer`.673- `## Approved Context Files` only for `plan-gap-reviewer`.674- `## Previous Agent Findings` only for integration-verifier and only after review/hunt phases.675676### Deterministic skill hints677678- Router is the only authority allowed to load internal CC10X skills.679- Agents may not self-activate `frontend-patterns`, `architecture-patterns`, or `debugging-patterns`.680- Include `cc10x:frontend-patterns` only when the request, changed files, plan, or design clearly targets UI/frontend work.681- Include `cc10x:architecture-patterns` only for multi-component, API, schema, auth, or integration-heavy work.682- Include `cc10x:research` only when planner or investigator receives `## Research Files`.683- Include project/domain skills only from `patterns.md ## Project SKILL_HINTS`.684- Skill precedence is strict:685 1. explicit user prompt686 2. project `CLAUDE.md` / repo standards / user standards687 3. approved plan and design docs688 4. domain-specific external skills689 5. internal CC10X skills690 6. model heuristics691692### Previous Agent Findings handoff693694When invoking `integration-verifier`, pass:695696```text697## Previous Agent Findings698699### Code Reviewer700**Verdict:** {Approve|Changes Requested}701**Critical Issues:**702{reviewer critical issues or "None"}703704### Silent Failure Hunter705**Critical Issues:**706{hunter critical issues or "None / not in this workflow"}707```708709DEBUG skips hunter findings.710711### Task metrics and timing telemetry712713- Timing telemetry is measurement only. It must never bypass gates, phase exit, or remediation rules.714- After `TaskGet()` / `TaskList()`, if Claude Code exposes task duration metrics, persist them into:715 - `telemetry.workflow_wall_clock_seconds`716 - `telemetry.agent_wall_clock_seconds.{agent}`717- If task metrics are unavailable, keep `task_metrics_available="unknown"` and continue. Missing telemetry is never a reason to advance or block a workflow.718- When `integration-verifier` reports a `### Timing & Workload` section, persist:719 - `telemetry.verifier.phase_exit_proof_runs`720 - `telemetry.verifier.extended_audit_runs`721 - `telemetry.verifier.workload_seconds`722- Use telemetry to explain latency. Do not use it to auto-reduce verification scope.723724## 8. Post-Agent Validation725726### Read-only contracts727728Primary signal:729- Line 1: `CONTRACT {"s":"...","b":...,"cr":...}`730731Fallback heading on line 2:732- `## Review: Approve|Changes Requested`733- `## Error Handling Audit: CLEAN|ISSUES_FOUND`734- `## Verification: PASS|FAIL`735- `## Planning Review: Pass|Findings`736737Verdict extraction:7381. Try the envelope on line 1.7392. If envelope is missing or malformed, scan the first 5 lines for the heading.7403. Extract `CRITICAL_ISSUES` from `### Critical Issues`.7414. If output is too short or malformed, run inline verification rather than blindly approving.7425. Detect `SELF_REMEDIATED` from task state:743 - If the task remains `in_progress` and `blockedBy` is non-empty after the agent stops, treat it as self-remediated.7446. For integration-verifier, parse scenario accounting:745 - `SCENARIOS_TOTAL`746 - `SCENARIOS_PASSED`747 - `SCENARIOS_FAILED`748 - Fail validation if those counts do not reconcile with the evidence array.749 - Fail validation if any scenario omits explicit `Expected` or `Actual` evidence.750751Read-only structured intent fields:752- `REMEDIATION_NEEDED: true|false`753- `REMEDIATION_REASON: 754755…(truncated)