You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Skill catalog trigger-clause detection: generic verb branch can pick imperative prose over the real when-to-use sentence #4520
The one-line skill catalog added in #4456 keeps each description's when-to-use sentence when it cuts a long description. In packages/coding-agent/src/core/skills-prompt.ts, TRIGGER_CLAUSE (line 13) has a verb branch, (?:Use|Used|Read|Load|Invoke|Apply|Run|Call)\b[^.!?]{0,40}?\b(?:when|whenever|for|before|after|if|only)\b. It also matches ordinary imperative prose that is not a trigger, such as "Run the formatter for each package before tagging." Because the first match wins, a misfire picks that sentence as the clause, and the real "Use when ..." sentence after it can be cut.
Measured on real skill libraries (86 descriptions with a trigger clause), the branch misfired 0 times. This is a latent precision gap, not an observed regression.
Reproduction (synthetic description, >100 skills so the one-line form is used)
Description: Formats the release notes for every package in the monorepo, grouping entries by section and linking pull requests. Run the formatter for each package before tagging. Use when the user asks to draft or fix release notes.
Rendered line:
- notes [r0]: Formats the release notes for every package in the monorepo, grouping entries by section and linking pull… Run the formatter for each package before tagging.
The catalog keeps "Run the formatter for each package before tagging." as the trigger, and the actual "Use when the user asks to draft or fix release notes." is cut.
Expected
The clause picked is the description's real when-to-use sentence. Explicit trigger forms (Use when/for/whenever, MUST USE, USE ONLY WHEN, This skill should be used, Triggers:) should rank above the generic verb branch. For example, try the explicit forms first and fall back to the verb branch only when none match, or restrict the verb branch to when|whenever|before|after|if directly after a short object.
Acceptance criteria
A table-driven test with imperative-prose decoys (Run ... for ..., Load ... before ..., Call ... if ...) placed before a real Use when sentence, asserting the real sentence is the one kept.
Activity
code-yeongyu commentedon Oct 29, 2026
Fixed by #4567, merged as 46641be.
Evidence at head 9338dd4: