clean-code

clean-code is a skill for Claude Code, Codex from renky1025/agent-skills. It costs 274 tokens per session (2,107 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

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

Good fit Use it when reviewing or improving code structure, naming, functions, error handling, tests, or common code smells in any programming language.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/renky1025/agent-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 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/github.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/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/renky1025/agent-skills/clean-code"><img src="https://agentmods.dev/badge/skills/renky1025/agent-skills/clean-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 274 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,107 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.00274 $0.02107
Opus 5.5 $0.00110 $0.00843
Sonnet 5.5 $0.00055 $0.00421
Haiku 4.5 $0.00027 $0.00211

Measured 1mo ago against content hash ad718673dcc8, 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.

clean-code/SKILL.md · 150 lines

How it starts

The opening of the file, as written. The whole thing — 150 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

Purpose

A synthesised study aid for Clean Code: it maps every named framework, principle, anti-pattern, and heuristic in the book to a reference file, then routes a question or a review finding to the file that answers it. It produces grounded advice with chapter citations — not the book text, and not a linting tool.

When to Use

  • Naming, functions, comments, formatting, objects vs data structures, error handling, boundaries, tests/TDD, classes/SRP, systems, concurrency, refactoring, code smells.
  • A live review or cleanup where you must name why something is a smell and what to do.
  • Studying the book, or asking "what does Uncle Bob say about X".
  • Trigger phrases: 整洁代码, 重构, 代码质量, 命名, 函数设计, 注释, 代码味道, 反模式, 测试驱动; clean code, naming, TDD, error handling, code smell, code review, SRP.

When NOT to Use

  • Review-and-fix of a diff -> claude-simplify runs the review and applies fixes; this skill only supplies the justification the review cites.
  • Beyond the book — design patterns, architecture, framework idioms -> say it is out of scope; do not extrapolate book positions.
  • Untrusted third-party code safety -> skill-security-check.
  • Language tooling (linters, formatters, rule configs) -> not covered.

Workflow

A. Look something up

  1. Classify the question into a topic in the Decision Rules table.
  2. Read that one file; preloading references/ defeats the routing table.
  3. Follow a chapter's cross-reference only when the question actually needs it.
  4. Answer from the loaded content, citing chapter and heuristic ids (Ch 3, G5, F1).
  5. For a non-Java language, read references/appendix-lang-map.md and translate rather than quoting Java syntax.

B. Apply the book to a live code review

  1. Read references/cheatsheet.md — it is the review lens.
  2. Tag each diff finding with its C/E/F/G/J/N/T heuristic id; load references/chapters/ch17-smells-and-heuristics.md for tags absent from the cheat sheet.
  3. Name the fixing framework, then load the chapter that owns it via the routing table.
  4. Load references/patterns.md when the fix is a technique and you need its trade-offs.
  5. Report each finding as: id -> why -> fix -> citation.

Read the full file on GitHub · 150 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. 1mo ago Changed · -23 lines · +175 tokens per session ad718673dcc8
  2. 1mo 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 (11 stars, last pushed 15d ago), licensed MIT. It adds 274 tokens to every session and 2,107 once invoked, about $0.0011 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

mindos

MindOS: local knowledge assistant & shared KB. Keeps decisions, notes, SOPs, debugging lessons, research findings, preferences across sessions/agents. Core: save notes, search KB, organize files, run workflows, review, append CSV, hand off context, distill lessons. NOT for app source or paths outside KB. Triggers…

GeminiLight/MindOS · 136 tokens

superlint

This skill describes the mandatory standard operating procedure for using our internal SuperLint tool. Use this when tasks require fixing code quality issues according to corporate standards.

mgechev/skillgrade · 0 tokens

api-design

Design public interfaces for libraries and tools that other people depend on. Use when designing or reviewing a public API surface, deciding what to export, naming functions and CLI flags, adding configuration options, planning deprecations, or when the user asks "is this a good API" or "how do I change this without…

the-open-agent/oss-skills · 107 tokens

code-review

Review a pull request the way a good open-source maintainer does. Use when reviewing an incoming PR, when the user asks "review this PR" or "is this ready to merge", when triaging a stale PR queue, or when writing review feedback to an external contributor. Covers what to check and in what order, severity levels…

the-open-agent/oss-skills · 118 tokens

refactor-safely

Restructure code that other people depend on without breaking them. Use when planning a large refactor or rewrite, splitting a monolith into packages, renaming or moving public symbols, changing internal architecture behind a stable API, or when the user says "I want to rewrite this" or "this code needs to be cleaned…

the-open-agent/oss-skills · 109 tokens

code_review

Comprehensive code review for quality, security, performance, and best practices across any language.

onmyway133/skills · 20 tokens