rmc-module-audit

Audit Rust module imports, exports, and re-exports for visibility discipline.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you assess whether a specific Rust module’s internal structure, imports, re-exports, and consumer-visible APIs are consistent, intentional, and visibility-disciplined.

Core Features & Use Cases

  • Module-level import & dependency inspection to understand what the module pulls in and where file-level dependencies matter.
  • Facade and re-export verification using declared vs consumer-filtered re-exports to detect dead facades and unintended exposure.
  • Export/visibility mismatch detection by comparing module-tree pub items against get_exports for an external consumer, highlighting pub(crate) leaks.
  • Decision-focused findings that classify results by severity (high/medium/low/info) for faster code review triage.
  • Targeted follow-ups to hand off deeper per-symbol work to rmc-symbol-forensics or crate-root API surface checks to rmc-api-surface.

Quick Start

Ask the Skill to audit the module my_crate::foo::bar for consumer crate my_client_crate after you have built the hypergraph for your workspace.

Frequently Asked Questions about rmc-module-audit

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

FAQPage Schema
How do I audit a Rust module's re-exports and API hygiene for external consumers?

To audit Rust module API hygiene, you need to traverse the module tree and compare declared re-exports against consumer-filtered exports to detect unintended exposure and dead facades. This validates whether the module's internal structure and visibility discipline are intentional.

What is a dead facade in Rust module exports and how do I detect it?

A dead facade in Rust module exports occurs when declared re-exports do not align with consumer-visible APIs. You detect dead facades by running module and file dependency queries, then comparing declared versus consumer-filtered re-exports to highlight visibility mismatches.

How do I check for pub(crate) leaks in a Rust module's public API surface?

To check for pub(crate) leaks in a Rust module, compare the module-tree pub items against the get_exports results for an external consumer. This export and visibility mismatch detection highlights where internal visibility restrictions unintentionally leak into the public API.

How do I inspect Rust module imports and file-level dependencies for code review?

Inspect Rust module imports and file-level dependencies by running module-by-module dependency queries during code review. This identifies what the module pulls in and where file-level dependencies matter, ensuring submodule boundaries remain consistent and intentional.

Can I get severity-ranked findings for Rust module visibility checks?

Yes, Rust module visibility checks produce severity-ranked findings classified as high, medium, low, or info. These decision-focused results classify export and re-export mismatches to enable faster triage during module-level code review.

What should I do after auditing Rust module exports if I need deeper symbol analysis?

After auditing Rust module exports, you should hand off deeper per-symbol work to specialized symbol forensics tools, or route crate-root API surface checks to dedicated API surface analysis tools for broader visibility validation.