Skip to content

refactor(scripts): simplify seven check- repository scripts - #14620

Merged
kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-14361-42613378860-1
Nov 9, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-14361-42613378860-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #14361

Summary

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

Simplified seven of the eight listed scripts without changing their output, exit codes, flags or written files. Removed a duplicate associative array, a loop flag that break 2 replaces, a one-use alias, a per-file array kept only to be counted, and a repeated path expression. The precompute gate now matches lines with bash [[ =~ ]] instead of starting one or two grep processes per line, using the same ERE patterns. The repeated indented-path loop in the stale-base gate is now one helper. scripts/check-spoke-plugin-root.sh was reviewed and left unchanged: nothing in it simplified without restructuring.

Not verified

  • The scripts' own suites (scripts/check-*.test.sh for the seven changed files) and shellcheck were not run here: this lane's Bash runs only the named wrappers. Left to the PR's CI.
  • Tidy was not run: every change is under scripts/, a shared path the tidy cutoffs exclude.
  • The reviewer noted one theoretical difference it did not test: GNU grep and the C library's regex matcher used by [[ =~ ]] could treat invalid UTF-8 bytes inside a !... precompute line differently, but only under a UTF-8 locale on a malformed SKILL.md.
  • scripts/check-skill-count-claims.sh line 94 still mentions an 'unmatched-mention report' in discover mode that the script does not have. It was left as is because this pass changes no behavior and kept edits to the simplifications.
  • ci-status green on the PR is checked by CI, not this run.

