rmc-api-surface

Audit a Rust crate's public API for accidental exposure and dead items.

29|5|Updated Nov 24, 2025
One-click install
npx skills add https://github.com/molaco/rust-code-mcp --skill rmc-api-surface
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rmc-api-surface
Source: https://github.com/molaco/rust-code-mcp/tree/main/skills/rmc-api-surface
Command: npx skills add https://github.com/molaco/rust-code-mcp --skill rmc-api-surface

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you identify and clean up a Rust crate’s public API by detecting accidental internal exposure, dead or unused public surface, and ineffective facades created by pub use re-exports.

Core Features & Use Cases

  • Single-crate API surface audit focused on what is publicly visible and what is re-exported at the crate root.
  • Facade vs canonical-path traffic detection using importer analysis to determine whether re-exports are actually used.
  • Dead public and dead facade detection to flag unused public items and re-exports with no cross-crate consumers.
  • Accidental internals exposure checks to surface cases where pub use patterns leak items that were intended to be crate-internal.

Quick Start

Use the rmc-api-surface skill with the target crate name to generate a severity-ranked audit report of declared re-exports, effective exports, and dead public surface.

Frequently Asked Questions about rmc-api-surface

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

FAQPage Schema
How do I audit a Rust crate's public API surface for accidental exposure?

To audit a Rust crate's public API surface, use this Skill to build a hypergraph of declared re-exports and canonical exports, comparing effective visibility against dead public items to detect accidental internal exposure. It generates a severity-ranked report for evidence-based refactoring.

How do I find dead pub use facades and unused public items in Rust?

Dead facade detection in Rust works by comparing pub use re-exports against cross-crate importer traffic to identify ineffective facades. This Skill ranks re-exports using who_imports traffic and overlap signals to flag unused public items with no external consumers.

Can I use this API audit for a multi-crate Rust workspace?

No, this API audit applies to single-crate scope workflows only. It is designed for teams wanting visibility-filtered exports for a consumer crate and evidence-based refactoring guidance within that specific boundary, not multi-crate workspace analysis.

How do I refactor Rust pub items to improve visibility hygiene?

Rust visibility hygiene is maintained by demoting pub items to crate-internal and dropping ineffective pub use facades. This Skill provides evidence-based refactoring guidance using importer analysis to safely remove accidental internals exposure and clean up the public surface.

What is the best way to check if pub use re-exports are actually used in Rust?

The best way to check pub use re-exports is through facade vs canonical-path traffic detection. This Skill uses importer analysis to determine whether re-exports have actual cross-crate consumers, ranking results by who_imports traffic and overlap signals.

What are the limitations of auditing Rust public APIs for dead code?

When refactoring Rust public APIs, you should be cautious about dropping pub use facades that may still serve as canonical paths for external consumers. This Skill mitigates this by comparing effective visibility to dead_pub findings and ranking results using who_imports traffic.