lean-code
Skill14 starsChanged 5 months agoMITView on GitHub
Write the shortest correct code that does exactly what was asked - nothing more. Solve the direct target, reach for stdlib and native features before custom code, one line before fifty, and never cut validation, error handling, security, or accessibility. Use whenever the user wants minimal, direct, no- fluff code, or complains about bloat, boilerplate, over-engineering, or unnecessary dependencies.
9 other projects use a version of this.
Adopted by
Most recently taken up by
- linsaftw/lean-agentstheir own version, first seen Nov 1, 2026
- AnastasiyaW/codex-claude-code-configtheir own version, first seen Oct 30, 2026
- Lean-LLM/lean-agentstheir own version, first seen Oct 25, 2026
- malkiii/lean-code-skilltheir own version, first seen Oct 24, 2026
- sammasak/skillstheir own version, first seen Oct 17, 2026
- timfewi/unix-agent-skillstheir own version, first seen Oct 17, 2026
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- AnastasiyaW/claude-code-config★ 214same name
- AnastasiyaW/codex-claude-code-config★ 214same name
- Lean-LLM/lean-agents★ 30same name
- linsaftw/lean-agents★ 30same name
- definite-d/agent-skills★ 2same name
- timfewi/unix-agent-skills★ 2same name
- malkiii/lean-code-skill★ 1same name
- sammasak/claude-code-skills★ 1same name
- sammasak/skills★ 1same 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 repository12 other files it gives its agents.
- brandkitSkill
- dublyobase-backend-builderSkill
- dublyo-deploySkill
- image-to-codeSkill
- mdn-web-best-practicesSkill
- moatSkill
- playwright-website-testerSkill
- dublyo-pocketbaseSkill
- saas-kitSkill
- saas-product-growthSkill
- dublyo-tag-manager-serverSkill
- design-taste-frontend-v1Skill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 6 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
6
Distinctive
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
- Distinctive: line 15
Write code like a senior dev who is paid to solve the problem, not to show off.
- Distinctive: line 29
Standard library does it?: Use it.
- Very specific: line 30
Native platform feature covers it?: Use it (<input type="date"> over a picker lib, CSS over JS, a DB constraint over app code).
- Distinctive: line 32
An installed dependency solves it?: Use it. Don't add a new dependency for what a few lines do.
- Distinctive: line 35
Only then: write the minimum code that works.
- Distinctive: line 42
No abstraction with one caller.
- Distinctive: line 64
If the explanation is longer than the code, delete the explanation.
“Common” is measured: kept by at least 6 in 10 of the 7 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
Write code like a senior dev who is paid to solve the problem, not to show off. The best code is the code you did not have to write. Hit the exact target the user asked for, in the fewest correct lines, and stop.
The target rule
Solve only what was asked. Restate the goal in one sentence, then write the smallest thing that fully meets it. No extra features, options, config, or "while we're here" additions. If you think they need more, ship the direct answer first and ask in one line.
The ladder (stop at the first rung that holds)
- Does it need to exist? Speculative need -> skip it, say so in one line.
- Standard library does it? Use it.
- Native platform feature covers it? Use it (
<input type="date">over a picker lib, CSS over JS, a DB constraint over app code). - An installed dependency solves it? Use it. Don't add a new dependency for what a few lines do.
- Can it be one line? Make it one line.
- Only then: write the minimum code that works.
Two rungs work -> take the higher one and move on. The first solution that works is the right one.
Rules
- No abstraction with one caller. No interface with one implementation. No config for a value that never changes.
- Deletion over addition. Boring over clever - clever is what someone debugs at 3am.
- Fewest files, shortest diff that does the job.
- Match the surrounding code's style, names, and patterns.
- Two same-size options -> pick the one that is correct on edge cases. Lazy means less code, not a flimsier algorithm.
- Mark a deliberate shortcut with a
lean:comment naming its ceiling and the upgrade path, e.g.// lean: in-memory only, swap for Redis if multi-process.
Never cut (lazy is not careless)
Input validation at trust boundaries, error handling that prevents data loss, security, accessibility, and anything the user explicitly asked to keep. Code without its check is unfinished: non-trivial logic leaves ONE runnable check behind (a small test or an assert-based self-check). Trivial one-liners need none.
Output
Code first. Then at most three short lines: what you skipped and when to add it. If the explanation is longer than the code, delete the explanation. Give full explanation only when the user explicitly asked for one.
Pattern: [code] -> skipped: [X], add when [Y].
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.

