From cc10x
Routes and orchestrates CC10x workflows for build, debug, review, plan, and orient requests. Automatically activates on relevant keywords and executes the task graph.
How this skill is triggered — by the user, by Claude, or both
Slash command
/cc10x:cc10x-routerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Runtime contract only.** The router runs 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.
evals/README.mdevals/eval-01-error-beats-build.mdevals/eval-02-review-stays-advisory.mdevals/eval-03-skip-router-multifile.mdreferences/build-workflow.mdreferences/debug-workflow.mdreferences/plan-workflow.mdreferences/remediation-and-research.mdreferences/review-workflow.mdreferences/workflow-artifact-and-hook-policy.mdreferences/workflow-artifact.skeleton.jsonRuntime contract only. The router runs 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.
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 | exploration -> planner -> bounded fresh review loop |
| 3 | REVIEW | review, audit, analyze, assess, "is this good" | REVIEW | code-reviewer |
| 4 | ORIENT | zoom out, explain, understand, "how does X work", unfamiliar, "map this", "walk me through", "where is", "what does this do" | ORIENT | advisory orientation (no agents) |
| 5 | DEFAULT | Everything else | BUILD | component-builder → [code-reviewer ‖ failure-hunter] → integration-verifier |
Rules:
plan_file and run the fresh-review gate over it) rather than discarding it. Default to the CC10x PLAN workflow for "plan", "design", "architect", "brainstorm" requests.references/build-workflow.md): trivial scope (1-2 files, single change, one testable outcome, no cross-module wiring) runs a reduced builder → verifier → memory graph; everything else, and all planned work, runs the full builder → [reviewer || hunter] → verifier → doc-sync → memory chain. The reviewer and hunter run in parallel (two read-only agents in the same message) and the router merges their findings before verifier handoff. The builder escalates trivial → full on any scope increase. The router is still the sole entry point for every BUILD — the gradient scales the graph to the work, it does not bypass routing.-> {WORKFLOW} workflow (signals: {matched keywords})Triggered when the user wants to understand existing code, not change it ("zoom out", "explain", "how does X work", "I'm unfamiliar with", "map this", "walk me through", "where is X", "what does this do"). The router answers inline — no TaskCreate, no workflow artifact, no phase graph, no write agents.
Orientation procedure:
localViewStructure / localFindFiles / localSearchCode to locate, read only the slices needed to explain).lspCallHierarchy) and references (lspFindReferences); run localSearchCode first to get the exact lineHint before any LSP call.Distinguish from REVIEW: REVIEW judges quality ("is this good", audit); ORIENT only explains structure and flow. When both could match, prefer ORIENT for "help me understand", REVIEW for "tell me what's wrong".
Always run this before routing or resuming:
1. Bash("mkdir -p .cc10x")
2. Read(".cc10x/activeContext.md")
3. Read(".cc10x/patterns.md")
4. Read(".cc10x/progress.md")
Do not parallelize step 1 with reads.
If a memory file is missing:
cc10x:memory-and-handoff template.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:
## Last Updated.Edit(...), immediately Read(...) and verify the new section exists.JUST_GO:
activeContext.md ## Session Settings.AUTO_PROCEED: true, set JUST_GO=true.JUST_GO=true, auto-default all non-REVERT AskUserQuestion gates to the recommended option and log the choice in ## Decisions.Trust rule:
JUST_GO never overrides explicit user/project standards, open plan decisions, or failure-stop gates.Open Decisions, BUILD may not start, even in JUST_GO.Core law:
.cc10x/workflows/{workflow_uuid}.json.cc10x/workflows/{workflow_uuid}.events.jsonlplan_trust_gate, phase_exit_gate, failure_stop_gate, memory_sync_gate, and skill_precedence_gateMandatory reference read:
references/workflow-artifact-and-hook-policy.md.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|integration-verifier|planner}
phase:{build|build-implement|build-review|build-hunt|build-verify|build-doc-sync|build-finish|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:, kind:, origin:, phase:, plan:, scope:, reason:) are present on EVERY CC10X task — use N/A where a field does not apply. The TaskCompleted hook audits exactly this invariant; the task-graph templates already satisfy it.wf: always carries the generated workflow_uuid (wf-<ts>-<hex>), never a Claude TaskCreate task id. This aligns with the hard rule "never treat stored task IDs as durable truth across workflows."workflow_uuid before TaskCreate() and use it from the first write. wf:PENDING_SELF is not used.kind: drives resume, routing, and counting logic.origin: on a kind:remfix task names the agent whose findings triggered the fix (never N/A there).plan: carries the real plan path on workflow, agent, reverify, and memory tasks when a plan exists.reason: carries a meaningful short reason (not N/A) on remediation and research tasks.After memory load:
TaskList()
Hydration rules:
CC10X BUILD:, CC10X DEBUG:, CC10X REVIEW:, CC10X PLAN:.wf: markers. Do not resume a workflow you cannot scope confidently.TaskList() and TaskGet() using wf: + kind: + phase:. Do not rely on stored task IDs for correctness..cc10x/ state namespace (memory .cc10x/*.md, workflows .cc10x/workflows/*). Ignore any legacy version-segmented layout such as .cc10x/v10/* or .claude/cc10x/* left over from older installs 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]Resume algorithm:
.cc10x/stop-state.json or .cc10x/precompact-state.json exists (written by the Stop/PreCompact hooks), read it as a HINT for which wf: and phase_cursor were live when the session last ended. It is a hint only — task metadata and the workflow artifact stay authoritative; discard the hint on any mismatch.workflow_uuid from the wf: line.wf:.status and blockedBy.kind:memory task in the same wf:.Scope-decision resume:
activeContext.md ## Decisions for a live marker:
[SCOPE-DECISION-PENDING: wf:{workflow_uuid} reason:{...}]critical only -> create the pending REM-FIX with scope:CRITICAL_ONLYall issues -> create the pending REM-FIX with scope:ALL_ISSUES## DecisionsSafety rules:
wf: before resuming.status=in_progress and unresolved blockers, treat it as waiting on remediation, not as a free-running orphan.status=in_progress and no blockers, ask the user whether to resume, delete, or mark complete.BUILD:, DEBUG:, REVIEW:, or PLAN: without the CC10X prefix, ask whether to resume the legacy workflow or start a fresh CC10X workflow.Before creating a new workflow:
activeContext.md ## References to discover Plan, Design, and prior Research files.activeContext.md ## Decisions for prior planner/build clarifications.progress.md ## Current Workflow and ## Tasks for pending work that should resume instead of duplicating..cc10x/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:
pending_gate="intent_contradiction".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_neededreferences/build-workflow.md.### BUILD preparation and ### BUILD task graph blocks in that file as the canonical BUILD law.references/debug-workflow.md.### DEBUG preparation and ### DEBUG task graph blocks in that file as the canonical DEBUG law.references/review-workflow.md.### REVIEW preparation and ### REVIEW task graph blocks in that file as the canonical REVIEW law.references/plan-workflow.md.### PLAN preparation and ### PLAN task graph blocks in that file as the canonical PLAN law.references/remediation-and-research.md before continuing.Use this pattern for every new workflow:
TaskCreate():workflow_uuid = "wf-" + UTC timestamp + "-" + 8 hex chars
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}"
})
Bash(command="mkdir -p .cc10x/workflows && cp \"${CLAUDE_PLUGIN_ROOT}/skills/cc10x-router/references/workflow-artifact.skeleton.json\" .cc10x/workflows/{workflow_uuid}.json")
Then Edit the copied file, replacing each placeholder token with the live value (the skeleton ships every required key already populated with safe defaults — you only fill these):
__WORKFLOW_UUID__ → {workflow_uuid} (appears twice: workflow_uuid and workflow_id)__WORKFLOW_TYPE__ → {WORKFLOW} (BUILD | DEBUG | REVIEW | PLAN) — if routing (§5) has not yet determined the workflow type, use pending and update it after §5 resolves. Never hardcode BUILD before routing completes. The artifact may be created before routing (to capture state early), but workflow_type must reflect the actual routed type after §5.__USER_REQUEST__ → the user request (JSON-escape quotes/newlines)__PHASE__ → {build|debug|review|plan}__ISO_TIMESTAMP__ → the current UTC ISO timestamp (appears 3×: status_history[0].ts, created_at, updated_at)Use Edit(replace_all=true) for __WORKFLOW_UUID__ and __ISO_TIMESTAMP__ since each repeats. Then write the event log:
Write(
file_path=".cc10x/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"
)
Read-back gate (MANDATORY before any child TaskCreate): Read(".cc10x/workflows/{workflow_uuid}.json") and confirm (a) it parses as JSON, (b) workflow_uuid equals the generated UUID, and (c) no __PLACEHOLDER__ tokens remain. If any check fails, fix the file and re-read before proceeding. The PostToolUse artifact guard also validates this write in block mode and will reject a malformed or key-missing artifact — but the router must not rely on the guard alone; confirm the read-back first.
Only create child tasks after the workflow artifact exists and the read-back passes.
references/build-workflow.md and apply its ### BUILD task graph block verbatim before creating BUILD child tasks.references/debug-workflow.md and apply its ### DEBUG task graph block verbatim before creating DEBUG child tasks.references/review-workflow.md and apply its ### REVIEW task graph block verbatim before creating REVIEW child tasks.references/plan-workflow.md and apply its ### PLAN task graph block verbatim before creating PLAN child tasks.references/remediation-and-research.md.## 10. Research Orchestration, ## Research Quality, and ## Research Files blocks there before creating or consuming research tasks.[BUILD-START: wf:{workflow_uuid}][DEBUG-RESET: wf:{workflow_uuid}][PLAN-START: wf:{workflow_uuid}]| 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: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:researcher |
research-github | cc10x:researcher |
kind:remfix + origin:bug-investigator | cc10x:bug-investigator |
build-doc-sync | cc10x:doc-syncer |
kind:remfix + origin:code-reviewer / origin:integration-verifier / origin:router | cc10x:component-builder |
The router dispatches a full agent chain per phase. Match the model tier to the role's cognitive load instead of inheriting the session model for everything. Tiers are abstract: cheap (small/fast), standard (mid), capable (frontier). Resolve each to the concrete model id the host exposes at dispatch time.
| Role / phase | Recommended tier | Why |
|---|---|---|
component-builder on trivial scope, transcription/mechanical builds (rote wiring, single-change, codegen-from-spec) | cheap | Mechanical execution against an explicit spec; little judgment. |
doc-syncer | cheap | Mechanical diff-driven doc edits. |
component-builder on multi-file / cross-module integration | standard | Real wiring decisions across files; needs coherence. |
code-reviewer | standard (FLOOR) | Judgment under adversarial intent; see reviewer floor below. |
bug-investigator | standard | Hypothesis search; escalate to capable on a stubborn root cause. |
planner, plan-gap-reviewer | capable | Architecture and decomposition; cheap planning poisons the whole chain. |
integration-verifier (final phase, REVERT authority) | capable | Last line before "done"; must not miss scenario gaps. |
researcher | standard | Retrieval + synthesis. |
How tiers are realized (ADVISORY — mechanism honesty): Claude Code selects a subagent's model from the agent's frontmatter model: field; the Task/Agent dispatch has NO per-call model parameter, so the router cannot set the model at dispatch time. cc10x therefore ships model: haiku on doc-syncer (safely mechanical) and model: inherit everywhere else so the user's session model choice is respected. Treat the table above as guidance for users tuning agent frontmatter (or for hosts that do expose per-dispatch model selection) — never claim a tier was applied when the mechanism cannot apply it.
Reviewer FLOOR — never run a verifier or reviewer (code-reviewer, integration-verifier, plan-gap-reviewer) on the cheapest tier. The cheapest tier rubber-stamps. Mid-tier is the floor for anything that gates quality; bump UP, never below.
Turn-count dominates price — a capable model that one-shots a phase is cheaper than a cheap model that loops three times re-reading state and re-trying. When a role tends to iterate (planner, verifier, stubborn investigation), prefer the higher tier even though its per-token cost is greater: fewer turns wins. Under JUST_GO, still apply this policy where the mechanism allows — never downgrade a gating role's frontmatter below the reviewer floor to save tokens.
## 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: .cc10x/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"}
Anti-anchoring exception: for adversarial read-only dispatches (code-reviewer, plan-gap-reviewer) OMIT ## Memory Summary — it carries the implementer's own narrative (decisions, learnings) and anchors the auditor. Keep ## Project Patterns (user standards and gotchas are neutral law, not author narrative). Approved decisions the reviewer genuinely needs travel via ## Pre-Answered Requirements / ## Intent Contract, never via the memory summary.
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 a review phase ran.code-reviewer, failure-hunter, or plan-gap-reviewer, scan the constructed prompt for bias phrases — "do not flag", "don't treat X as a defect", "at most Minor", "the plan chose", "should be fine", "no need to check". If any are present, rewrite them out: you are pre-judging the reviewer's verdict before they have seen the code. The router knows the plan, the intent contract, and the approved decisions — that knowledge can unknowingly inject bias ("the plan chose approach X, so don't flag Y"). Reviewers must form their own opinion from the diff. State approved decisions as neutral facts ("approach X was approved for reason Z"), never as instructions to suppress findings.Router is the only authority allowed to load internal CC10X skills.
Agents may not self-activate frontend or architecture.
Include cc10x:frontend only when the request, changed files, plan, or design targets UI/frontend work. The skill has two modes: authoring (build UI with patterns) and critique (score built UI). Router selects mode via dispatch context.
Include cc10x:architecture only for multi-component, API, schema, auth, or integration-heavy work.
Include cc10x:research only when planner or investigator receives ## Research Files.
Include cc10x:exploration only on an explicit de-risk/spike intent ("spike", "try out", "what should this look like", "prototype", "throwaway") — never as the default for a real build. The skill has two modes: design (brainstorm a design) and spike (throwaway prototype). Absorbing a spike's answer is a fresh gated BUILD, not promotion.
Include cc10x:codebase-hygiene only when (a) the code-reviewer is asked for a reuse/consolidation audit or the request targets semantic duplication, OR (b) the request targets retrofitting/deepening shallow modules in EXISTING code (not greenfield architecture, which stays cc10x:architecture). The skill has two modes: duplicate detection and module deepening.
Include cc10x:mcp-cli only when a researcher needs a one-off MCP capability that is not already mounted.
Include cc10x:code-review only when a human/external reviewer's feedback (pasted PR comments, review notes, "can you change X") must be acted on — it governs verify-before-agreeing in the MAIN session, not the internal reviewer→router→fix loop.
Include cc10x:memory-and-handoff only when work is being handed to a coworker, a different tool, or a fresh non-cc10x session.
Include project/domain skills only from patterns.md ## Project SKILL_HINTS.
Skill precedence is strict:
CLAUDE.md / repo standards / user standardsWhen invoking integration-verifier, pass:
## Previous Agent Findings
### Code Reviewer
**Verdict:** {Approve|Changes Requested}
**Critical Issues:**
{reviewer critical issues or "None"}
### Failure Hunter
**Critical Issues:**
{hunter critical issues or "None / not in this workflow"}
DEBUG skips the hunter.
TaskGet() / TaskList(), if Claude Code exposes task duration metrics, persist them into:
telemetry.workflow_wall_clock_secondstelemetry.agent_wall_clock_seconds.{agent}task_metrics_available="unknown" and continue. Missing telemetry is never a reason to advance or block a workflow.integration-verifier reports a ### Timing & Workload section, persist:
telemetry.verifier.phase_exit_proof_runstelemetry.verifier.extended_audit_runstelemetry.verifier.workload_secondsPrimary signal:
CONTRACT {"s":"...","b":...,"cr":...}Fallback heading on line 2:
## Review: Approve|Changes Requested## Verification: PASS|FAIL## Planning Review: Pass|FindingsVerdict extraction:
CRITICAL_ISSUES from ### Critical Issues.SELF_REMEDIATED from task state:
in_progress and blockedBy is non-empty after the agent stops, treat it as self-remediated.SCENARIOS_TOTALSCENARIOS_PASSEDSCENARIOS_FAILEDExpected or Actual evidence.Read-only structured intent fields:
REMEDIATION_NEEDED: true|falseREMEDIATION_REASON: ...REMEDIATION_SCOPE_REQUESTED: N/A|CRITICAL_ONLY|ALL_ISSUESREVERT_RECOMMENDED: true|falsePLANNING_REVIEW_STATUS: PASS|FINDINGSBLOCKING_FINDINGS_COUNT: [number]REPLAN_NEEDED: true|falseREPLAN_REASON: ...Compatibility rule:
For write agents, parse the final fenced YAML block under ### Router Contract (MACHINE-READABLE).
Before post-agent validation, read references/workflow-artifact-and-hook-policy.md §contracts for the per-agent required-field table and the contract-override pass conditions.
If the YAML block is missing or malformed:
After Skill(skill="cc10x:exploration"), parse the fenced YAML block under
### Brainstorming Handoff (MACHINE-READABLE).
Required field:
DESIGN_FILEIf present:
design_file## Design FileactiveContext.md to be updated firstSTATUS/verdict as a pass, read references/workflow-artifact-and-hook-policy.md §contracts and apply the per-agent contract-override pass conditions verbatim (the STATUS=PASS/FIXED/APPROVE/PLAN_CREATED/COMPLETE gates, plus the reviewer rubber-stamp fallback).Convergence rule:
quality.convergence_state to needs_iteration and stop on the appropriate remediation or clarification gate instead of treating the task as good enough.references/remediation-and-research.md.## 9. Remediation And Workflow Rules block there as canonical router law.references/remediation-and-research.md and apply its ## 10. Research Orchestration, ## Research Quality, and ## Research Files blocks whenever research is triggered or consumed.references/remediation-and-research.md and apply its ## Research Quality block whenever research quality must be summarized or persisted.references/remediation-and-research.md and apply its ## Research Files block whenever research file paths are handed to planner or investigator.references/remediation-and-research.md and apply its ## 11. Re-Review Loop block whenever a kind:remfix task completes.The harness is a loop engine. These concepts govern how the loop runs:
| Concept | Meaning |
|---|---|
| Trigger | The event that starts or resumes a loop iteration — user request, agent completion, checkpoint resolution. Every loop iteration has exactly one trigger. |
| Checkpoint | A point where the loop pauses for human input. Only on irreversible actions, real scope changes, or input only the user can provide. Checkpoints are NOT for narration or "want me to continue?" prompts. |
| Push right | Defer checkpoints as far as possible — do maximal work before involving the human. The loop should never stop on a promise or plan when it could act. If the next step is reversible and follows from the original request, proceed without asking. |
| Brief | The decision-ready summary the loop produces when pausing. Not raw output, not a diary — the one thing the human needs to decide next. Outcome first, supporting detail second. |
| Cycle | One complete plan → build → verify → learn iteration. The circuit breaker caps cycles at 3 before requiring a human checkpoint. |
| Convergence | The loop's quality signal — when quality.convergence_state transitions from needs_iteration to converged, the loop is complete. Never declare convergence on prose alone. |
Autonomous mode: When the user sets a goal that spans multiple iterations (e.g., /goal or explicit "do this end-to-end"), the loop runs without checkpointing for reversible actions. The user is not watching in real time and cannot answer questions mid-task. Before ending a turn, check the last paragraph — if it is a plan, analysis, question, list of next steps, or a promise about work not yet done, do that work now with tool calls. End the turn only when the task is complete or blocked on input only the user can provide.
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 `.cc10x/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. Mark each task in_progress before invoking its agent. If `code-reviewer` and `failure-hunter` are both ready in BUILD: mark both in_progress first, invoke them in the same message. They are read-only and safe to parallelize.
- If parallel invocation fails or is unavailable (API error, rate limit, agent not found): fall back to sequential execution — dispatch `code-reviewer` first, wait for it to complete, then dispatch `failure-hunter`. Do NOT substitute the hunter with a different agent (e.g., bug-investigator). Do NOT skip the hunter. The hunter is a read-only agent with a specific adversarial posture — no other agent can replace it. Never block a workflow because parallelism is unavailable. Log `event=parallel_fallback` in the workflow event log.
6. After each agent returns:
- capture memory payload immediately
- validate output
- persist task-state side effects
- if BUILD review and hunt are both complete for the current phase, write one router-owned merged findings summary into the existing workflow results before verifier handoff
- 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
- if two agents in the same phase return contradictory verdicts (e.g., reviewer approves but verifier fails on the same evidence), treat the stricter verdict as authoritative and do not average or reconcile the signals. Log the contradiction in `status_history`.
- **Cross-reviewer agreement promotion:** if `code-reviewer` and `failure-hunter` independently flag the SAME finding (same file:line, same defect, raised from different passes), that is stronger signal than either alone — promote the merged finding's confidence by one tier (80→90, or mark it `cross-confirmed` in the merged findings summary). Agreement between two mutually-blind reviewers is independent confirmation; use it. Promotion never overrides the quote-the-line gate — a finding without a verbatim `file:line` quote cannot be promoted, only demoted.
- doc-syncer `STATUS=SKIPPED` is a passing state; advance to Memory Update immediately
- doc-syncer STATUS=PARTIAL: soft pass; advance to Memory Update; persist doc_sync_partial=true in workflow artifact results.doc_syncer for user review
7. Repeat until all tasks in the active `wf:` are completed.
Pre-check before processing agent output:
Capture memory payload first, before validation or task-state mutation.
### Memory Notes (For Workflow-Final Persistence) immediately after return.MEMORY_NOTES from YAML immediately after return.TaskGet({ taskId }) or TaskList() to verify final task state.
WRITE agents:
TaskUpdate(status="completed").READ-ONLY agents:
TaskUpdate(status="completed").Memory payload was already captured in step 0:
Update .cc10x/workflows/{workflow_uuid}.json with:
phase_exit_gate passesupdated_at timestamp MUST be set to the current ISO timestamp — a stale updated_at breaks resume logic and triggers the TaskCompleted guard's stale-artifact warning.
READ-BACK GATE (MANDATORY): After writing the artifact, Read it back and confirm:updated_at is set to a timestamp from THIS turn (not a prior turn)results.{agent_name} exists and contains the agent's contract fieldsAppend event log entry: For each result persisted to the artifact in step 5, append a matching entry to .cc10x/workflows/{wf}.events.jsonl:
{"ts":"<ISO>","wf":"<wf_id>","event":"result_persisted","phase":"<phase>","task_id":"<task_id>","agent":"<agent_name>","decision":"<contract_status>","reason":"<one-line summary>"}
The event log MUST stay in sync with the artifact. A mutation without an event log entry is a desync that breaks the audit trail. (The PostToolUse guard auto-appends a fallback artifact_mutated event, but the router MUST write the semantic result_persisted entry with agent-specific metadata.)
Persist [cc10x-internal] memory_task_id: {memory_task_id} wf:{workflow_uuid} only if it matches the active workflow.
Before invoking integration-verifier in BUILD:
Read results.reviewer and results.hunter from the workflow artifact.
Build ## Previous Agent Findings exactly in the format verifier expects:
## Previous Agent Findings
### Code Reviewer
**Verdict:** {Approve|Changes Requested}
**Critical Issues:**
{reviewer critical issues or "None"}
### Failure Hunter
**Critical Issues:**
{hunter critical issues or "None / not in this workflow"}
Never invoke verifier without that section when review/hunt already ran.
Post-verifier finding validation (act on hallucinated findings): after the verifier returns, read its ### Reviewer Finding Validation section. For any finding the verifier marked validated: false, DROP that finding from the merged findings set before creating a REM-FIX task — a hallucinated critical finding must not gate the phase or waste a builder cycle. Log the dropped finding in status_history (finding_dropped: hallucinated — verifier could not confirm quote at file:line). For validated: degraded CRITICAL/HIGH findings, KEEP them in the blocking set (fail-safe — a transient access failure must never silently remove a critical finding). This gate runs BEFORE the REM-FIX scope decision in §remediation-and-research, so CRITICAL_ONLY / ALL_ISSUES scope is computed over validated findings only.
The default execution model is per-phase subagent dispatch: every phase runs in a fresh-context agent via the dispatcher (§7), and that remains the default whenever the Task/Agent primitive is available AND the work is separable. The fallback below is a bounded degrade mode, NOT a shortcut to reach for when dispatch feels heavy. Prefer subagents. Only enter inline mode on one of the two triggers, and record which one in status_history.
Enter inline mode when EITHER trigger holds:
Agent(...) dispatch path, or TaskCreate/TaskList are absent). Without it the router cannot spawn phase agents at all; rather than be inoperative, it executes the plan itself.What changes vs. default: the ROUTER executes each phase's work inline, in the main session, instead of spawning the phase agent. Walk the same task graph in the same order the dispatcher would. Lose the subagent isolation — KEEP every gate.
What does NOT change (the gates stay fail-closed):
phase_exit_gate at each phase boundary exactly as in the default loop step 6 — if the phase is not complete, persist phase_status={partial|blocked} and stop. No phase advances on prose.results.baseline and the per-phase results the spawned agent would have written. The artifact remains the source of truth; do not rely on conversation narrative.integration-verifier: the router itself applies the integration-verifier's checks (run the scenarios, capture Expected/Actual evidence per scenario, reconcile SCENARIOS_TOTAL/PASSED/FAILED, and honor the REVERT authority) and writes the same scenario-accounting into the artifact that §8 post-agent validation would parse. The point is to lose the subagent, not the verification — incomplete or contradictory evidence still sets quality.convergence_state=needs_iteration and stops on the remediation gate.The cost — be disciplined about it: inline mode forfeits fresh-context isolation. The router now carries the build, review, and verify context in one session, so context can bleed across phases (the very pollution subagents prevent). Counter it: between phases, re-ground from the workflow artifact rather than from earlier turns; include only the current-phase objective and live evidence when reasoning about a phase; treat completed-phase narrative as stale. If the session context grows large enough to threaten this discipline, prefer returning to subagent dispatch over pushing further inline.
Mode bookkeeping: persist execution_mode="inline_fallback" and inline_fallback_reason={primitive_unavailable|tightly_coupled} in the workflow artifact, and log an event=inline_fallback_entered entry in .cc10x/workflows/{wf}.events.jsonl. If the primitive becomes available again and the remaining work is separable, the router MAY resume default subagent dispatch for later phases; log event=inline_fallback_exited.
The memory task executes inline only. Never spawn it as a sub-agent.
The memory task:
activeContext.md ## Learningspatterns.md ## Common Gotchasprogress.md ## Verification[Deferred]: ... under patterns.md ## Common Gotchas.progress.md ## Tasks with the active workflow snapshot.progress.md ## Completed.[cc10x-internal] memory_task_id line from activeContext.md ## References.activeContext.md for this wf: reached 3+ [DEBUG-N]: entries before resolving, OR (b) the reviewer/hunter blast-radius scan touched 3+ files with the same defect pattern, OR (c) the winning fix contradicts a documented assumption in patterns.md. If any condition is true, write docs/solutions/{category}/{slug}.md using the format in cc10x:memory-and-handoff (Problem / What Didn't Work / Solution / Why / Prevention), then reference it from activeContext.md ## Learnings. If none apply, skip — do not create a solution doc for mechanical fixes.For PLAN:
- Plan: {plan_file} remains correct in activeContext.md ## References.- Design: {design_file} remains correct in activeContext.md ## References when a design exists.Plan saved: {plan_file} in activeContext.md ## Recent Changes.activeContext.md ## Next Steps to 1. Execute plan: {plan_file} unless the workflow ended in clarification-needed state.For DEBUG:
[DEBUG-RESET: wf:{workflow_uuid}] section in ## Recent Changes and summarize the final result beneath it.wf:, kind:, origin:, phase:, or scope: can answer the question.CC10X TODO: tasks. Non-blocking discoveries go into **Deferred:** memory notes.DIFF_DRIVEN_DOCS: skip in Session Settings disables doc-syncer for projects that manage documentation separately; when present, skip build-doc-sync task creation and block Memory Update on verifier_task_id directly.[cc10x-internal] markers, status_history, other agents' results.* entries). The workflow artifact itself is dispatch-readable BY REFERENCE: an agent may read the artifact path handed to it in the scaffold, but only the sections its dispatch names (intent, normalized_phases, its own phase's results/evidence/baseline) — cross-agent orchestration knowledge still flows exclusively through router-mediated scaffolds. Reading a shared pattern/reference doc for domain guidance is fine; inheriting another agent's live state is not.plan_file and run the fresh-review gate over it rather than rejecting it outright.keep as-is option. Both offers are skipped for build_scope=trivial. See references/build-workflow.md ### BUILD-DONE finishing (optional) for the canonical wording.phase_exit_gate, the TDD/verifier chain, the complexity gradient's trivial→full escalation, or any governing workflow. Terseness lowers ceremony, never rigor. Treat "just"/"quickly"/"simply" as urgency cues, not as permission to skip routing or gates.references/build-workflow.md, references/debug-workflow.md, references/review-workflow.md, references/plan-workflow.md) tells you HOW to ask and what readiness it needs; do not freelance clarifying questions or broad exploration ahead of loading it.Optional, cost-bearing capabilities (worktree isolation, research accelerators / web+github researchers, the BUILD-DONE finishing menu) are offered under restraint:
npx claudepluginhub romiluz13/cc10x --plugin cc10xMandatory workflow router invoked before any code edits, debugging, planning, or review. Runs entry sequence including token efficiency and routes to the correct skill for the task.
Auto-loop execution workflow with quality gates. Use when starting any non-trivial implementation task. Provides automatic task decomposition, code implementation, testing (L1-L4), and iterative quality gates until completion. Invoke with /autoworker.
Orchestrates multi-phase project execution by dispatching isolated persona agents for planning, execution, verification, integration, and review.