clean-code

clean-code is a skill for Claude Code, Codex from bcastelino/agent-skills-kit. It costs 45 tokens per session (1,081 once invoked), scanned A, a copy of clean-code, MIT.

A code-writing and review guide based on Robert C. Martin's Clean Code principles, which focus on making software easy for other developers to read and change.

In plain words
What is it for?
Use it when writing code, reviewing pull requests, refactoring older code, or setting shared coding standards.
Why use it?
It helps identify unclear names, oversized functions, code smells, and other patterns that make maintenance harder.

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

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/bcastelino/agent-skills-kit/clean-code.svg)](https://agentmods.dev/skills/bcastelino/agent-skills-kit/clean-code)
Your own site
<a href="https://agentmods.dev/skills/bcastelino/agent-skills-kit/clean-code"><img src="https://agentmods.dev/badge/skills/bcastelino/agent-skills-kit/clean-code.svg" alt="Measured on agentmods" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,081 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 97% 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 $0.00045 $0.01081
Opus 5 $0.00023 $0.00541
Sonnet 5 $0.00009 $0.00216
Haiku 4.5 $0.00005 $0.00108

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

Origin

This is a copy

97% identical to clean-code — 9 lines differ, 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 · 92 lines

How it starts

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

Clean Code Skill

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

Use this skill when:

  • Writing new code: To ensure high quality from the start.
  • Reviewing Pull Requests: To provide constructive, principle-based feedback.
  • Refactoring legacy code: To identify and remove code smells.
  • Improving team standards: To 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.
  • 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 ourselves in code.
  • Explain Yourself in Code:
    # Check if employee is eligible for full benefits
    if employee.flags & HOURLY and employee.age > 65:
    
    vs
    if employee.isEligibleForFullBenefits():
    
  • Good Comments: Legal, Informative (regex intent), Clarification (external libraries), TODOs.
  • Bad Comments: Mumbling, Redundant, Misleading, Mandated, Noise, Position Markers.

Read the full file on GitHub · 92 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 · 92 lines · 45 tokens per session scan A 20b8d75e7cf1

Subscribe to this mod's changes

clean-code is a skill published in the GitHub repository bcastelino/agent-skills-kit (2 stars, last pushed 29d ago), licensed MIT. It adds 45 tokens to every session and 1,081 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 97% identical to clean-code, differing in 9 lines, and is treated as a copy.

Related

Other skills, from other repositories

jobs

Manage agy staffer background jobs - collect results, check status, cancel, follow-up conversation, and setup. Use when an agy job needs collecting, when the user asks "is the agy job done", "show agy's result", "cancel the agy job", "continue the agy conversation", or "set up agy". This is the orchestrator's skill…

keli-wen/agy-staff · 99 tokens

researcher

Delegate a deep research or survey task to Google's Antigravity CLI (agy staffer, fast Gemini). Use when the user says /agy:researcher, "ask agy to research", "have the agy staffer survey X", or wants a second, independent deep-dive on a topic or codebase without spending the host model's quota.

keli-wen/agy-staff · 75 tokens

staffer

Delegate a general-purpose task to Google's Antigravity CLI (agy staffer, fast Gemini) with a minimal, unopinionated prompt. Use when the user says /agy:staffer, "have agy do/handle X", "have agy generate an image", or the task fits none of the specialist personas (researcher / reviewer / implementer / ask) — the…

keli-wen/agy-staff · 121 tokens

ask

Ask Google's Antigravity CLI (agy staffer, fast Gemini) a cheap one-shot question - the fast zero-tool mode and the post-install smoke test. Use when the user says /agy:ask, "ask agy", "quick second opinion from agy", or right after installing to verify the plugin works.

keli-wen/agy-staff · 67 tokens

reviewer

Get a second-opinion review from Google's Antigravity CLI (agy staffer, fast Gemini) - of code (a diff, PR, working tree) or of a decision, plan, or design. Use when the user says /agy:reviewer, "have agy review this", "second opinion on my diff/PR/plan", or after finishing work and wanting an independent verifier…

keli-wen/agy-staff · 94 tokens

gemini-swarm

Use BEFORE writing or editing code, tests, docs, or other content yourself — whenever the writing spans more than one file or more than 20 lines. Delegating the writing to Gemini sessions via the agy (Antigravity) CLI is the default; you orchestrate. Also use when the user asks to swarm/fan out/parallelize work across…

Vallykrie/gemini-swarm-skill · 142 tokens