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.
npx agentmods add agents/josverl/micropython-stubs/stub-source-auditorgit clone --depth 1 https://github.com/Josverl/micropython-stubsWrote 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.
[](https://agentmods.dev/agents/josverl/micropython-stubs/stub-source-auditor)<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>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.
| Model | Per session | Once 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 |
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.
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:
- Target stub module/file to improve.
- 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
- Locate and read the target stub module.
- Locate corresponding implementation files in the MicroPython repo.
- 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.
- If the module has domain-specific behavior, run a focused verification workflow for that module before editing.
- Classify differences:
- Missing stub members.
- Extra/incorrect stub members.
- Per-port API differences that require separate classes or aliases.
- Apply focused edits to the stub module.
- Preserve compatibility with aliases when names are widely referenced.
- Provide an evidence summary with concrete source file/line references.
- 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:
- Check CAN IRQ object construction in the shared CAN implementation (for example
extmod/machine_can.c) and confirm whethermp_irq_new(...)is used. - Verify whether returned CAN IRQ objects map to generic
mp_irq_typemethods (init,enable,disable,flags) viaports/cc3200/misc/mpirq.clocals dict. - Distinguish internal callbacks/method tables (
mp_irq_methods_tfields liketrigger/info) from Python-exposed methods. - Confirm trigger constants and validation behavior used by CAN IRQ configuration (allowed trigger mask, unsupported trigger errors).
- Confirm return type behavior for
CAN.irq(...)(object creation/reuse and return path), then align stubs accordingly.
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.
- today First seen · 75 lines · 39 tokens per session scan A 5acaf49f829d
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.
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…
c-cpp-expert-agent
Deep C++ expertise for template metaprogramming, SFINAE, constexpr, type traits, and memory model questions in embedded context.
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.
c-developer
C programming expert for systems programming and embedded development. Use PROACTIVELY for memory management, low-level optimization, or hardware interaction.
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.
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.