dhpk-python-static-checks

dhpk-python-static-checks is a skill for Claude Code from hmj1026/dhpk. It costs 116 tokens per session (1,168 once invoked), scanned A, original, MIT.

A guide to setting up Python code checks with Ruff, Pyright, or mypy, including linting, formatting, and gradual type checking. It also explains how the project's hooks run these checks.

In plain words
What is it for?
Use it when configuring Python checks in pyproject.toml, adopting type hints over time, or investigating lint, format, or type-check failures.
Why use it?
It helps teams choose suitable rules and a type checker, keep editor and CI results consistent, and handle exceptions without hiding real problems.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the dhpk plugin — 65 skills, 31 commands, 40 agents, 4 hooks shipped together

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/hmj1026/dhpk/dhpk-python-static-checks
Any agent
npx skills add hmj1026/dhpk --skill dhpk-python-static-checks
Clone the repo
git clone --depth 1 https://github.com/hmj1026/dhpk

Made for: Claude Code.

Or install dhpk, the plugin that ships this one along with the rest of its 65 skills, 31 commands, 40 agents, 4 hooks.

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 dhpk-python-static-checks

README.md
[![agentmods](https://agentmods.dev/badge/skills/hmj1026/dhpk/dhpk-python-static-checks.svg)](https://agentmods.dev/skills/hmj1026/dhpk/dhpk-python-static-checks)
Your own site
<a href="https://agentmods.dev/skills/hmj1026/dhpk/dhpk-python-static-checks"><img src="https://agentmods.dev/badge/skills/hmj1026/dhpk/dhpk-python-static-checks.svg" alt="Measured on agentmods" height="20"></a>
Per session 116 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,168 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.1 $0.00116 $0.01168
Opus 5 $0.00058 $0.00584
Sonnet 5 $0.00023 $0.00234
Haiku 4.5 $0.00012 $0.00117

Measured today against content hash ba7c4cd828be, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

dhpk-python-static-checks 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 today.

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.

generated/claude-profiles/compat-v1/package/skills/dhpk-python-static-checks/SKILL.md · 80 lines

How it starts

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

Python Static Checks

How to configure and reason about the Python tooling the python dhpk module drives. The module never bundles config — it runs the project's own pyproject.toml via the configured runner (uv run by default).

ruff — lint + format in one tool

  • Two commands, one tool: ruff check (lint) and ruff format (Black-compatible formatter). The hooks run both; CI should too.
  • Rule selection lives in [tool.ruff.lint] select = [...]. A solid baseline (ccas uses it): E (pycodestyle), F (pyflakes), I (isort/import order), N (pep8-naming), W (warnings), UP (pyupgrade — modern-syntax nudges). Add B (bugbear), S (bandit security), ASYNC as the codebase matures.
  • Per-line suppression: # noqa: E501 (specific code, never bare # noqa). Per-file: [tool.ruff.lint.per-file-ignores] (e.g. allow unused imports in __init__.py, asserts in tests/).
  • Keep line-length and target-version in pyproject.toml so editor, hook, and CI agree. ruff check --fix and ruff format auto-resolve most findings.

Type checking — pyright vs mypy

  • The module's python_typechecker knob selects pyright (default), mypy, or none. Pick one and gate on it; running both doubles noise.
  • pyright: fast, excellent inference, strict mode is aggressive. Configure in pyproject.toml [tool.pyright] (or pyrightconfig.json): set pythonVersion, venvPath/venv, and typeCheckingMode. ccas runs strict.
  • mypy: ubiquitous, plugin ecosystem (pydantic, SQLAlchemy). Configure [tool.mypy]; adopt --strict incrementally via per-module overrides.
  • Progressive adoption for a legacy codebase: start non-strict, enable strict per-package via overrides, ratchet up. Don't blanket-# type: ignore to go green — each ignore needs a trailing reason and ideally a specific error code.

How the hooks invoke them

  • post-edit (post-edit-python-lint.sh): advisory ruff check + ruff format --check on edited .py. Batched once at Stop by default (DHPK_PY_LINT_MODE), never blocks. Set DHPK_PY_STOP_TYPECHECK=1 to also typecheck at Stop.
  • pre-commit (pre-commit-python-validation.sh): the real gate — ruff check, ruff format --check, then the type checker on staged .py, grouped by the owning pyproject.toml dir. Exit 2 blocks the commit; [skip-python-lint] bypasses.
  • Tool resolution: runner prefix (uv run) is used only when its binary exists, else tools run bare off PATH; if neither resolves, the gate self-skips with a warning rather than failing — so a machine without the toolchain isn't blocked.

Read the full file on GitHub · 80 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. today First seen · 80 lines · 116 tokens per session scan A ba7c4cd828be

Subscribe to this mod's changes

dhpk-python-static-checks is a skill published in the GitHub repository hmj1026/dhpk (2 stars, last pushed yesterday), licensed MIT. It adds 116 tokens to every session and 1,168 once invoked, about $0.0006 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-05.

Related

Other skills, from other repositories

add-or-fix-type-checking

Fixes broken typing checks detected by ty, make typing, or make check-repo. Use when typing errors appear in local runs, CI, or PR logs.

huggingface/transformers · 41 tokens

python-code-quality

Code quality checks, linting, formatting, and type checking commands for the Agent Framework Python codebase. Use this when running checks, fixing lint errors, or troubleshooting CI failures.

microsoft/agent-framework · 40 tokens

plugin-architecture-patterns

Design, implement, or diagnose Xberg plugin traits, typed registries, priority collisions, lifecycle, native extractors, and Alef-generated Python plugin bridges. Load for plugin-system work, not ordinary extractor parsing.

xberg-io/xberg · 49 tokens

pyghidra-scripting

Write and run Python (PyGhidra) code inside the Ghidra session that ReVa's MCP server is already attached to, using the five ReVa scripting tools — run-script, list-scripts, read-script, write-script, edit-script. Use this whenever the user asks to execute Python against the current program, reach for the Ghidra Flat…

cyberkaida/reverse-engineering-assistant · 209 tokens

fastapi

FastAPI best practices and conventions. Use when working with FastAPI APIs and Pydantic models for them. Keeps FastAPI code clean and up to date with the latest features and patterns, updated with new versions. Write new code or refactor and update old code.

ReflexioAI/claude-smart · 57 tokens

cnsplots

Create, revise, and troubleshoot publication-ready scientific plots in Python with cnsplots, including distribution, regression, heatmap, genomics, survival, set, flow, and multi-panel figures. Use when a user asks for cnsplots code, Cell/Nature/Science-style visualization, precise pixel-sized figures, statistical…

faridrashidi/cnsplots · 79 tokens