🎨 Cc10x Router

2installs

This skill executes cc10x router workflows by detecting intent, loading memory, and continuously updating state to complete tasks.

QUICK INSTALL
npx playbooks add skill romiluz13/cc10x --skill cc10x-router

Cc10x Router instructions

cc10x Router

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.

1. Intent Routing

A keyword hit only NOMINATES a row; the request's primary deliverable DECIDES the route (e.g. "triage incoming issues" contains issue but its deliverable is triage, so it routes TRIAGE, not DEBUG). When the primary-deliverable test genuinely holds for more than one row, the lower Priority number wins. The QA, ORIENT, and REVIEW cases below are applications of this test, not exceptions to it.

| 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 | QA | test, QA, e2e, end-to-end, integration test, test plan, test coverage, regression, smoke test, "verify my feature", "prove it works" | QA | qa-researcher (fan-out) → qa-plan → plan-gap-reviewer → qa-preflight → qa-harness-builder → [code-reviewer ‖ failure-hunter] → qa-executor |
| 6 | TRIAGE | triage, "incoming issues", "look at #", "triage #" | TRIAGE | triage-agent → optional exploration → agent-ready brief |
| 7 | CODEBASE-HEALTH | "codebase health", "improve architecture", "deepening", "ball of mud", "shallow modules", "architecture audit" | CODEBASE-HEALTH | architecture-scanner → HTML report → human picks → exploration (grilling) → feeds PLAN |
| 8 | DEFAULT | Everything else | BUILD | component-builder → [code-reviewer ‖ failure-hunter] → integration-verifier |

