Skip to content

feat: add routing-focused eval support #166

Done

Description

@googs1025

Motivation

skill-up is good at evaluating whether an Agent completes a task correctly once a Skill is installed. For Skill development, another important question is whether the Skill should be triggered for a prompt at all.

Routing behavior matters because:

  • a Skill should trigger for intended prompts
  • it should not trigger for unrelated prompts
  • in multi-Skill environments, one Skill should not over-trigger or shadow another Skill

Proposed capability

A routing case could look like this:

id: route-code-review-positive
tag: routing

input:
  prompt: "Review this pull request and identify risks"

routing_expect:
  must_include: [code-review]
  allow_extra: false
  max_skills: 1

A negative case could look like this:

id: route-code-review-negative
tag: routing

input:
  prompt: "Write a poem about winter"

routing_expect:
  must_not_include: [code-review]

Possible semantics:

  • must_include: expected Skill names must be selected or loaded
  • must_not_include: listed Skills must not be selected or loaded
  • allow_extra: false: no other Skills should be triggered
  • max_skills: upper bound for triggered Skills

Why this matters

Without routing evals, a Skill can pass positive task cases but still be harmful in practice:

  • it may trigger too often
  • it may respond outside its intended scope
  • it may cause negative delta in multi-Skill setups

Initial small scope

To keep the first version manageable, this could start as:

  1. model routing cases as normal cases with tag: routing
  2. add a routing_expect schema
  3. support only engines that expose triggered/loaded Skill information
  4. return a clear skipped/unsupported result when routing info is unavailable

Open questions

  1. Do current agent adapters expose enough information to reliably identify which Skills were triggered?
  2. Should routing be a top-level suite type, or regular cases with tag: routing plus routing_expect?
  3. Should the first version support only single-Skill routing, leaving multi-Skill routing for later?

Activity

  1. zpzjzj commented on Aug 7, 2026

    @zpzjzj
    Collaborator

    The routing-eval goal is valuable, but I think there is an observability question that must be resolved before adding routing_expect: how can skill-up reliably know that an engine actually selected, loaded, or applied a Skill?

    These are different states:

    installed -> selected -> loaded -> applied -> outcome changed
    
    • installed: skill-up copied the Skill into the runtime. This is known, but it does not prove routing.
    • selected: the engine's router decided the Skill was relevant.
    • loaded: the engine read/invoked the complete Skill body.
    • applied: the model followed the Skill instructions. This is normally internal and cannot be directly observed.
    • outcome changed: a controlled with-Skill/without-Skill comparison shows a behavioral difference.

    The current SessionResult has transcript and output data, but no normalized Skill activation events. Adapter observability is also inconsistent: an engine may expose a structured Skill tool call, another may expose only command/MCP calls, and another may provide only the final response. Looking at an output that resembles the Skill's behavior is not sufficient evidence, because the base model may produce the same answer without loading the Skill.

    I suggest reversing the implementation order:

    1. Prove an observation source first

    Run a real canary for each candidate engine and determine whether it emits a stable, structured event containing the Skill identity, for example:

    {
      "type": "skill.loaded",
      "name": "code-review",
      "status": "success"
    }

    A generic Skill tool call plus a successful tool result may also be usable. Monitoring a SKILL.md file read is weaker evidence: it proves that a file was opened, not that the complete Skill was selected or followed.

    2. Normalize engine-native evidence

    If at least one engine exposes reliable evidence, adapters could normalize it into something like:

    type SkillActivation struct {
        Name   string
        Event  string // selected, loaded, invoked
        Turn   int
        Source string // engine_event, tool_call
    }

    The engine should also expose an explicit capability indicating whether Skill activation events are supported.

    3. Reuse rule_based assertions

    Rather than introducing a separate case evaluation path immediately, routing can remain a normal case and use deterministic judge rules:

    tag: routing
    
    judge:
      type: rule_based
      success:
        - skill_activated:
            name: code-review
      failure:
        - skill_activated:
            name: unrelated-skill

    Aggregate constraints such as allow_extra or max_skills can be added after multi-Skill event reporting is proven. The tag should remain classification metadata rather than changing execution semantics.

    4. Do not silently pass unsupported engines

    When an engine does not expose reliable activation evidence, the result should be explicitly UNSUPPORTED or ERROR, not silently treated as PASS. Defaulting to SKIP can create false-green CI; skipping should require an explicit opt-in.

    Even with a reliable load event, “applied” cannot be proven by that event alone. The strongest practical evidence is a combination of:

    1. an engine-native Skill activation/load event,
    2. behavior assertions showing the expected Skill-specific outcome, and
    3. repeated with-Skill/without-Skill benchmark deltas to reduce model nondeterminism.

    So my recommendation is to keep this issue, but make the first milestone an engine capability investigation and real canary. The final routing_expect or skill_activated schema should be designed only after we know which engines provide trustworthy evidence and what those events actually mean.

  2. googs1025 commented on Aug 8, 2026

    @googs1025
    ContributorAuthor

    Thanks for the detailed feedback. I agree that we should resolve the observability problem before introducing routing_expect.

    The distinction between installed -> selected -> loaded -> applied -> outcome changed makes sense. In particular, installed Skills are not enough evidence for routing, and matching the final output is also too weak because the base model may produce the same behavior without loading the Skill.

    I think we can split this into two milestones:

    1. Capability investigation / canary

      • Run a small routing canary for each candidate engine.
      • Check whether the engine exposes stable evidence for Skill activation, such as selected, loaded, or tool-call based invocation.
      • Document what each engine can and cannot reliably report.
    2. Normalized activation evidence

      • If at least one engine exposes reliable evidence, add a normalized adapter-level structure, for example:
      type SkillActivation struct {
          Name   string
          Event  string // selected, loaded, invoked
          Turn   int
          Source string // engine_event, tool_call
      }
      • Add an explicit engine capability flag for Skill activation observability.
      • For unsupported engines, return UNSUPPORTED or ERROR rather than silently passing.

    For the first assertion API, reusing rule_based judge sounds like the right direction:

    tag: routing
    
    judge:
      type: rule_based
      success:
        - skill_activated:
            name: code-review
      failure:
        - skill_activated:
            name: unrelated-skill

    We can leave aggregate constraints like allow_extra and max_skills for a later milestone after multi-Skill activation reporting is proven.

    Would you prefer the first PR to focus only on the canary/capability investigation and documentation, or should it also introduce the normalized SkillActivation type and capability flag for adapters that can support it?

  3. zpzjzj commented on Aug 17, 2026

    @zpzjzj
    Collaborator

    I would prefer the first PR to focus only on the capability investigation and canary, without introducing SkillActivation, the capability flag, or a public assertion schema yet.

    The important constraint is that this should be an executable and repeatable investigation, not documentation based only on manual observation. We do not yet know whether similarly shaped events from different engines mean the same thing. For example, a Skill tool call may prove invoked, but not necessarily that the complete body was loaded or that its instructions were applied. Defining the normalized type first risks encoding a false equivalence between selected, loaded, and invoked.

    I suggest the first PR produce:

    • a pinned engine version and runtime for each canary;
    • positive, negative, and competing multi-Skill cases;
    • preserved raw native event fixtures;
    • a capability matrix recording the observed evidence and the strongest claim it supports;
    • repeated runs showing that the signal is stable;
    • a Skill-specific hidden action or verifier, so behavior is checked independently of final-text resemblance.

    The matrix should distinguish cases such as structured activation/invocation events, file-read-only evidence, and no observable evidence. It should also keep result semantics precise:

    • UNSUPPORTED: the engine does not expose a trustworthy activation signal;
    • ERROR: the engine claims/supports that signal, but collection or parsing failed;
    • SKIP: only when the eval explicitly opts into skipping unsupported engines.

    Once the canary proves at least one reliable observation source, a second PR can derive SkillActivation, the engine capability flag, and skill_activated rules from the actual event contracts. That keeps the first abstraction evidence-driven and avoids committing to a schema that the adapters cannot implement consistently.

  4. karanb192 commented on Nov 2, 2026

    @karanb192
    Contributor

    For what it is worth, routing can already be tested on claude_code with what exists today:

    1. skills: [], so nothing is installed and the agent picks from the skills already on the machine.
    2. A rule_based judge with tool_called: {name: Skill, args: {skill: <name>}} in success for "should route", or in failure for "should not route".

    This worked on 0.14.0 across seven cases. Two gaps showed up: it tests the user's real setup rather than a pinned one, and nothing in the report separates "did not route" from "routed but did the task badly" unless you split them into separate judges.

    One more trick that helped: setting skillListingMaxDescChars in the fixture's .claude/settings.json cuts each listed description short, which lets a Claude run approximate how clients that truncate descriptions (Codex, for example) see the list.

  5. Walternater commented on Nov 13, 2026

    @Walternater
    Contributor

    Following the first milestone from the earlier discussion: a real, repeatable engine canary, without introducing SkillActivation, a capability flag or skill_activated yet.

    PR: #402. It adds examples/routing-canary/ (two Skills with disjoint triggers, relevant / unrelated / competing cases that check marker files written by the Skill bodies, so green means applied rather than "the answer looked similar"), scripts/routing-canary/run.sh to run it per engine against a temp copy, and a report at docs/design/routing-canary.md.

    What the canary observed so far:

    Engine Native evidence Strongest claim
    claude_code 2.1.317 structured Skill tool call + paired result (Launching skill: <name>) invoked/loaded — engine-native, name-bearing
    codex 0.166.0 no Skill event; injected <skills_instructions> catalog, activation only visible as cat .../SKILL.md loaded (weaker); no engine-level selection signal
    opencode 1.19.0 not measured — engine refuses the local user-level V2 permission config —

    Both measured engines passed 3/3 by behavior evidence (markers) including the negative and competing cases, so the canary is not just "did anything happen" — but that is outcome, and the observability question is separate.

    Three confounders worth knowing before designing the normalized type:

    1. Engine-global Skill roots leak into the evaluation. Codex injected ~/.agents/skills (100+ unrelated Skills, including the user's own gstack/canary) into the same catalog as the canary Skills; CODEX_HOME isolates only part of its roots. Claude Code transcripts show shell exploration of ~/.claude/skills. Worth quarantining for any CI signal.
    2. The engines disagree on identity. Claude Code's Skill call uses the install directory name (skill), Codex's catalog uses the SKILL.md name (canary-routing) pointing at the same directory. A SkillActivation.Name cannot compare those strings directly (this is adjacent to a local_path skill is installed under its folder's name, not the name in SKILL.md #367/fix(agent): install a Skill under its declared name #393).
    3. Nested Skill directories register twice because skills[].path is copied recursively — my first fixture did that accidentally; the committed fixture keeps the Skills flat.

    I have kept the report explicit about what it does not prove (applied, with/without delta) and why Codex should be reported as unsupported rather than silently green for now. Happy to extend the matrix for OpenCode/docker in a follow-up once the shape here is agreed.

  6. moved this from Backlog to In progress in skill-up projecton Nov 24, 2026
  7. moved this from In progress to Done in skill-up projecton Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions