clean-code

clean-code is a skill for Claude Code, Codex from renky1025/agent-skills. It costs 99 tokens per session (2,927 once invoked), scanned A, original, MIT.

A reference guide to Robert C. Martin's software-writing principles, covering names, functions, comments, error handling, tests, and class design. TDD means writing a test before the code that makes it pass.

In plain words
What is it for?
Use it when reviewing or improving code structure, naming, functions, error handling, tests, or common code smells in any programming language.
Why use it?
It gives developers a shared way to spot code that is hard to understand, change, or test.

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/renky1025/agent-skills/clean-code
Any agent
npx skills add renky1025/agent-skills --skill clean-code
Clone the repo
git clone --depth 1 https://github.com/renky1025/agent-skills

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/renky1025/agent-skills/clean-code.svg)](https://agentmods.dev/skills/renky1025/agent-skills/clean-code)
Your own site
<a href="https://agentmods.dev/skills/renky1025/agent-skills/clean-code"><img src="https://agentmods.dev/badge/skills/renky1025/agent-skills/clean-code.svg" alt="Measured on agentmods" height="20"></a>
Per session 99 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,927 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.00099 $0.02927
Opus 5 $0.00049 $0.01463
Sonnet 5 $0.00020 $0.00585
Haiku 4.5 $0.00010 $0.00293

Measured 4d ago against content hash 5c75cf8bd2f4, 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 4d 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.

clean-code/SKILL.md · 173 lines

How it starts

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

Clean Code

Author: Robert C. Martin (Uncle Bob) | Pages: ~462 | Chapters: 17 | Generated: 2026-08-24

How to Use This Skill

  • No arguments — load core frameworks for reference (this file's Core Frameworks section).
  • With a topic — ask about naming, functions, comments, TDD, error handling, code smells, etc.; I find and read the relevant chapter.
  • With a chapter — ask for ch03 (functions) or ch17 (smells); I load that specific chapter file.
  • Browse — ask "what chapters do you have?" to see the full index.

When you ask about a topic not covered in the Core Frameworks below, I will read the relevant chapter file before answering, grounded in the book's actual content.

Language-agnostic: The principles in this skill are universal software-engineering truths, not Java rules. The book happens to use Java for its code examples, but naming, functions, comments, SRP, TDD, error handling, concurrency, and code smells apply to every language. When you name a language (e.g. "in Rust", "in Go"), I will translate the advice to that language using appendix-lang-map.md instead of quoting Java syntax.


Core Frameworks & Mental Models

Clean Code is a discipline of care: code is read far more than it is written (reading:writing ≈ 10:1), so optimize for the reader. Below are the author's named, reusable frameworks — apply them, don't just recall them.

Professionalism & attitude

  • The Boy Scout Rule — Leave the campground cleaner than you found it. Every check-in makes one small, safe improvement (rename, extract, de-dupe). Cumulatively this prevents rot; you never need a "Grand Redesign in the Sky".
  • LeBlanc's law — "Later equals never." Refactoring deferred to "later" is refactoring never done. Fix it where you stand.
  • The Primal Conundrum — Making a mess to hit a deadline guarantees you miss it; the only way to go fast is to keep the code clean. Refuse requirements that force chaos (Semmelweis hand-washing analogy).

Read the full file on GitHub · 173 lines

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. 4d ago First seen · 173 lines · 99 tokens per session scan A 5c75cf8bd2f4

Subscribe to this mod's changes

clean-code is a skill published in the GitHub repository renky1025/agent-skills (10 stars, last pushed 5d ago), licensed MIT. It adds 99 tokens to every session and 2,927 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-31.

Related

Other skills, from other repositories

design-taste-frontend

Anti-slop frontend skill for landing pages, portfolios, and redesigns. The agent reads the brief, infers the right design direction, and ships interfaces that do not look templated. Real design systems when applicable, audit-first on redesigns, strict pre-flight check.

Leonxlnx/taste-skill · 61 tokens

stitch-design-taste

Semantic Design System Skill for Google Stitch. Generates agent-friendly DESIGN.md files that enforce premium, anti-generic UI standards — strict typography, calibrated color, asymmetric layouts, perpetual micro-motion, and hardware-accelerated performance.

Leonxlnx/taste-skill · 50 tokens

full-output-enforcement

Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.

Leonxlnx/taste-skill · 44 tokens

image-to-code

Elite website image-to-code skill for Codex. For visually important web tasks, it must first generate the design image(s) itself, deeply analyze them, then implement the website to match them as closely as possible. In Codex, it must prefer large, readable, section-specific images instead of tiny compressed boards…

Leonxlnx/taste-skill · 116 tokens

imagegen-frontend-mobile

Elite mobile app image-generation skill for creating premium, app-native screen concepts and flows. Designed for iOS, Android, and cross-platform mobile products. Prioritizes clean hierarchy, comfortably readable text, strong multi-screen consistency, controlled color palettes, non-generic creative direction, textured…

Leonxlnx/taste-skill · 126 tokens

imagegen-frontend-web

Elite frontend image-direction skill for generating premium, conversion-aware website design references. CRITICAL OUTPUT RULE — generate ONE separate horizontal image FOR EVERY section. A landing page with 8 sections produces 8 images. Never compress multiple sections into one image. Enforces composition variety (not…

Leonxlnx/taste-skill · 126 tokens