clean-code

clean-code is a skill for Claude Code from kumaran-is/claude-code-onboarding. It costs 79 tokens per session (1,637 once invoked), scanned A, original, MIT.

A language-independent guide for making source code easier to read, understand, and maintain. It covers names, functions, comments, formatting, error handling, tests, classes, and common code smells.

In plain words
What is it for?
Use it when writing, reviewing, refactoring, or setting team standards for code quality.
Why use it?
It helps identify confusing or unnecessarily difficult code before it causes maintenance problems or slows down other developers.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it when writing, reviewing, refactoring, or setting team standards for code quality.

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

Made for: Claude Code.

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/kumaran-is/claude-code-onboarding/clean-code/github.svg)](https://agentmods.dev/skills/kumaran-is/claude-code-onboarding/clean-code)
Your own site
<a href="https://agentmods.dev/skills/kumaran-is/claude-code-onboarding/clean-code"><img src="https://agentmods.dev/badge/skills/kumaran-is/claude-code-onboarding/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/kumaran-is/claude-code-onboarding/clean-code"><img src="https://agentmods.dev/badge/skills/kumaran-is/claude-code-onboarding/clean-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,637 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.00079 $0.01637
Opus 5 $0.00039 $0.00818
Sonnet 5 $0.00016 $0.00327
Haiku 4.5 $0.00008 $0.00164

Measured 6d ago against content hash 80455e328ae5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, 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 6d 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.

.claude/skills/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 Skill

Iron Law: Before applying any principle, READ the relevant source file first. Do not refactor or flag issues based on memory — verify the actual code (file:line) before making any claim.

This skill embodies the principles of "Clean Code" by Robert C. Martin (Uncle Bob). Use it to transform "code that works" into "code that is clean."

Core Philosophy

"Code is clean if it can be read, and enhanced by a developer other than its original author." — Grady Booch

When to Use

  • Writing new code: Ensure high quality from the start.
  • Reviewing Pull Requests: Provide constructive, principle-based feedback.
  • Refactoring legacy code: Identify and remove code smells.
  • Improving team standards: Align on industry-standard best practices.

1. Meaningful Names

  • Use Intention-Revealing Names: elapsedTimeInDays instead of d.
  • Avoid Disinformation: Don't use accountList if it's actually a Map.
  • Make Meaningful Distinctions: Avoid ProductData vs ProductInfo.
  • Use Pronounceable/Searchable Names: Avoid genymdhms.
  • Class Names: Use nouns (Customer, WikiPage). Avoid Manager, Data.
  • Method Names: Use verbs (postPayment, deletePage).

2. Functions

  • Small: Functions should be shorter than you think.
  • Do One Thing: A function should do only one thing, and do it well.
  • One Level of Abstraction: Don't mix high-level business logic with low-level details (like regex).
  • Descriptive Names: isPasswordValid is better than check.
  • Arguments: 0 is ideal, 1-2 is okay, 3+ requires a very strong justification — introduce a parameter object.
  • No Side Effects: Functions shouldn't secretly change global state.

3. Comments

  • Don't Comment Bad Code — Rewrite It: Most comments are a sign of failure to express in code.
  • Explain Yourself in Code:
    # BAD: comment explains intent that code should express
    if employee.flags & HOURLY and employee.age > 65:
    
    # GOOD: code expresses intent directly
    if employee.isEligibleForFullBenefits():
    
  • Good Comments: Legal, informative (regex intent), clarification (external library behavior), TODOs (with ticket).
  • Bad Comments: Mumbling, redundant, misleading, mandated, noise, position markers.

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. 6d ago First seen · 150 lines · 79 tokens per session scan A 80455e328ae5

Subscribe to this mod's changes

clean-code is a skill published in the GitHub repository kumaran-is/claude-code-onboarding (35 stars, last pushed 2mo ago), licensed MIT. It adds 79 tokens to every session and 1,637 once invoked, about $0.0004 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-09-03.