code-quality

code-quality is a skill for Claude Code from bobmatnyc/claude-mpm-skills. It costs 61 tokens per session (1,306 once invoked), scanned A, original, MIT.

A review guide for finding common correctness and readability problems in Python code. It focuses on issues that automated checks or a careful code review should catch.

In plain words
What is it for?
It helps review exception handling, identity comparisons, imports, unexplained numeric values, and unused local variables.
Why use it?
It helps prevent subtle bugs and makes code easier to understand before it reaches production.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Good fit It helps review exception handling, identity comparisons, imports, unexplained numeric values, and unused local variables.

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

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 code-quality

README.md
[![agentmods](https://agentmods.dev/badge/skills/bobmatnyc/claude-mpm-skills/code-quality/github.svg)](https://agentmods.dev/skills/bobmatnyc/claude-mpm-skills/code-quality)
Your own site
<a href="https://agentmods.dev/skills/bobmatnyc/claude-mpm-skills/code-quality"><img src="https://agentmods.dev/badge/skills/bobmatnyc/claude-mpm-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/bobmatnyc/claude-mpm-skills/code-quality"><img src="https://agentmods.dev/badge/skills/bobmatnyc/claude-mpm-skills/code-quality.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,306 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.00061 $0.01306
Opus 5 $0.00030 $0.00653
Sonnet 5 $0.00012 $0.00261
Haiku 4.5 $0.00006 $0.00131

Measured 5d ago against content hash e0217649bdd8, 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 5d 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.

toolchains/python/quality/code-quality/SKILL.md · 106 lines

How it starts

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

Python Code Quality

High-value Python code-quality anti-patterns to check during review or self-review. This skill is review-focused: it covers correctness and readability defects that a reviewer (or a linter) should flag, separate from testing mechanics (pytest) and whole-codebase health scoring (code-quality-scoring).

Source note: These anti-patterns are derived from CAST Highlight's Python code quality indicators (https://doc.casthighlight.com/), which reference PEP 8 and the Python data model as primary sources. Where a rule mirrors PEP 8, the PEP is the authoritative source. All examples are original.

When to Use This Skill

Use it when the task is "is this Python code clean and correct?" — for example:

  • Reviewing a pull request and checking for the defects below.
  • Self-reviewing before opening a PR.
  • Configuring ruff/pylint/mypy rules so CI catches these automatically.
  • Writing or updating a team's Python code-quality guidance.

Do not use it for testing mechanics (use the pytest skill) or for scoring a whole codebase's health and technical debt (use the code-quality-scoring skill).

Core Anti-Patterns (Summary)

Six highest-value Python anti-patterns. Each has a non-compliant/compliant example and a "how to test" note in the reference doc:

  • Custom exceptions must derive from Exception — a class meant to be raised that inherits from object fails at runtime and breaks every except clause.
  • Compare singletons with is, not == — use is/is not for None/True/False (PEP 8); use is only for singletons, never for value comparison.
  • Avoid bare / overly broad except — catch the narrowest type you can handle; a generic except Exception only as a last-position fallback that logs or re-raises.
  • Avoid wildcard imports (from x import *) — they hide dependencies, risk silent name collisions, and defeat static analysis.
  • Replace magic numbers with named constants — promote non-obvious literals to documented, named constants.
  • Remove unused local variables — a dead assignment misleads readers and can hide a bug where a value was meant to be used.

Read the full file on GitHub · 106 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 106 lines · 61 tokens per session scan A e0217649bdd8

Subscribe to this mod's changes

code-quality is a skill published in the GitHub repository bobmatnyc/claude-mpm-skills (74 stars, last pushed 1mo ago), licensed MIT. It adds 61 tokens to every session and 1,306 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-09-03.

Related

Other skills, from other repositories

verify-language

Language-specific verification for Python, TypeScript/JavaScript, and Go. Checks type safety, language idioms, and best practices. Use when asked to "verify language", "check types", or for language-specific checks.

Aurite-ai/agent-verifier · 48 tokens

code-quality-analysis

Analyze Angular / Cumulocity Web SDK code for anti-patterns, bugs, and quality issues. Use when reviewing components, services, or modules for code quality, maintainability, performance, and correctness. Covers TypeScript best practices, Angular idioms, C8Y SDK usage patterns, and project-specific conventions.…

Cumulocity-IoT/cumulocity-skills · 90 tokens

mypy

Skill "mypy" from bobmatnyc/claude-mpm, covering mypy - static type checking for python, basic mypy, with common type stubs, for fastapi projects and for django projects.

bobmatnyc/claude-mpm · 24 tokens

code-reviewer-python

Auto-route to this skill if project contains.

buiphucminhtam/forgewright · 4 tokens

django-testing

Django testing discipline — TDD workflow for Django/DRF (RED-GREEN-REFACTOR against models, views, serializers, permissions), pytest-django and factory patterns, database and transaction handling in tests, API client testing, AND the verification gates a Django change must pass before it ships (migrations check…

Nmor/the-claude-council · 91 tokens

python-patterns

Pythonic idioms, PEP 8 standards, type hints, and best practices for building robust, efficient, and maintainable Python applications.

Nmor/the-claude-council · 33 tokens