mds-rust-namespace-surface

Enforce module-first Rust naming and export rules for project APIs.

Updated Jan 6, 2026
One-click install
npx skills add https://github.com/eboody/eran.codes --skill mds-rust-namespace-surface
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mds-rust-namespace-surface
Source: https://github.com/eboody/eran.codes/tree/main/.codex/skills/mds-rust-namespace-surface
Command: npx skills add https://github.com/eboody/eran.codes --skill mds-rust-namespace-surface

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the challenge of maintaining clear, organized, and idiomatic Rust APIs by enforcing module-first naming conventions and export rules, preventing namespace pollution and improving code readability.

Core Features & Use Cases

  • Module-First Namespacing: Ensures that module paths form the primary namespace for related types and functions.
  • Anti-Flattening Imports: Discourages the use of pub use that flattens module structures, promoting explicit qualification.
  • Companion Type Shaping: Guides the organization of generic companion types within their respective modules.
  • Use Case: When refactoring a Rust crate's public API, use this Skill to guide changes to mod.rs files, use statements, and public type visibility to ensure a clean and maintainable module structure.

Quick Start

Apply the mds-rust-namespace-surface skill to ensure Rust APIs are module-first.

Frequently Asked Questions about mds-rust-namespace-surface

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

FAQPage Schema
How do I enforce module-first naming conventions in a Rust crate?

You can enforce module-first Rust APIs by ensuring module paths form the primary namespace for related types and functions, preventing namespace pollution and improving overall code readability.

What is the best way to stop flattening module structures with pub use in Rust?

Stop flattening module structures by discouraging `pub use` re-exports that collapse hierarchies, instead promoting explicit path qualification to maintain clear namespace visibility at call sites.

How do I organize companion type families within Rust modules?

Organize companion type families by guiding generic companion types into their respective modules and ensuring call sites maintain strict namespace visibility for a clean module structure.

When should I refactor a Rust crate's public API for namespace visibility?

Refactor a Rust crate's public API for namespace visibility when module structures become flattened, companion types are disorganized, or call sites lose explicit namespace qualification.

Does this approach require modifying mod.rs files and use statements?

Yes, enforcing module-first Rust APIs requires guiding changes to `mod.rs` files, `use` statements, and public type visibility to ensure a clean and maintainable module structure.