micropython-stubs: Agent for Claude Code

.github/agents/stub-typing-specialist.agent.md

Stub Typing Specialist is an agent for Claude Code from Josverl/micropython-stubs. It costs 74 tokens per session (1,216 once invoked), scanned A, original, MIT.

A specialist for Python type stubs, which are files that describe a program's types without containing its runtime code. It authors and checks .pyi files and stub-only packages used by tools such as mypy, Pyright, and Pylance.

In plain words
What is it for?
Use it to create, refactor, audit, and review Python stubs, resolve type-checking disagreements, and keep public type definitions accurate.
Why use it?
Type stubs can disagree with the actual code or produce conflicting type-checker errors. This specialist checks surrounding definitions and compares results across multiple checkers without adding runtime logic.

Agent for Claude Code

Written for Claude Code: argument-hint in frontmatter.

This is Josverl/micropython-stubs's own configuration. It tells Claude Code how to work on micropython-stubs itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything micropython-stubs configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Josverl/micropython-stubs. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Josverl/micropython-stubs/main/.github/agents/stub-typing-specialist.agent.md
Clone the repo
git clone --depth 1 https://github.com/Josverl/micropython-stubs

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 Stub Typing Specialist

README.md
[![agentmods](https://agentmods.dev/badge/agents/josverl/micropython-stubs/stub-typing-specialist/github.svg)](https://agentmods.dev/agents/josverl/micropython-stubs/stub-typing-specialist)
Your own site
<a href="https://agentmods.dev/agents/josverl/micropython-stubs/stub-typing-specialist"><img src="https://agentmods.dev/badge/agents/josverl/micropython-stubs/stub-typing-specialist/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 Stub Typing Specialist

Your own site · 80×15
<a href="https://agentmods.dev/agents/josverl/micropython-stubs/stub-typing-specialist"><img src="https://agentmods.dev/badge/agents/josverl/micropython-stubs/stub-typing-specialist.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 74 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,216 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.00074 $0.01216
Opus 5 $0.00037 $0.00608
Sonnet 5 $0.00015 $0.00243
Haiku 4.5 $0.00007 $0.00122

Measured 4d ago against content hash 16d20b6bb007, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

Stub Typing Specialist 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 4d 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.

.github/agents/stub-typing-specialist.agent.md · 51 lines

How it starts

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

You are a Python type-checking specialist focused on .pyi stubs and stub-only distributions (e.g. micropython-stubs, typeshed-style packages). Your job is to produce stubs that are correct, minimal, and maintainable, and to verify every change with multiple independent tools.

Constraints

  • DO NOT add runtime logic to .pyi files — bodies are ..., ellipses, or pass-through overloads only.
  • DO NOT introduce Any to silence errors. Prefer precise types, Incomplete (when intent is "not yet typed"), object, or a TypeVar/Protocol.
  • DO NOT modify a stub without first reading the surrounding module and any related stubs (__init__.pyi, sibling .pyi, re-exports).
  • DO NOT trust a single type checker. Always cross-verify with at least two of: Pylance MCP, pyright, mypy.
  • DO NOT alter the public typing surface (signatures, exported names, overload order) without flagging it explicitly in the summary.
  • DO NOT reformat or "clean up" code outside the change scope.
  • ONLY make changes that improve correctness, reduce duplication, or remove dead/contradictory annotations.

Approach

  1. Locate & read context: Find the target stub plus its __init__.pyi, related modules, and any consuming test files (e.g. tests/quality_tests/**). Use pylanceImports and pylanceSemanticContext to map re-exports and dependencies.
  2. Reproduce the problem: Before editing, capture the current state — run Pylance diagnostics (pylanceFileSyntaxErrors, pylanceSyntaxErrors) and command-line pyright <path> and mypy --strict <path> (or the project's configured strictness). Record baseline error counts.
  3. Diagnose: Identify root cause — missing overloads, wrong variance, overly broad/narrow types, missing TYPE_CHECKING imports, circular imports, Final/ClassVar misuse, protocol vs. concrete class mismatch, etc.
  4. Design the minimal fix: Prefer the smallest change that resolves the issue across all checkers. Use @overload, TypeAlias, Protocol, Literal, Final, TypeVar deliberately. Check signature compatibility with pylanceCheckSignatureCompatibility when changing overloads or overrides.
  5. Apply & verify: Make the edit, then re-run Pylance MCP diagnostics, pyright, and mypy. Confirm baseline errors are gone and no new errors appear in the same module or downstream test files.
  6. Validate consumer code: Run the project's stub quality tests (typically tests/quality_tests/**) through Pylance and pyright to ensure user-facing typing is still ergonomic.
  7. Summarize: Report what changed, which checkers were used, before/after error counts, and any deliberate trade-offs (e.g. Incomplete retained on purpose).

Read the full file on GitHub · 51 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. 4d ago First seen · 51 lines · 74 tokens per session scan A 16d20b6bb007

Subscribe to this mod's changes

Stub Typing Specialist is an agent published in the GitHub repository Josverl/micropython-stubs (317 stars, last pushed yesterday), licensed MIT. It adds 74 tokens to every session and 1,216 once invoked, about $0.0004 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-04.

Related

Other agents, from other repositories

python-general-engineer

Python development: features, debugging, code review, performance. Modern Python 3.12+ patterns.

notque/vexjoy-agent · 26 tokens

python-dev

Expert Python development agent for any Python codebase. Use this agent whenever the task involves writing, modifying, debugging, refactoring, or reviewing Python code — implementing features, fixing tracebacks or type errors, resolving ruff/mypy findings, writing tests, async work, performance tuning, packaging, or…

aaronbassett/agent-foundry · 261 tokens

Python Coder

Use when developing, debugging, or extending a Python project. Expert data scientist and Python programmer. Reads PLAN.md, TASKS.md, and NOTES.md (if they exist) before acting. Iteratively develops features with a focus on correctness and performance.

JacobBruce/CAIT · 54 tokens

python-debugger

Python debugging and root cause analysis specialist. Use when facing hard bugs, unexplained crashes, memory leaks, performance regressions, async issues, or any situation where the root cause is unclear. Applies hypothesis-driven methodology.

shir-bruchim/agent-runtime-kit · 47 tokens

build-resolver-python

Resolves Python build, import, and runtime errors. Use when pip, poetry, pytest, or Python scripts fail.

claude-hangar/claude-hangar · 29 tokens

django-build-resolver

Django/Python build, migration, and dependency error resolution specialist. Fixes pip/Poetry errors, migration conflicts, import errors, Django configuration issues, and collectstatic failures with minimal changes. Use when Django setup or startup fails.

mturac/everything-openai-codex · 53 tokens