Repository navigation
Commit 3d498be
fix: agent_persona hook silently drops hyphen-less skill names like docker
_SKILL_TOKEN_RE required at least one hyphen in every skill token
(quantifier was '+', one-or-more), so single-word skill names such as
'docker' and 'kubernetes' -- both real, currently-shipping skills in
claude-global-library -- were silently dropped from the parsed
declared-skills list even when present verbatim in a persona block's
skills: field. This caused the PreToolUse hook to HARD BLOCK correct
Agent/Task dispatches with a misleading "missing: docker" message.
Fix: change the quantifier to '*' (zero-or-more) so a bare hyphen-less
word still matches. The regex is only ever applied to the already-
isolated skills: field value, so the broadened match carries no risk of
picking up unrelated words elsewhere in a dispatch prompt.
Added a regression test class (TestHyphenLessSkillNamesAreNotDropped)
covering token extraction and the full dispatch-allow/dispatch-block
paths for a hyphen-less mandatory skill, since none of the existing 38
tests exercised this case -- which is exactly how the bug shipped
unnoticed.
Fixes #314.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZrJrDJYy6x6bJFvQrpuJi1 parent c82ee38 commit 3d498be
2 files changed
Lines changed: 58 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
298 | 305 | | |
299 | 306 | | |
300 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
301 | 349 | | |
302 | 350 | | |
303 | 351 | | |
| |||
0 commit comments