Skip to content

model policy: a skill name in two folders T3 reads runs only when every copy agrees (#987 items 2, 5) - #1500

Merged
scuttletoby merged 1 commit into
mainfrom
fix/model-policy-same-name-skills
Nov 30, 2026
Merged

scuttletoby merged 1 commit into
mainfrom
fix/model-policy-same-name-skills

Conversation

@scuttletoby

Copy link
Copy Markdown
Owner

Part of #987 (item 5, plus the part of item 2 that covers the places T3 reads).

What changes

The model policy's Skill and slash-command check used to read the first copy of a skill that T3's skill list kept. Two gaps came from that:

  • Item 5: the list skips a SKILL.md it cannot read or parse and takes the next skill with that name. Claude Code may parse the skipped file and run it, so the check read a different file from the one that runs.
  • Item 2 (places T3 reads): T3's order (managed, then the config folder's, then the project's) has not been checked against Claude Code's own order, so Claude Code may run a different copy.

Now, for a skill name without a plugin prefix, the check looks in all three folders. When the name is in more than one of them, the check passes only if every copy can be read and runs the same model and effort (an alias and its full id count as the same). Otherwise it fails closed: enforce refuses and advise runs with a note. The refusal names each copy and what it runs, so a person can see which file to fix. A folder without a SKILL.md is not counted. All the code is in fork files (apps/server/src/fork/claudeAgentModelPolicy.ts). No upstream file changes.

Left on #987

  • Item 1: skills T3 does not read at all (bundled with Claude Code, MCP servers', .claude/commands, parent folders, --add-dir / --plugin-dir). They are still refused under enforce, as before.
  • Item 2, the rest: a same-name copy in one of those unread places. The fix needs the resolved skill from Claude Code.
  • Item 3: alias mapping per instance.
  • Item 6: the check reads the disk, but Claude Code runs the version it loaded.
  • Not scanned here: plugin skills (their names carry the plugin prefix) and launch-arg folders. The hook does not see the launch args.

Tests

apps/server/src/fork/claudeAgentModelPolicy.test.ts has a new case, "a name in two places T3 reads runs only when every copy reads the same", which fails on main:

  • These copies now pass: the same pick in two folders, an alias in one copy and its full id in the other, and a project folder without a SKILL.md.
  • These are now refused: copies that run different models, an inline copy with a forked copy, a copy T3's list drops for one it keeps (in the user or managed folder), and a project copy T3 cannot read behind a readable user copy.
  • The same checks run through the slash command and in advise.

Each mutant of the fix (the managed folder, scanning other copies, the "same" test, the name match) makes the test fail. vp run check:changed passes: format, lint, knip, typecheck and tests.

🤖 Generated with Claude Code

…ry copy agrees (#987)

The Skill check read the first copy T3's skill list keeps. The list passes
over a copy it cannot parse and takes the next one of that name, and
Claude Code's own order is not checked against T3's, so Claude Code could
run a copy the check never read.

Now a name found in more than one of the managed, config and project skill
folders is refused (enforce) or noted (advise) unless every copy reads and
runs the same model and effort. The refusal names each copy and what it
runs. Plugin skills (prefixed names) and launch-arg folders are not
scanned.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@scuttletoby scuttletoby added the fork:merge-ready Merge conveyor: lenses done, merge when green (PRs) label Nov 30, 2026
@scuttletoby
scuttletoby merged commit c49d994 into main Nov 30, 2026
33 checks passed
@scuttletoby
scuttletoby deleted the fix/model-policy-same-name-skills branch November 30, 2026 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork:merge-ready Merge conveyor: lenses done, merge when green (PRs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant