simplify-for-readability
Skill3 starsChanged 8 months agoMITView on GitHub
Use before any code generation, code modification, or refactor to check whether the implementation can be made simpler, more direct, and more readable without changing behavior. Also use when a user explicitly asks to simplify code, reduce indirection, improve readability, or remove over-engineering.
In this repository8 other files it gives its agents.
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 7 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Prefer the simplest code that preserves behavior and defaults.
- Distinctive: line 18
Delete indirection before adding structure.
- Distinctive: line 22
Keep shared state generic, then map it to tool-specific values only where the concrete API is called.
- Distinctive: line 25
Do not eagerly overwrite built-in defaults just because shared state exists.
- Distinctive: line 28
Do not introduce constants for single-use values, temporary mappings, or values that exist only to make code look more abstract.
- Very specific: line 33
Prefer expression-bodied arrows for return-only callbacks.
- Very specific: line 34
When an arrow callback only returns one expression, remove braces and return.
- Very specific: line 36
Prefer short-circuit expressions for truthy-or-null choices.
- Very specific: line 37
When an expression only chooses between a value and null, prefer condition && value over condition ?
- Very specific: line 39
Prefer a single expression for small return-only branches.
- Very specific: line 40
When a function only selects one value from a short ordered set of conditions, prefer a ternary expression over multiple if returns, as …
- Distinctive: line 47
Remove leftover helpers, wrappers, and dead branches.
- Distinctive: line 51
Before finishing any code change, explicitly check:
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
Simplify For Readability
Overview
Prefer the simplest code that preserves behavior and defaults.
This skill is for refactors where the main goal is not “more architecture”, but “less to read, less to remember, less to mentally simulate”.
Apply this skill by default before finalizing any code change, even when the user did not explicitly ask for simplification.
Core Rules
- Delete indirection before adding structure. Inline helper methods if they are only forwarding state or hiding a one-line operation.
- Convert at the boundary when different implementations need different concrete values. Keep shared state generic, then map it to tool-specific values only where the concrete API is called.
- Preserve native defaults. Do not eagerly overwrite built-in defaults just because shared state exists. Only apply shared state after it is meaningfully set.
- Extract constants only when they are real constants and referenced in multiple places. Do not introduce constants for single-use values, temporary mappings, or values that exist only to make code look more abstract.
- Optimize for scanability. A reader should understand the control flow without jumping between multiple tiny helpers.
- Prefer expression-bodied arrows for return-only callbacks.
When an arrow callback only returns one expression, remove braces and
return; for multi-line expressions, break immediately after=>and indent the returned expression one level so the expression remains the visual focus. - Prefer short-circuit expressions for truthy-or-null choices.
When an expression only chooses between a value and
null, prefercondition && valueovercondition ? value : null. - Prefer a single expression for small return-only branches.
When a function only selects one value from a short ordered set of conditions, prefer a ternary expression over multiple
ifreturns, as long as the result is still easy to scan top-to-bottom.
Refactor Order
- Identify the real state being shared.
- Collapse duplicate storage into the minimum number of variables.
- Move conversion logic to the call site or a single lookup helper when implementations differ.
- Remove leftover helpers, wrappers, and dead branches.
Required Check
Before finishing any code change, explicitly check:
- Can one layer of helpers, wrappers, or state be removed?
- Can the same behavior be expressed more directly?
- Did any extracted constant, helper, or abstraction actually improve readability?
- Is there a simpler version that preserves defaults and behavior?
Decision Tests
Choose the version that makes more of these true:
- Fewer moving parts
- Fewer state variables
- Fewer helper hops
- Fewer places where defaults can be broken
- Easier to explain in one short paragraph
Session Pattern
Bad:
- Different call sites each handle the same special case differently
- Helpers exist only to shuffle values around
- Shared state and concrete state drift apart
Better:
- Shared behavior is expressed once
- Special handling is concentrated at the boundary
- Readers can see the real control flow without chasing helpers
- Small ordered choices can be read as one expression instead of several return branches
Anti-Patterns
- Introducing a manager/helper layer for a single direct assignment
- Restoring shared state before checking whether the user ever changed it
- Storing the same idea in multiple representations at once
- Extracting constants that are not truly constant
- Extracting single-use constants
- Extracting constants that make the code longer but not clearer
- Converting long or side-effecting branches into nested ternaries that are harder to scan than the original
if
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.

