clean-code

clean-code is a skill for Claude Code, Codex from markoa/clean-code-skill. It costs 93 tokens per session (1,280 once invoked), scanned A, a copy of clean-code, MIT.

A set of language-independent standards for writing, refactoring and reviewing code so it is easier to read, test and maintain.

In plain words
What is it for?
It guides code changes in any programming language, including clearer structure, simpler control flow, better separation of responsibilities and more reliable errors.
Why use it?
It reduces confusing names, unnecessary complexity, duplicated code and weak error handling.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It guides code changes in any programming language, including clearer structure, simpler control flow, better separation of responsibilities and more reliable errors.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/markoa/clean-code-skill/clean-code
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.

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

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for clean-code

README.md
[![agentmods](https://agentmods.dev/badge/skills/markoa/clean-code-skill/clean-code/github.svg)](https://agentmods.dev/skills/markoa/clean-code-skill/clean-code)
Your own site
<a href="https://agentmods.dev/skills/markoa/clean-code-skill/clean-code"><img src="https://agentmods.dev/badge/skills/markoa/clean-code-skill/clean-code/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for clean-code

Your own site · 80×15
<a href="https://agentmods.dev/skills/markoa/clean-code-skill/clean-code"><img src="https://agentmods.dev/badge/skills/markoa/clean-code-skill/clean-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod 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.1 $0.00093 $0.01280
Opus 5.5 $0.00037 $0.00512
Sonnet 5.5 $0.00019 $0.00256
Haiku 4.5 $0.00009 $0.00128

Measured 1mo ago against content hash c8a9d0ede73b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo ago.

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

This is a copy

100% identical to clean-code, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

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. 1mo ago 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 markoa/clean-code-skill (7 stars, last pushed 5mo ago), licensed MIT. It adds 93 tokens to every session and 1,280 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to clean-code, and is treated as a copy.

Related

Other skills, from other repositories

re0-merge

Review and land an external contribution the way this suite does: gate it against the thesis, land it with the author's credit intact, complete a new skill rather than merging it raw, then approve, credit, and explain before closing. Use when reviewing a pull request, as any collaborator or maintainer, not only the…

LilMGenius/paperthin · 70 tokens

sip

After you create or change an artifact or skill, taste-test it with our own skills instead of trusting your in-session judgment — recursive self-improvement, made automatic. Use right after writing or editing anything, before calling it done, committing, or handing it off.

LilMGenius/paperthin · 55 tokens

prism

Split one artifact — a claim, plan, or file — across 2 to 5 independent lenses, one per genuinely distinct failure mode (correctness, security, readability, cost, adversarial-user), and return their convergence: where they agree, where they disagree, and the single next question that resolves the disagreement. Use…

LilMGenius/paperthin · 98 tokens

hate

Attack a plan, design, or argument like you want it to fail before you commit real effort — return the single load-bearing objection and the cheapest experiment that would prove it matters, not a checklist. User-invoked on purpose: a hate-it reflex always in the agent's reach would bias it toward demolition. Weighs…

LilMGenius/paperthin · 79 tokens

clean-code

Use when writing, editing, reviewing, testing, planning, or refactoring code in any language or framework; creating files or deciding where code and folders belong; designing or changing module boundaries, layers, and dependencies; starting a new project; auditing or cleaning up an existing one; or compressing agent…

btseee/clean-code-skills · 78 tokens

solid-interface-segregation

This skill should be used when the user asks about "interface segregation", "ISP", mentions "fat interfaces", discusses clients forced to depend on methods they don't use, or wants to design smaller, focused interfaces.

helmedeiros/clean-code-skills · 48 tokens