clean-code

A set of standards for making code easier to read, change, and test, regardless of programming language.

In plain words
What is it for?
Use it when writing or reviewing code to simplify control flow, improve naming, separate concerns, and reduce complexity.
Why use it?
It reduces confusing names, duplicated logic, tangled responsibilities, and weak error handling during coding, refactoring, and review.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/superplanehq/superplane/clean-code
Any agent
npx skills add superplanehq/superplane --skill clean-code
Clone the repo
git clone --depth 1 https://github.com/superplanehq/superplane

Made for: Claude Code, Codex.

Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,280 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00093 $0.01280
Opus 5 $0.00046 $0.00640
Sonnet 5 $0.00019 $0.00256
Haiku 4.5 $0.00009 $0.00128

Measured yesterday against content hash c8a9d0ede73b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

clean-code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.agents/skills/clean-code/SKILL.md · 145 lines

How it starts

The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Clean Code

These are mandatory engineering standards for any code you write, change, or review while this skill is active. They are language-agnostic: apply them in whatever language the project uses, respecting that language's idioms.

If there is tension between speed and cleanliness, choose the clean solution unless there is a demonstrated operational emergency. If a shortcut is unavoidable, contain it, make it obvious, and leave the code safe to clean up later.

For detailed rationale, examples, and design heuristics, read reference.md — consult it when a rule needs interpretation or when you face a non-obvious design decision.

Core Rules

1. Leave the code cleaner

Every change must improve at least one of: clarity, naming, simplicity, cohesion, testability, error handling, duplication removal, or separation of concerns. Do not add code that is merely functional — add code that is understandable.

2. Optimize for readers

  • Write code for the next engineer, not for impressiveness.
  • Prefer straightforward code over clever code.
  • Keep control flow obvious.
  • If code is hard to explain, treat that as a design problem.

3. Use strong names

  • Names must reveal intent. Use domain language consistently.
  • Prefer specific names over generic ones. Avoid data, info, thing, stuff, manager, helper, util, misc, handle, temp, obj unless they are genuinely correct in the domain or an external protocol.
  • Boolean names read like predicates (active?, isActive, hasItems, retryable?), following the language's convention.
  • Collection names are plural.
  • Function names describe the action performed, not vague activity (calculate_invoice_total, not do_invoice).

4. Keep methods small and focused

  • A method should do one thing at one level of abstraction.
  • Do not mix business rules, formatting, persistence, external calls, and error recovery in one method. Extract helpers when a method grows multiple phases.
  • Prefer zero, one, or two parameters; three should trigger scrutiny; more usually means a missing value object or domain object.
  • Do not use boolean parameters to switch behavior when separate methods would express intent more clearly.

Read the full file on GitHub · 145 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 145 lines · 93 tokens per session scan A c8a9d0ede73b

Subscribe to this mod's changes

clean-code is a skill published in the GitHub repository superplanehq/superplane (5,633 stars, last pushed yesterday), licensed Apache-2.0. It adds 93 tokens to every session and 1,280 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories