SKILL.md
agent-contracts Routing Tuning
Use this skill when you are designing or debugging routing behavior (rule matches vs LLM selection).
Routing Model (what to optimize)
- Rule filtering via
TriggerCondition(when/when_not, priority) - Candidate selection (top matches + ties)
- Optional LLM decision among candidates (with
llm_hint) - Fallbacks and terminal states (
response.response_type)
Practical Tuning Steps
- Make rule-based selection deterministic first (LLM off).
- Use priorities to express business rules (100+ = critical, 50-99 = main, 1-49 = fallback).
- Add
llm_hintonly where ambiguity remains after rules. - Use
context_builderonly when needed; keep default minimal slices. - Debug with
decidewithtrace()and inspect matched rules.
Guardrails
- Prefer rules for safety/constraints; use LLM for ambiguous intent.
- Keep candidate sets small and explainable.
- Treat
response.response_typeterminal values as part of routing design.
References (load only when needed)
docs/core_concepts.md(Traceable Routing / Context Builder)examples/02routingexplain.pydocs/skills/official/agent-contracts-routing-tuning/references/debug_playbook.md