| name | context-routing |
| description | Determines minimal context and routes tasks to the correct prompts, agents and tools. |
| metadata | [object Object] |
Context Routing Skill
The context-routing skill applies deterministic rules to decide which files, prompts, skills and tools are necessary to answer a user request. Use this skill to minimise context loading and avoid hallucinations.
Steps
Load the manifest. Parse
ce.manifest.jsoncto build an index of available artifacts, their tags, inputs, outputs and dependencies. Validate that the manifest is well-formed.Analyse signals. Inspect the user’s request to detect intent, scope, risk and actionability signals (e.g. planning, implementation, review, debug). Use the routing rules documented in
.github/ce/routing-rules.mdto map signals to candidate targets.Select authoritative documents. Always include the core project documents (
PRODUCT.md,ARCHITECTURE.md,CONTRIBUTING.md) when relevant to the detected scope. Use tags and dependencies to decide which docs are required.Pick the primary prompt or skill. Based on the intent signal, select one prompt or skill whose tags match the intent (e.g.
planning→create-plan.prompt.md). Avoid loading multiple prompts for a single request.Resolve dependencies. For each selected artifact, load its
dependsOnfiles and artifacts. Ensure no more than the maximum configured in the manifest defaults (maxFilesToLoad) are included unless explicitly requested by the user.Return the route plan. Produce a list of target files, skills, prompts and tools to be loaded, along with a brief justification for each selection. If the plan includes any action that modifies files or executes commands, ensure that a validation task is also included.
Support debugging. When invoked via the
debug-routingprompt, explain why each artefact was selected and suggest any metadata or tag updates that would improve future routing.
This skill makes routing decisions transparent and reproducible, enabling precise control over the AI’s context window and improving answer quality.