debloat
Skill2 starsChanged 22 days agoMITView on GitHub
Enforce lean code in any language: confirm requirements, research current best practices, then write the smallest implementation that works. Use this skill whenever I ask you to write, add, extend, or refactor code (a feature, script, module, function, endpoint, config, or integration), even if I never mention 'lean', 'minimal', or 'best practices'. Also use it when a task invites scope creep, such as 'make it flexible', 'set this up properly', or 'add support for X'. Skip it for prose, debug-only sessions, code review without edits, and one-line fixes.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- cofin/flowtheir own version, first seen Nov 7, 2026
- LilMGenius/paperthintheir own version, first seen Nov 2, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- LilMGenius/paperthin★ 1.4ksame name
- cofin/flow★ 19same 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 repository27 other files it gives its agents.
- python-subprocess-and-concurrencySkill
- rust-flaky-test-investigatorSkill
- rust-test-best-practicesSkill
- sql-guidelinesSkill
- philosophySkill
- tidySkill
- wordsmithSkill
- bugsterSkill
- verification-antipatternSkill
- noexec-codingSkill
- noexec-pythonSkill
- noexec-rustSkill
- autopsySkill
- modernizerSkill
- reviewSkill
- tracerSkill
- paraglide-svelte5-best-practicesSkill
- svelte5-ssr-runesSkill
- svelte5-static-runesSkill
- blueprintSkill
- maestroSkill
- oracleSkill
- prismSkill
- probeSkill
- progressSkill
- retroSkill
- my-skill-nameSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 14 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Before any work, load the tidy skill.
- Distinctive: line 34
Stop before you pass it: If a change would take a file above 450 lines, stop and redesign the implementation until it fits.
- Distinctive: line 39
Only I change this number, and only by saying so explicitly.
- Distinctive: line 53
Interactive session: Ask me to confirm. If something material is ambiguous, ask at most 3 specific questions rather than guessing.
- Distinctive: line 54
Autonomous or no-reply context: Write the restatement as an explicit assumptions list at the top of your work, and choose the narrowest …
- Distinctive: line 55
Existing codebase: Read the neighboring code first so your requirements include its conventions (naming, error style, test framework, …
- Distinctive: line 63
If no search tool is available, say so, fall back to established patterns in the codebase and your own knowledge, and flag anything …
- Distinctive: line 70
Keep this to a few lines in your reply.
- Distinctive: line 74
Write the smallest code that satisfies the confirmed requirements and the practices from Gate 2.
- Distinctive: line 76
Do not add, until a confirmed requirement demands it:
- Distinctive: line 84
Prefer, in order: reuse existing code, use the standard library, write a few plain lines, and only then add a dependency.
- Distinctive: line 86
If you notice a nearby bug or improvement outside the requested scope, always mention it in the final message and leave it unchanged.
- Distinctive: line 90
Before finishing, check each item:
- Distinctive: line 93
Requirement trace: every added item maps to a confirmed requirement.
- Distinctive: line 100
Keep it short, in this shape:
≈ “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
Debloat
Unrequested code is a liability: every extra function, flag, and dependency must be read, tested, and maintained, and most of it is never used. This skill makes you earn each line through three gates. The gates prevent the two failure modes that produce bloat: building the wrong thing because requirements were guessed, and building too much because nothing stopped you.
Lean does not mean sloppy. Input validation at trust boundaries, meaningful error handling, and tests for the behavior you add are part of the requirement, not extras.
Tidy gate (run first)
Before any work, load the tidy skill. If tidy is not present, stop immediately and ask me to install tidy first (npx skills add agentmemoir/skills --skill tidy --global -y). Do nothing else until tidy is installed.
Once tidy is loaded, strictly adhere to it for the rest of the task. Route by artifact: when the sprawl is in code or configuration, debloat uses Tidy's decomposition principles and progressive disclosure to prune sprawl and split monolithic files into modular components without deleting necessary domain invariants — split by responsibility into one-topic-per-file bounded contexts, keep one canonical source and link to it, and preserve 100% of existing invariants, contracts, and decisions while pruning. When the sprawl is in documentation, hand the structural work to the tidy skill, or to wordsmith for reader-facing prose, instead of doing it under debloat's lean-code gates. Duplication doctrine by medium: Tidy's zero-duplication and link-to-canonical rule governs markdown, plans, and specs; debloat's third-repetition rule governs executable code. When Tidy's rules require clarification, follow debloat's Gate 1 mode rule: interactive sessions stop and ask; autonomous sessions record the assumption explicitly and continue with the narrowest reading.
Hard limits
One number outranks every trade-off below, and it is checked before the task is called done.
Every file you create or modify holds at most 450 lines. Any language, any format, any purpose: source, config, scripts, tests, generated project files. Header comments count toward the total. 450 is the ceiling, not 449 — a file at exactly 450 lines passes, 451 fails. Markdown is the only exemption.
- Stop before you pass it. If a change would take a file above 450 lines, stop and redesign the implementation until it fits. Never land it over the line and plan to trim it later.
- Split by responsibility. Splitting a file is good practice when it follows the single-responsibility principle: each resulting file owns one job, can be named without "and", and reads on its own. Splitting at arbitrary cut points, or sharding content into files that serve no distinct purpose, is a code smell and does not count as a fix.
- No file is grandfathered. Size is never excused by age. If you modify a file that is already above 450 lines, dividing it by responsibility until every part is at 450 or fewer is part of that task — so a small edit to a large file is a large task. Size the work accordingly, and say in the final message which files you split.
- Markdown exempt, logic not. Prose files cost nothing at runtime and are the only ones outside the count. Anything that executes is inside it.
Only I change this number, and only by saying so explicitly.
Scale the process to the task
| Task size | Gate 1 | Gate 2 | Gate 3 |
| Trivial (under ~10 lines, established pattern nearby) | One-sentence restatement | Skip; say "followed existing pattern in <file>" | Yes |
| Normal (a function, script, or small feature) | Restate + confirm | 2–3 targeted searches | Yes |
| Large (new module, integration, new dependency) | Restate + confirm, list open questions | Full research, cite sources | Yes, in reviewable increments |
Gate 1: Requirements
Restate in your own words: the goal, inputs, outputs, and constraints (language, runtime, performance, compatibility, existing conventions). Then decide:
- Interactive session: Ask me to confirm. If something material is ambiguous, ask at most 3 specific questions rather than guessing.
- Autonomous or no-reply context: Write the restatement as an explicit assumptions list at the top of your work, and choose the narrowest interpretation.
- Existing codebase: Read the neighboring code first so your requirements include its conventions (naming, error style, test framework, dependency policy).
Done when I confirm, or the task is small enough that the restatement is the confirmation. Guessed requirements fail this gate, because code built on them is the most expensive kind to throw away.
Gate 2: Best-Practices Research
Use your agent's search and page-reading tools to find current canonical guidance for the specific task: official docs, language or framework standards, RFCs, or widely cited guides. Prefer sources matching the project's actual language and version. Avoid blog folklore and answers that predate the version in use.
If no search tool is available, say so, fall back to established patterns in the codebase and your own knowledge, and flag anything version-sensitive that I should verify.
Done when you can state:
- Apply: the 2–3 practices that matter here (e.g. YAGNI, KISS, DRY, input validation, error handling, testing), each tied to a source or to the codebase.
- Skip: the practices you are deliberately not applying, and why. Naming these prevents them from creeping back in.
Keep this to a few lines in your reply. Do not paste research notes.
Gate 3: Minimal Implementation
Write the smallest code that satisfies the confirmed requirements and the practices from Gate 2.
Do not add, until a confirmed requirement demands it:
- Helpers or abstractions used in only one place
- Parameters, options, or config flags nothing currently passes
- Extension points for hypothetical future use
- New dependencies where the standard library or an existing dependency suffices
- Comments restating what the code already says, and error handling for cases that cannot occur
Prefer, in order: reuse existing code, use the standard library, write a few plain lines, and only then add a dependency. Duplication is cheaper than the wrong abstraction, so wait for the third repetition before extracting.
If you notice a nearby bug or improvement outside the requested scope, always mention it in the final message and leave it unchanged.
Verification
Before finishing, check each item:
- Deletion test: for every function, dependency, and flag you added, ask "what breaks if I delete this?" If the answer is "nothing," delete it.
- Requirement trace: every added item maps to a confirmed requirement.
- Run it: the affected tests pass — the smallest check that can prove the change. If there is no suite, run a smoke check (execute the script, call the function with a representative input) and report what you ran. Never claim it works without running something. If the only proof is a check that runs over five minutes,
verification-antipatternoverrides this step: scope the run to the change, or background it and leave the full gate to CI — do not block the task on it. Say what you ran, and what you left to a slower stage. - Diff size: skim the diff. Anything you would not defend line by line to a reviewer goes.
- Line counts: count every file you created or modified (
wc -lon text files). Any file you touched that ends above 450 lines fails the task, including one that was already over the line before you started. Redesign it — do not report it. Name the counts in the final message, and name the files you split. Markdown files are the only ones you skip.
Final message
Keep it short, in this shape:
Built: <one line>
Practices applied: <2–3, with source or "existing pattern in <file>">
Left out on purpose: <bullet per item, with the reason>
Verified by: <tests run or smoke check; note anything left to a slower stage>
Line counts: <file: N — one line per file created or modified>
Noticed but untouched: <optional>Example: "Left out on purpose"
- Retry logic: not required, and the caller already retries.
- Config file support: only one value, hardcoded as a named constant.
requestsdependency:urllib.requestcovers the single GET.
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.

