datafusion-python: Skill for Claude Code

.ai/skills/ffi-capsule-protocol/SKILL.md

ffi-capsule-protocol is a skill for Claude Code from apache/datafusion-python. It costs 102 tokens per session (3,069 once invoked), scanned A, original, Apache-2.0.

A set of rules for sharing Rust objects with Python extension libraries through PyCapsules, which are Python containers for passing native objects safely across an interface. It covers DataFusion's capsule getter and extension-planner protocols.

In plain words
What is it for?
Use it before adding, reviewing, or changing DataFusion capsule getters, FFI exports, query planners, table providers, or extension codecs.
Why use it?
It prevents mismatched method names, arguments, and interfaces when changing code that connects Python with Rust or extension libraries.

Skill for Claude Code ✓ vendor

Written for Claude Code: argument-hint in frontmatter.

This is apache/datafusion-python's own configuration. It tells Claude Code how to work on datafusion-python itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything datafusion-python configures →

About the project

Apache DataFusion Python Bindings is a Python library connecting applications to DataFusion, an in-memory query engine built on Apache Arrow. It is for building Python data systems that query CSV, Parquet, and JSON data with SQL or DataFrames, optimize those queries, run Python code, and exchange data with other DataFrame libraries. The catalogue add-ons support development workflows around these Python bindings.

apache/datafusion-python · 610 stars · on GitHub · datafusion.apache.org

Reuse

Borrowing it

Nothing to install: this file belongs to apache/datafusion-python. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/apache/datafusion-python/main/.ai/skills/ffi-capsule-protocol/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/apache/datafusion-python

Made for: Claude Code.

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 ffi-capsule-protocol

README.md
[![agentmods](https://agentmods.dev/badge/skills/apache/datafusion-python/ffi-capsule-protocol/github.svg)](https://agentmods.dev/skills/apache/datafusion-python/ffi-capsule-protocol)
Your own site
<a href="https://agentmods.dev/skills/apache/datafusion-python/ffi-capsule-protocol"><img src="https://agentmods.dev/badge/skills/apache/datafusion-python/ffi-capsule-protocol/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 ffi-capsule-protocol

Your own site · 80×15
<a href="https://agentmods.dev/skills/apache/datafusion-python/ffi-capsule-protocol"><img src="https://agentmods.dev/badge/skills/apache/datafusion-python/ffi-capsule-protocol.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,069 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.00102 $0.03069
Opus 5.5 $0.00041 $0.01228
Sonnet 5.5 $0.00020 $0.00614
Haiku 4.5 $0.00010 $0.00307

Measured 1mo ago against content hash 3079bcb87c0f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ffi-capsule-protocol 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.

.ai/skills/ffi-capsule-protocol/SKILL.md · 243 lines

How it starts

The opening of the file, as written. The whole thing — 243 lines — stays where its author put it; the contents beside it link to each section on GitHub.

FFI Capsule Protocol

datafusion-python shares Rust objects with extension libraries through PyCapsules. Every hook is a dunder method named __datafusion_<thing>__ that returns a capsule wrapping an FFI-safe struct. They are one protocol, not a collection of unrelated methods, and they have a settled convention that has already been migrated once (see docs/source/user-guide/upgrade-guides.md, DataFusion 52.0.0 and 55.0.0).

Rule 1 — enumerate the family before you change a member

Do this first, every time. It takes one command and it is the whole point of this skill:

grep -rn "__datafusion_[a-z_]*__" --include="*.rs" crates/ examples/*/src/

Compare the signature you are about to write against what the others already do. If yours is shaped differently, that is a finding about your design, not about theirs.

Rule 2 — a getter takes the session it is being installed on

fn __datafusion_physical_extension_codec__<'py>(
    &self,
    py: Python<'py>,
    session: Bound<'py, PyAny>,
) -> PyResult<Bound<'py, PyCapsule>> { ... }

The host calls the getter and passes itself. That argument is how an extension library reaches things only the session has.

Read the full file on GitHub · 243 lines

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. 1mo ago Changed · +43 lines 3079bcb87c0f
  2. 1mo ago Changed · +9 lines 1a81957f705d
  3. 2mo ago First seen · 191 lines · 102 tokens per session scan A 0fbf0b020c1d

Subscribe to this mod's changes

ffi-capsule-protocol is a skill published in the GitHub repository apache/datafusion-python (610 stars, last pushed 4d ago), licensed Apache-2.0. It adds 102 tokens to every session and 3,069 once invoked, about $0.0004 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-08-30.