Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
bobmatnyc avatar

Code Quality

  • 87 installs
  • 63 repo stars
  • Updated July 18, 2026
  • bobmatnyc/claude-mpm-skills

code-quality is a Claude Code skill listing six high-value Python code-quality anti-patterns to catch in review and enforce with ruff, pylint, and mypy.

About

code-quality is a skill covering six high-value Python code-quality anti-patterns to catch during review or self-review. It flags malformed exception classes, == None vs is None, bare except, wildcard imports, magic numbers, and unused locals, and maps each to ruff, pylint, or mypy rules. A developer uses it when reviewing Python code or configuring lint rules for CI. It is review-focused, distinct from testing mechanics and whole-codebase scoring.

  • Six high-value Python code-quality anti-patterns to catch in review
  • Covers exception hierarchy, is-vs-== singletons, bare except, wildcard imports, magic numbers, dead locals
  • Maps each anti-pattern to ruff/pylint/mypy rules for CI enforcement

Code Quality by the numbers

  • 87 all-time installs (skills.sh)
  • Ranked #472 of 1,352 Code Review & Quality skills by installs in the Skillselion catalog
  • Data as of Aug 1, 2026 (Skillselion catalog sync)
At a glance

code-quality capabilities & compatibility

Capabilities
code review · static analysis · quality check
Use cases
code review · refactoring
From the docs

What code-quality says it does

High-value Python code-quality anti-patterns to check during review or self-review.
SKILL.md
Compare singletons with `is`, not `==`
SKILL.md
**Gate these in CI.** Most are enforceable cheaply with `ruff`
SKILL.md
npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill code-quality

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs87
repo stars63
Last updatedJuly 18, 2026
Repositorybobmatnyc/claude-mpm-skills

What it does

Catch high-value Python anti-patterns during code review and enforce them with ruff/pylint/mypy in CI.

Who is it for?

developers reviewing Python code for correctness and readability defects a linter should catch

Skip if: testing mechanics or whole-codebase health scoring

When should I use this skill?

reviewing or self-reviewing Python code for correctness and readability defects, or configuring ruff/pylint/mypy rules

By the numbers

  • 6 core Python anti-patterns
  • ruff rules F403/F405/F841/E711/E712

Files

SKILL.mdMarkdownGitHub ↗

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.

Best Practices

  • Gate these in CI. Most are enforceable cheaply with ruff (F403/F405 wildcard,

F841 unused locals, E711/E712 singleton comparison), pylint, and mypy. Put the lint step in CI so review effort focuses on judgment, not mechanics.

  • Prefer specific exception handlers. Order handlers narrowest-first; reserve a

generic except Exception for a logging/re-raising last resort.

  • Name intent, not values. A constant's name documents why a threshold exists; a

bare literal documents nothing.

Anti-Patterns (What to Avoid)

  • Inheriting custom exceptions from object or directly from BaseException.
  • == None, == True, or is "some literal".
  • Bare except: or except BaseException: that swallows control-flow signals.
  • from module import * outside a curated __init__.py with explicit __all__.
  • Unexplained numeric literals in business logic.
  • Assigned-but-never-read locals left behind by a stale refactor.

Navigation

  • [quality-antipatterns.md](references/quality-antipatterns.md): Full non-compliant

vs compliant examples and a "how to test" note for each of the six anti-patterns.

Related Skills

  • pytest (toolchains/python/testing/pytest): testing mechanics — fixtures,

parametrization, mocking. Several anti-patterns here (broad except, malformed exception classes) directly cause flaky tests.

  • code-review-standards (universal/process/code-review-standards): the

project-wide, severity-tagged review checklist that incorporates equivalents of these.

  • code-quality-scoring (universal/quality/code-quality-scoring): whole-codebase

health and technical-debt scoring, rather than individual findings.

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.