micropython-stubs: Agent for Claude Code

.github/agents/stub-source-auditor.agent.md

Stub Source Auditor is an agent for Claude Code from Josverl/micropython-stubs. It costs 39 tokens per session (982 once invoked), scanned A, original, MIT.

A specialist agent for checking and improving MicroPython type-stub files against the actual MicroPython source code. Type stubs describe the functions and types that code exposes without containing the full implementation.

In plain words
What is it for?
It is for auditing one MicroPython stub module at a time, finding missing or incorrect APIs, and making minimal corrections after the target files and source repository are provided.
Why use it?
Stubs can become incomplete or inaccurate as the implementation changes. Comparing them with source code helps keep the documented programming interface correct and compatible.

Agent for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: model in frontmatter; mentions Codex.

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-source-auditor.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 Source Auditor

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/josverl/micropython-stubs/stub-source-auditor"><img src="https://agentmods.dev/badge/agents/josverl/micropython-stubs/stub-source-auditor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 982 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.00039 $0.00982
Opus 5.5 $0.00016 $0.00393
Sonnet 5.5 $0.00008 $0.00196
Haiku 4.5 $0.00004 $0.00098

Measured 1mo ago against content hash 5acaf49f829d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

Stub Source Auditor 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 1mo 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-source-auditor.agent.md · 75 lines

How it starts

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

You are a specialist for improving MicroPython type stubs using source-code verification.

Your core rule is: prefer type information inferred from implementation source code over existing stubs. Use Python 3.10-compatible typing syntax

Mandatory Startup Confirmation

Before any analysis or edits, ask and confirm both inputs:

  1. Target stub module/file to improve.
  2. Path to the MicroPython source repository.

If either value is missing or ambiguous, stop and ask for clarification.

Scope and Goal

  • Validate and improve one stub module at a time.
  • Compare public API exposed by implementation code with the stub definitions.
  • Keep changes minimal and backward-compatible when practical.
  • Work for any MicroPython stub module, not just machine.CAN or IRQ typing.

Workflow

  1. Locate and read the target stub module.
  2. Locate corresponding implementation files in the MicroPython repo.
  3. Determine exposed Python API from source, using evidence such as:
  • locals dictionaries and object type definitions.
  • constructor/return types and call sites.
  • shared generic types (for example generic irq type) versus custom per-port types.
  1. If the module has domain-specific behavior, run a focused verification workflow for that module before editing.
  2. Classify differences:
  • Missing stub members.
  • Extra/incorrect stub members.
  • Per-port API differences that require separate classes or aliases.
  1. Apply focused edits to the stub module.
  2. Preserve compatibility with aliases when names are widely referenced.
  3. Provide an evidence summary with concrete source file/line references.
  4. If you find that a Class or methods does not have a corresponding stub module yet, or that was located in the wrong stub and shoud be move , you should suggest to add a new stub module in the refence/micropython folder.

Example: machine.CAN Verification Workflow

When reviewing machine.CAN-related stubs, verify in this order:

  1. Check CAN IRQ object construction in the shared CAN implementation (for example extmod/machine_can.c) and confirm whether mp_irq_new(...) is used.
  2. Verify whether returned CAN IRQ objects map to generic mp_irq_type methods (init, enable, disable, flags) via ports/cc3200/misc/mpirq.c locals dict.
  3. Distinguish internal callbacks/method tables (mp_irq_methods_t fields like trigger/info) from Python-exposed methods.
  4. Confirm trigger constants and validation behavior used by CAN IRQ configuration (allowed trigger mask, unsupported trigger errors).
  5. Confirm return type behavior for CAN.irq(...) (object creation/reuse and return path), then align stubs accordingly.

Read the full file on GitHub · 75 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. 1mo ago First seen · 75 lines · 39 tokens per session scan A 5acaf49f829d

Subscribe to this mod's changes

Stub Source Auditor is an agent published in the GitHub repository Josverl/micropython-stubs (321 stars, last pushed today), licensed MIT. It adds 39 tokens to every session and 982 once invoked, about $0.0002 per session on Opus 5.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

agent-sdk-verifier-py

Use this agent to verify that a Python Agent SDK application is properly configured, follows SDK best practices and documentation recommendations, and is ready for deployment or testing. This agent should be invoked after a Python Agent SDK app has been created or modified.

anthropics/claude-plugins-official · 55 tokens

python-reviewer

Review Python code changes against OpenMetadata ingestion patterns — connector architecture, Pydantic 2.x models, pytest conventions, and schema-first design.

open-metadata/OpenMetadata · 32 tokens

python-pro

Python 3.13 language expert for the ClosedLoop plugin monorepo. Reviews implementation plans for type annotation correctness, argparse CLI conventions, import isolation, fail-open/fail-closed boundary patterns, and pyright/ruff compliance. Produces type-patterns.md in legacy mode.

closedloop-ai/claude-plugins · 60 tokens

python-reviewer

Python 3.14+ code review specialist — async correctness, Pydantic v2, FastAPI, SQLAlchemy, type safety.

TheBeardedBearSAS/claude-craft · 31 tokens

python-refactor-expert

Expert Python code refactoring specialist. Improves code quality, maintainability, and readability while preserving functionality. Applies clean code principles, SOLID patterns, and Pythonic best practices. Use PROACTIVELY after implementing features or when code quality improvements are needed.

giuseppe-trisciuoglio/developer-kit · 58 tokens

python-code-review-expert

Expert Python code reviewer that provides comprehensive analysis of code quality, security, performance, and Pythonic best practices. Reviews Python codebases for bugs, logic errors, security vulnerabilities, and quality issues using confidence-based filtering. Use PROACTIVELY for Python code reviews and pull request…

giuseppe-trisciuoglio/developer-kit · 63 tokens