clean-code

clean-code is a skill for Claude Code from btseee/clean-code-skills. It costs 78 tokens per session (1,994 once invoked), scanned A, original, MIT.

A coding guide for readable code and clear software structure across languages and frameworks. It covers naming, responsibilities, module boundaries, dependencies, testing, and refactoring.

In plain words
What is it for?
Use it while writing, reviewing, testing, refactoring, or organizing application code, scripts, infrastructure, and database work.
Why use it?
It helps prevent code from being placed in the wrong layer, duplicated, or changed without checking how the surrounding system works.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions CLAUDE.md; mentions AGENTS.md; $skill-name invocation.

Part of the clean-code-skills plugin — 1 skill shipped together

Good fit Use it while writing, reviewing, testing, refactoring, or organizing application code, scripts, infrastructure, and database work.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/btseee/clean-code-skills/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 btseee/clean-code-skills --skill clean-code
Clone the repo
git clone --depth 1 https://github.com/btseee/clean-code-skills

Made for: Claude Code.

Or install clean-code-skills, the plugin that ships this one along with the rest of its 1 skill.

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/btseee/clean-code-skills/clean-code/github.svg)](https://agentmods.dev/skills/btseee/clean-code-skills/clean-code)
Your own site
<a href="https://agentmods.dev/skills/btseee/clean-code-skills/clean-code"><img src="https://agentmods.dev/badge/skills/btseee/clean-code-skills/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/btseee/clean-code-skills/clean-code"><img src="https://agentmods.dev/badge/skills/btseee/clean-code-skills/clean-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,994 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 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.1 $0.00078 $0.01994
Opus 5.5 $0.00031 $0.00798
Sonnet 5.5 $0.00016 $0.00399
Haiku 4.5 $0.00008 $0.00199

Measured 21d ago against content hash a37a39538077, 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 21d 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.

skills/clean-code/SKILL.md · 152 lines

How it starts

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

Clean Code And Clean Architecture

Before The First Edit: Load Context

You forget everything between sessions. scripts/ and references/ resolve from this file's folder. Read in order; trivial edits (typo, comment) skip this gate and the review checklist.

  1. Stack. .clean/context.json; missing: run scripts/detect_stack.py, or read manifests and file extensions.
  2. Packs. Open each pack in packs or under "Read next" with the file-read tool (naming a pack is not reading it), except framework packs whose pack_scopes exclude your area. By hand: clean-packs index in references/framework-map.md; none: answer its adaptation questions.
  3. Layers. .clean/architecture.md; see Layer Rules.
  4. Decisions. .clean/decisions.md, .clean/ledger.md. Recorded decisions are settled; resume, never restart, campaigns in progress.
  5. Structure. Your area's .clean/structure.md rows (grep path) or scripts/map_structure.py --path <area>; by hand, list the folder, open the two or three most similar files.
  6. Project instructions. AGENTS.md, CLAUDE.md, CONTRIBUTING.md, ARCHITECTURE.md, README.md.

On conflict, first wins: project instructions, recorded decisions, declared layers, local conventions, framework pack, language pack, this skill. Only init, audit, new-project create .clean/; plain sessions read it, offer to persist at the end.

Operating Loop

  1. Frame: behavior change, assumptions, smallest scope, success check. Ask only if ambiguity changes the implementation.
  2. Read nearby code, naming, tests, error style, framework idiom; search for existing implementations first.
  3. Place: owning unit; which side of which boundary.
  4. Edit surgically: every changed line traces to the request; targeted edits, never whole-file regeneration; remove what your change orphaned.
  5. Verify: narrowest meaningful check, then what the risk level owes (review-checklist.md); bug: reproducer test first; refactor: tests before and after. Never claim success without running something.
  6. Review the diff with references/review-checklist.md, self-check included.

Read the full file on GitHub · 152 lines

Files

What ships with it

60 files 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. 21d ago Changed · -221 lines · -34 tokens per session a37a39538077
  2. 1mo ago Changed f244e119bdc6
  3. 1mo ago First seen · 373 lines · 112 tokens per session scan A 30eb3500ddef

Subscribe to this mod's changes

clean-code is a skill published in the GitHub repository btseee/clean-code-skills (14 stars, last pushed 22d ago), licensed MIT. It adds 78 tokens to every session and 1,994 once invoked, about $0.0003 per session on Opus 5.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-31.

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

architecture-compass

Architectural thinking partner for an existing repository — scans the codebase, conducts a structured interview, agrees on current architectural state and recommended direction, and produces a shareable insights document. Scoped to one repository, module, or folder. Does not execute transformation — it orients. Use…

techygarg/lattice · 114 tokens

review-refiner

Facilitate a structured conversation to customize how the review molecule works -- atom loading rules, severity classification, report format, scope rules, insight capture, and health logging. Produces a formal review-standards.md document that the review molecule will use as its process configuration. Use when the…

techygarg/lattice · 92 tokens