Fix

  • scripts/check-skill-count-claims.sh: int_to_word reads 'thirty' from the number_words table instead of a separate branch; the per-line matched flag is replaced by break 2 out of the form and subject loops.
  • scripts/check-skill-leaf-names.sh: dropped the collisions associative array, an exact copy of leaf_owners for colliding leaves; both loops read leaf_owners directly, and the comment explaining the indexed collision_leaves array was reworded to match.
  • scripts/check-skill-portability.sh: removed the one-use base alias and passed "$GE_REF" directly to gate_entry::collect_changed.
  • scripts/check-skill-precompute-compose.sh: replaced the line_has_git helper and the per-line grep -qE calls with [[ =~ ]] against INJECTION_RE and GIT_RE, which hold the same ERE patterns; renamed the git_count flag to has_git and flattened the nested ifs.
  • scripts/check-stale-base-overlap.sh: the two loops that print the indented overlapping paths are now one print_overlap helper.
  • scripts/check-standards-contract-bump.sh: the five repeats of ${rest%%/*} now use one plugin variable.
  • scripts/check-test-tmp-cleanup.sh: the *.test.sh path array, used only for its length, is now a counter like the JS one.

Verification

The runner ran each check from the base copy against 9a0f3aa:

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

The run reports:

  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changelog-fragments: All 8 changelog fragment(s) under .changes/ are valid.
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changed-skills: No changed skills under plugins/*/skills/ — nothing to gate.
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-affected: 10 passed, 6 skipped over 7 changed files.
  • Fresh-context review subagent over the whole diff against HEAD: no findings. It confirmed that number_words[30] is 'thirty', that break 2 reaches the same end state as the matched flag, that collisions[$leaf] was always leaf_owners[$leaf], that no sourced lib reads or clobbers a global…
  • Grep over scripts/*.test.sh: no test asserts on the changed source lines (line_has_git, collisions, matched, tracked).
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42613378860

Left out: the items under Not verified.

Related

#14361

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

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #14620 (head 9a0f3aa)

No security issues found.

I read every hunk in all 7 changed files under scripts/. None of them matches a trusted-path glob. None is a trust control, merge hold, token or kill-switch path, plugin manifest, or standing instruction. The changes are behavior-preserving refactors of repository check scripts:

  • check-skill-count-claims.sh:
    • int_to_word now reads number_words[30] from the table instead of a separate branch.
    • The matched flag is replaced by break 2, which leaves the form and subject loops the same way the flag did.
  • check-skill-leaf-names.sh: the duplicate collisions associative array is removed, and both loops read leaf_owners directly. The word-splitting is unchanged.
  • check-skill-portability.sh: the one-use base alias is removed. "$GE_REF" is still passed quoted.
  • check-skill-precompute-compose.sh: the grep -qE calls are replaced by [[ =~ ]] with the same ERE patterns, held in fixed constants and expanded unquoted on the right-hand side, which is correct for regex matching. The SKILL.md line is only matched, never evaluated, so no injection surface is added.
  • check-stale-base-overlap.sh: a print_overlap helper prints the indented paths to stderr. It reads the existing global overlap, and its output is unchanged.
  • check-standards-contract-bump.sh: the repeated ${rest%%/*} expression is now one plugin variable, used quoted in function arguments and in messages.
  • check-test-tmp-cleanup.sh: the path array that was only counted is now a counter.

No new command, path or template injection surface is introduced, and no secret or token handling changes. The PR context file holds no embedded directives.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

No findings. I read every hunk in all 7 changed files, along with the unchanged code they call, and checked each simplification against what the base branch does.

  • scripts/check-skill-count-claims.sh
    • number_words[30] is thirty (line 100), so folding n == 30 into the lookup branch prints the same text.
    • The form loop sits directly inside the subject loop, so break 2 gives the same result as the old matched=1; break followed by ((matched)) && break at the top of the subject loop. The continue paths in the form loop are unchanged, and claims_found and report still get one entry per line.
  • scripts/check-skill-leaf-names.sh
    • Wherever collisions[$leaf] was set, it was a copy of leaf_owners[$leaf].
    • Both readers loop only over collision_leaves, so reading leaf_owners there gives the same owner sets.
  • scripts/check-skill-portability.sh
    • Nothing else in the file reads base. Passing $GE_REF directly gives the same diff call.
  • scripts/check-skill-precompute-compose.sh
    • INJECTION_RE and GIT_RE are the same POSIX ERE patterns the old code gave to grep -qE, and [[ =~ $VAR ]] (unquoted) treats them as regexes.
    • The script runs set -uo pipefail without -e, so a [[ … ]] && has_git=1 that doesn't match cannot abort it.
    • The rule that a violation needs more than one injection line and git on one of them is unchanged.
    • The PR body raises a possible difference for invalid UTF-8 between grep and the C library regex. I did not test this; it is author-claimed and unverified.
  • scripts/check-stale-base-overlap.sh
    • print_overlap now skips empty lines in the release-notes branch, which the old inline loop there did not.
    • This cannot change output. comm -12 can only put out an empty line when both path lists are empty, and in that case overlap is empty after the trailing newline is stripped, so the script exits at the -z check first.
    • local path keeps the global path from being changed.
  • scripts/check-standards-contract-bump.sh
    • changelog_fragments::bump_delivered and the line-180 helper in scripts/lib/changelog-fragments.sh declare plugin and rest as local, so the new global plugin is not overwritten between its uses.
  • scripts/check-test-tmp-cleanup.sh
    • tracked was only ever counted, and the new counter prints the same number.

Closing issue #14361:

  • Behavior unchanged: met by my reading of the code above. These are behavior-preserving refactors, and the PR says no test asserts on the changed lines (author-claimed). As a result, a regression in equivalence would only show up through the scripts' existing output-level suites, which I could not run (no shell).
  • Diff limited to the listed files: met. All 7 changed files are on the issue's list, and scripts/check-spoke-plugin-root.sh was left unchanged.
  • Within 400 lines and 15 files: met.
  • ci-status green: left to CI; I did not verify it.

No embedded instructions were found in the PR context. There are no prior findings for this lane, and this was a full review, not a blocking-only one. No paid or prepaid spend is involved.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit a762969 Nov 9, 2026
49 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-14361-42613378860-1 branch November 9, 2026 13:30
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.

Simplify the check-skill-count-claims.sh, check-skill-leaf-names.sh, check-skill-portability.sh and 5 more repository scripts

1 participant