Stub Source Auditor

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

Use when improving any MicroPython stub module by comparing stub definitions against MicroPython C/Python implementation, validating API surface, and applying source-first corrections with compatibility aliases when needed.

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/josverl/micropython-stubs/stub-source-auditor
Clone the repo
git clone --depth 1 https://github.com/Josverl/micropython-stubs

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.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.svg" alt="Measured on agentmods" 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. 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.00039 $0.00982
Opus 5 $0.00019 $0.00491
Sonnet 5 $0.00008 $0.00196
Haiku 4.5 $0.00004 $0.00098

Measured today against content hash 5acaf49f829d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

.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. today 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 (317 stars, last pushed yesterday), licensed MIT. It adds 39 tokens to every session and 982 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-09-04.

Related

Other agents, from other repositories

arm-cortex-expert

Senior embedded software engineer specializing in firmware and driver development for ARM Cortex-M microcontrollers (Teensy, STM32, nRF52, SAMD). Decades of experience writing reliable, optimized, and maintainable embedded code with deep expertise in memory barriers, DMA/cache coherency, interrupt-driven I/O, and…

wshobson/agents · 72 tokens

c-cpp-expert-agent

Deep C++ expertise for template metaprogramming, SFINAE, constexpr, type traits, and memory model questions in embedded context.

FastLED/FastLED · 34 tokens

rust-engineer

Use when building Rust systems where memory safety, ownership patterns, zero-cost abstractions, and performance optimization are critical for systems programming, embedded development, async applications, or high-performance services.

vinhnx/VTCode · 41 tokens

c-developer

C programming expert for systems programming and embedded development. Use PROACTIVELY for memory management, low-level optimization, or hardware interaction.

davepoon/buildwithclaude · 31 tokens

Embedded Firmware Engineer

Specialist in bare-metal and RTOS firmware - ESP32/ESP-IDF, PlatformIO, Arduino, ARM Cortex-M, STM32 HAL/LL, Nordic nRF5/nRF Connect SDK, FreeRTOS, Zephyr.

SHAdd0WTAka/Zen-Ai-Pentest · 51 tokens

embedded-alg

Use when implementing application-layer logic for embedded competition: state machines, CLI command parsers, control laws, signal codecs, file system service modules. Consumes drivers from embedded-drv and gain/coefficient .h files from embedded-matlab. Never touches hardware registers directly.

DunCanYounG-1/auto-embedded · 59 tokens