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.
curl -O https://raw.githubusercontent.com/Josverl/micropython-stubs/main/.github/agents/stub-source-auditor.agent.mdgit 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/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.
<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>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.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 |
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.
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.
- 1mo ago 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 (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.
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.
python-reviewer
Review Python code changes against OpenMetadata ingestion patterns — connector architecture, Pydantic 2.x models, pytest conventions, and schema-first design.
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.
python-reviewer
Python 3.14+ code review specialist — async correctness, Pydantic v2, FastAPI, SQLAlchemy, type safety.
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.
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…