code-quality

A project-specific guide for checking and maintaining code quality. It covers automatic code formatting, linting for likely mistakes, type checking with mypy, and the project's naming and documentation rules.

In plain words
What is it for?
Use it to format code, run the full linting checks, check Python types, review code style, or follow the project's Makefile quality commands.
Why use it?
It prevents relying on a single checker when the project's standard uses several tools. It also gives consistent commands for preparing code and checking it before changes are committed.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/thomwebb/gac/code-quality
Any agent
npx skills add thomwebb/gac --skill code-quality
Clone the repo
git clone --depth 1 https://github.com/thomwebb/gac

Made for: Claude Code, Codex.

Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 635 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00038 $0.00635
Opus 5 $0.00019 $0.00318
Sonnet 5 $0.00008 $0.00127
Haiku 4.5 $0.00004 $0.00064

Measured 2d ago against content hash 27533c5362c3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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/code-quality/SKILL.md · 103 lines

How it starts

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

Code Quality Tools and Standards

When to Use

  • Formatting code before committing
  • Linting code for errors and style issues
  • Type checking for correctness
  • Reviewing or refactoring code

Makefile Targets (canonical)

make lint and make format run four tools, not just ruff:

make format     # ruff check --fix + ruff format + prettier --write + markdownlint --fix
make lint       # ruff check + ruff format --check + prettier --check + markdownlint --check
make type-check # mypy
make test       # uv run -- pytest

Running uv run ruff check . alone does NOT equal make lint. CI runs all four.

Individual Tools

uv run ruff check src/           # Lint
uv run ruff format src/          # Format
uv run mypy src/                 # Type check

Coding Standards

Type Annotations (required)

def parse_response(response: dict[str, Any]) -> str | None:
    """Parse API response and extract content."""
    message = response.get("message", {})
    return message.get("content")

Naming

  • Modules/functions: snake_case
  • Classes: CapWords
  • Constants: UPPER_SNAKE_CASE

Line Length: 120 characters max

Docstrings: Google-style

def generate(model: str, messages: list[dict]) -> tuple[str, int, int, int, int]:
    """Generate text using the AI provider.

    Args:
        model: Model name to use.
        messages: List of message dictionaries.

    Returns:
        Tuple of (content, input_tokens, output_tokens, input_cost, output_cost).
    """

File Size: 600 lines max

Split when exceeded — but don't split purely for line count if it hurts cohesion.

Pre-commit Workflow

# 1. Make changes
# 2. Format + lint
make format
make lint
# 3. Type check
make type-check
# 4. Test
make test
# 5. Commit with gac (scope + yes)
gac -sy

Note: -s is --scope (infers commit scope), -y is --yes (skips confirmation). Not "short mode".

Checklist

[ ] make format run?
[ ] make lint passes? (all 4 tools)
[ ] make type-check passes?
[ ] make test passes?
[ ] File length under 600 lines?
[ ] Type annotations on all functions?
[ ] Docstrings on public functions?

Read the full file on GitHub · 103 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. 2d ago First seen · 103 lines · 38 tokens per session scan A 27533c5362c3

Subscribe to this mod's changes

code-quality is a skill published in the GitHub repository thomwebb/gac (318 stars, last pushed 4d ago), licensed MIT. It adds 38 tokens to every session and 635 once invoked, about $0.0002 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-30.