Rules:

  • Planning runs through the CC10x PLAN workflow so it gains orchestration state, workflow artifacts, intent contracts, and the bounded fresh review. Native plan mode (EnterPlanMode) is not a substitute for that, but it is not forbidden: if the user invokes it, treat the plan it produces as an input the PLAN workflow ingests (record it as the 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.
  • ERROR always wins over BUILD, but route on the PRIMARY DELIVERABLE, not the first keyword hit: "add a dark-mode toggle and fix the button alignment" is a BUILD whose scope includes a small fix, not a DEBUG. Use DEBUG when diagnosing/repairing broken behavior IS the deliverable; use BUILD when the deliverable is new/changed functionality that happens to mention fixing something along the way.
  • REVIEW is advisory only. Never let REVIEW create code-changing tasks.
  • ORIENT is read-only and advisory. It precedes DEFAULT/BUILD: a "help me understand this code" request must never fall through to BUILD and spawn a write builder. ORIENT spawns NO write agents and creates NO phase graph. If the user follows an orientation with a change request, re-route the new request (BUILD/DEBUG/PLAN) from scratch.
  • QA is entered when testing the code is the deliverable — designing, building, and running integration tests, backend E2E across services, and simulated manual QA in the UI. Disambiguation, in order: DEBUG beats QA ("the E2E test is failing" → repairing broken behavior is the deliverable); QA beats BUILD ("write E2E tests for checkout" → QA designs a test system for code that already exists, whereas BUILD's inner TDD writes unit tests for code being written); QA over REVIEW: the deliverable test separates them, so the tie-break never applies — "prove it works" is QA, "tell me what's wrong with it" is REVIEW ("audit coverage and fill the gaps" → QA; "is our suite any good?" → REVIEW). QA never edits product code — it reports defects and may OFFER a DEBUG follow-up, exactly as REVIEW may offer BUILD. BUILD's TDD contract is untouched; QA is the outer confidence ring over it.
  • TRIAGE is advisory-only. It categorizes, verifies, and writes agent-ready briefs for incoming issues/PRs. It never writes code. A triaged issue routes to BUILD or DEBUG only on a fresh user request — TRIAGE never auto-routes into a code-writing workflow. Category and wontfix decisions are high-blast-radius: stop for human input (do not auto-decide). Primary-deliverable rule: TRIAGE applies only when triage/categorization/briefing IS the deliverable (the request contains triage or incoming issues or look at # / triage #). A request that mentions a bug/issue/feature but asks to implement/fix/change it is BUILD or DEBUG — the primary deliverable is the change, not the triage. Do not route to TRIAGE unless the user explicitly asks to triage.
  • CODEBASE-HEALTH is advisory-only upkeep. It surfaces deepening candidates and grills the chosen one. It never writes code. A chosen candidate routes to PLAN only on a fresh user request. The scanner writes a single HTML report to the OS temp dir (not the repo). Primary-deliverable rule: CODEBASE-HEALTH applies only when discovery/advice IS the deliverable (the request contains codebase health, improve architecture, deepening, ball of mud, shallow modules, or architecture audit). A request that asks to refactor/fix/change specific code is BUILD — the primary deliverable is the change, not the audit.
  • BUILD uses a complexity gradient (see 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.
  • Before execution, output one line: -> {WORKFLOW} workflow (signals: {matched keywords})

ORIENT move (read-only)

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 NEW workflow artifact, no phase graph, no write agents. (Edge case: if an artifact was pre-created before routing resolved — §2a permits early creation with workflow_type: pending — set its workflow_type to ORIENT and phase_cursor to orient, record the close in status_history, and create no phase graph. That is the only reason ORIENT/orient appear in the artifact enums.)

Orientation procedure:

  1. Map the relevant modules/files for the named subject (use Glob / Grep to locate, Read only the slices needed to explain). Octocode local tools (localViewStructure, localSearchCode), when mounted, are optional accelerators.
  2. Trace ONE layer up: callers and dependents of the focal symbols via the LSP tool (incomingCalls, findReferences) where a language server is configured, else Grep; locate the exact line and column with Grep before any LSP call. Octocode lspCallHierarchy is an optional accelerator.
  3. Explain in the project's OWN vocabulary (names, terms, domain glossary from the code), not generic CS abstractions.
  4. Stop at understanding. Do not propose or apply edits. If a change is clearly implied, end by offering to route it (BUILD/DEBUG/PLAN) — do not start it.

Distinguish from REVIEW: REVIEW judges quality ("is this good", audit); ORIENT only explains structure and flow. The deliverable decides: "help me understand" is ORIENT, "tell me what's wrong" is REVIEW; only a genuine tie goes to REVIEW (lower number).

2. Memory Load And Template Validation

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 — the reads assume the directory exists.

If a memory file is missing:

  • Create it using the cc10x:memory-and-handoff 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 AskUserQuestion gates to the recommended option EXCEPT: REVERT, failure-stop gates, destructive finishing options (auto-pick Keep as-is; never merge/push/discard), drop-work confirmations (the §14 drop-work rule and Discard's typed discard), and plans with unresolved Open Decisions (BUILD may not start). A JUST_GO auto-answer is never the user's agreement. Log each auto-choice in ## Decisions.

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

Core law:

  • Durable router state lives under .cc10x/workflows/{workflow_uuid}.json
  • Companion event log lives under .cc10x/workflows/{workflow_uuid}.events.jsonl
  • Router-owned gates still include plan_trust_gate, phase_exit_gate, failure_stop_gate, memory_sync_gate, and skill_precedence_gate

Mandatory reference read:

  • Before workflow creation, artifact mutation, hook policy changes, or resume logic that depends on artifact fields, immediately read references/workflow-artifact-and-hook-policy.md.
  • That reference contains the verbatim artifact schema, event log contract, hook policy, and gate wording extracted from the prior router monolith.

Plugin root for commands in reference files: ${CLAUDE_PLUGIN_ROOT}; Claude Code substitutes it when this skill loads, but reference files read through Read arrive with the placeholder literal. When a reference command carries the plugin-root placeholder, build the absolute path from the value on this line; never run the placeholder as-is.

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|failure-hunter|integration-verifier|planner|qa-harness-builder|qa-executor}
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|plan-review-amendment|qa|qa-research|qa-plan|qa-plan-review|qa-re-plan|qa-plan-review-2|qa-preflight|qa-build|qa-review|qa-hunt|qa-execute|memory-finalize|re-review|re-hunt|re-verify|re-plan|re-qa-build|re-qa-execute|research-web|research-github|triage|codebase-health}
plan:{path|N/A}
scope:{ALL_ISSUES|CRITICAL_ONLY|N/A|{source}|code:{repo}}
reason:{short reason or N/A}

Rules:

  • ALL SEVEN metadata lines (wf:, kind:, origin:, phase:, plan:, scope:, reason:) are present on EVERY CC10X task — use N/A where a field does not apply. 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."
  • Router must generate workflow_uuid before TaskCreate() and use it from the first write.
  • 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.
  • The router must never depend on loose prose when metadata can answer the question.

4. Resume And Hydration

After memory load:

TaskList()

Task tools are optional. Claude Code ships TaskCreate/TaskList/TaskGet/TaskUpdate by default only on some models; the Agent tool is a separate primitive and stays available without them. The workflow artifact is the source of truth and task metadata mirrors it. When the Task tools are absent, do not fail and do not run inline: use ARTIFACT-ONLY GRAPH MODE. Phase state, task ids and ordering are tracked in the artifact (task_ids, phase_status, phase_cursor, results) and the events log; every agent is still dispatched through the Agent tool with fresh context; validation and every gate apply as written; completion is recorded by the router in the artifact, because no agent holds TaskUpdate or is told to call it (the router completes every task after contract validation). The inline no-subagent fallback (§12) applies only when the Agent/dispatch primitive itself is unavailable. CLAUDE_CODE_ENABLE_TODO_TOOLS=1 restores the tools on every model (recommended); CLAUDE_CODE_TASK_LIST_ID shares one task list across sessions (optional).

Hydration rules:

  • Find active parent workflow tasks by subject prefix CC10X BUILD:, CC10X DEBUG:, CC10X REVIEW:, CC10X PLAN:, CC10X QA:. TRIAGE and CODEBASE-HEALTH create no parent task: find them by CC10X triage-agent: / CC10X architecture-scanner: or the pending CC10X Memory Update: task, scoped by wf:; a paused workflow has no Memory Update task yet, and its artifact pending_gate names the open question. In Task-tools mode, when no such task is found for an advisory route, fall back to the non-terminal artifacts that carry a pending_gate and have workflow_type TRIAGE or CODEBASE-HEALTH (they have no parent task). ORIENT creates no task.
  • 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 .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]
  • 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:

  1. If .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.
  2. Identify the active parent workflow, dropping every terminal workflow first (Terminal test below).
  3. Extract workflow_uuid from the wf: line.
  4. Read all CC10X tasks whose descriptions contain that wf:.
  5. Derive runnable tasks from status and blockedBy.
  6. Reconstruct the memory task as the unique pending/in_progress kind:memory task in the same wf:.
  7. Artifact-only resume (no Task tools; replaces steps 1 and 3-5): (a) list .cc10x/workflows/.json, drop the terminal ones, and keep the artifacts whose workflow_uuid the user named or whose user_request matches the current conversation, never by modification time alone; one match resumes it, more than one, ask which; when none matches, look up the paused workflow a bare reply answers: the candidates are the non-terminal artifacts with a non-null pending_gate (the wf the step 0 hint names counts when its artifact is non-terminal and has one); exactly one candidate means the reply is the answer to its pending_gate, more than one, ask which (list each gate name and user_request), none starts a new workflow (say so); (b) read pending_gate first and answer it, then phase_cursor, phase_status and results; (c) a graph step is complete only if the events log holds a result_persisted event for its agent and task phase with details.phase_id equal to the current phase_cursor, appended after the latest phase_started or remediation_created event for that phase_id (file order decides; the workflow start event is the boundary when neither exists, and after a remediation_created the current graph is the remediation graph: REM-FIX, re-review, re-hunt, re-verify (REM-FIX is the component-builder step with the originating task phase; a pending original verifier that has not run takes the re-verify slot and keeps its task phase; doc-sync follows the verifier on the BUILD route as usual)); results. holds only the latest value and never proves a step done; null, missing and N/A phase_id values compare equal (a BUILD with no plan phases has a null phase_cursor); a result_persisted whose decision is NEEDS_INFO or NEEDS_GRILLING is the pause of a pass that a second pass of the same agent and task phase follows, so it does not complete its step and only a terminal-status result does (CANDIDATES_FOUND completes the scanner step: no second pass follows and pending_gate carries the pause); the next step is the first step of that route's graph that is not complete, and a partial or blocked step is re-entered only through its remediation or clarification gate.
  8. QA workflows, before the next dispatch: apply references/qa-workflow.md step 2a's resume and legacy bullets and step 0c's resume bullet, and fill every QA dispatch's Denied reads: line from intent.constraints at dispatch.

Terminal test: a workflow is terminal when its events log or status_history holds memory_finalized, workflow_completed or workflow_failed, or its phase_cursor is memory-finalize and completed. Pending gate (both modes): if a non-terminal artifact carries pending_gate, read it first; the user's reply answers it, and the router CLEARS it (sets null and records the answer in status_history in the user's exact words) once answered and also when the workflow reaches a terminal state.

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
  • Afte

Related Skills

Get the best new skills
in your inbox

Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.