Skip to content

feat: run improvement skills across several repositories - #17228

Merged
kyle-sexton merged 5 commits into
mainfrom
feat/multi-repo-target-scope
Nov 18, 2026
Merged

kyle-sexton merged 5 commits into
mainfrom
feat/multi-repo-target-scope

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

No related issue: owner request to let improvement, maintenance and cleanup skills run across several repositories; per-skill adoption issues are linked under Related

Summary

Improvement and cleanup skills each resolved one repository, and /coupling:reduce claimed the repositories altitude without a way to read more than one. This adds one shared contract for multi-repository scope, so every adopter takes the same target words and nobody invents a second way. The default stays one target. The first two adopters land here.

Fix

  • New docs/contracts/target-scope/README.md, registered in the convention registry, with generated copies in architecture and coupling: target forms (--repo, --repos-from, --owner, --fleet, --skip, reusing /repo-hygiene:clean's selection words), path resolution by origin owner/name, one subagent per repository, one ranking across repositories, the signals only a multi-repository run has, and writes kept per repository (one worktree and one PR each).
  • plugins/architecture/reference/improvement-steps.md "Scope and fan-out" resolves repositories before areas, so the deepening and conventions lenses of /architecture:improve can run across several; --repo added to its argument hint.
  • /coupling:reduce runs per repository under the contract and, over two or more, runs the new scripts/cross-repo-dups.py: blobs tracked in several repositories (exact), and same-name files whose copies drifted (diverged, with line similarity), leaving out copies a sync manifest or vendoring registry declares, generated files and fixture paths. Steps in reference/cross-repo-copies.md.

Verification

  • cross-repo-dups.test.sh: 17 passed (exact, diverged with similarity 0.75, generated and fixture exclusion, per-repository and all-repository managed entries, labels, usage errors). The other coupling suites still pass (derivable-list 29, value-sites 285).
  • Smoke run on three org repositories read at origin/HEAD: 2 exact and 5 diverged rows, 0.44 s.
  • sync-shared-copies.sh --check, --check-bump origin/main, check-cross-plugin-source-drift.sh --check, check-changed-skills.sh origin/main (reduce and improve PASS), markdownlint, ruff, shellcheck, and the pre-push check-affected run all pass.
  • Left out: no eval run of either skill over several real repositories; the adoption issues each own their skill's run.

Related

Adoption issues, one per plugin, each depending on this PR: #17229 (improvement), #17230 (code-tidying), #17231 (code-metrics), #17232 (docs-hygiene), #17233 (docs-naming), #17234 (ai-slop), #17235 (codebase-health), #17236 (bugs), #17237 (attribution), #17238 (instruction-placement), #17239 (overengineering), #17240 (testing), #17241 (mutation-testing), #17242 (work-items), #17243 (discipline), #17244 (architecture remainder), #17245 (harness-config), #17246 (harness-memory), #17247 (repo-hygiene).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vcupoo79EqmECYFZ4MTv6C

kyle-sexton and others added 3 commits November 18, 2026 14:23
Add the target-scope contract: one target stays the default, and --repo,
--repos-from, --owner and --fleet (repo-hygiene's selection words) name a
set of repositories. It owns path resolution, one subagent per repository,
merged ranking, the cross-repository signals, and per-repository writes.

First adopters: architecture's improvement-steps "Scope and fan-out" and
coupling:reduce, which gains cross-repo-dups.py to list exact and drifted
copies between repositories, leaving out managed and generated copies.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Vcupoo79EqmECYFZ4MTv6C
Rename ambiguous loop names in cross-repo-dups.py, format it, drop the
quoted expansion from the test fixture, and register the target-scope
copies in the cross-plugin source registry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Vcupoo79EqmECYFZ4MTv6C
This was referenced Nov 18, 2026
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 18, 2026 19:30
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T19:33:22.612825Z c66c60e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c66c60e5a9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

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

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #17228, incremental (73e8418 → a7320f8)

No security issues in this push. This lane already reviewed an earlier head, so this review reports only blocking findings (CRITICAL and IMPORTANT).

I read every hunk of the three files in scope: plugins/coupling/skills/reduce/reference/cross-repo-copies.md, plugins/coupling/skills/reduce/scripts/cross-repo-dups.py and cross-repo-dups.test.sh.

What I checked:

  • Empty-file exclusion. cross-repo-dups.py now leaves out empty files: a file is skipped when its blob ID is in EMPTY_BLOBS, a fixed set holding the SHA-1 and SHA-256 IDs of git's empty blob. This only changes what the report counts. It adds no file reads, no git calls and no subprocess arguments.
  • Generated-file count. Generated files are now collected in a set of (label, path) pairs, so a file isn't counted twice. Each check still goes through the existing generated() helper, which only reads blobs through git. This changes the reported totals and nothing else, and nothing uses the count to decide anything.
  • Test file. The new G1, G2, Z1 and Z2 cases build throwaway local repositories under the test's temporary directory. They make no network calls and post nothing.
  • Reference doc. The change is one line of prose about the new empty count. It removes no instruction or guardrail.
  • Who can reach this code. The script runs locally. Its repository paths and --managed files come from the operator's own command line, so no author of a pull request, issue or comment can reach it.
  • Trust controls and manifests. None of the in-scope files matches a trusted-path glob. The push touches no workflow, action, token request, kill switch, merge hold or plugin manifest, so there are no manifest lines.
  • Embedded text. Nothing in the pull request context is addressed to this lane.

critical-findings: 0

…rity unknown

A managed entry such as `one:scripts/retry.sh` was read as a bare path
whenever its label had no slash, so a LABEL=PATH or origin-less repo's
managed copies were reported as unmanaged. Labels are now matched against
the resolved repository labels.

Past 12 content variants the similarity was the minimum over the first 12
only, which could rank unrelated files as close copies. It now reads `?`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Vcupoo79EqmECYFZ4MTv6C

@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 73e8418b9516ac48219e598eedabd01084c5a880; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review, incremental: 73e8418..a7320f8 (#17228)

No blocking findings. This review covered only what changed since the last one, and since this lane already reviewed an earlier head, it reported blocking findings only.

The new commit fixes this lane's two earlier advisory findings in cross-repo-dups.py. The owner resolved both threads, citing this commit.

  • Empty files: zero-byte blobs are now skipped before grouping and counted as excluded empty.
    • Both empty-blob IDs are listed in EMPTY_BLOBS: SHA-1 e69de29… and SHA-256 473a0f4c….
    • The check runs after the managed and path checks, so each file still lands in exactly one bucket.
    • The docstring and reference/cross-repo-copies.md both list the new empty reason, and the excluded loop prints it.
    • Tests Z1 and Z2 use the earlier reproduction.
  • Generated-file count: excluded generated is now the size of a set of (label, path) pairs, filled from both the exact groups and the name groups.
    • A blob found in both kinds of group is counted only once.
    • The tuple shapes match: by_blob holds (label, name), and the name-group loop builds (lab, p).
    • generated() is cached per SHA, and the name-group filter already called it on every copy, so the new line adds no git reads.
    • Tests G1 and G2 use the earlier reproduction.

I ran nothing. The claims that each new test fails on the previous script and passes now are the author's, and I did not verify them.

Other inputs:

  • Settled threads: all four are marked lines changed since resolution: no and were not raised again.
  • Embedded instructions: none found in the settled-threads or prior-findings files.
  • Plugin manifests: this push changes none.
  • Loosened checks: verdict fail, by default, because the prompt has no loosened_check_verdict: or loosened_check_patterns: lines; patterns: 0. The prompt also has no loosened_check_decision_record: line, so I did not check the citation requirement. This push loosens no check.

Verifier dropped 0 of 0 candidates.

Every zero-byte file shares one blob, so empty __init__.py and .gitkeep
files across repositories became the top exact row. They are now skipped
and counted as `excluded empty`.

Generated copies filtered from name groups were dropped without being
counted, so `excluded generated` under-reported. Each generated copy is
now counted once, whether it falls in an exact or a name group.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Vcupoo79EqmECYFZ4MTv6C
@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 44386720867

Failed GitHub API calls

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

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit 040dbc8 Nov 18, 2026
64 checks passed
@kyle-sexton
kyle-sexton deleted the feat/multi-repo-target-scope branch November 18, 2026 20:21
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 4, survived 3, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 57%; mutation score 57%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/coupling/skills/reduce/scripts/cross-repo-dups.py 4 3 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/coupling/skills/reduce/scripts/cross-repo-dups.py:225 SBR productive input-gap
plugins/coupling/skills/reduce/scripts/cross-repo-dups.py:244 LCR productive no-assertion
plugins/coupling/skills/reduce/scripts/cross-repo-dups.py:263 other productive input-gap

The run's summary has the full report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant