clean-code

clean-code is a skill for Claude Code, Codex from KunanonJ/ai-skills-hub. It costs 39 tokens per session (1,172 once invoked), scanned A, a copy of clean-code, MIT.

A set of programming guidelines based on the book Clean Code by Robert C. Martin. It focuses on making code easier for another developer to read, understand, change, and review.

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

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it when writing code, reviewing pull requests, refactoring older code, or improving shared coding standards.

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

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/kunanonj/ai-skills-hub/clean-code.svg)](https://agentmods.dev/skills/kunanonj/ai-skills-hub/clean-code)
Your own site
<a href="https://agentmods.dev/skills/kunanonj/ai-skills-hub/clean-code"><img src="https://agentmods.dev/badge/skills/kunanonj/ai-skills-hub/clean-code.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,172 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 86% 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.1 $0.00039 $0.01172
Opus 5 $0.00019 $0.00586
Sonnet 5 $0.00008 $0.00234
Haiku 4.5 $0.00004 $0.00117

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

86% identical to clean-code — 2 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.

.agents/skills/clean-code/SKILL.md · 100 lines

How it starts

The opening of the file, as written. The whole thing — 100 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 · 100 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. 7d ago First seen · 100 lines · 39 tokens per session scan A d90261fd5e38

Subscribe to this mod's changes

clean-code is a skill published in the GitHub repository KunanonJ/ai-skills-hub (4 stars, last pushed 1mo ago), licensed MIT. It adds 39 tokens to every session and 1,172 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 86% identical to clean-code, differing in 2 lines, and is treated as a copy.

Related

Other skills, from other repositories

swarm-pr-review

Run a graph-guided, tool-augmented PR review using context packing, parallel exploration, mandatory repository-agnostic risk-family coverage with dispatch scaled to diff size and risk, independent reviewer validation, critic challenge, and metrics writeback. Use for deep pull request review with low false-positive…

ZaxbyHub/opencode-swarm · 91 tokens

plankton-code-quality

Write-time code quality enforcement using Plankton — auto-formatting, linting, and Claude-powered fixes on every file edit via hooks.

loulanyue/awesome-claude-notes · 34 tokens

critic-gate

Full execution protocol for MODE: CRITIC-GATE -- plan critic review, revision loops, and hard stop before execution.

ZaxbyHub/opencode-swarm · 29 tokens

swarm-pr-feedback

Codex adapter for closing known PR feedback in any repository. Use when asked to address pasted review feedback, GitHub review comments or threads, requested changes, CI/check failures, merge conflicts, stale PR branches, or follow-up work that must verify and close all known PR issues.

ZaxbyHub/opencode-swarm · 61 tokens

codebase-review-swarm

Codex adapter for running a rigorous, quote-grounded codebase review or security/QA/accessibility/performance/AI-slop/enhancement audit. Use for full-repo or large-subsystem review reports; not for normal implementation.

ZaxbyHub/opencode-swarm · 54 tokens

swarm-pr-review

Thin adapter for the canonical swarm-pr-review skill. The authoritative workflow lives in .opencode and this file only preserves the mirror contract for Codex-side skill discovery.

ZaxbyHub/opencode-swarm · 38 tokens