python-build-resolver

A Python toolchain build-fixing assistant. It works with common Python tools for formatting, type checking, testing, and installing project dependencies.

In plain words
What is it for?
Use it when ruff, mypy, pyright, pytest, uv, pip, or Poetry commands fail in a Python project.
Why use it?
It helps find the cause of failed checks, tests, asynchronous-test setup problems, or environment and installation errors, then apply the smallest suitable correction.

Agent

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 agents/hmj1026/dhpk/python-build-resolver
Clone the repo
git clone --depth 1 https://github.com/hmj1026/dhpk
Per session 139 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,149 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.00139 $0.01149
Opus 5 $0.00069 $0.00575
Sonnet 5 $0.00028 $0.00230
Haiku 4.5 $0.00014 $0.00115

Measured yesterday against content hash 378950921eb8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

python-build-resolver 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 yesterday.

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.

agents/python-build-resolver.md · 85 lines

How it starts

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

Python Build Resolver

Get a failing Python toolchain command green with surgical changes. Read the error, fix the root cause, re-run, repeat — never silence a check to make it pass.

Before a fix that changes a signature or a public name, gauge its blast radius with gitnexus_impact (or cx references --name X) — optional tools, fall back to Grep when absent. See ${CLAUDE_PLUGIN_ROOT}/rules/tool-routing.md.

Detect the runner first: a uv.lockuv run <tool>; a poetry.lockpoetry run <tool>; an already-activated venv ⇒ the bare tool on PATH. Find the project root by walking up to the nearest pyproject.toml.

When NOT

  • Rust / Cargo toolchain failures → rust-build-resolver
  • Swift / Xcode / SwiftPM toolchain failures → swift-build-resolver

Diagnose

ruff check . 2>&1 | head -40
ruff format --check . 2>&1 | head -20
mypy . 2>&1 | head -40            # or: pyright 2>&1 | head -40
pytest -x -q 2>&1 | tail -40     # stop at first failure, quiet
python -c 'import sys; print(sys.version)'
sed -n '1,60p' pyproject.toml    # tool config, asyncio_mode, deps

Error -> likely cause -> fix

Error (substring) Cause Surgical fix
F401 imported but unused Dead import Remove it (or re-export via __all__ if intentional)
F821 undefined name Typo / missing import Add the import / correct the name
E501 line too long Formatting ruff format the file (don't hand-wrap)
Function is missing a return type annotation Untyped def Add it; -> None for side-effecting fns
Incompatible return value type Wrong type Fix the value or widen the annotation honestly (no blanket # type: ignore)
Argument N has incompatible type Call-site mismatch Fix the argument or the signature, not a cast
async def functions are not natively supported / test skipped Missing pytest-asyncio wiring Set asyncio_mode = "auto" in [tool.pytest.ini_options], or mark @pytest.mark.asyncio
ScopeMismatch: ... event_loop fixture Async fixture scope clash Align fixture scope; use loop_scope / scope consistently
ModuleNotFoundError in tests Dep not installed / wrong env uv sync (or pip install -e .); confirm the right interpreter
ResolutionImpossible / version conflict Constraint clash Relax / align the constraint in pyproject.toml, regenerate the lock

Read the full file on GitHub · 85 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. yesterday First seen · 85 lines · 139 tokens per session scan A 378950921eb8

Subscribe to this mod's changes

python-build-resolver is an agent published in the GitHub repository hmj1026/dhpk (2 stars, last pushed 2d ago), licensed MIT. It adds 139 tokens to every session and 1,149 once invoked, about $0.0007 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-31.

Related

Other agents, from other repositories