Arguments. [[<dir>]... [--root <dir>]... [--repo <dir>]... [--config <file>] [--detail]|--apply-plan <path>]. Full form: [[<dir>]... [--root <dir>]... [--repo <dir>]... [--config <file>] [--canonical <github.com/owner/repo=path>]... [--skip <name>]... [--extend-skip <name>]... [--max-depth <1..12>] [--detail] [--plan-file <path>]|--apply-plan <path>]
Purpose
Coordinate cross-repository hygiene. This skill owns bounded fleet discovery, canonical
checkout resolution, fleet-scale evidence collection, rollup, and action-plan routing. It does
not own per-repository cleanup decisions or execution; those belong to repo-hygiene and
source-control.
The collector produces the detailed read-only report described below, including the compact
machine-readable rollup and action-plan artifact. Tell the user to run
/repo-fleet-hygiene:apply --plan-file <path> (dry-run by default; --apply plus confirmation or
--yes to mutate; --remote-branches additionally opts in to per-branch remote deletion, which
--yes never answers). Do not add an execute flag to this audit script.
Non-negotiable boundary
Never run or suggest running inline from this skill: git fetch, git worktree prune,
git worktree repair, git worktree remove, git branch -d/-D, git remote set-url, or any
filesystem deletion. The bundled script has no mutation mode. --apply-plan is a read-only
dry-run approval artifact over a prior plan file. A report may name a command/tool as a future
handoff; the fleet action plan lists those invocations once per repository behind one confirmation
gate. Actual fleet mutation belongs to /repo-fleet-hygiene:apply, not this skill.
Input resolution
Parse $ARGUMENTS as opaque arguments for the bundled script. Supported flags:
<dir>: a bare positional path, treated as--root. A drive root (D:,D:/) is a legitimate
discovery root and normalizes to D:/. This is the form /repo-fleet-hygiene:audit D: uses.
--root <dir>: bounded recursive repository discovery (repeatable).--repo <dir>: exact repository/worktree target (repeatable).--config <file>: explicit Git-format config (at most one).--canonical <github.com/owner/repo=path>: invocation-specific canonical checkout override
(repeatable; explicit wins over config).
--skip <name>: discovery directory-name skip (repeatable). Explicit--skip/fleet.skip
entries replace the default skip list rather than appending. Otherwise shrinking is
impossible. Default (neither CLI nor config): vendor plus the package-manager cache trees
node_modules, .venv, .pnpm-store, .yarn, .npm, .cargo, .rustup, .gradle, .m2,
.nuget, __pycache__, and .tox. To shrink (e.g. reach a repo under vendor/), list only the
names you still want skipped. CLI and config compose additively with each other like other scope
inputs. Values must be bare directory names (no empty value, no path separator). ., .., and
.git stay skipped unconditionally even when an explicit list omits them.
--extend-skip <name>: discovery directory-name skip that adds to whichever list is in
effect (the defaults, or an explicit --skip / fleet.skip list) instead of replacing it
(repeatable). Config equivalent: repeatable fleet.skipAppend. Same bare-name validation.
--max-depth <1..12>: discovery bound; explicit wins over config/default5.--project-dir <dir>: the session's project directory, used for the project-scoped config rung.
It is not a scope fallback; see the no-scope ladder below.
--detail: emit collapsed per-target evidence after the rollup (default is rollup + action plan
only).
--plan-file <path>: write the machine-readable action-plan JSON to this path (otherwise a temp
file is created and named in the report).
--apply-plan <path>: standalone read-only mode. Render the ordered dry-run approval artifact
for a previously written plan (cannot combine with discovery flags).
Always pass --project-dir "${CLAUDE_PROJECT_DIR}" on audit runs (not on --apply-plan). The
script does not read the project directory from its environment, so passing it in is what makes
the project rung below reachable at all.
- Pointer: where the token is substituted is in
Available string substitutions,
and which processes receive the variable is in
If no explicit scope and no config-supplied fleet.root/fleet.repo resolve, the run uses the
shared no-scope ladder: --named paths, then ghq root --all when ghq is installed, then the
nearest of the 4 parents above the working directory's checkout (above the working directory itself
outside a checkout) that directly holds 2 or more Git repositories, so a run inside one checkout
covers its sibling fleet, then the checkout holding the working directory, else exit 3 naming every
rung. A Git checkout in the working directory is a rung; the session project directory is not one
on its own. Claim: ghq root --all prints every configured root. Basis: the
ghq README (ghq root [--all]; "Without '--all' option,
the primary one is shown") and ghq help root on ghq 1.10.1 ("--all Show all roots"). As of:
2026-11-10. Recheck: the README's root entry drops or renames --all. Pass that guidance
through rather than re-deriving a root yourself. Config resolution is the script's own ladder. Do not
pre-resolve or pass a probed path yourself:
explicit --config wins, else the script probes
<project-dir>/.claude/repo-fleet-hygiene.conf (project-scoped), else
~/.claude/repo-fleet-hygiene.conf (user-global, a machine-scoped fleet config placed there is
recorded user intent, not a guessed root). The report header names the consumed config and its
source, or states that none was consumed. Never guess a broader machine root from the current
path beyond that ladder.
Config-supplied scope is additive to CLI-supplied scope: a --repo X run still walks every
configured root. The header's Scope: line names each contributing rung and its entry count, so
report that line rather than assuming the arguments were the whole scope.
Before execution, reject any arguments outside this grammar, noting that a bare positional path
is in the grammar, so /repo-fleet-hygiene:audit D: and
/repo-fleet-hygiene:audit /path/to/tree are valid invocations to pass through, not arguments to
refuse. What stays rejected is an unrecognized flag: anything beginning with - that is not listed
above. Pass every path/override as a quoted argument; never assemble a shell fragment from config,
repository, remote, or branch text.
Run exactly once:
${CLAUDE_SKILL_DIR}/scripts/audit-fleet.sh --project-dir "${CLAUDE_PROJECT_DIR}" <validated-and-quoted-arguments>
The script validates config with git config --file; it never sources or executes it.
Evidence rules
The bundled collector is authoritative for classifications. Preserve its evidence in the report:
- Canonical checkout: explicit remote-keyed override → configured remote-keyed override → the
repository's main worktree, read from git worktree list --porcelain, never from the
checkout discovery reached first. Which record is the main worktree: git-worktree's