Scale-Adaptive Routing
Automatically classifies task complexity based on domain keywords.
Internal sub-skill of Phase 0 (Orient). Not user-invocable directly — invoked by the orchestrator during task classification.
Purpose
Replace subjective orchestrator judgment with deterministic, auditable domain-based routing. A fintech auth change should auto-classify as COMPLEX without human intervention.
How It Works
- Input: User task description (string)
- Layer 0: Match keywords from
data/domain-complexity.csv
- Layer 1: Analyze task content — classify type and extract mentioned files/modules (load
references/multi-layer-detection.md)
- Layer 2: Check project context — files present, directory structure, recent git changes
- Layer 3: Score confidence per domain (HIGH ≥70, MEDIUM 40–69, LOW <40)
- Classify task type — map signals to one of:
bug_fix, feature, refactor, security, devops, docs, review, intake (load references/task-type-classification.md)
- Optional: Check
.cursor/product-areas.yaml if exists — merge area keywords and paths (see references/product-area-config.md)
- Output:
{domain, level, workflow, execution_tier, task_type, suggested_skill, confidence, product_area?}
- Fallback: No match → return
unknown, defer to manual classification
CSV Schema
| Column |
Values |
Purpose |
| domain |
snake_case identifier |
Domain name |
| signals |
comma-separated keywords |
Match against task description |
| level |
low, medium, high |
Complexity classification |
| workflow |
one-shot, standard, enhanced, advanced |
Workflow intensity |
| web_searches |
comma-separated topics |
Suggested research queries |
Routing Logic
| Level |
Execution Tier |
Gate 1 |
Workflow |
| low |
minimal |
Bypass eligible (one-shot) |
Minimal |
| medium |
standard |
Required |
Standard phases |
| high |
high-assurance |
Required |
Full phases + security |
Provider Boundary
This skill emits only task complexity, risk, workflow intensity, and scaffolding density. It does not select a model or name a provider. The active harness resolves any provider-specific model policy after this routing result is produced.
Usage
Called automatically by orchestrator at Phase 0. Not invoked directly by users.
Orchestrator Phase 0:
1. Run mk:scale-routing on task description
2. If match found → use returned level/workflow/execution_tier
3. If no match → fall back to manual classification
Extending
Users can add custom domains by editing data/domain-complexity.csv. Add a new row with domain keywords relevant to your project.
Gotchas
- Runtime dependency on
mk:autobuild/scripts/density-select.sh — if the autobuild workflow skill is removed or renamed, density selection breaks. The script is shared intentionally (single source of truth for density policy); treat it as load-bearing infrastructure, not a private harness internal.
- Multiple domains can match a single task (e.g., "fintech dashboard" matches both fintech and internal_tools) — use the HIGHEST complexity match
- CSV keyword matching is case-insensitive but signal order matters — first match wins for domain name
- Adding too many low-signal keywords (e.g., "data", "app") creates false positives — keep signals specific to the domain
- One-shot workflow bypass requires BOTH CSV match AND orchestrator zero-blast-radius confirmation — CSV alone is not sufficient
Output Schema (v2.0)
Base fields (v1.0):
| Field |
Values |
Description |
domain |
snake_case string |
Matched domain or unknown |
level |
low, medium, high |
Complexity classification |
workflow |
one-shot, standard, enhanced, advanced |
Workflow intensity |
execution_tier |
minimal, standard, high-assurance |
Provider-neutral execution intensity |
New fields (v2.0):
| Field |
Values |
Description |
task_type |
bug_fix, feature, refactor, security, devops, docs, review, intake |
Classified task type |
suggested_skill |
mk:fix, mk:cook, mk:cso, mk:review, mk:intake |
Recommended skill for this task |
confidence |
HIGH, MEDIUM, LOW |
Routing confidence from Layer 3 scoring |
product_area |
string |
Area name from .cursor/product-areas.yaml (omitted if no YAML) |
New fields (v2.1 — Phase 5 of harness plan, 260408):
| Field |
Values |
Description |
autobuild_density |
MINIMAL, FULL, LEAN |
Recommended scaffolding density for mk:autobuild runs (see Adaptive Density Policy below) |
Harness Density Selection (v2.1)
Used by mk:autobuild to choose how much scaffolding to apply per run. The decision rules:
level |
neutral baseline |
autobuild_density |
| low |
none |
MINIMAL |
| medium |
none |
FULL |
| high |
none |
FULL |
Override: MEOWKIT_AUTOBUILD_MODE=MINIMAL\|FULL\|LEAN env var, when set, overrides the auto-detected value. The override is logged in the autobuild run report for audit.
For scriptable density selection, callers may invoke .cursor/skills/autobuild/scripts/density-select.sh which echoes only the density token to stdout.
Data File
data/domain-complexity.csv — Domain → complexity → workflow mapping
Reference Files
references/multi-layer-detection.md — 4-layer detection logic and confidence scoring
references/task-type-classification.md — 8 task types, signals, and suggested skills
references/product-area-config.md — Optional .cursor/product-areas.yaml schema and loading rules
Cross-Skill Dependencies
.cursor/skills/autobuild/scripts/density-select.sh — Echoes autobuild_density token to stdout; used by autobuild when scriptable density selection is needed
1---2name: mk-scale-routing-33description: Domain-aware complexity routing: scans the task for domain keywords, matches domain-complexity.csv, and returns complexity level, workflow intensity, and execution tier. Extends Phase 0 orchestration.4---56# Scale-Adaptive Routing78Automatically classifies task complexity based on domain keywords.910> Internal sub-skill of Phase 0 (Orient). Not user-invocable directly — invoked by the orchestrator during task classification.1112## Purpose1314Replace subjective orchestrator judgment with deterministic, auditable domain-based routing. A fintech auth change should auto-classify as COMPLEX without human intervention.1516## How It Works17181. **Input:** User task description (string)192. **Layer 0:** Match keywords from `data/domain-complexity.csv`203. **Layer 1:** Analyze task content — classify type and extract mentioned files/modules (load `references/multi-layer-detection.md`)214. **Layer 2:** Check project context — files present, directory structure, recent git changes225. **Layer 3:** Score confidence per domain (HIGH ≥70, MEDIUM 40–69, LOW <40)236. **Classify task type** — map signals to one of: `bug_fix`, `feature`, `refactor`, `security`, `devops`, `docs`, `review`, `intake` (load `references/task-type-classification.md`)247. **Optional:** Check `.cursor/product-areas.yaml` if exists — merge area keywords and paths (see `references/product-area-config.md`)258. **Output:** `{domain, level, workflow, execution_tier, task_type, suggested_skill, confidence, product_area?}`269. **Fallback:** No match → return `unknown`, defer to manual classification2728## CSV Schema2930| Column | Values | Purpose |31|--------|--------|---------|32| domain | snake_case identifier | Domain name |33| signals | comma-separated keywords | Match against task description |34| level | low, medium, high | Complexity classification |35| workflow | one-shot, standard, enhanced, advanced | Workflow intensity |36| web_searches | comma-separated topics | Suggested research queries |3738## Routing Logic3940| Level | Execution Tier | Gate 1 | Workflow |41|-------|-----------|--------|---------|42| low | minimal | Bypass eligible (one-shot) | Minimal |43| medium | standard | Required | Standard phases |44| high | high-assurance | Required | Full phases + security |4546## Provider Boundary4748This skill emits only task complexity, risk, workflow intensity, and scaffolding density. It does not select a model or name a provider. The active harness resolves any provider-specific model policy after this routing result is produced.4950## Usage5152Called automatically by orchestrator at Phase 0. Not invoked directly by users.5354```55Orchestrator Phase 0:56 1. Run mk:scale-routing on task description57 2. If match found → use returned level/workflow/execution_tier58 3. If no match → fall back to manual classification59```6061## Extending6263Users can add custom domains by editing `data/domain-complexity.csv`. Add a new row with domain keywords relevant to your project.6465## Gotchas6667- **Runtime dependency on `mk:autobuild/scripts/density-select.sh`** — if the autobuild workflow skill is removed or renamed, density selection breaks. The script is shared intentionally (single source of truth for density policy); treat it as load-bearing infrastructure, not a private harness internal.68- Multiple domains can match a single task (e.g., "fintech dashboard" matches both fintech and internal_tools) — use the HIGHEST complexity match69- CSV keyword matching is case-insensitive but signal order matters — first match wins for domain name70- Adding too many low-signal keywords (e.g., "data", "app") creates false positives — keep signals specific to the domain71- One-shot workflow bypass requires BOTH CSV match AND orchestrator zero-blast-radius confirmation — CSV alone is not sufficient7273## Output Schema (v2.0)7475Base fields (v1.0):7677| Field | Values | Description |78|---|---|---|79| `domain` | snake_case string | Matched domain or `unknown` |80| `level` | low, medium, high | Complexity classification |81| `workflow` | one-shot, standard, enhanced, advanced | Workflow intensity |82| `execution_tier` | minimal, standard, high-assurance | Provider-neutral execution intensity |8384New fields (v2.0):8586| Field | Values | Description |87|---|---|---|88| `task_type` | bug_fix, feature, refactor, security, devops, docs, review, intake | Classified task type |89| `suggested_skill` | mk:fix, mk:cook, mk:cso, mk:review, mk:intake | Recommended skill for this task |90| `confidence` | HIGH, MEDIUM, LOW | Routing confidence from Layer 3 scoring |91| `product_area` | string | Area name from `.cursor/product-areas.yaml` (omitted if no YAML) |9293New fields (v2.1 — Phase 5 of harness plan, 260408):9495| Field | Values | Description |96|---|---|---|97| `autobuild_density` | `MINIMAL`, `FULL`, `LEAN` | Recommended scaffolding density for `mk:autobuild` runs (see Adaptive Density Policy below) |9899### Harness Density Selection (v2.1)100101Used by `mk:autobuild` to choose how much scaffolding to apply per run. The decision rules:102103| `level` | neutral baseline | `autobuild_density` |104|---|---|---|105| low | none | `MINIMAL` |106| medium | none | `FULL` |107| high | none | `FULL` |108109**Override:** `MEOWKIT_AUTOBUILD_MODE=MINIMAL\|FULL\|LEAN` env var, when set, overrides the auto-detected value. The override is logged in the autobuild run report for audit.110111For scriptable density selection, callers may invoke `.cursor/skills/autobuild/scripts/density-select.sh` which echoes only the density token to stdout.112113## Data File114115- `data/domain-complexity.csv` — Domain → complexity → workflow mapping116117## Reference Files118119- `references/multi-layer-detection.md` — 4-layer detection logic and confidence scoring120- `references/task-type-classification.md` — 8 task types, signals, and suggested skills121- `references/product-area-config.md` — Optional `.cursor/product-areas.yaml` schema and loading rules122123## Cross-Skill Dependencies124125- `.cursor/skills/autobuild/scripts/density-select.sh` — Echoes `autobuild_density` token to stdout; used by autobuild when scriptable density selection is needed