code-cleanup
Skill4 starsChanged 5 months agoMITView on GitHub
Refactor and simplify Python files modified in the current session — minimal diff, clean code principles, then lint/format/typecheck. Use when the user asks to clean up, simplify, or refactor code.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- snappedly/skillstheir own version, first seen Sep 17, 2026
- evanpersinger/claude-skillstheir own version, first seen Aug 16, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- snappedly/skills★ 2same name
- evanpersinger/claude-skills★ 0same 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 repository28 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- appkit-commonsSkill
- boostSkill
- commit-msgSkill
- create-readmeSkill
- docker-multi-stageSkill
- frontend-designSkill
- github-actions-cicdSkill
- python-clean-codeSkill
- python-codingSkill
- reflex-docsSkill
- reflex-state-and-architectureSkill
- reflex-testing-stateSkill
- releaseSkill
- runic-migrateSkill
- runic-ogmSkill
- terraform-azure-verified-modulesSkill
- terraform-refactor-moduleSkill
- terraform-run-acceptance-testsSkill
- terraform-search-importSkill
- terraform-stacksSkill
- terraform-style-guideSkill
- terraform-testSkill
- appkit-commonsSkill
- appkit-mantine-referenceSkill
- appkit-userSkill
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 12
If $ARGUMENTS is provided, use those files.
- Distinctive: line 19
If no modified Python files are found, report that and stop.
- Distinctive: line 29
Remove dead code, unused imports, redundant comments, and unnecessary variables.
- Distinctive: line 33
Ensure every function and method has a type annotation.
- Very specific: line 35
No f-strings in logger calls: log.info("x: %s", x) not log.info(f"x: {x}").
- Distinctive: line 36
If a file exceeds 1000 lines after refactoring, split it and update imports accordingly.
- Very specific: line 42
After all edits: run task format && task lint && task typecheck and fix any issues.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Code Cleanup
Target files
If $ARGUMENTS is provided, use those files. Otherwise, run:
git diff --name-only HEAD && git ls-files --others --exclude-standardFilter the output to .py files only — those are the files to clean up.
If no modified Python files are found, report that and stop.
Rules
- Minimal diff — change only what clearly improves the file; do not restructure things that already work.
- No new features — preserve all existing behavior exactly.
- Per-file scope — do not modify files outside the target list unless an import must be fixed.
What to apply (per file)
- Remove dead code, unused imports, redundant comments, and unnecessary variables.
- Simplify overly complex conditionals; prefer early returns over deep nesting.
- Break functions > 20 lines into focused, well-named helpers — but only when the split is obvious.
- Replace verbose loops with list/dict/set comprehensions or generator expressions where readable.
- Ensure every function and method has a type annotation.
- No
printstatements — uselogging(default level:logger.debug). - No f-strings in logger calls:
log.info("x: %s", x)notlog.info(f"x: {x}"). - If a file exceeds 1000 lines after refactoring, split it and update imports accordingly.
Process
- Determine the target file list as described above and show it to the user.
- For each file: read it, identify improvements, apply as a single focused edit pass.
- After all edits: run
task format && task lint && task typecheckand fix any issues. - Summarize what changed per file (one line per change group).
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.

