code-quality

code-quality is a skill for Claude Code, Codex from 05-deepak-patidar/claude-skills. It costs 66 tokens per session (1,042 once invoked), scanned A, original, MIT.

A guide for writing and reviewing maintainable, correct code in any programming language. It focuses on code that is understandable and safe to change, including naming, structure, and error handling.

In plain words
What is it for?
Use it when writing modules, reviewing code, refactoring, choosing names, handling unusual input, or checking whether an implementation is easy to maintain.
Why use it?
It helps prevent code that works only for simple cases or becomes risky to modify. The guidance is aimed at reducing the effort needed for the next change.

Skill for Claude CodeCodex

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

Good fit Use it when writing modules, reviewing code, refactoring, choosing names, handling unusual input, or checking whether an implementation is easy to maintain.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/05-deepak-patidar/claude-skills/code-quality/github.svg)](https://agentmods.dev/skills/05-deepak-patidar/claude-skills/code-quality)
Your own site
<a href="https://agentmods.dev/skills/05-deepak-patidar/claude-skills/code-quality"><img src="https://agentmods.dev/badge/skills/05-deepak-patidar/claude-skills/code-quality/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 code-quality

Your own site · 80×15
<a href="https://agentmods.dev/skills/05-deepak-patidar/claude-skills/code-quality"><img src="https://agentmods.dev/badge/skills/05-deepak-patidar/claude-skills/code-quality.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,042 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.00066 $0.01042
Opus 5 $0.00033 $0.00521
Sonnet 5 $0.00013 $0.00208
Haiku 4.5 $0.00007 $0.00104

Measured 9d ago against content hash 0e7689059dde, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

code-quality 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 9d 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.

code-quality/SKILL.md · 60 lines

How it starts

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

Code Quality

Code quality is not aesthetics. It is one measurable thing: how fast can the next person (human or AI) change this code without breaking it? Every rule below serves that.

The hierarchy — when rules conflict, higher wins

  1. Correct — handles the real input space, including the ugly parts (empty, null, duplicate, concurrent, huge, malformed).
  2. Honest — the code's names, types, and structure tell the truth about what it does. No function named validate that also saves.
  3. Changeable — the next likely change touches one place.
  4. Consistent — matches the codebase around it. A "better" pattern that fights the codebase is worse.
  5. Small/clever/fast — last, and only with evidence it matters.

Writing rules

Shape

  • Functions do one thing at one level of abstraction. The test: can you name it accurately without "and"? Length is a symptom, not the rule — a 40-line straight-line function beats 5 fragmented ones you must chase.
  • Depth over surface: prefer few functions with real behavior over layers of one-line delegation. Every hop a reader must follow is a cost; charge it against real value.
  • Data shapes beat control flow: replacing an if/else ladder with a lookup table, an enum with exhaustive matching, or a well-typed state object usually deletes bugs. Make illegal states unrepresentable where the type system allows.

Names

  • Names carry the spec: retry_delay_seconds not delay; is_eligible_for_credit not check. If a good name is impossible, the abstraction is wrong.
  • Booleans read as assertions (is_, has_, can_); functions as verbs; avoid negated booleans (not_disabled) that force double negation.

Errors — where most "quality" issues actually live

  • Handle or propagate, never swallow. An empty catch block is a bug with extra steps; catching broad Exception to log-and-continue hides corruption.
  • Fail fast at boundaries: validate inputs where they enter (API edge, file load, config boot), then the interior trusts its inputs. Validation sprinkled everywhere means it's guaranteed nowhere.
  • Error messages state what failed, with what input, and what the caller can do — written for the debugging session at 2 a.m.
  • Distinguish expected failures (user error → typed error/result, clean message) from bugs (invariant broken → crash loudly). Converting bugs into handled errors hides them.

Read the full file on GitHub · 60 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. 9d ago First seen · 60 lines · 66 tokens per session scan A 0e7689059dde

Subscribe to this mod's changes

code-quality is a skill published in the GitHub repository 05-deepak-patidar/claude-skills (4 stars, last pushed 2mo ago), licensed MIT. It adds 66 tokens to every session and 1,042 once invoked, about $0.0003 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.