fmt-sweep
Skill1 starsChanged 6 months agoMITView on GitHub
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.
- Commits and pushes
1 other project uses a version of this.
Adopted by
Most recently taken up by
- kymostudio/kymostudiotheir own version, first seen Jun 24, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- kymostudio/kymostudio★ 9same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository16 other files it gives its agents.
- audit-unused-depSkill
- checkpointSkill
- double-checkSkill
- file-adrSkill
- fleetSkill
- forge-mirror-scaffoldSkill
- forgeSkill
- gemini-pullSkill
- loop-from-taskSkill
- loop-healthSkill
- loop-onSkill
- loopSkill
- loopsSkill
- regression-guardSkill
- restoreSkill
- workspace-testsSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
If drift > 0: runs cargo fmt --all to canonicalize
- Distinctive: line 29
Default in-scope set (PlausiDen substrate):
- Very specific: line 68
If cargo test --workspace returns non-zero post-fmt, revert the fmt changes (git checkout -- '*.rs') and bail.
- Distinctive: line 87
No drift in any repo → exit 0 with summary
- Very specific: line 99
Don't include any non-.rs files in the commit (generated artifacts under static/, reports/, target/ etc.
- Distinctive: line 100
Don't fmt-sweep with uncommitted semantic changes pending in the repo — separate the cleanup pass from the feature pass.
- Distinctive: line 101
Don't include LFI repos by default per the dedicated-instance doctrine.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/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/CrucibleSame 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 main4. 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 repos6. 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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

