By clin1234
Analysis agents for Python extensions written in Rust with PyO3. Safety-critical: unsafe-block soundness auditing, PyResult propagation and exception clobbering, GIL discipline (attach/detach, foreign callbacks, free-threading), panic safety across the FFI boundary. PyO3-specific: #[pyclass] Send/Sync/frozen trait bounds, #[pymethods] protocol correctness (__traverse__/__clear__, __richcmp__), #[pymodule] init, Bound/Py/Borrowed lifetime handles. Plus PyO3 version compatibility, complexity measurement, git history analysis, and Rust/Python parity checking. Tree-sitter-rust parsing with optional clippy/miri/cargo-expand integration.
Based on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Comprehensive review of a Python extension written in Rust with PyO3. Use when the user asks to analyze, audit, or review a PyO3 extension, find bugs in Rust extension code, run all checks, or do a full extension review. Covers unsafe-block soundness, PyResult propagation, GIL discipline, panic safety, #[pyclass] trait bounds and protocol correctness, #[pymodule] init, handle lifetimes, PyO3 version compatibility, complexity, git history, and Rust/Python parity.
Quick scored health dashboard for a Python extension written in Rust with PyO3. Use when the user wants a fast overall-quality read rather than a full review -- runs every agent in summary mode and scores each dimension 1-10.
Find the worst functions in a Python extension written in Rust with PyO3. Use when the user asks where to focus review effort -- runs the safety-critical and complexity agents and ranks the riskiest code.
Produce a PyO3 migration checklist for a Python extension written in Rust. Use when the user wants to upgrade their PyO3 version, adopt the Bound API, prepare for free-threading, or change the abi3 floor. The highest-value command given PyO3's frequent API churn.
Use this agent to audit GIL discipline -- attach/detach handling, foreign callbacks, and free-threading readiness -- in Python extension code written in Rust with PyO3. <example> User: Check the GIL handling in my PyO3 extension that wraps a C library. Agent: I will run the GIL-discipline scanner, triage each finding, and review detached-closure violations, nested attach, foreign-callback GIL acquisition, and the module's free-threading declaration. </example>
Use this agent for temporal analysis of a Rust/PyO3 extension -- finding similar unfixed bugs via git history and prioritizing review by churn. <example> User: We just fixed an unsafe-block soundness bug -- did we miss any similar ones? Agent: I will run the history analyzer, read the recent fix-commit diffs, extract the bug pattern, and search the whole crate for structurally similar code that was never fixed. </example>
Use this agent to audit PyO3 handle kinds and lifetimes -- `Bound` vs `Py` vs `Borrowed` vs legacy `&PyAny` -- in Python extension code written in Rust with PyO3. <example> User: Check that my PyO3 extension uses the modern Bound handle API. Agent: I will run the lifetime-handle scanner, triage each finding, and review legacy GIL-reference types, `Py::as_ref`, non-idiomatic `Py<T>` parameters, and `Borrowed` handles. </example>
Use this agent to audit `#[pymodule]` initialization and module-level state in Python extension code written in Rust with PyO3. <example> User: Review the module initialization in my PyO3 extension. Agent: I will run the module-init scanner, triage each finding, and review process-global Python statics, unchecked registration calls, and the #[pymodule] return type. </example>
Use this agent to audit panic safety across the FFI boundary in Python extension code written in Rust with PyO3. <example> User: Check my PyO3 extension for panics that could reach Python. Agent: I will run the panic-safety scanner, triage each finding, and review `.unwrap()`/`.expect()` on non-PyResult values, slice indexing, panic macros, and panics inside `extern "C"` callbacks. </example>
Uses power tools
Uses Bash, Write, or Edit tools
A Claude Code plugin for
reviewing Python extensions written in Rust with PyO3 — finding soundness
bugs in unsafe code, PyO3 API misuse, GIL/lifetime discipline issues,
#[pyclass] trait-bound violations, panic-safety problems, and PyO3
version-migration debt.
Find the soundness bugs in your Rust extension before your users do.
PyO3's type system already eliminates most classic C-extension bug classes, so this toolkit does not scan for them:
Py_INCREF/Py_DECREF — Py<T> and Bound<'py, T> implement DropPyResult<T> / Option<T>'py lifetime ties handles to the
interpreterWhat PyO3 does not prevent — and what this toolkit is for:
unsafe (raw pyo3-ffi, transmute, manual buffer
protocol, C-library FFI)#[pyclass] trait-bound violations — non-Send/Sync fields without
unsendableextern "C" FFI boundaryPyResult propagation gaps — .unwrap(), .ok(), let _ =, missing ?,
exception clobberingBound vs Py vs Borrowed; legacy &PyAny#[pymethods] protocol mistakes — missing __traverse__/__clear__,
__richcmp__ semanticsabi3 consistencyclaude plugin marketplace add devdanzin/rust-ext-review-toolkit
claude plugin install rust-ext-review-toolkit@rust-ext-review-toolkit
git clone https://github.com/devdanzin/rust-ext-review-toolkit.git
claude --plugin-dir rust-ext-review-toolkit/plugins/rust-ext-review-toolkit
pip install tree-sitter tree-sitter-rustcargo clippy / cargo miri / cargo expand
for deeper cross-referencingIn a PyO3 crate:
/rust-ext-review-toolkit:health # Quick scored dashboard
/rust-ext-review-toolkit:hotspots # Worst functions: unsafe + panic + complexity
/rust-ext-review-toolkit:explore # Full analysis (all agents, phased)
/rust-ext-review-toolkit:migrate # Bound-API / free-threading / abi3 checklist
13 agents — 11 script-backed, 1 qualitative, 1 preflight.
unsafe block; raw pyo3-ffi
calls; transmute; manual buffer protocol (the #1 agent).unwrap()/.ok() on PyResult, missing
?, exception clobberingdetach; nested attach;
foreign-callback GIL acquisition; free-threading declarations#[pymethods] /
#[pyfunction]#[pyclass] Send/Sync/frozen/unsendable#[pymethods] slot signatures,
__traverse__/__clear__, __richcmp__#[pymodule] shape, module-level static stateBound vs Py vs Borrowed; legacy &PyAnyunsafe-block
density)| Command | Purpose |
|---|---|
explore | Full analysis, phased agent groups, selectable aspects |
health | Quick scored dashboard, all agents in summary mode |
hotspots | Worst functions first — unsafe + pyresult + panic + complexity |
migrate | Bound-API migration, free-threading readiness, abi3 — checklist output |
Tree-sitter-rust parsing. Scripts parse .rs source with tree-sitter-rust
— style-agnostic and robust against macro-heavy code. Tree-sitter does not
expand procedural macros, so #[pyclass]/#[pymethods] analysis is syntactic
inference over the attribute + struct + method shape.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimnpx claudepluginhub clin1234/rust-ext-review-toolkit --plugin rust-ext-review-toolkitComprehensive PR review agents specializing in comments, tests, error handling, type design, code quality, and code simplification
Upstash Context7 MCP server for up-to-date documentation lookup. Pull version-specific documentation and code examples directly from source repositories into your LLM context.
Comprehensive feature development workflow with specialized agents for codebase exploration, architecture design, and quality review
Comprehensive startup business analysis with market sizing (TAM/SAM/SOM), financial modeling, team planning, and strategic research
v9.44.1 — Patch release for Gemini environment/version detection and qwen auth gating. Run /octo:setup.
Complete creative writing suite with 10 specialized agents covering the full writing process: research gathering, character development, story architecture, world-building, dialogue coaching, editing/review, outlining, content strategy, believability auditing, and prose style/voice analysis. Includes genre-specific guides, templates, and quality checklists.