ext-php-rs-bindings

ext-php-rs-bindings is a skill for Claude Code, Codex from Goldziher/ai-rulez. It costs 68 tokens per session (333 once invoked), scanned A, original, MIT.

A set of rules for building PHP 8.2 or newer extensions from Rust code, so PHP programs can call native Rust functions and classes. It covers type conversion, exceptions, loading, memory cleanup, and PHPUnit tests.

In plain words
What is it for?
Use it when creating or reviewing ext-php-rs extensions, exposing Rust functions or classes to PHP, configuring php.ini, building releases, and testing with PHPUnit.
Why use it?
It reduces errors when crossing between PHP and Rust, including bad value conversions, uncaught failures, reference-counting problems, and unsafe pointer use.

Skill for Claude CodeCodex

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

Good fit Use it when creating or reviewing ext-php-rs extensions, exposing Rust functions or classes to PHP, configuring php.ini, building releases, and testing with PHPUnit.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/goldziher/ai-rulez/ext-php-rs-bindings"><img src="https://agentmods.dev/badge/skills/goldziher/ai-rulez/ext-php-rs-bindings.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 333 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.00068 $0.00333
Opus 5 $0.00034 $0.00167
Sonnet 5 $0.00014 $0.00067
Haiku 4.5 $0.00007 $0.00033

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

Security

Grade A, and why

ext-php-rs-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 11d 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/ext-php-rs/skills/ext-php-rs-bindings/SKILL.md · 17 lines

What it actually says

  • Use ext-php-rs for PHP 8.2+ native extensions. Use #[php_class] and #[php_function] macros.
  • Map Rust types to PHP via FromZval/IntoZval traits. Return PhpResult<T> for fallible operations.
  • Map Rust errors to PHP exceptions: PhpException::from(...) with specific classes (InvalidArgumentException, RuntimeException).
  • Use #[php_method] for class methods. Implement __construct for PHP constructors.
  • Build with cargo build --release. Load extension via php.ini (extension=your_ext.so) or PECL distribution.
  • Test from PHP using PHPUnit. Verify extension loading with php -m | grep extension_name.
  • Use ZendClassObject<T> for wrapping Rust structs as PHP objects.
  • PHP uses reference counting — avoid circular references in wrapped Rust structs. Implement Drop for cleanup.
  • PHP is single-threaded per request — offload CPU-intensive work to Rust, return results synchronously.
  • Keep PHP extension thin — business logic in Rust, PHP provides typed interface.
  • Anti-patterns: panics in PHP functions, blocking operations without timeout, raw pointer manipulation.
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. 11d ago First seen · 17 lines · 68 tokens per session scan A c4881e04dc1b

Subscribe to this mod's changes

ext-php-rs-bindings is a skill published in the GitHub repository Goldziher/ai-rulez (141 stars, last pushed 3d ago), licensed MIT. It adds 68 tokens to every session and 333 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

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

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

test-new-skill

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

dimetron/pi-go · 4 tokens

softdev-loop

Go software-development loop — implement, test, vet; repeat until green.

rysh-ai/rysh-cli-code · 15 tokens

golang-testing

Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI…

alexastrum/skl · 115 tokens