Index of every page on this site: llms.txt
All skills
meza avatar

/clean-code

@982e21e
by mezameza/skills2 stars
Run it yourself

Use when designing, writing, refactoring, reviewing, or explaining code, tests, APIs, modules, or architecture. Provides a progressive catalog of clean-code qualities covering comprehension, domain modeling, state and failure behavior, boundaries, evolvability, operability, safety, and test design.

Use this Skill: https://skilld.dev/gh/meza/skills/clean-code

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈78 tokens for metadata: the name and description. ≈1.4k when used: this file. ≈44k more on demand in 95 files.

Description uses 3.9% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈312 characters, or 3.9%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Clean Code

Clean code makes correct change safe. Its value is not tidiness or conformity for their own sake. It reduces interpretation work, hidden risk, and accidental coupling for the people who must understand, operate, test, and evolve the system.

The qualities in this skill reinforce one another. Clear types can protect invariants. Explicit boundaries can localize change. Realistic tests can make those boundaries trustworthy. A locally elegant choice is not clean when it shifts complexity, risk, or ambiguity elsewhere.

Find the relevant qualities

Start from the actual decision, code, or failure under consideration. Use the descriptions below to select the concern areas that can materially affect it. Open only those navigation documents first. Each one provides enough context to decide which individual quality references need deeper reading.

  • Comprehension and intent - A reader can build a correct mental model of the code from its naming, structure, documented contracts, and stated assumptions, without reconstructing hidden intent from implementation detail.
  • Domain modeling and data expressiveness - Types, signatures, and data structures express domain concepts and the invariants that govern them, instead of flattening meaning into primitives, flags, and generic containers that invite misuse.
  • State effects and failure behavior - Runtime behavior is legible and safe: what mutates and who owns it, what must happen in what order, what enters from outside, and what happens on every failure path.
  • Structure boundaries and dependencies - The arrangement of modules reflects real responsibilities: related things live together, variation and shared rules have one owner, and dependencies point the right way through narrow contracts.
  • Evolvability and consistency - The code can be changed, extended, and deleted safely and cheaply, and it solves problems the way the rest of the codebase already solves them.
  • Operability and production behavior - The system can be configured, observed, scaled, migrated, and released by people who did not write it, and its signals reflect what is really happening.
  • Security privacy and user harm - Trust boundaries, privileges, secrets, data exposure, auditability, defaults, and user-facing language protect the people the system touches.
  • Test meaning and evidence - The tests state and protect meaningful promises about behavior, cover invariants and unhappy paths, and give a reader enough evidence to trust a pass and diagnose a failure.
  • Test placement and isolation - Each test sits at the cheapest layer that can provide trustworthy evidence and is insulated from the world, so results reflect product behavior rather than environment.

Read more than one concern area when the decision crosses boundaries. Do not load the entire catalog by default.

Apply judgment

Treat every quality as a reasoning lens, not an automatic finding or universal prohibition. Establish the requirements, target architecture, project conventions, and evidence first. A quality matters when it changes correctness, comprehension, failure risk, operability, safety, or the cost of future change in the current context.

When qualities pull in different directions, prefer the option that protects correctness and safety, keeps responsibilities and dependencies explicit, and owns the least unjustified complexity. Make the trade-off visible. Do not improve one unit by exporting ambiguity or maintenance cost to its callers, tests, operators, or neighboring modules.

This catalog does not authorize edits, broaden a task, replace language-specific guidance, or override project instructions. It sharpens judgment inside the authority and scope already established.

Communicate the judgment

Explain the relevant quality, the concrete evidence, and the consequence. Distinguish an observed property from a proposed remedy. When several qualities expose one root cause, describe the root cause once rather than multiplying equivalent concerns.

Recommendations should say what boundary or behavior needs to improve and why. Avoid prescribing a pattern merely because its name resembles the problem. Prefer a solution that fits the codebase's target architecture and makes the desired quality structural.

Make uncertainty explicit when the available evidence cannot establish a quality. Missing context is a reason to narrow confidence, not to invent a defect.

Self-verification

Before handing over work shaped by this skill, verify that:

  • concern areas were selected from their descriptions rather than loaded indiscriminately;
  • the relevant individual references were read rather than inferred from their link titles;
  • facts, assumptions, trade-offs, and unknowns remain distinguishable;
  • recommendations address a demonstrated consequence rather than aesthetic preference;
  • interacting qualities and downstream effects were considered;
  • the result fits the target architecture and project conventions;
  • no catalog entry was treated as mutation authority or an inflexible rule.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts28d3 checks · Risk SAFE
  • Gen Agent Trust Hub28d

    The skill 'clean-code' is a comprehensive educational catalog of software engineering principles and clean-code qualities. It provides structured guidance and pseudocode examples to help AI agents reason about code quality, security, and maintainability. No malicious code, hidden instructions, or security risks were identified during the analysis.

  • Socket28d

    No alerts

  • Snyk28d

    Risk: LOW · No issues

Signed by skilld at 982e21e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 weeks ago.

Activeupdated 3 months ago

README badge

README badge for meza/skills/clean-code