Make agents load the matching skill before they edit the files it covers
Categories
(Developer Infrastructure :: AI for Development, task)
Tracking
(Not tracked)
People
(Reporter: dao, Assigned: dao)
References
(Blocks 2 open bugs)
Details
(Keywords: leave-open)
Attachments
(4 external files, 1 obsolete file)
A skill's description does not reliably get it loaded before an edit it covers: an agent that judges the edit simple skips the skill. One agent deleted a line from button.tokens.json without desktop-theme-tokens, missed New Tab's _tokens.scss until the build rewrote it, and was value-neutral only by luck.
Proposal: one generic PreToolUse hook in .claude/settings.json on Edit|Write, reading a table of path patterns and skill names. On a matching edit it checks the session transcript for a load of that skill and, if there is none, denies the edit with a reason naming the skill. Later edits pass. Each skill family adds its row on its own bug; the first sends *.tokens.json, the generated tokens-*.css and New Tab's _tokens.scss to desktop-theme-tokens.
In a trial of fresh sessions on tasks that reach a token edit midway, the current description let the edit come first once in 15 runs; with the hook none did, and its one denial sent the agent to the skill before it returned to the file.
The hook reaches Claude Code only, fires at edit time and not during review.
| Assignee | ||
Comment 1•12 days ago
|
||
Updated•12 days ago
|
| Assignee | ||
Updated•12 days ago
|
Updated•12 days ago
|
| Assignee | ||
Comment 2•3 days ago
|
||
In a trial of fresh Opus sessions, the parent's description loaded a theme skill on as many theme reviews, open theme bugs and screenshot requests as the four subject descriptions did, and on none of the non-theme bugs. It saves about 1,100 bytes of skill descriptions in every session. Harnesses reading .agents/skills ignore skillOverrides and still list the subject descriptions.
| Assignee | ||
Comment 3•3 days ago
|
||
A Bash command counts as an edit of the files it visibly writes (a redirection, tee, sed -i, perl -i, cp, mv); a script that writes a file itself, or a cd earlier in the command, gets through unchecked.
| Assignee | ||
Comment 4•3 days ago
|
||
Updated•2 days ago
|
| Assignee | ||
Comment 5•2 days ago
|
||
Telling agents when to run ./mach lint is left for bug 2094532.
| Assignee | ||
Updated•2 days ago
|
Comment 7•1 day ago
|
||
| bugherder | ||
Description
•