/repo-fleet-hygiene:apply --plan-file <path> [--apply] [--yes] [--remote-branches]from repo-fleet-hygiene
Executes a fleet action plan from /repo-fleet-hygiene:audit, cleaning merged branches and worktrees across multiple repos behind a single confirmation gate. Dry-run by default; requires --apply for mutation.
Ships in repo-fleet-hygiene. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Consume the machine-readable action-plan JSON emitted by /repo-fleet-hygiene:audit and drive
cleanup for N repositories behind one confirmation gate. This is the executing verb for the
fleet cleanup contract. It is a separate skill from :audit on purpose: keeping execution out of
audit-fleet.sh keeps the audit's allowed-tools grant from ever covering a mutation.
Default is dry-run (evidence refresh + ordered preview, no mutation). Execution requires an
explicit --apply, then interactive confirmation or --yes for non-interactive consent.
--plan-file pointing at a prior audit plan (schema_version: 1).merged-local-branch deletion here (repo-hygiene branch deletion stays interactive /
per-repo and is not batched).delete-merged-local-branches, cleanup-worktrees, then delete-remote-branches.--remote-branches is passed.Parse $ARGUMENTS and pass them through to the bundled script. Supported flags:
--plan-file <path> (required): action-plan JSON from a prior audit (--plan-file on audit, or
the temp path named in the audit report).--apply: opt into mutation after the batch confirmation gate.--yes / -y: skip the interactive prompt (required for non-interactive --apply).--remote-branches: opt in to delete-remote-branches rows (unmerged-remote-branch findings of
class never-pr or closed-unmerged). Without it those rows are skipped with
remote deletion requires --remote-branches, no remote is contacted, and the local rows run under
the confirmation gate alone. --yes never answers this flag's prompts.Reject any other flag. Run exactly once:
${CLAUDE_SKILL_DIR}/scripts/apply-plan.sh <validated-and-quoted-arguments>
| Session | Flags | Behavior |
|---|---|---|
| Any | (default / no --apply) | Dry-run preview only |
| Interactive tty | --apply | Prompt once for the whole plan; decline → mutate nothing |
| Interactive tty | --apply --yes | Apply without prompt |
| Non-interactive | --apply without --yes | Print plan, stop (exit 3), mutate nothing |
| Non-interactive | --apply --yes | Apply |
One gate covers every repository and every local operation in the plan.
--remote-branches)Remote deletion is separate from that gate and stricter:
git ls-remote. It requires
every URL Git would fetch from or push to for the remote (effective config, so pushurl and
url.*.insteadOf count) to name the repository the audit recorded in remote_key. It re-reads
the branch's pull requests with gh pr list --state all for github_repo: never-pr needs
none, closed-unmerged needs only CLOSED ones with one at the plan tip. An OPEN or MERGED
pull request, a changed class, a full 100-row page, or a failed gh call skips the row. The
identity and pull request checks run again after a yes and before the ledger write and the push.[y/N] prompt naming repository, remote, branch, class, and tip. --yes
does not answer it. A non-interactive session with any remote row that would be prompted deletes
nothing at all, local rows included (exit 3).<plan-file>.tip-ledger (tab-separated: repository,
remote, branch, class, tip, UTC time, restore command). A ledger write failure aborts that branch
(exit 4). The push is git push <remote> --delete refs/heads/<branch> with a lease on the exact
recorded tip, so a head that moved since the read is not deleted.git -C <repo> push <remote> <tip>:refs/heads/<branch>. It works only while the tip object exists locally. Apply fetches the
tip first when it is absent, but a successful delete removes the remote-tracking ref, so the
object is unreachable afterward and git gc prunes it once gc.pruneExpire passes (two weeks by
default).gc.pruneExpire defaults to two weeks. Basis: the gc.pruneExpire entry of
https://git-scm.com/docs/git-gc ("prune --expire 2.weeks.ago"), matching git help config
(git 2.53.0). As of: 2026-09-29. Recheck: when a Git release changes the
gc.pruneExpire default or the restore window in that entry.--remote-branches only
previews and exits 3. To delete, run apply-plan.sh --plan-file <path> --apply --remote-branches
in your own terminal.Scope is fixed by the audit: only never-PR and closed-unmerged branches are planned. Branches with a
merged PR (merged-remote-branch) are out of scope and are rejected if they appear in a
delete-remote-branches row.
/repo-fleet-hygiene:audit.audit-fleet.sh./repo-hygiene:clean git (if enabled) (that skill refuses to batch branch deletion).delete_branch_on_merge.--remote-branches, without its own per-branch confirmation, or
when its merged PR is the only evidence./repo-fleet-hygiene:audit … --plan-file <path> (or takes the path from the report).${CLAUDE_SKILL_DIR}/scripts/apply-plan.sh --plan-file <path>--apply (interactive) or --apply --yes (headless). Remote branch rows need --remote-branches and the operator's own terminal.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub melodic-software/claude-code-plugins --plugin repo-fleet-hygiene4 skills in this plugin
/auditRead-only Git/GitHub fleet hygiene audit: discover each canonical repo, merged remote branch still on origin, orphaned worktree, and moved/renamed GitHub entry into an action plan (never mutates). Use when: 'audit the fleet', 'stale branches across repos', 'orphaned worktrees across repos'. Not for applying: /repo-fleet-hygiene:apply./setupInspect optional .claude/repo-fleet-hygiene.conf read-only (check) or add fleet roots, exact repos, and canonical checkout overrides (apply)./syncSwitch canonical fleet checkouts to the default branch and fast-forward, parking dirty work in worktrees (dry-run default; --apply after confirm).Other plugins' skills for the same job