Skip to content

Commit 5d45d61

Browse files
montjeffreyclaude
andcommitted
docs(router): reframe as a structured task resolver (proposal-only)
WP-5 of the ECC execution plan. docs/SKILL-ROUTER.md: retitled "Structured task resolver (proposal-only)". The opening now states plainly that the hook suggests <=3 skills per prompt and does not select, activate, switch profiles, or implement affaan-m#3037's `routed` disposition. Added a "Relationship to context profiles" section quoting affaan-m#3037's own contract verbatim (scripts/lib/context-profiles.js: "Selection modes are recorded intent; task routing and automatic switching are not implemented.") and its design doc's lane-table entry for this PR ("Future structured task resolver; selectionMode: 'auto' alone implements none of this"), then states input (the carrier's catalog, which after the carrier binds to the compiler is the compiler's routedIds) and output (suggestions only, no disposition changed). docs/PLUGIN-PROFILES.md: added a short cross-reference to the router under "The ecc-catalog Skill and On-Demand Content" -- it did not mention the router/resolver at all before this change (verified by grep; a discrepancy from the plan's assumption that it already did, recorded here since the correct fix is the same either way: add the reference). The header-comment reframing for scripts/hooks/skill-router.js and scripts/lib/skill-router.js landed in the previous commit (touches the same regions as that commit's JSDoc additions). tests/hooks/skill-router.test.js already carries the required "suggestion resolver output is suggestion-only" test (previous commit); it passed immediately (GREEN on first run), meaning it is a pin, not a fix -- the router never emitted selection/activation language and was already <=4 lines. See evidence/WP-5-pr-bodies.md and evidence/WP-5-rename-inventory.md for the drafted-but-unposted PR bodies and the task-resolver rename inventory (not applied; gated on a user decision per the plan). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MLu1Dhxs54ndeS3CTvSHSC
1 parent f8264d9 commit 5d45d61

2 files changed

Lines changed: 52 additions & 8 deletions

File tree

docs/PLUGIN-PROFILES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,12 @@ needs a skill outside the profile, the agent reads it from inside the plugin.
368368
Because on-demand content is copied at generation time, a carrier reflects the
369369
catalog as it was when generated. Regenerate after updating ECC.
370370

371+
An optional, opt-in **task resolver (suggestion hook)** can shorten the
372+
distance between a prompt and an on-demand entry: it scores the prompt
373+
against the carrier's catalog and suggests up to three matching skills by
374+
path. It never installs, activates, or switches anything — see
375+
[docs/SKILL-ROUTER.md](SKILL-ROUTER.md).
376+
371377
## Custom Selections
372378

373379
`plan` and `generate` accept the same selection vocabulary as the installer:

docs/SKILL-ROUTER.md

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1-
# Skill Router (opt-in)
1+
# Structured task resolver (proposal-only)
22

3-
A discovery affordance inside an already-selected carrier. It does not decide
4-
what a session can do; the carrier already did that.
3+
A `UserPromptSubmit` hook that **suggests** up to three skills per prompt into
4+
context. It does not select, activate, or switch profiles, and it does not
5+
implement the `routed` disposition #3037's context-profile compiler assigns
6+
to `routedIds` — that contract stays exactly what it says: "recorded intent;
7+
task routing and automatic switching are not implemented." This hook proposes
8+
candidates for a human or the model to act on; it commits to nothing on its
9+
own.
510

6-
A `UserPromptSubmit` hook scores each prompt against the catalog the carrier
7-
already holds and names up to three skills that look relevant. It **suggests;
8-
it never loads**. The model reads a skill because it decided to, from a path
9-
inside the plugin — the router only shortens the distance between "I need
10-
something" and "it is at `on-demand/<skill>/SKILL.md`".
11+
It is a discovery affordance inside an already-selected carrier. It does not
12+
decide what a session can do; the carrier already did that.
13+
14+
The hook scores each prompt against the catalog the carrier already holds and
15+
names up to three skills that look relevant. It **suggests; it never loads**.
16+
The model reads a skill because it decided to, from a path inside the plugin
17+
— the resolver only shortens the distance between "I need something" and "it
18+
is at `on-demand/<skill>/SKILL.md`".
1119

1220
That boundary is what makes the feature small enough to be worth having:
1321

@@ -25,6 +33,36 @@ That boundary is what makes the feature small enough to be worth having:
2533
The router changes what the model sees on every matching prompt, so it is a
2634
separate behavioral feature from profile carriers and is **off by default**.
2735

36+
## Relationship to context profiles
37+
38+
#3037's context-profile compiler (`scripts/lib/context-profiles.js`) assigns
39+
every catalog skill a disposition: `selected` (eager), `routed` (recorded as
40+
a candidate but not shipped), or `excluded`. Its own source is explicit about
41+
what that disposition does and does not mean:
42+
43+
> Selection modes are recorded intent; task routing and automatic switching
44+
> are not implemented.
45+
46+
and the design doc's own lane table names this hook directly:
47+
48+
> [#2945] Task routing and automatic-selection proposals — Future structured
49+
> task resolver; `selectionMode: "auto"` alone implements none of this
50+
51+
This hook is that "future structured task resolver," landing as a proposal
52+
step, not the routing #3037 explicitly does not implement:
53+
54+
- **Input**: the carrier's catalog — after the carrier binds to the compiler
55+
(WP-3), that catalog *is* the compiler's `routedIds` (plus the eagerly
56+
selected skills), copied into `on-demand/` and listed in the receipt.
57+
- **Output**: suggestions only, printed to stdout for the model to read. No
58+
disposition is changed, no profile is switched, no skill is activated —
59+
the compiler's `selected`/`routed`/`excluded` labels for a session are
60+
exactly what they were before this hook ran.
61+
62+
Closing the gap between "recorded intent" and actual task routing — a
63+
disposition that changes based on what this hook suggests — is future work,
64+
not something landed here.
65+
2866
## Enabling
2967

3068
```bash

0 commit comments

Comments
 (0)