rust-abstraction-police

Detects leaky abstractions in Rust codebases with evidence-backed findings and remediation guidance.

2|Updated May 6, 2026
One-click install
npx skills add https://github.com/bpcakes/jig-skills --skill rust-abstraction-police-bpcakes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-abstraction-police
Source: https://github.com/bpcakes/jig-skills/tree/main/plugins/jig-rust/skills/rust-abstraction-police
Command: npx skills add https://github.com/bpcakes/jig-skills --skill rust-abstraction-police-bpcakes

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Rust APIs often leak implementation details—backend types, lifetimes, lock guards, Serde schemas, or runtime handles—through boundaries that claim to hide them, forcing consumers to couple to internals. This Skill audits Rust abstraction boundaries and reports only evidence-backed leaks, filtering out legitimate concrete contracts. ## Core Features & Use Cases - Five-condition confirmation rule: Every finding must prove the boundary, the intrusion, the consequence, source evidence, and the absence of an intentional contract before being reported. - Rust-specific leak taxonomy: Covers representation, backend/dependency, ownership/lifetime, concurrency/runtime, error, schema, invariant, generic, macro, unsafe/FFI, feature, and behavioral leakage categories. - Optional candidate collector: A dependency-free Python script inventories syntactic leak signals (public fields, foreign errors, escape hatches) as leads for manual semantic validation. - Use Case: Ask the agent to review a Rust PR for new leaky abstractions; it traces boundaries outward and consumers inward, then returns severity-ranked findings with file locations, change tests, and minimal remediation steps. ## Quick Start Ask the agent to abstraction-police your Rust workspace and report only evidence-backed leaky abstractions with file locations and severity rankings.

Frequently Asked Questions about rust-abstraction-police

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find leaky abstractions in a Rust codebase?

Invoke the skill against a workspace, crate, or diff and it traces each boundary's public surface and consumer call sites. Findings are reported only when boundary, intrusion, consequence, evidence, and intent checks all pass, ranked by severity.

How to review a Rust PR for encapsulation problems?

Use diff review mode, which inspects changed boundaries, their definitions, and affected callers. It reports only leaks introduced or materially worsened by the change unless you request a broader audit.

Does the candidate collector script need external dependencies?

No, the collector uses only the Python standard library and requires Python 3.11 or newer for tomllib. It performs source-only analysis without compiling or executing any repository code.

Is a public concrete type like Vec or Arc always a leak in Rust?

No. The skill explicitly rejects findings based only on public concrete types when the semantics are part of the contract, such as Vec for ordered sequences or Arc for intentional shared ownership. A leak requires proof the detail contradicts the boundary's promise.

What are the limitations of the automated candidate collection?

The collector emits syntactic leads, not findings; it cannot resolve effective visibility, architectural intent, or consumer impact. The skill must still validate each candidate against the five-condition confirmation rule before reporting.