rmc-enum-variants

Analyze Rust enum variants and measure per-variant fan-in across the workspace.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you understand which Rust enum variants actually matter in practice by listing variants and computing where each variant is used across the codebase.

Core Features & Use Cases

  • Enum variant listing: Pulls variants from a specific enum with qualified names and source locations, so you can audit the variant set without manual parsing.
  • Per-variant fan-in (who uses it): Identifies all construction sites and match/pattern uses for each variant, highlighting the load-bearing states.
  • Convergence detection across enums: Clusters duplicated/identical variant models using semantic overlaps to spot convergent enum design.
  • Attribute-aware dead-state checks: Supports attribute auditing (for example, identifying #[non_exhaustive]) so “unused” findings are interpreted correctly.

Quick Start

Ask the MCP server to build the hypergraph and index the codebase, then run the enum_variants step for your target enum and follow up with who_uses_summary for each variant to see which states carry usage.

Frequently Asked Questions about rmc-enum-variants

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

FAQPage Schema
How do I detect unused Rust enum variants across a workspace?

Detecting unused Rust enum variants involves extracting variants from target enums and computing per-variant fan-in across the codebase. This reveals which variants lack construction sites or match patterns, flagging them as unused states.

What is the best way to identify Rust enum refactoring candidates?

Auditing enum variants for refactoring candidates requires listing variants with qualified names and measuring their usage load. By identifying all construction sites and pattern uses, you can isolate load-bearing states from redundant ones suitable for refactoring.

How do I detect convergent enum designs in a Rust codebase?

Finding convergent enum designs in Rust uses semantic overlaps to cluster identical variant models across different enums. This convergence detection spots duplicated state representations, helping you consolidate overlapping enum structures during code auditing.

Does enum variant usage analysis work with non_exhaustive attributes?

Enum variant usage analysis works with non_exhaustive attributes by applying attribute-aware dead-state checks. This ensures that unused findings are interpreted correctly, preventing false positives when variants are marked to allow future additions outside the current crate.

How do I start static analysis of Rust enum variants?

To start analyzing Rust enum variants using static analysis, build the hypergraph and index the codebase. Then run the enum variant extraction step for your target enum, followed by querying who uses each variant to see which states carry usage.

Can I measure enum variant fan-in across a Rust workspace?

You can measure enum variant fan-in across a Rust workspace by indexing the codebase and querying per-variant usage. This identifies all construction sites and match patterns, quantifying how often each variant is referenced within the workspace call graph.