lean-code
Skill1 starsChanged 28 days agoMITView on GitHub
Use when about to add a comment, doc block, error variant, config option, helper, or test beyond what the change strictly needs — in any code writing or review. Not for Rust-specific lints, crates, or toolchain choices — rust-engineering owns those.
8 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/skillsword for word, first seen Oct 17, 2026
- timfewi/unix-agent-skillstheir own version, first seen Oct 17, 2026
Other versions8 projects use a version of this.
Word for word · 1
- sammasak/skills★ 1100% same
Edited · 0
None found.
Wrote their own version · 7
- 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
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 repository25 other files it gives its agents.
- agent-handoffSkill
- agent-orchestrationSkill
- assigning-subagent-modelsSkill
- credentialsSkill
- deep-modulesSkill
- device-protocol-investigationSkill
- e2e-testingSkill
- herdr-operationsSkill
- herdrSkill
- knowledge-vaultSkill
- kubernetes-gitopsSkill
- nix-audit-operatorSkill
- nix-flake-developmentSkill
- ntfy-notificationsSkill
- orchestrated-reviewSkill
- pcap-evidence-analysisSkill
- pi-offloadSkill
- pi-ticketSkill
- rf-chaos-experiment-reviewSkill
- rust-engineeringSkill
- sdlc-pipelineSkill
- secrets-managementSkill
- tooling-feedbackSkill
- verify-serviceSkill
- wireless-lab-diagnosticsSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
1
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 26
When touching code, remove what the change makes dead: unused impls, stale helpers, tests made redundant by better ones (replace, don't …
“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
Code is cost; the behaviour is the asset. The best diff is the smallest one that solves the whole problem, and the best line is the one that no longer needs to exist.
Comments and docs
A comment earns its line only by stating what the code cannot: a constraint, an invariant, a consequence ("X breaks when…"), or a non-obvious why. Name things well enough that narration never becomes necessary.
State each fact exactly once, in the one place its reader looks. A public function's contract lives in its doc comment; the module doc then only routes ("parsing for duration strings — see parse_duration"), it does not restate the grammar. A doc line above an attribute or signature that re-says it (/// The input was empty. above #[error("duration string is empty")] Empty) is deleted on sight. Section banners (// ─── Config ───) are replaced by file/module structure.
Surface sized to real callers
Build for the callers that exist today:
- An error type gets as many variants as callers branch on. A CLI that prints the message needs one well-worded message, not six variants carrying owned
Strings. - A config option, trait, or generic parameter is added when the second concrete need arrives, never for a hypothetical one (see the deep-modules skill for seam discipline).
- Deliver the design that fits now and stop; put future ideas in the commit message or nowhere, not as "we could later add a
Jittertrait" notes in the code.
Deletion is a feature
When touching code, remove what the change makes dead: unused impls, stale helpers, tests made redundant by better ones (replace, don't layer). Weight cleanup toward code that changed recently (git history), leave stable corners alone.
Calibrate ceremony to the ask
Match effort to what was requested and to the environment: asked for code in a reply, write the code — a full crate scaffold, toolchain download, and pedantic-lint pass is for changes landing in a real repo. On these memory-constrained hosts, heavy verification runs once and sequentially, at the layer that owns it (git hooks / sdlc gates), not re-improvised per edit.
Red flags
- The same contract explained in the module doc, the type doc, and the function doc.
- A comment or doc line that would survive translation into the identifier under it.
- Error variants, fields, or options nothing matches on or sets.
- A "for future flexibility" abstraction with one user.
- More lines of scaffolding and process than of requested change.
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.

