clean
Skill0 starsChanged yesterdayMITView on GitHub
Clean up the code smells broom finds across a repo or an area - long functions, files and types, high complexity, deep nesting, duplicate and dead code, magic numbers and the like - worst first, in small verified batches. Use for /broom:clean, when broom's session note reports smells and the user agrees to a cleanup, when the user asks to clean up, refactor or pay down tech debt, or before reworking an area that `broom smells` ranks as a hotspot.
21 other projects use a version of this.
Adopted by
Most recently taken up by
- flavien-ia/hypervibe-harnesstheir own version, first seen Nov 15, 2026
- nazmirket/skillstheir own version, first seen Nov 15, 2026
- romeohc/afkittheir own version, first seen Nov 15, 2026
- mystilleef/spae-frameworktheir own version, first seen Nov 13, 2026
- hemal08ce094/DesignSkillsSwiftUItheir own version, first seen Nov 8, 2026
- Mrbaeksang/skillstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use expressive, friendly and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
bergsideSkillexpressive
Vibrant, personality-driven design with bold colors, playful graphics, and dynamic layouts that balance creativity with structure.
Also in 4 projects that use this
bergsideSkillfriendly
Approachable, intuitive design with rounded elements, ample whitespace, and soft pastel color palettes.
Also in 4 projects that use this
- +10 more from bergside
Other versions21 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 21
- bergside/awesome-design-skills★ 2.9ksame name
- aimeos/pagible★ 604same name
- kurtosis-tech/kurtosis★ 560same name
- OutThisLife/brooklyn-skills★ 215same name
- flavien-ia/hypervibe-craft★ 52same name
- flavien-ia/hypervibe-harness★ 52same name
- RektTillNoon/alpha-skills★ 4same name
- VoTruongDanh/Skills-Agent★ 4same name
- andalabx/skills★ 2same name
- Mrbaeksang/skills★ 2same name
11 more not listed
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.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.
0
Common
Most of the 19 edited versions we read keep these.
1
Distinctive
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
- Distinctive: line 28
Keep behavior. Run the project's tests before and after.
- Very specific: line 58
Run broom smells on the same scope again: the batch's smells are gone and nothing new is past a limit.
- Very specific: line 63
Stop when the scope is clean, the user says so, or after the batches they agreed to.
- Very specific: line 66
If the user doesn't want a cleanup now, run broom smells --dismiss: the session note stays quiet until the repo's count of smells past the …
“Common” is measured: kept by at least 6 in 10 of the 19 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
1. Rank
broom smells [paths] --top 10It lists the hotspot files (most smells past the hard limit first) and the worst smells (furthest past their
limit first), --top of each, and says how many more there are. Add --json to read it as data. With no paths it
covers the repo; with paths, only those.
Pick the scope with the user: an area (src/layout), a file, or a kind of smell ("the long functions", "dead
code"). When the request already names it, use that.
2. Plan
Propose batches, worst first: one file, or one kind of smell in a few files, per batch. Say for each what changes: extract functions, split a file, name constants, delete dead code, merge duplicates. Wait for the user's go-ahead unless they already asked for the cleanup itself.
3. Clean one batch
- Keep behavior. Run the project's tests before and after; a failing test stops the batch. If some tests fail before you start, note which and compare by name: only a new failure stops a batch.
- Refactor the smell away, not the metric: no splitting a function at an arbitrary line, no
smells_offto silence something fixable. - A smell that is deliberate (a long lookup table, a protocol's fixed parameter list, code loaded dynamically)
stays: say so, and offer
.broom.jsonexclude,limits(test_limitsfor tests that are long because they list cases),legacy(code a migration is replacing) orsmells_offinstead of contorting the code.
How each kind is usually put right:
| Smell | The fix |
function_lines, complexity, nesting | Extract the steps the function takes into functions named for what they do; return early to flatten |
file_lines, type_lines | Split by area, not by size. Move what the parts share into a module of its own first, so they don't import one another |
params, bool_params | Group related parameters in one object; make a flag keyword-only (*, flag in Python) or an enum |
unused_params | Remove it and the callers' argument. Where a shared signature fixes it (a callback table, a command handler), name it _name |
magic_numbers | A named constant that says what the number means, with its unit |
nested_ternary | Plain if statements, or early returns |
duplicate_lines | Extract the shared block; where the copies differ, a function with a parameter for the difference |
dead_code, commented_code | Delete it; git keeps it |
import_cycle | Move what the files share into a third module both import. An import inside a function is the last resort |
globals | Pass the state in, or hold it in an object |
debug_output | Delete it, or use the project's logger |
type_escape | Narrow the type with a check instead of casting or unwrapping |
suppression, swallowed_error | Give the suppression its rule and a reason; handle or log the error |
todo | Do it, or write it down as an issue and drop the comment |
broad_test_asserts | Assert on the message or the exact error |
4. Check and commit
Run broom smells on the same scope again: the batch's smells are gone and nothing new is past a limit. Commit
the batch on its own (broom checks the commit as usual), then go on to the next batch.
5. Stop
Stop when the scope is clean, the user says so, or after the batches they agreed to. Report what is left with the
counts from broom smells.
If the user doesn't want a cleanup now, run broom smells --dismiss: the session note stays quiet until the
repo's count of smells past the hard limit grows.
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.

