code-quality

code-quality is a skill for Claude Code from mthines/agent-skills. It costs 183 tokens per session (5,525 once invoked), scanned A, original, MIT.

A code-writing and review guide focused on making software easier to read, understand, test, and change over time.

In plain words
What is it for?
Use it while planning, writing, or reviewing code. It covers simpler control flow, focused functions, type-safe designs, validation, reusable utilities, and appropriate performance choices.
Why use it?
It reduces the mental effort required from the next developer and helps avoid tangled logic, duplicated concepts, unclear types, and unnecessary performance tweaks. It considers readability first, then maintainability and practical performance.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the mthines-agent-skills plugin — 57 skills, 5 agents shipped together

Good fit Use it while planning, writing, or reviewing code. It covers simpler control flow, focused functions, type-safe designs, validation, reusable utilities, and appropriate performance choices.

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

Made for: Claude Code.

Or install mthines-agent-skills, the plugin that ships this one along with the rest of its 57 skills, 5 agents.

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/mthines/agent-skills/code-quality/github.svg)](https://agentmods.dev/skills/mthines/agent-skills/code-quality)
Your own site
<a href="https://agentmods.dev/skills/mthines/agent-skills/code-quality"><img src="https://agentmods.dev/badge/skills/mthines/agent-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/mthines/agent-skills/code-quality"><img src="https://agentmods.dev/badge/skills/mthines/agent-skills/code-quality.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 183 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,525 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.00183 $0.05525
Opus 5.5 $0.00073 $0.02210
Sonnet 5.5 $0.00037 $0.01105
Haiku 4.5 $0.00018 $0.00553

Measured 1mo ago against content hash e3995d3bff0c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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.

skills/quality/code-quality/SKILL.md · 317 lines

How it starts

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

Code Quality Skill

Write code that is easy to review, understand, and change. Optimize for the next developer's mental load before optimizing for machine performance, because readable code is cheaper to change, debug, and trust — and most performance wins come from algorithmic choices and profiling, not micro-optimizations.

The three quality axes this skill targets, in priority order:

  1. Readability — a reader understands the code top-to-bottom on first pass.
  2. Maintainability — the next variant of a concept is a one-file, one-edit change; existing utilities are reused rather than re-invented; one concept has one canonical home.
  3. Pragmatic performance — algorithmic wins by default, micro-optimizations only when a profiler points at them.

This skill applies in four modes:

  1. Plan mode — invoked with Skill("code-quality", "plan"), before any code is written. Reads a plan.md (or proposed approach) and the existing codebase, and verifies the plan's structure follows the existing patterns and avoids predictable design-time risks (premature parallel maps, missing branded primitives, untyped error paths, parameter creep, neighbour mismatch). Returns findings only — no code edits. Used by autonomous-workflow Phase 1. See rules/plan-mode.md.
  2. Authoring mode — when writing new code (e.g., GREEN phase of TDD, new features). Apply principles inline so the first version already meets the bar. Default mode when no argument is passed.
  3. Review mode — invoked with Skill("code-quality", "code") or Skill("code-quality", "review"), after code is written. When refactoring, reviewing PRs, or being asked to "clean this up". Diagnose against the rules and propose targeted changes. Returns findings only — no code edits.
  4. Simplify mode — invoked with Skill("code-quality", "simplify"), after a feature is implemented and tests are green. Runs the review pass, then applies mechanical refactors (Class M recipes from rules/refactor-recipes.md) one at a time behind Skill("confidence", "code") ≥ 90 % and a scoped fast-check, reverting on failure. Judgment-class recipes (Class J) stay as proposals. See rules/simplify-mode.md. Variants: simplify aggressive also auto-applies Medium-impact mechanical recipes; simplify dry-run reports without writing; simplify <path> scopes to a path instead of the diff.

Detect the mode from the $ARGUMENTS first token: plan → plan mode; code or review → review mode; simplify → simplify mode; anything else (including no argument) → authoring mode. The legacy convention "user said review or audit" still routes to review mode for ad-hoc invocations.


Read the full file on GitHub · 317 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 First seen · 317 lines · 183 tokens per session scan A e3995d3bff0c

Subscribe to this mod's changes

code-quality is a skill published in the GitHub repository mthines/agent-skills (19 stars, last pushed today), licensed MIT. It adds 183 tokens to every session and 5,525 once invoked, about $0.0007 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

ego-lite-simplify

Find and implement evidence-backed simplifications in the ego-lite repository. Use when reviewing the codebase for dead code, duplicated state or APIs, speculative abstractions, unnecessary compatibility layers, hand-written infrastructure, excessive tests or documentation, or when the user asks to reduce code size or…

citrolabs/ego-lite · 68 tokens

code-review-and-quality

Runs code review as a change-management process — right-sizing the diff, labeling findings by required-vs-optional severity, applying structural remedies for complexity, and resolving reviewer/author disagreements. Use when a change needs splitting before review, when review comments need severity labels, when a…

shennawardana23/skillme · 86 tokens

code-simplification

Simplifies working code for clarity without changing behavior — reduces nesting, renames vague identifiers, removes dead code and unnecessary abstraction. Use when code works but is harder to read, maintain, or extend than it should be, or when a review flagged accumulated complexity. Not for adding features or fixing…

shennawardana23/skillme · 74 tokens

coding-standards

Cross-language code-quality heuristics -- function size, nesting depth, magic numbers, comment intent, naming -- for reviewing or writing code in any language. Use when reviewing code for maintainability, setting up lint rules, or onboarding conventions. For Go-specific idioms use go-service-idioms, for API contracts…

shennawardana23/skillme · 106 tokens

doubt-driven-development

Subjects a non-trivial decision to a fresh-context adversarial review before it stands, in-flight rather than as a post-hoc PR verdict. Use before an architectural decision under uncertainty, before committing non-trivial code, before asserting a non-obvious fact ("this is safe", "this scales", "this matches the…

shennawardana23/skillme · 81 tokens

best-practices

Apply modern web development best practices for security, compatibility, and code quality. Use when asked to "apply best practices", "security audit", "modernize code", "code quality review", or "check for vulnerabilities".

shennawardana23/skillme · 49 tokens