clean-coding
Skill4 starsChanged 34 days agoCC0-1.0View on GitHub
Minimal, direct code with the smallest scoped diff, concise names, and no speculative config, one-use helpers, dead code, or history comments. Use when writing or reviewing code.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- berkeley-humanoids/skillsword for word, first seen Oct 9, 2026
Other versions1 project uses a version of this.
Word for word · 1
- berkeley-humanoids/skills★ 4100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
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 repository8 other files it gives its agents.
- github-workflowSkill
- grounded-researchSkill
- paper-figuresSkill
- pixi-workspaceSkill
- research-code-validationSkill
- robotics-conventionsSkill
- ros2-conventionsSkill
- ste-writingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. About 0 are common, 17 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈17
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Write the smallest obvious implementation that satisfies the current requirement.
- Distinctive: line 10
Follow established project conventions for mechanical style.
- Distinctive: line 15
Do not add flexibility, extension points, defensive branches, or settings for hypothetical future needs.
- Distinctive: line 16
Prefer a simple data representation that removes special cases over adding conditionals around them.
- Distinctive: line 21
Use the shortest conventional name that is unambiguous at its scope.
- Distinctive: line 23
Prefer concise domain names.
- Very specific: line 26
Do not encode change history or recency: no new, old, v2, final, fixed, or similar suffixes unless they are the actual domain distinction.
- Distinctive: line 27
Do not introduce a variable merely to name a simple expression used once unless the name materially improves clarity.
- Distinctive: line 31
Every parameter and return value must be necessary and used.
- Very specific: line 32
Use explicit signatures. Do not use a bare * keyword-only marker.
- Distinctive: line 34
Prefer straightforward control flow and eliminate special cases when the data or structure can make them ordinary cases.
- Distinctive: line 35
Do not extract a private helper merely to shorten a function.
- Distinctive: line 40
Do not introduce module/global state for convenience when a local, parameter, or object attribute is sufficient.
- Distinctive: line 41
Do not turn a stable implementation constant into configurable state merely to make it adjustable.
- Distinctive: line 43
Do not scatter config values across unrelated implementation files.
- Distinctive: line 53
Never restate obvious code.
- Distinctive: line 55
If an old decision contains an enduring fact, keep only the fact:
- Distinctive: line 65
No commented-out code, superseded branches, unused parameters, or compatibility paths kept "just in case".
- Very specific: line 66
Delete from __future__ import annotations unless the module needs deferred evaluation, such as annotations that reference …
- Very specific: line 68
Never invent metadata such as _note, reason, changed_from, old_value, or migration_note to preserve conversation history.
- Distinctive: line 72
Read the diff as if you had never seen the conversation.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Clean Coding
Write the smallest obvious implementation that satisfies the current requirement. Unnecessary generality is a bug. Every added line needs a concrete reason to exist now.
Follow established project conventions for mechanical style. Do not make unrelated edits.
Keep the implementation direct
- Reuse existing code and the standard library before adding abstractions, dependencies, files, or configuration.
- Do not add flexibility, extension points, defensive branches, or settings for hypothetical future needs.
- Prefer a simple data representation that removes special cases over adding conditionals around them.
- Preserve existing behavior and interfaces unless the task requires changing them.
Names
Use the shortest conventional name that is unambiguous at its scope. Names describe what a thing is, not its history or implementation story.
- Prefer concise domain names; do not turn identifiers into English sentences.
- Spell words out. Use an abbreviation only when it is standard in the domain or already conventional in the codebase (
cmd,idx,ms); never invent contractions or drop vowels. Write_left/_right, not_l/_r. - Include units or reference frames when ambiguity matters:
timeout_ms,pos_world. - Do not encode change history or recency: no
new,old,v2,final,fixed, or similar suffixes unless they are the actual domain distinction. - Do not introduce a variable merely to name a simple expression used once unless the name materially improves clarity.
Functions and control flow
- Every parameter and return value must be necessary and used. Remove unused arguments, single-value flags, and redundant conditions.
- Use explicit signatures. Do not use a bare
*keyword-only marker. Avoid*argsand**kwargs; use them only when an interface you do not control requires forwarding them. - Validate at the boundary. Do not repeat checks internally for states that cannot occur.
- Prefer straightforward control flow and eliminate special cases when the data or structure can make them ordinary cases.
- Do not extract a private helper merely to shorten a function. Inline one-use helpers. Extract when logic is reused by another code path or an interface requires a separate callable.
- Long function bodies are fine when they represent one readable procedure. Use sparse section comments to divide major steps instead of scattering the flow across helpers.
State and configuration
- Do not introduce module/global state for convenience when a local, parameter, or object attribute is sufficient.
- Do not turn a stable implementation constant into configurable state merely to make it adjustable.
- Real user/project configuration belongs in the project's existing centralized config location. If none exists, create one organized config module/file only when there are enough genuine settings to justify a configuration surface.
- Do not scatter config values across unrelated implementation files.
Comments and docstrings
Code is self-explanatory by default. Write a comment only for:
- a section header in a long procedure;
- a non-obvious pitfall or easy-to-miss correctness issue;
- an enduring constraint, invariant, unit/frame convention, protocol rule, or rationale.
Never restate obvious code. Never turn conversation, debugging, or diff history into source-code provenance: no "changed from", "previously", "for now", "after debugging", or similar narration.
If an old decision contains an enduring fact, keep only the fact:
// Raised from 100 Hz after debugging -> // Controller diverges below 200 Hz.
Otherwise delete the comment. History belongs in the issue, commit, PR, or design document.
Docstrings are brief API overviews, not walkthroughs. State only purpose and non-obvious contract details such as units, frames, side effects, ownership, or exceptional behavior. Omit docstrings when the name, signature, and types already say enough. Do not add Args: / Returns: blocks that merely repeat the signature.
Dead code and structured config
- No commented-out code, superseded branches, unused parameters, or compatibility paths kept "just in case". Version control holds history.
- Delete
from __future__ import annotationsunless the module needs deferred evaluation, such as annotations that referenceTYPE_CHECKING-only imports. - In JSON/YAML/TOML/URDF/MJCF and similar files, add only fields consumed by the program, defined by the schema, or requested by the user.
- Never invent metadata such as
_note,reason,changed_from,old_value, ormigration_noteto preserve conversation history.
Before done
Read the diff as if you had never seen the conversation. Remove any added comment, helper, argument, condition, config field, global, file, or abstraction that is not required by the resulting system.
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.

