Skip to content

fix(skill-quality): track unquoted triggers in check 3 and drop check 12's single-quote rule - #12130

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-11965-41353325900-1
Nov 1, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-11965-41353325900-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #11965

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Check 3 of check-skill.sh now tracks unquoted triggers. It takes the first Use when clause of description and of when_to_use, up to the . or ; that ends it, splits it at commas, drops a leading or/and, and skips any item that holds a quote. Each item prints in single quotes, the same form as a quoted phrase, so quoting a formerly unquoted item does not read as a drop. With that coverage in place, check 12's 'Use when:' triggers are not single-quoted warning is removed. Both changes land together with a new test (9a) for a dropped unquoted item and a test (9a2) for quoting one.

B2, two attempts ranked on the session-flow trim-pilot diff (#12021, the #11954 pilot). I applied each candidate by hand to that commit's 16 description changes, read from the merged diff through WebFetch; neither checker was executed here.

  1. Attempt A, per-item tracking (shipped): 13 dropped-item warnings across 6 skills. Each names one intent the trim reworded or removed, for example 'a context-measuring mechanism says to fork' (handoff) and 'when the next step is unclear' (workflow). It also keeps clean-stop's 'stopping for the day', which went from quoted to unquoted, out of the drop list. The sibling-move exception still works because items compare line by line.
  2. Attempt B, whole-clause residue (the unquoted remainder of the clause as one phrase): one warning per changed skill on the same 6 skills. Each warning is a single long blob that also lists items the trim kept (for example the session is heavy in handoff), and a whole clause almost never reappears verbatim in a sibling, so the move exception never applies. Ranked second for coarser, less accurate warnings.

Issue #11954 (blocker) is closed via merged PR #12021 (merge commit 08e5938), and its trimmed session-flow descriptions are on this checkout.

Not verified

  • check-skill.test.sh was not executed: this lane runs no code from the checked tree, so the red-then-green run (tests 9 and 9a fail on main's checker and pass on this one) is left to the PR's CI
  • bash plugins/skill-quality/scripts/check-skill.sh plugins/session-flow/skills was not run with the changed checker, for the same reason; left to the PR's CI. Check 3 never fails a run and the change only removes a check 12 warning, so it cannot add a FAIL
  • The B2 ranking applies both candidates by hand to the #12021 diff as WebFetch rendered it, not by running either checker on that diff
  • Tidy pass 5 (ai-slop): the detector and digest-guard scripts are not among the wrappers this lane runs, so only a hand rubric read of the two markdown spots was done (no tells found); passes 1-4 ran, and pass 4 made one wording fix in the changelog fragment
  • Untracked runner files at the checkout root (.bash_profile, .bashrc, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) are not part of this change and were left untouched

Fix

  • plugins/skill-quality/scripts/check-skill.sh: new use_when_items (unquoted Use-when items, matched on a word boundary) and listing_triggers (quoted phrases plus those items, per field); fm_listing_triggers and CUR_TRIG use it, so check 3 compares both kinds against the base ref; check 12's n
  • plugins/skill-quality/scripts/check-skill.test.sh: test 9 now asserts an unquoted Use-when list passes with no Use-when warning; new test 9a asserts a dropped unquoted item warns naming only that item and exits 0; new test 9a2 asserts quoting a formerly unquoted item is not a drop
  • plugins/skill-quality/skills/check/SKILL.md: the check 3 gotcha now says check 3 tracks unquoted Use-when items, and drops the line about check 12 asking for quotes
  • .changes/skill-quality/work-resolve-issue-issue-11965-41353325900-1-da052a31.md: new minor fragment describing both changes

Verification

The runner ran each check from the base copy against fbe01f1:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-changelog-fragments: all 20 fragments valid
  • check-changed-skills: plugins/skill-quality/skills/check PASS, 0 errors (it runs the trusted main copy of check-skill.sh, so it still prints the old not-single-quoted warning)
  • check-affected: 12 passed, 6 skipped, 0 failed over 4 changed files (markdownlint fixed an MD038 finding in SKILL.md on an earlier run)
  • Grep for not single-quoted in plugins/skill-quality/scripts/check-skill.sh: no matches (done-when item 2's rg count is 0)
  • Fresh-context subagent review of the full diff: found that "x" vs 'x' made quoting an unquoted trigger read as a drop, and that use when matched inside words like because when; both fixed, with test 9a2 added for the first
  • read https: //github.com/melodic-software/claude-code-plugins/issues /11954: closed as completed by PR #12021; records the trim diff and the pilot's own two ranked probe attempts
  • read https: //github.com/melodic-software/claude-code-plugins/pull /12021: merged via the queue as commit 08e5938
  • read https: //github.com/melodic-software/claude-code-plugins/commit/08e5938772a273ceb64a237b3b801f2fba5e2707.diff: per-skill removed and added Use-when items of the 16 trimmed session-flow descriptions, used for the B2 ranking
  • read https: //patch-diff.githubusercontent.com/raw/melodic-software/claude-code-plugins/pull /12021.diff: lists the 16 changed session-flow SKILL.md description lines
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41353325900

Left out: the items under Not verified.

Related

#11965

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

claude-review reviewed fbe01f1318c4bb14903bf698130e81c84a1066d5: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings

I read every hunk of all 4 changed files:

  • check-skill.sh
  • check-skill.test.sh
  • skills/check/SKILL.md
  • the changelog fragment

For context I also read the code that uses the new triggers: check 3's base-ref comparison and sibling-move lookup in check-skill.sh (L1077-L1140), and skill_frontmatter::extract_triggers in skill-frontmatter.sh.

What the change does. A new use_when_items function pulls the unquoted items out of each field's first Use when clause. It prints each one as 'item', the same form extract_triggers prints, so the two can be compared. It folds contractions the same way extract_triggers does, and it skips any item that contains a quote. It runs on description and on when_to_use separately.

I traced these paths by reading the code:

  • Clause start. The text opens with a space and the match is [^a-z]use when, so substr(text, RSTART + 9) begins right after "use when". "because when" no longer matches.
  • Clause end. The trailing space added to the clause means a final . still ends it.
  • Comparison. sort -u on both sides keeps the comm -23 input ordered.
  • Sibling moves. Siblings go through the same fm_listing_triggers, so the grep -qxF check still works line by line.

Tests.

  • Test 9a: on main, an unquoted item is never tracked, so this test fails there and passes with this change.
  • Test 9a2: it uses the quote normalization, which extract_triggers alone would not have matched.
  • Test 9b: its assertion depends only on the warning check 12 keeps.

I reached these by reading, not by running the tests.

Closing issue #11965, Done when:

  • The test suite includes a case that warns on a dropped unquoted trigger: met by test 9a. The suite was not run here or by the lane (author-stated); it is left to CI.
  • rg -c "not single-quoted" on check-skill.sh returns 0: met. My search finds no match in check-skill.sh.
  • check-skill.sh plugins/session-flow/skills exits 0: not run, author-stated as unverified. Check 3 never fails a run (warn only), and check 12 only loses a warning, so the change cannot add a FAIL.
  • Both changes in the same PR, with a red-then-green test and the B2 ranking recorded: met. The PR body records the two ranked attempts. The B2 ranking comes from applying both attempts by hand, as the author says; nobody ran either checker on that diff.

Docs. No other doc left in the plugin still describes the old check 12 quoting rule; the only mention is a historical entry in CHANGELOG.md. The SKILL.md gotcha now describes the current rule, as .claude/rules/skill-bodies-state-current-rules.md requires.

Manifest. No plugin.json or marketplace.json changes. The fragment's bump: minor fits a change in what check 3 and check 12 report.

Prior findings: none (round 0 of 3). I saw no embedded instructions in the PR context.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

claude-security-review reviewed fbe01f1318c4bb14903bf698130e81c84a1066d5: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #12130

I found no security issues.

What changed. The pull request changes an advisory lint check in plugins/skill-quality/scripts/check-skill.sh:

  • Check 3 now also tracks the unquoted, comma-separated items of a skill's Use when clause. Before, it tracked only single-quoted trigger phrases.
  • Check 12 no longer warns when Use when triggers are not single-quoted.

The pull request also updates the test script, the check skill's Gotchas text and a changelog fragment.

What I checked

  • Trusted paths: none of the 4 changed files matches a TRUSTED PATHS: glob.
  • Trust controls: the diff touches no trust control. That means nothing changes in:
    • the trusted-trigger or trusted-actor checks
    • the lane token scope
    • the kill switch
    • the resolve-config signer
    • the merge holds
    • any action under .github/actions/
  • Injection and data flow:
    • The new use_when_items / listing_triggers functions read frontmatter text from stdin through sed and awk.
    • Values reach them as arguments to printf '%s\n', never as a format string or through eval.
    • The awk program is a fixed literal, and the text reaches it only as data (-v sq="'" is a constant). Nothing builds a command out of skill text, so I found no command or template injection path.
    • The output only feeds the comm/grep-style comparison and the warn messages.
  • Instruction-surface lens:
    • The SKILL.md edit changes how the Gotchas section describes check 3 and check 12.
    • Removing the check 12 warning drops an advisory style nudge. It is not a guardrail on any action in the instruction exception register's protected classes: no permission, credential, destructive-action or trust rule is removed.
    • Check 3 stays advisory and never fails a run, so neither change removes a FAIL gate.
  • Plugin manifests: the diff changes no plugin.json or marketplace.json.
  • Embedded text: the PR context file contains no directive aimed at the review lane.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head fbe01f1318c4bb14903bf698130e81c84a1066d5.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit 296af8d Nov 1, 2026
45 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-11965-41353325900-1 branch November 1, 2026 22:29
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 296af8dc44448df94013e41cb3c2bb8e0bb233fe; later checks count it verified from this comment.

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.

fix(skill-quality): track unquoted triggers in check 3 and drop check 12's single-quote rule

0 participants