lean-code
Skill213 starsChanged 3 days agoMITView on GitHub
On-demand minimalism intensifier — find the smallest sufficient, verified implementation for the requested outcome. Use when the user says "be lazy / yagni / simplest / minimal / shortest / don't over-engineer", complains about bloat / boilerplate / unnecessary dependencies / abstraction, or before writing a substantial chunk of new code. Supports intensity: lite / full / ultra. Pairs with the always-on quality-code rule and the over-engineering-advisor hook. Do NOT use as a general code-review or bug-hunting pass — it only removes over-building and will not find unrelated correctness defects; use /code-review or /review for those.
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Stdlib does it?: Use it.
- Distinctive: line 17
An already-installed dependency solves it?: Use it. Never add a new dependency for what a few lines do.
- Distinctive: line 18
Can the accepted behavior safely be one line?: Prefer it; do not contort control flow, validation, or errors merely to make it fit.
“Common” is measured: kept by at least 6 in 10 of the 5 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
Lean Code
Aggressive YAGNI mode, on demand. The always-on baseline is rules/quality-code.md; this skill is the intensifier you invoke when minimalism matters most. The win is the smallest solution that fully satisfies the accepted task outcome, not the fewest lines or the shortest explanation.
The ladder — stop at the first rung that holds
Choose a rung only when it preserves the accepted architecture, contracts, and non-functional requirements; installed/native status alone does not justify crossing an established project boundary.
- Does this need to exist at all? Speculative need → skip it, say so in one line. (YAGNI)
- Stdlib does it? Use it.
- Native platform feature covers it? (
<input type="date">over a picker lib, CSS over JS, a DB constraint over app code.) - An already-installed dependency solves it? Use it. Never add a new dependency for what a few lines do.
- Can the accepted behavior safely be one line? Prefer it; do not contort control flow, validation, or errors merely to make it fit.
- Only then — the minimum code that works.
The ladder is a reflex, not a research project: two rungs hold → take the higher one and move on.
Intensity
- lite — build what the user asked; mention one leaner alternative only when it materially helps. Do not pause accepted implementation for an optional choice. Ask only when an unresolved decision materially changes the requested outcome or authority.
- full — enforce the ladder; prefer stdlib/native and the smallest sufficient, verified diff. (Default.)
- ultra — challenge a requested mechanism, scope assumption, or speculative extension against the required outcome; do not challenge an explicit user decision merely to reduce code. Once retained, implement it without re-arguing.
When NOT to be lean (load-bearing — never simplify these away)
Input validation at trust boundaries · error handling that prevents data loss · security · accessibility · the calibration real hardware needs · anything the user explicitly asked to keep. Lean ≠ incomplete: non-trivial logic leaves one runnable check behind (assert-demo or one small test). User insists on the full version → build it, no re-arguing.
Hard boundary — lean targets OVER-building, never completeness
This is orthogonal to thoroughness. "Minimal" means less unnecessary complexity while delivering every accepted branch, not fewer branches done, a lower line count, or a shortcut. It must never excuse under-delivery, skipped verification, or a hack — see rules/finish-the-task.md (its completeness + quality pillars win) and rules/quality-code.md (the no-monkey-patch pole). Mark a deliberate shortcut with a simplification: comment naming the ceiling + upgrade path.
Output
Complete and verify the requested result first. Then use at most three short lines for what was deliberately skipped and the trigger to add it. Do not suppress an explanation needed to document a safety boundary, user decision, or upgrade path. Read the surrounding code and requirements before pruning — prune to the task, not to a blanket rule.
Why this works (evidence, not marketing)
GitClear's 2025 report observed rising copy/paste and falling moved-line rates across 211M changed lines; Faros observed higher team task/PR throughput alongside slower review and no demonstrated organization-wide gain. Those are ecosystem signals, not proof that a particular agent or diff is bloated. A "do I even need this?" check is therefore useful, but not a line-count target. GitClear · Faros
Generic prompt additions can trade one measured behavior for another in small local experiments; they do not establish a universal minimalism rule. Keep this on-demand and advisory, then evaluate its instructions on representative held-out tasks. arXiv:2601.22025
Gotchas
- A one-liner is worse when it hides a required failure path, access need, or future-maintenance boundary.
ultracan question how to achieve an outcome; it cannot silently remove an outcome or override the user's retained choice.
Troubleshooting
- The diff is short but a required behavior vanished. Restore the behavior, then remove only the unnecessary mechanism around it and run the smallest relevant check.
- A simplification has an explicit scale or correctness ceiling. Keep the simple version only with its
simplification:ceiling and upgrade trigger; otherwise implement the proper architecture now.
Other versions8 projects use a version of this.
Word for word · 1
- AnastasiyaW/codex-claude-code-config★ 213100% same
Edited · 0
None found.
Wrote their own version · 7
- definite-d/agent-skills★ 2same name
- sammasak/claude-code-skills★ 2same name
- sammasak/skills★ 2same name
- timfewi/unix-agent-skills★ 2same name
- malkiii/lean-code-skill★ 1same name
- Lean-LLM/lean-agents★ 0same name
- linsaftw/lean-agents★ 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 repository60 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-harness-designSkill
- agents-best-practicesSkill
- diffusion-engineeringSkill
- flux2-klein-promptingSkill
- flux2-lora-trainingSkill
- forensic-prompt-compilerSkill
- ml-research-labSkill
- notebooklm-grounded-researchSkill
- vlm-segmentationSkill
- feature-newSkill
- harness-designSkill
- layer-newSkill
- plan-swarm-reviewSkill
- pixel-art-storyboardSkill
- pixel-art-studioSkill
- architecture-firstSkill
- architecture-qualitySkill
- bug-reproducerSkill
- code-complexitySkill
- control-cliSkill
- control-uiSkill
- deep-reviewSkill
- deslopSkill
- distill-feedbackSkill
- harness-feedbackSkill
- proof-verifySkill
- refactoring-safelySkill
- repo-mapSkill
- root-cause-deliverySkill
- system-and-data-designSkill
- testing-strategySkill
- thermo-nuclear-code-quality-reviewSkill
- verify-thisSkill
- workflow-orchestrationSkill
- frontend-designSkill
- motion-framerSkill
- ui-designSkill
- ui-ux-pro-maxSkill
- ios-developmentSkill
- cross-harness-continuationSkill
- deepseek-provider-contractSkill
- desktop-sessions-discoverySkill
- epistemic-challengeSkill
- gemini-delegateSkill
- harness-auditSkill
- observability-monitoringSkill
- remote-compute-opsSkill
- plan-to-ticketsSkill
- product-meaning-extractorSkill
- remotion-production-guideSkill
- script-evaluatorSkill
- video-narrative-arcSkill
- video-post-productionSkill
- article-structure-reviewSkill
- cavemanSkill
- humanize-englishSkill
- humanize-russianSkill
- owner-voiceSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

