Skip to content

feat: slim skill context, add route --brief/--hook, and cut routing noise - #212

Merged
BrocksiNet merged 2 commits into
mainfrom
feat/slim-context-and-routing
Nov 25, 2026
Merged

BrocksiNet merged 2 commits into
mainfrom
feat/slim-context-and-routing

Conversation

@BrocksiNet

Copy link
Copy Markdown
Owner

Summary

Implements Handoff 02 (Phases 3, 2, and 4 of 2026-10-slim-skill-context.md) to fix silent non-activation, shrink always-on listing tokens, and cut router noise without losing recall.

Recommended Wave 1 merge order: #2 (after Handoff 01).

Changes

  • Phase 3 — route.mjs --brief and --hook (skills/sw-skill-router/scripts/route.mjs, tools/src/router-index.ts):
    • Enriched skills/sw-skill-router/index.json routes with active rule IDs and short titles from rules/catalog.json.
    • Added zero-dependency --brief output and worktree-safe --hook repeat suppression (state stored under git rev-parse --git-dir) with unit tests in tools/test/skill-router.test.ts.
    • Documented optional hook wiring and Claude Code skillOverrides ("name-only", explicitly paired with the hook) in docs/installation.md and use-cases/.
  • Phase 2 — Slim frontmatter descriptions (all 20 skills):
    • Total description chars: 11,863 → 7,039 (-40.7%); max description: 1,005 → 458 chars.
    • Preserved load-before-editing triggers and Do NOT use for ... boundaries; moved non-trigger prose into skill bodies/references.
  • Cut routing noise & split oversized files:
    • Split skills/sw-testing/references/test-shape-and-flags.md into test-assertions-and-shape.md and flags-stubs-and-reflection.md with narrow anchors.
    • Split oversized files in sw-php-foundation (references/data-shapes-and-types.md) and sw-plugin-development (references/upgrade-6-8-and-rector.md).
    • Updated rules/catalog.json, skills/sw-extension-review/routes.json, evals/routing/, and evals/routing-replay/.
  • Route table regex cap & context: fork note (tools/src/routes.ts):
    • Added hint support and capped rendered trigger token length in generated SKILL.md route tables (keeping full regexes in routes.json and index.json). Note: sw-extension-review/SKILL.md is roughly flat (12,293 → 12,287 bytes) as regex savings offset 3 newly split borrowed rows.
    • Documented context: fork strictly for self-contained review skills (sw-extension-review, sw-pr-review).

Metrics & Verification

  • replay-routes.ts --corpus evals/routing-replay: 76.9% recall (70/91), 84.7% mean recall/PR, 2.18 noisy refs/PR (down from 2.26), 3/3 hand labels selected
  • npm run mutate --prefix tools -- routing: 97.41% (threshold 95%)
  • bash scripts/validate-skills.sh — OK
  • bash scripts/run-activation-evals.sh — OK (dry)
  • tools: tsc -p ., oxlint --type-aware --deny-warnings, oxfmt --check ., npm test, api-index npm test — OK
  • bash evals/test-graders.sh — OK

Before marking ready

  • Run live activation evals (scripts/run-activation-evals.sh with a real agent) and a spot A/B (EVAL_TASKS=prepare-plugin-for-6-8,... bash scripts/eval-local.sh) to verify slimmer descriptions do not regress activations.

Made with Cursor

…oise

- Enrich sw-skill-router/index.json routes with active rule IDs and titles from rules/catalog.json
- Add zero-dependency --brief and worktree-safe --hook (repeat suppression) modes to route.mjs with unit tests and Claude Code hook + skillOverrides docs
- Tighten frontmatter descriptions across all 20 skills (11,863 -> 7,039 chars, -40.7%; max 1,005 -> 458 chars) while preserving load-before-editing triggers and Do NOT boundaries
- Split sw-testing/references/test-shape-and-flags.md into test-assertions-and-shape.md and flags-stubs-and-reflection.md with narrow anchors, plus split oversized sw-php-foundation and sw-plugin-development files
- Add route hint support and cap rendered trigger token length in SKILL.md route tables (97.41% routing mutation score) and document context: fork strictly for self-contained review skills

Co-authored-by: Cursor <cursoragent@cursor.com>
@BrocksiNet
BrocksiNet marked this pull request as ready for review November 25, 2026 14:19
Co-authored-by: Cursor <cursoragent@cursor.com>
@BrocksiNet
BrocksiNet merged commit 399063c into main Nov 25, 2026
11 checks passed
@BrocksiNet
BrocksiNet deleted the feat/slim-context-and-routing branch November 25, 2026 15:00
BrocksiNet added a commit that referenced this pull request Nov 25, 2026
BrocksiNet added a commit that referenced this pull request Nov 25, 2026
… and gate (#213)

* feat(evals): record diagnostic reference-read telemetry in A/B runner and gate

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(router): re-render index.json with sw-mcp-development rule titles

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(ab): use sw-assistant-style for zero-reference skill check after #212

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant