rmc-crate-audit

Audit a Rust crate for dead public APIs and structural risks.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Identifies dead or misleading public API surfaces and highlights structural and complexity risks in a Rust crate so teams can prioritize safe cleanup and refactors.

Core Features & Use Cases

  • Crate-scoped structural audit: builds a module tree snapshot, re-export map, and dead-public detection, then cross-tabulates them to find dead canonical items and dead facade re-exports.
  • Dependency direction analysis: determines outgoing vs incoming dependencies to assess whether the crate is single-purpose or a shared library with strong coupling.
  • Complexity-driven prioritization: runs file-aggregated complexity analysis and links hot spots to usage summaries to target changes that matter most.
  • Public surface validation: confirms whether root-level canonical types and key methods have real external fan-in using usage queries, flagging test-only or empty targets.
  • Method-level deepening (Layer 4): analyzes types’ methods for unused or critical-path fan-in with visibility derived from source spans.

Quick Start

Run rmc-crate-audit for the crate name you want and the workspace path to generate a severity-ranked findings table and recommended actions.

Frequently Asked Questions about rmc-crate-audit

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

FAQPage Schema
How do I find dead public APIs in a Rust crate?

A crate audit detects dead public APIs by cross-tabulating a module tree snapshot, re-export map, and dead-public queries to identify unused canonical items and misleading facade re-exports.

How can I assess dependency coupling to find god-crates in a Rust workspace?

Assessing dependency direction determines outgoing versus incoming dependencies to identify whether a target crate is single-purpose or a shared library with strong coupling, highlighting facade or god-crates.

What is the best way to prioritize refactoring targets based on code complexity?

Prioritizing refactoring targets involves running file-aggregated complexity analysis and linking identified hot spots to usage summaries, targeting structural changes that matter most for workspace maintenance.

Does crate audit require a prebuilt workspace hypergraph to analyze public surfaces?

Yes, performing a crate audit requires a prebuilt workspace hypergraph to cross-tabulate liveness, using module_tree plus re-export and dead-public queries to validate public surface fan-in.

Can I validate if a Rust crate's public methods have real external usage?

You can validate external usage by confirming whether root-level canonical types and key methods have real external fan-in using usage queries, which flags test-only or empty targets.