code-readability
Skill3 starsChanged 8 months agoMITView on GitHub
Makes code readable at the point of use: no floating (magic) numbers or strings without a name or a unit-and-why note nearby, names that carry units and meaning, small functions, shallow nesting, honest comments, and no dead code. Balanced by default: 0, 1, -1, named object properties, tests, and self-evident math are exempt. Use when writing or reviewing code, naming a constant, adding a timeout, retry, threshold, limit, or percentage, or when a reviewer asks "what is this number / what does this do". Not for type safety (typescript-safety), UI text (ux-copy), or performance (spa-performance, react-performance).
3 other projects use a version of this.
Adopted by
Most recently taken up by
- smileynet/code-spicetheir own version, first seen Oct 13, 2026
- PrairieAster-Ai/quality-butlertheir own version, first seen Jul 15, 2026
- nesco/skillstheir own version, first seen Apr 10, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- nesco/skills★ 0same name
- PrairieAster-Ai/quality-butler★ 0same name
- smileynet/code-spice★ 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 repository17 other files it gives its agents.
- api-securitySkill
- ascii-artSkill
- gotchasSkill
- llm-agent-securitySkill
- nextjs-app-routerSkill
- plain-docsSkill
- product-marketingSkill
- prompt-rewriteSkill
- react-performanceSkill
- react-testingSkill
- seoSkill
- spa-performanceSkill
- tailwind-design-systemSkill
- typescript-safetySkill
- ux-copySkill
- wcag-accessibilitySkill
- webgpuSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
4
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 27
Read the change for a reader who arrives cold.
- Distinctive: line 28
Read the resource for that smell in the table below.
- Distinctive: line 30
Do not rename or restructure unrelated code in the same change.
- Distinctive: line 31
If the project has linting, run it.
“Common” is measured: kept by at least 6 in 10 of the 3 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
Code readability
Code is read at the point of use, by someone who does not have the author's head. A value, name, or shape that needs the author's memory to decode is a readability bug, even when it runs correctly.
Name it, or document it where it is used. Prefer naming. A named constant explains itself on every use and can only change in one place. A comment is the fallback for code that cannot hold a name (a config table, a protocol layout), and it must give the unit and the reason, not restate the literal.
Balanced, not strict. This skill flags meaning a reader cannot recover from context. It does not flag 0, 1, -1, a literal already labelled by the property or argument it sits in ({ timeoutMs: 5000 }), test data, or math whose meaning the formula itself carries (width / 2 for a centre). Chasing those teaches people to ignore the rule.
Source checks and dates: SOURCES.md.
Procedure
- Read the change for a reader who arrives cold. Mark every place you had to scroll, guess, or already know something to understand it.
- Read the resource for that smell in the table below.
- Fix by preference, in order: rename, extract a named constant or helper, restructure (guard clause, lookup table), then — only if none of those fit — a unit-and-why comment at the use site.
- Do not rename or restructure unrelated code in the same change. Readability fixes ride along only where the change already touches.
- If the project has linting, run it. Report findings as Must fix / Should fix / Leave, with the rule name. Never report a smell you did not actually see in the code.
a literal a reader can't decode ──> magic-numbers.md, magic-strings.md
a name that hides unit or meaning ──> naming.md
a function you must hold in your head ──> functions.md, nesting-and-conditionals.md
a comment that lies, repeats, or apologises ──> comments-and-dead-code.md
want a machine to catch it ──> linting.mdWhere to read
| Task | Resource |
Floating / magic numbers: timeouts, retries, thresholds, sizes, rates, the performance.now() deadline | magic-numbers.md |
| Magic strings, status literals, boolean flag arguments, stringly-typed values | magic-strings.md |
| Names: units in names, abbreviations, boolean names, names that lie, scope and length | naming.md |
| Function size, doing one thing, abstraction levels, arguments, early returns as structure | functions.md |
| Nesting depth, guard clauses, complex conditions, negations, nested ternaries | nesting-and-conditionals.md |
| Comments that earn their place, comments that lie or repeat code, commented-out and dead code, TODOs | comments-and-dead-code.md |
ESLint no-magic-numbers and friends, tuned balanced, as warnings, adopted by directory | linting.md |
The smells that cost the most time
| Symptom | Usual cause | Read |
performance.now() + 180_000 — 180 thousand what? | A duration with no unit and no name | magic-numbers.md |
setTimeout(fn, 86400000) runs daily, nobody dares change it | Milliseconds computed in someone's head once | magic-numbers.md |
if (status === 3) in three files, meaning drifts | A status code never became a named constant or union | magic-strings.md |
render(true, false, true) at the call site | Boolean flag arguments; the booleans carry no meaning | magic-strings.md |
const d = 5000 then setTimeout(fn, d) | Abbreviation dropped the unit the reader needed | naming.md |
| A 200-line function where the bug hides in the middle | Setup, logic, and formatting at mixed abstraction levels | functions.md |
| Code indented six levels, happy path at the bottom right | Missing guard clauses; errors handled by nesting | nesting-and-conditionals.md |
if (!isNotEmpty(x)) needs three reads | Stacked negations; the name or the condition should flip | nesting-and-conditionals.md |
| A comment says "returns null on error"; the code throws | The comment was true once and never updated | comments-and-dead-code.md |
| 80 lines of commented-out code "just in case" | Git already keeps it; the block only confuses search | comments-and-dead-code.md |
Review checklist
- No bare literal carries time, retries, thresholds, limits, money, rates, or sizes without a name or a unit-and-why note at the use site
- Named constants are named for meaning and unit (
SESSION_TIMEOUT_MS), not for their value (TIMEOUT_180000) 0,1,-1, labelled properties, and self-evident math were left alone- Strings compared in logic are named constants, enums, or union members — never retyped literals
- No call passes bare booleans whose meaning is invisible at the call site
- Names carry their unit and do not lie about type, side effects, or contents
- Each function does one thing at one level of abstraction; length and nesting read as smell, not law
- Conditions read in the positive where they can; no nested ternaries in prose-like code
- Every comment adds why, a constraint, or a warning — none restate the code, none are stale
- No commented-out code, no unreachable branches, no TODO without an owner or issue
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.

