pyo3-bindings

pyo3-bindings is a skill for Claude Code, Codex from Goldziher/ai-rulez. It costs 61 tokens per session (322 once invoked), scanned A, original, MIT.

A set of Rust and Python integration rules for PyO3, the library used to expose Rust types and functions to Python. It covers Python-visible classes, error conversion, properties, performance, builds, and tests.

In plain words
What is it for?
Use it when creating or reviewing Rust libraries with Python bindings, including classes, methods, constructors, exception handling, maturin builds, and pytest tests.
Why use it?
It helps avoid incorrect Python errors, blocked Python execution, lifetime problems, and unsafe failure handling. It also keeps Python wrappers small while the main logic stays in Rust.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when creating or reviewing Rust libraries with Python bindings, including classes, methods, constructors, exception handling, maturin builds, and pytest tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/goldziher/ai-rulez/pyo3-bindings
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.

Any agent
npx skills add Goldziher/ai-rulez --skill pyo3-bindings
Clone the repo
git clone --depth 1 https://github.com/Goldziher/ai-rulez

Made for: Claude Code, Codex.

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 pyo3-bindings

README.md
[![agentmods](https://agentmods.dev/badge/skills/goldziher/ai-rulez/pyo3-bindings/github.svg)](https://agentmods.dev/skills/goldziher/ai-rulez/pyo3-bindings)
Your own site
<a href="https://agentmods.dev/skills/goldziher/ai-rulez/pyo3-bindings"><img src="https://agentmods.dev/badge/skills/goldziher/ai-rulez/pyo3-bindings/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 pyo3-bindings

Your own site · 80×15
<a href="https://agentmods.dev/skills/goldziher/ai-rulez/pyo3-bindings"><img src="https://agentmods.dev/badge/skills/goldziher/ai-rulez/pyo3-bindings.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 322 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00061 $0.00322
Opus 5 $0.00030 $0.00161
Sonnet 5 $0.00012 $0.00064
Haiku 4.5 $0.00006 $0.00032

Measured 12d ago against content hash c767eb99e010, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

pyo3-bindings 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 12d 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.

internal/builtins/bindings/pyo3/skills/pyo3-bindings/SKILL.md · 16 lines

What it actually says

  • Use #[pyclass] and #[pymethods] for Python-visible types. Use #[new] for constructors.
  • Map Rust Result<T, E> to Python exceptions via PyErr. Use PyResult<T> as return type.
  • Use pyo3::types for conversions. Prefer &str over String in parameters, return String.
  • Prefer Bound<'py, T> over Py<T> for ergonomic, lifetime-checked references (PyO3 0.22+).
  • Release the GIL with py.allow_threads() for CPU-intensive Rust code. Never hold GIL during I/O.
  • Use #[getter] and #[setter] for properties. Implement __repr__ and __str__ for debugging.
  • Build with maturin develop for local testing, maturin build --release for distribution.
  • Test bindings from Python using pytest. Test both success and error paths.
  • Keep Python wrappers thin — business logic lives in Rust, Python provides ergonomic API.
  • Anti-patterns: .unwrap() in pyclass methods, blocking GIL for long operations, leaking Python objects.
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. 12d ago First seen · 16 lines · 61 tokens per session scan A c767eb99e010

Subscribe to this mod's changes

pyo3-bindings is a skill published in the GitHub repository Goldziher/ai-rulez (141 stars, last pushed 4d ago), licensed MIT. It adds 61 tokens to every session and 322 once invoked, about $0.0003 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-08-30.

Related

Other skills, from other repositories

check-linters-before-commit

Before any commit, run linters, vet, tests, and build verification; do not commit until checks pass.

dimetron/pi-go · 30 tokens

go-127

What changed in Go 1.27 (released August 2026) and how it changes the way Go is written in pi-go. Use this skill when writing or reviewing Go that could use a 1.27 feature, when bumping the go directive in go.mod, when a build or test behaves differently after a toolchain upgrade, or when code-guidelines-go points…

dimetron/pi-go · 177 tokens

bubbletea-testing

Use this skill whenever writing tests for Bubble Tea (charmbracelet/bubbletea) TUI applications in Go. Triggers include any mention of testing Bubble Tea models, teatest, golden file testing for TUIs, testing tea.Cmd or tea.Msg, snapshot testing terminal output, or writing tests for any Go CLI/TUI that uses the Elm…

dimetron/pi-go · 139 tokens

vhs-e2e-gif

Record a test run, a TUI session, or any terminal command as a GIF with VHS and attach it to a GitHub PR as a release-hosted asset, never a repo commit. Use when asked to record an e2e run, demo a fix on a PR, attach a GIF or screen recording to a pull request, show a test passing visually, or produce a terminal…

dimetron/pi-go · 106 tokens

pixiv-cli-mcp-tool

Add or change a pixiv-cli MCP tool with full sync of registration, tests, localized MCP docs, README, and CHANGELOG.

FlanChanXwO/pixiv-cli · 34 tokens

test-new-skill

Skill "test-new-skill" from dimetron/pi-go, covering test-new-skill, examples and guidelines.

dimetron/pi-go · 4 tokens