Skip to content

feat(code-tidying): accept target-scope forms to run tidying skills across repos - #17499

Open
melodic-automation-lanes[bot] wants to merge 4 commits into
mainfrom
work-resolve-issue/issue-17230-44405800674-1
Open

melodic-automation-lanes[bot] wants to merge 4 commits into
mainfrom
work-resolve-issue/issue-17230-44405800674-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #17230

Summary

Opened by the work-resolve-issue lane from work-resolve-issue/issue-17230-44405800674-1, which an earlier run left with commits and no report. A summary-only model pass read the branch's diff and the issue, changed nothing, and wrote:

The five listed code-tidying skills (audit-comment-residue, audit-dead-code, batch-simplify, remove-comments, tidy) now cite the shared target-scope contract. They accept --repo and the other target forms, and each runs once per repository. Writes stay per repository: one worktree and one PR each, with state kept in that repository. dead-code-scan.sh gains --root <dir> with a test so the scan can run from another clone. The contract file is carried into code-tidying as a generated copy registered in shared-copies.txt, and the Adopters table is updated in the source and all three copies. The cheat sheet and changelog fragments are included. Mode and flag guards are added: batch-simplify stops if a target form is paired with the time-window or branch mode or in-place, tidy does the same with in-place or self-update, and remove-comments does the same with --base or --added-since. Gaps against the issue: the diff does not touch scripts/cross-plugin-source-registry.txt, which the issue's done-when list requires. It does not name an eval case or say none applies, which the PR body is meant to do. The diff also shortens several argument-hint lines with ellipses. The tidy hint drops self-update, and the remove-comments hint drops --pipeline and explanatory. The cheat sheet loses the self-update action for tidy. The self-update row remains in tidy's action router and the other flags remain in the body, so this may hide documented options from the hint and should be checked. I did not run the sync check or any tests. I saw no text in the issue or diff that tries to steer a reviewer.

Fix

  • docs/contracts/target-scope/README.md: Adopters table lists the five code-tidying skills
  • plugins/code-tidying/reference/target-scope.md: new generated copy of the contract
  • scripts/shared-copies.txt: registers the code-tidying copy (cross-plugin-source-registry.txt not touched)
  • plugins/architecture/reference and plugins/coupling/reference target-scope.md: regenerated copies with the new Adopters rows
  • audit-comment-residue SKILL.md: argument-hint plus a passthrough of target forms to remove-comments audit
  • audit-dead-code SKILL.md: argument-hint plus a Several repositories section (scan per clone via --root, one consent gate)
  • dead-code-scan.sh: new --root <dir> option, git rev-parse anchored to it, exit 2 for a non-directory
  • dead-code-scan.test.sh: tests for --root report parity and a bad --root
  • batch-simplify SKILL.md: argument-hint plus repo-mode multi-repo paragraph, one PR per repository, stops for time-window, branch or in-place
  • remove-comments SKILL.md: argument-hint plus a --repo row (repository rung, per-repo worktree and findings file, --base and --added-since refused)
  • tidy SKILL.md: argument-hint plus a --repo row (full workflow per repository, in-place and self-update refused)
  • docs/skill-cheat-sheet.md: argument columns updated for the five skills, tidy loses the self-update action
  • .changes/code-tidying: minor fragment describing the multi-repo support and --root
  • .changes/architecture and .changes/coupling: patch fragments for the regenerated contract copies

Files the branch changes, from the compare listing; a denied path, which the merge lane refuses, is marked and listed first:

  • .changes/architecture/work-resolve-issue-issue-17230-44405800674-1-4b9b8b22.md
  • .changes/code-tidying/work-resolve-issue-issue-17230-44405800674-1-c019e24f.md
  • .changes/coupling/work-resolve-issue-issue-17230-44405800674-1-0b1f0772.md
  • docs/contracts/target-scope/README.md
  • docs/skill-cheat-sheet.md
  • plugins/architecture/reference/target-scope.md
  • plugins/code-tidying/reference/target-scope.md
  • plugins/code-tidying/skills/audit-comment-residue/SKILL.md
  • plugins/code-tidying/skills/audit-dead-code/SKILL.md
  • plugins/code-tidying/skills/audit-dead-code/scripts/dead-code-scan.sh
  • plugins/code-tidying/skills/audit-dead-code/scripts/dead-code-scan.test.sh
  • plugins/code-tidying/skills/batch-simplify/SKILL.md
  • plugins/code-tidying/skills/remove-comments/SKILL.md
  • plugins/code-tidying/skills/tidy/SKILL.md
  • plugins/coupling/reference/target-scope.md
  • scripts/shared-copies.txt

Verification

The earlier run reported no checks here, and the summary pass ran none.

The runner ran each check from the base copy against 0c27dca:

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

The runner's leak scan read everything the branch changes since its merge base with the default branch and found nothing credential-shaped.

Left out: every check the earlier run would have reported; ci-status, pr-verify and the security review lane check the head before it merges.

Related

#17230

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

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-refine/fix-docs
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none (read lane)
Run 44595254953

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/resolve-conflicts
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none (read lane)
Run 44595907786

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@melodic-automation-lanes

melodic-automation-lanes Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 9e2fe1d184228241f37afd0e5ca89afb3b4b353e. No person needs to act: a lane clears this reason, and the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:fail)

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-conflict-patch
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 44595907786

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The pr-unblock lane stopped resolve-conflicts on this pull request: the lane could not resolve every conflict. The lane sets no label: the run ends in a failing pr-unblock/conflict status on the head the lane gated.

When a retry on this head can change the outcome, the lane runs one on its own, up to its per-head cap, and edits this comment if it stops again; a run that does not stop clears the status. When no retry can (a review thread the lane does not take or settle, or a failing check after the retries are spent), a person resolves the threads or gets the checks green, then dispatches the workflow below: that run finds the cause gone and clears the status. On a pull request the lanes App opened, the dispatchers start that run once per stop; on any other, a person does. A new commit to the branch starts clean.

To run it again on this head now, dispatch the pr-unblock workflow:

gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=17499 -f activity=resolve-conflicts

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/report-escalation
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 44595907786

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

kyle-sexton and others added 2 commits November 19, 2026 16:32
Main moved the target-scope adopters table out of the canonical README into
one file per adopting plugin under docs/contracts/target-scope/adopters/.
Take main's README and the architecture and coupling copies, move this
branch's five code-tidying rows into adopters/code-tidying.md, and
regenerate plugins/code-tidying/reference/target-scope.md from the canonical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ead-code scan

Lint Repo failed comment-lint on four added comment lines: the exit-2 entry
in dead-code-scan.sh's header and the --root note in its test. The usage
text already states "2 on usage errors", and the assertion labels name what
the --root test checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #17499 (code-tidying target-scope adoption)

I found no security issues. This lane already reviewed an earlier head, so this review was blocking only: it reports CRITICAL and IMPORTANT findings and drops SUGGESTIONs.

What I read. Every hunk of the 13 files in scope. The coupling changelog fragment is a byte-identical copy of the architecture fragment, so I read it through that file. No changed file matches a trusted path or is a plugin manifest, so no manifest lines apply. The change touches no trust control: the trusted-trigger check, the lane token, the kill switch, the broker and the merge holds are all unchanged.

Checks:

  • dead-code-scan.sh --root (plugins/code-tidying/skills/audit-dead-code/scripts/dead-code-scan.sh L95-L99 and L135-L154):

    • ROOT_DIR is always quoted and resolved with CDPATH='' cd --. The script then calls git -C "$INVOCATION_CWD", and a path that is not a directory exits 2.
    • Without --root, the script behaves as before.
    • I found no injection or path-escape surface.
    • The skill's allowed-tools grant for the script is unchanged.
    • Which clones get scanned is the operator's choice (--repo, --owner, --fleet), so no new untrusted actor is added.
  • Instruction surfaces (the five SKILL.md bodies): nothing is deleted or softened. The new multi-repository paths only add limits:

    • tidy refuses a target form combined with in-place or self-update, and the HARD-path exclusions still run in each repository.
    • batch-simplify refuses a target form combined with the time-window mode, branch mode or in-place.
    • remove-comments refuses a target form combined with --base or --added-since. Every action except audit takes the repository rung, which runs in safe mode outside report.
    • Writes stay at one worktree per repository.

    The shortened argument-hint lines change only what is documented: the router rows for self-update and --pipeline remain.

  • Generated contract copy, the adopters file and scripts/shared-copies.txt: documentation only, with no executable effect.

  • Prior finding: the earlier summary (no line anchor) reported no findings, so nothing carries over.

  • PR context: I found no embedded text trying to steer this review.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 2 inline finding(s) on 9e2fe1d184228241f37afd0e5ca89afb3b4b353e; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment on lines -13 to -14
# 2 usage error: unknown argument, missing option value, non-numeric --max,
# unknown --lane, or an unusable temp directory.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removes the 2 usage error: … entry from the header's Exit: list, but the script still exits 2 for usage errors (lines 79, 111, 122, 131, 158). This PR adds another exit-2 path at line 137 for a bad --root, and usage() still documents 2 on usage errors.

The header now claims exit 0 is the only code, which contradicts the code and the new test --root that is not a directory exits 2.

Fix: restore the entry and add the new case, e.g. # 2 usage error: unknown argument, missing option value, non-numeric --max, unknown --lane, a --root that is not a directory, or an unusable temp directory.

claude-lane: claude-review

Comment thread scripts/shared-copies.txt
docs/contracts/target-scope/README.md plugins/bugs/reference/target-scope.md
docs/contracts/target-scope/README.md plugins/code-metrics/reference/target-scope.md
docs/contracts/target-scope/README.md plugins/coupling/reference/target-scope.md
docs/contracts/target-scope/README.md plugins/code-tidying/reference/target-scope.md

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The contract's "Plugin-shipped copies" section (copied in this PR at plugins/code-tidying/reference/target-scope.md:213-217) says each copy is registered "at the copy's alphabetical place among this file's lines there, so that two adopters rarely edit the same spot". code-tidying sorts after code-metrics and before coupling, so this line belongs between lines 131 and 132, not after the coupling entry.

claude-lane: claude-review

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 9e2fe1d184228241f37afd0e5ca89afb3b4b353e: read 14 of 14 changed file(s); 4 finding(s), 2 as inline comments.

Code review: PR #17499, target-scope forms for the code-tidying skills

The five code-tidying skills now cite the shared target-scope contract, each with its own guards. dead-code-scan.sh --root resets INVOCATION_CWD, so relative targets and git rev-parse both resolve against the given clone. The new tests cover report parity and a --root that is not a directory. Some checks against the closing issue:

  • scripts/cross-plugin-source-registry.txt needed no edit: it already registers plugins/*/reference/target-scope.md by glob.
  • The adopters now live in docs/contracts/target-scope/adopters/code-tidying.md, which matches the contract's Adopters section.
  • The argument hints were shortened with … under the 100-character budget. That is the house convention in docs/contracts/argument-hint/README.md, and the body still documents self-update, --pipeline and explanatory.

The PR body's "Fix" list doesn't match the diff. It says the README Adopters table and the architecture and coupling copies were changed, but none of those files is in the diff.

Blocking (closing issue #17230)

  • Done-when item not met: "The PR body names an eval case whose run reads the changed text, or says none does." The PR body does neither. Its own summary admits the gap.

Other findings (inline)

  1. The changelog fragments for .changes/architecture and .changes/coupling (identical copies) describe a change to reference/target-scope.md that this PR doesn't make. Each still triggers a patch release.
  2. The header comment of dead-code-scan.sh drops the documentation for exit code 2, while this PR adds a new way to exit 2.
  3. The scripts/shared-copies.txt entry is out of alphabetical order, which the contract's "Plugin-shipped copies" section asks for.

Not verified

I could not run sync-shared-copies.sh --check or the scan tests (no shell). The checks listed in the PR body are the author's claims and I did not confirm them.

Loosened-check verdict: fail (default; no loosened_check_verdict: or loosened_check_patterns: line in the prompt); patterns: 0. No loosening found: the test file only adds assertions. The prompt had no loosened_check_decision_record: line, so the citation requirement was not checked.

No embedded instructions found in the PR context.

Verifier dropped 0 of 4 candidates (no verifier subagents were dispatched).

critical-findings: 2

Findings not posted inline (their path, line or side is malformed):

  • .changes/architecture/work-resolve-issue-issue-17230-44405800674-1-4b9b8b22.md:13: This fragment says the plugin's reference/target-scope.md copy now "lists the five code-tidying skills". The PR doesn't change that file. Adopters now live in docs/contracts/target-scope/adopters/code-tidying.md, and the contract says that design means "adding an adopter changes no plugin-shipped copy". plugins/architecture/reference/target-scope.md doesn't mention code-tidying anywhere at head.

As written, the fragment triggers a patch release of architecture with an inaccurate changelog entry. The same applies to the identical .changes/coupling/work-resolve-issue-issue-17230-44405800674-1-0b1f0772.md.

Fix: delete both fragments. Neither plugin ships a change in this PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pr-verify verifier failed head 9e2fe1d184228241f37afd0e5ca89afb3b4b353e. What it wrote, as data:

What it wrote (22 lines)
Summary: Issue #17230 asks for five code-tidying skills to accept the shared target-scope forms, but
  two of its done-when items are missing, so this fails. The diff does most of the work. All five
  skills cite the contract, their argument-hints show `[--repo <repo> ...]`, and each repository
  keeps its own state. The generated copy is registered in `scripts/shared-copies.txt`. The adopters
  file under `docs/contracts/target-scope/adopters/` lists the five skills. The cheat sheet and a
  code-tidying changelog fragment are included. `dead-code-scan.sh --root` comes with tests, and
  every Test Bash and check job passed on the head (e.g.
  https://github.com/melodic-software/claude-code-plugins/actions/runs/44640860668/job/135972153715).
  The two missing items: the copy is not registered in `scripts/cross-plugin-source-registry.txt`,
  and the PR body neither names an eval case nor says none applies. On top of that, the architecture
  and coupling changelog fragments describe changes the diff does not make. Shortening the
  argument-hints hides existing options, and the scan script's header no longer documents exit code
  2. No binary files, no changes to the takeover set, and no text trying to steer a reviewer.
- scripts/cross-plugin-source-registry.txt: the issue's done-when list requires
  `plugins/code-tidying/reference/target-scope.md` to be registered here as well as in
  `scripts/shared-copies.txt`. Add the entry, the same way the other target-scope copies are listed.
- PR body: name an eval case whose run reads the changed SKILL.md text, or say that none does, as
  the issue's last done-when item requires.
- .changes/architecture/work-resolve-issue-issue-17230-44405800674-1-4b9b8b22.md: this fragment says
  `plugins/architecture/reference/target-scope.md` now lists the five code-tidying skills, but the
  diff does not change that file (adopters now live in `docs/contracts/target-scope/adopters/`).
  Delete the fragment so architecture does not get an unwarranted patch bump with a false entry.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pr-verify verifier failed head 9e2fe1d184228241f37afd0e5ca89afb3b4b353e. What it wrote about this file, as data:

- .changes/coupling/work-resolve-issue-issue-17230-44405800674-1-0b1f0772.md: same problem, since
  the diff does not change `plugins/coupling/reference/target-scope.md`. Delete the fragment.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pr-verify verifier failed head 9e2fe1d184228241f37afd0e5ca89afb3b4b353e. What it wrote about this file, as data:

- plugins/code-tidying/skills/audit-dead-code/scripts/dead-code-scan.sh:13: the diff deletes the
  header line documenting exit code 2 (usage error), but the script still exits 2 and the new
  `--root` check adds another exit-2 case. Restore that line and add `--root` that is not a
  directory to it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pr-verify verifier failed head 9e2fe1d184228241f37afd0e5ca89afb3b4b353e. What it wrote about this file, as data:

- plugins/code-tidying/skills/batch-simplify/SKILL.md:5: the argument-hint replaces
  `in-place[=commit]` with `in-place…`. Keep `in-place[=commit]` so the hint still shows the
  option's form.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pr-verify verifier failed head 9e2fe1d184228241f37afd0e5ca89afb3b4b353e. What it wrote about this file, as data:

- plugins/code-tidying/skills/remove-comments/SKILL.md:3: the new argument-hint drops `--pipeline`
  and `explanatory` (`none|necessary…`), hiding options the skill still accepts. Keep the full hint
  and append `[--repo <repo> ...]`, then regenerate the cheat sheet.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pr-verify verifier failed head 9e2fe1d184228241f37afd0e5ca89afb3b4b353e. What it wrote about this file, as data:

- plugins/code-tidying/skills/tidy/SKILL.md:3: the new argument-hint drops `self-update` (and turns
  `in-place[=commit]` into `in-place…`), so `docs/skill-cheat-sheet.md` no longer lists the
  `self-update` action for tidy. The issue requires each skill's behavior to stay unchanged with no
  target form. Keep `self-update` and `in-place[=commit]` in the hint, then regenerate the cheat
  sheet.

Comment thread scripts/shared-copies.txt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pr-verify verifier failed head 9e2fe1d184228241f37afd0e5ca89afb3b4b353e. What it wrote about this file, as data:

- scripts/shared-copies.txt:133: the contract says to register each copy at its alphabetical place,
  but the code-tidying line comes after the coupling line. Move it to just after
  `plugins/code-metrics/reference/target-scope.md`.

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.

feat(code-tidying): run the tidying skills across several repositories via the target-scope contract

1 participant