Fmt sweep
Pause, resume, edit, and audit Claude Code cron jobs (e.g. /loop) without losing state.
npx -y skills add thepictishbeast/claude-tools --skill fmt-sweepAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Run cargo fmt --all across N Rust workspaces, verify tests still pass, commit per-repo with a uniform body, push to origin. Compresses what would otherwise be 6-8 tool calls per repo into one invocation. Use when the user says "fmt sweep", "canonicalize whitespace", or as a /loop PRIORITY 5 hygiene step.
SKILL.md
4.8 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it
/fmt-sweep — multi-repo cargo fmt + test + commit + push
Walks a configured list of Rust workspaces and, per repo:
- Runs
cargo fmt --all --checkto count drifted regions - If drift > 0: runs
cargo fmt --allto canonicalize - Runs
cargo test --workspaceto verify no regression chown -R paul:paul(when running as root) so the autogenerated artifacts have correct ownership before git- Stages only
.rsfiles (filters out generatedstatic/,reports/, etc.) - Commits with an auto-generated body listing the drift count + files touched
- Pushes to
origin main
LFI repos excluded by default per feedback_lfi_out_of_scope_for_this_instance. Override via --include-lfi.
Why this exists
Surfaced 2026-05-20 during a manual fmt sweep across PlausiDen-Forge / PlausiDen-Crawler / PlausiDen-Loom / Crucible. Per-repo, the manual sequence was: cargo fmt --check → cargo fmt --all → cargo fmt --check again → cargo test --workspace → chown -R paul:paul → sudo -u paul git add (filtered) → sudo -u paul git commit (HEREDOC body) → sudo -u paul git push. That's ~8 tool calls per repo × 4 repos = 32 tool calls plus the verification + chown ceremony. Compresses to one invocation.
This is paul's contribute to claude tools repo any tasks that can be automated that can save tokens directive: each repeated agent workflow is a fmt-sweep waiting to happen.
Steps
1. Read the workspace list
Default in-scope set (PlausiDen substrate):
/home/paul/projects/PlausiDen-Forge
/home/paul/projects/PlausiDen-Loom
/home/paul/projects/PlausiDen-Crawler
/home/paul/projects/Crucible
Same overrides as workspace-tests:
$FMT_SWEEP_REPOSenv (colon-separated absolute paths)~/.config/fmt-sweep/repos.txt(one path per line)- Positional args
--include-lfiflag
2. Per repo: drift check + apply + test
DRIFT=$(sudo -u paul cargo fmt --all --check --manifest-path "$REPO/Cargo.toml" 2>&1 | grep -c '^Diff in')
if [ "$DRIFT" -eq 0 ]; then
printf '%-32s\tclean\n' "$(basename "$REPO")"
continue
fi
sudo -u paul cargo fmt --all --manifest-path "$REPO/Cargo.toml"
sudo -u paul cargo test --workspace --manifest-path "$REPO/Cargo.toml" > "$LOG" 2>&1 \
|| { echo "REGRESSION in $REPO post-fmt — reverting"; git -C "$REPO" checkout -- '*.rs'; exit 1; }
3. Per repo: stage filtered + commit + push
cd "$REPO"
sudo -u paul git diff --name-only HEAD | grep '\.rs$' | xargs sudo -u paul git -C "$REPO" add
sudo -u paul git -C "$REPO" commit -m "$(printf 'chore: cargo fmt --all sweep across %s workspace\n\n%d drifted regions across N .rs files canonicalized.\nWorkspace cargo test --workspace passes post-fmt.\ncargo fmt --all --check reports 0 drift after the sweep.\n' "$(basename "$REPO")" "$DRIFT")"
sudo -u paul git -C "$REPO" push origin main
4. Rollback safety
If cargo test --workspace returns non-zero post-fmt, revert the
fmt changes (git checkout -- '*.rs') and bail. Pre-existing
compile errors (E0063 etc.) are NOT fmt-introduced and surface
this way — the script reports the regression repo + tail-50 of
the test output for the next agent to investigate.
5. Output format
PlausiDen-Forge 0 drift — clean
PlausiDen-Loom 214 drift → fmt'd → tests pass → committed b4bac18 → pushed
PlausiDen-Crawler 101 drift → fmt'd → tests pass → committed 3a0871a → pushed
Crucible 4 drift → fmt'd → tests pass → committed 6e5d37c → pushed
-----
TOTAL 319 drifted regions canonicalized across 3 repos
6. Bypass conditions
- No drift in any repo → exit 0 with summary
- One repo has uncommitted non-fmt changes → skip that repo with warning
cargonot installed → exit 2 with the install URLcargo fmtnot installed → exit 2 withrustup component add rustfmt
Companion skills
workspace-tests— sibling skill that runs only the test step. fmt-sweep invokes workspace-tests internally as the post-fmt verification gate.regression-guard— adjacent; catches per-PR regressions on a single repo.
Don't
- Don't include any non-
.rsfiles in the commit (generated artifacts understatic/,reports/,target/etc. drift independently and have their own commit cadence). - Don't fmt-sweep with uncommitted semantic changes pending in the repo — separate the cleanup pass from the feature pass.
- Don't include LFI repos by default per the dedicated-instance doctrine.