How the router decides

Updated Oct 08, 2026

rust-router routes by the concrete problem at hand, not by the file being edited.

For borrow-sensitive ownership, API, async, or performance work, it first inspects rust-toolchain.toml, Cargo configuration, CI commands, and Polonius flags. Current nightly enables Polonius Alpha by default unless the project uses -Zpolonius=off; explicit next, off, or legacy selection wins. For dated nightlies, wrappers, or future stable compilers, the router uses a small compile canary rather than guessing from a channel name.

This is ambient context. A project using Alpha still routes ordinary ownership questions to rust-memory-and-state, async boundaries to rust-async-and-concurrency, and hot paths to rust-performance-and-layout. The migration skill is loaded only when adoption, NLL-residue auditing, or API evolution is itself the task.

For screen readers: The following flowchart shows the router establishing borrow-checker posture once as ambient context, then selecting a skill. Borrow-sensitive ownership, async, and performance questions go to the ordinary language skills, which consume that posture; only adoption, audit, and migration work reaches the migration skill.

Migration skill

Ordinary language skills

Borrow-sensitive ownership / async / performance

Borrow-sensitive ownership / async / performance

Borrow-sensitive ownership / async / performance

Polonius adoption, NLL workaround audits,
borrow-centric API migration

User invokes rust-router

Determine borrow-checker posture via polonius-alpha reference
(nll, polonius-alpha, polonius-legacy, unknown)

Identify concrete problem:
ownership/async/performance vs migration/adoption/audit

rust-memory-and-state

rust-async-and-concurrency

rust-performance-and-layout

nll-to-polonius

Figure 1: How the router establishes borrow-checker posture and selects a skill.

A short version of the decision table:

  • ownership, borrowing, aliasing, or interior mutability → rust-memory-and-state,
  • Polonius adoption, NLL workaround audits, borrow-checker-driven defensive clones, or borrow-centric API evolution → nll-to-polonius,
  • parser, codec, protocol, actor, or device lifecycle state; correlated flags, sentinel values, or typestate-versus-runtime-ADT choices → rust-state-machines,
  • trait bounds, generics, API shape, newtypes, or API-facing typestate → rust-types-and-apis,
  • error shape, panic boundary, or library-versus-binary handling → rust-errors,
  • unit-test fixtures, table tests, assertion helper refactors, snapshots, or serialized tests → rust-unit-testing,
  • dead_code, unused_imports, feature-gated reachability, or uncertain unused-item removal → rust-unused-code,
  • tasks, Send/Sync, blocking, channels, or cancellation → rust-async-and-concurrency,
  • allocation pressure, layout, or benchmark discipline → rust-performance-and-layout,
  • unsafe, FFI, layout guarantees, or soundness review → rust-unsafe-and-ffi,
  • crate boundaries, features, public surface, or layering → arch-crate-design,
  • dependency hygiene, cargo-vet, cargo-deny, SemVer guardrails → arch-supply-chain,
  • recording a hard-to-reverse architectural decision (Y-Statement) → arch-decision-records,
  • choosing a verification tool (Miri, proptest, cargo-mutants, loom, shuttle, turmoil, Kani, Verus) → rust-verification,
  • HTTP services, middleware, or request state → domain-web-services,
  • CLIs, workers, daemons, or long-running jobs → domain-cli-and-daemons,
  • no_std, firmware, devices, or edge nodes → domain-embedded-and-iot.

The router's pairing rules and escalation triggers live in its SKILL.md. The Polonius Alpha project-posture reference defines checker detection and the semantic boundary consumed by ordinary skills. The routing matrix covers the residual ambiguous cases.