Agent skill

Organize Modules

by r3bl-org in r3bl-org/r3bl-open-core

Apply private modules with public re-exports (barrel export) pattern for clean API design.

Apache-2.0Auto-check passedBackend & APIs

Install Organize Modules

skills CLI
$ npx skills add r3bl-org/r3bl-open-core --skill organize-modules -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install r3bl-org/r3bl-open-core organize-modules --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/r3bl-org/r3bl-open-core.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/organize-modules .claude/skills/organize-modules && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
organize-modules
GitHub stars
485
Token cost
~5.8k tokens
SKILL.md length
1,860 words
Files
2
Skills in repo
25
Repo updated
First seen
Licence
Apache-2.0

At a glance

Apply private modules with public re-exports (barrel export) pattern for clean API design.

  • Works in 11 steps: Apply the Recommended Pattern → Control Rustfmt Behavior (When Needed) → Apply Conditional Visibility for Docs… → …
  • Creating modules
  • SKILL.md covers When to Use, Instructions, Benefits of This Pattern and Decision Trees, plus 5 more sections
  • Calls cargo

What it does

Organize Modules is an agent skill from r3bl-org/r3bl-open-core. Apply private modules with public re-exports (barrel export) pattern for clean API design. Includes conditional visibility for docs and tests. Use when creating modules, organizing mod.rs files, or before creating commits.

Its SKILL.md is about 5.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `examples.md`).

It sits in Backend & APIs, covering API design. The repository describes itself as: TUI framework and developer productivity apps in Rust 🦀. The licence is Apache-2.0.

When your agent uses it

  • Creating modules
  • Organizing mod.rs files
  • Before creating commits

Example prompts

  • “/organize-modules”

Workflow steps

11 steps, taken from the step headings in SKILL.md.

  1. Apply the Recommended Pattern
  2. Control Rustfmt Behavior (When Needed)
  3. Apply Conditional Visibility for Docs and Tests
  4. Handle Transitive Visibility
  5. Reference in Rustdoc
  6. Multi-Level Barrel Exports and Rustdoc Search
  7. Macro Module Organization
  8. Clean, Flat API
  9. Refactoring Freedom
  10. Avoid Naming Conflicts
  11. Encapsulation

What it can do on your machine

Read from SKILL.md and the folder at commit 89db352. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • developer.mozilla.org
    • en.wikipedia.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Organize Modules loads about 5.8k tokens when it runs. Until then it costs about 60 tokens; SKILL.md has 1,860 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~60
When it runs · the whole SKILL.md, loaded when a task matches
~5.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from r3bl-org/r3bl-open-core at commit 89db352, republished under its Apache-2.0 licence (© r3bl-org). 1,860 words, ~5,833 tokens.

Download SKILL.mdSave it as .claude/skills/organize-modules/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
organize-modules
description
Apply private modules with public re-exports (barrel export) pattern for clean API design. Includes conditional visibility for docs and tests. Use when creating modules, organizing mod.rs files, or before creating commits.

Module Organization Best Practices

When to Use

  • Creating new Rust modules
  • Refactoring module structure
  • Organizing mod.rs files
  • Reviewing code that exposes internal structure
  • Making private types visible to documentation
  • Before creating commits with module changes
  • When user says "organize modules", "refactor modules", "fix module structure", etc.

Instructions

Follow these patterns for clean, maintainable module organization:

Prefer private modules with public re-exports (also known as the barrel export pattern) as the default pattern.

This provides a clean API while maintaining flexibility to refactor internal structure.

rust
// mod.rs - Module coordinator

// Private modules (hide internal structure)
mod constants;
mod types;
mod helpers;

// Public re-exports (expose stable API)
pub use constants::*;
pub use types::*;
pub use helpers::*;

What this achieves:

  • Clean, flat API for users
  • Internal structure is hidden and can be refactored freely
  • No namespace pollution from module names
Step 2: Control Rustfmt Behavior (When Needed)

For mod.rs files with deliberate manual alignment, prevent rustfmt from reformatting:

rust
// mod.rs

#![rustfmt::skip]

// Private modules
mod constants;
mod types;
mod helpers;

// Public re-exports
pub use constants::*;
pub use types::*;
pub use helpers::*;

When to use rustfmt skip:

  • Large mod.rs files with many exports
  • Deliberately structured code alignment for clarity
  • Manual grouping of related items (e.g., test fixtures)
  • Files where organization conveys semantic meaning

When NOT to use:

  • Small, simple mod.rs files
  • When automatic formatting is preferred
Step 3: Apply Conditional Visibility for Docs and Tests

When you need a module to be:

  • Private in production builds (encapsulation)
  • Public for documentation (rustdoc links work)
  • Public for tests (test code can access internals)

Use conditional compilation:

rust
// mod.rs - Conditional visibility

#[cfg(any(test, doc))]
pub mod internal_parser;
#[cfg(not(any(test, doc)))]
mod internal_parser;

// Re-export items for the flat public API
pub use internal_parser::*;

How this works:

  • In doc builds: Module is public → rustdoc can see and link to it
  • In test builds: Module is public → tests can access internals
  • In production builds: Module is private → internal implementation detail

This pattern is frequently used with the write-documentation skill when fixing documentation links to private types.

When to Omit the Fallback Branch

You can skip the #[cfg(not(any(test, doc)))] fallback when the module has no code to compile in production:

rust
// ✅ OK to skip fallback - documentation-only module (no actual code)
#[cfg(any(test, doc))]
pub mod integration_tests_docs;

// ✅ OK to skip fallback - all submodules are #[cfg(test)] anyway
#[cfg(any(test, doc))]
pub mod integration_tests;

Keep the fallback when the module contains code that must compile in production (even if private):

rust
// ✅ Need fallback - module has actual code used in production
#[cfg(any(test, doc))]
pub mod internal_parser;
#[cfg(not(any(test, doc)))]
mod internal_parser;

pub use internal_parser::*;  // Re-exports need the module to exist!
Integration Tests Module

For modules that contain PTY integration tests (typically under integration_tests/), follow these rules:

  1. Dedicated Files: Each complex test gets its own file.
  2. Module Documentation: Use //! at the top of the file to document the test's intent.
  3. Run Instructions: Always include a "Run with:" section at the top of the file (see write-documentation skill for details).
  4. Conditional Visibility: Parent modules must make these test modules public for doc and test builds.
rust
// integration_tests/mod.rs

#[cfg(any(test, doc))]
pub mod pty_feature_test;
Platform-Specific Modules with Cross-Platform Docs

For modules that are platform-specific but should have docs generated on all platforms, use any(doc, ...) to separate documentation from runtime requirements:

rust
// ✅ Linux-only runtime, but docs build on all platforms
#[cfg(any(doc, all(target_os = "linux", test)))]
pub mod input;
#[cfg(all(target_os = "linux", not(any(test, doc))))]
mod input;

// Re-export also needs the doc condition
#[cfg(any(target_os = "linux", doc))]
pub use input::*;

Key insight: rustdoc runs the Rust compiler internally. When you write #[cfg(all(target_os = "linux", any(test, doc)))], the target_os = "linux" check still excludes macOS/Windows even during doc builds. The doc cfg flag doesn't override other conditions: it's just another flag you can check.

The fix: Use any(doc, ...) to make doc an alternative path:

  • any(doc, all(target_os = "linux", test)) means: "docs on any platform OR tests on Linux"
  • all(target_os = "linux", any(test, doc)) means: "Linux AND (tests OR docs)": still requires Linux!

When you see broken doc links for platform-specific modules:

rust
// ❌ Broken: Docs won't generate on macOS
#[cfg(all(target_os = "linux", any(test, doc)))]
pub mod linux_only_module;

// ✅ Fixed: Docs generate on all platforms (if module code is platform-agnostic)
#[cfg(any(doc, all(target_os = "linux", test)))]
pub mod linux_only_module;
#[cfg(all(target_os = "linux", not(any(test, doc))))]
mod linux_only_module;
⚠️ Unix Dependency Caveat

The cfg(any(doc, ...)) pattern above assumes the module's code compiles on all platforms. When the module uses Unix-only APIs (e.g., mio::unix::SourceFd, signal_hook, std::os::fd::AsRawFd), restrict doc builds to Unix:

rust
// Module uses Unix-only APIs: restrict doc builds to Unix platforms
#[cfg(any(all(unix, doc), all(target_os = "linux", test)))]
pub mod input;
#[cfg(all(target_os = "linux", not(any(test, doc))))]
mod input;

#[cfg(any(target_os = "linux", all(unix, doc)))]
pub use input::*;

Three-tier hierarchy:

Module dependenciesPatternDocs: LinuxDocs: macOSDocs: Windows
Platform-agnosticcfg(any(doc, ...))✅✅✅
Unix APIscfg(any(all(unix, doc), ...))✅✅excluded
Linux-only APIscfg(any(all(target_os = "linux", doc), ...))✅excludedexcluded

Rule of thumb: Match your doc cfg guard to your dependency's cfg guard in Cargo.toml.

Apply at all levels: If the module is nested, both parent and child need the visibility change. Also update any re-exports:

rust
// Parent module
#[cfg(any(doc, all(target_os = "linux", test)))]
pub mod integration_tests;

// Child modules inside integration_tests/mod.rs
#[cfg(any(doc, all(target_os = "linux", test)))]
pub mod pty_input_test;

// Re-exports
#[cfg(any(target_os = "linux", doc))]
pub use integration_tests::*;
Step 4: Handle Transitive Visibility

Important: If a conditionally public module links to another module in its documentation, that target module must also be conditionally public.

rust
// mod.rs

#[cfg(any(test, doc))]
pub mod paint_impl;  // Contains docs that link to diff_chunks
#[cfg(not(any(test, doc)))]
mod paint_impl;

#[cfg(any(test, doc))]
pub mod diff_chunks;  // Must also be conditionally public!
#[cfg(not(any(test, doc)))]
mod diff_chunks;

// Re-export for public API
pub use paint_impl::*;
pub use diff_chunks::*;

Why: Rustdoc needs to resolve all links in documentation. If paint_impl docs link to diff_chunks, rustdoc must be able to see diff_chunks.

Step 5: Reference in Rustdoc

When linking to conditionally public modules in documentation, use the mod@ prefix:

rust
/// See [`internal_parser`] for implementation details.
///
/// [`internal_parser`]: mod@crate::internal_parser

See the write-documentation skill for complete details on rustdoc links.

When rustdoc generates documentation, the search index includes all public items and modules. For multi-level barrel exports (pub mod intermediate; pub use intermediate::*;), the search index resolves the "shortest public path" for items. But rustdoc only generates HTML pages at the canonical definition path, not at the flattened re-export path.

This means searching for an item re-exported via a barrel might produce a link to a page that doesn't exist (e.g., core/ansi/csi/index.html instead of core/ansi/constants/csi/index.html).

The fix: Use #[doc(inline)] to re-export submodules at the parent level, but only when the intermediate module is a well-documented organizational hub (has module-level //! docs, organization tables, etc.) AND its submodules are pub mod.

Intermediate module characteristicsActionWhy
Public, has module docs, organization tablesAdd #[doc(inline)]Submodules are discoverable via search; pages must exist
Private with pub use *; only (pure barrel)No action neededSubmodules aren't in the search index at all
Public but no module docs (structural only)No action neededNot worth the doc noise; users won't search for these

In the parent module's mod.rs, add explicit #[doc(inline)] re-exports alongside the existing glob re-export:

rust
// Existing: keeps flat item access working
pub use constants::*;

// New: creates rustdoc pages at the parent path for searchability
#[doc(inline)] // Create doc pages at re-export path so rustdoc search links resolve.
pub use constants::{csi, dsr};

Always include the inline comment on #[doc(inline)] lines:

rust
#[doc(inline)] // Create doc pages at re-export path so rustdoc search links resolve.

If the re-exported modules use conditional visibility (#[cfg(any(test, doc))]), add the guard with its own inline comment:

rust
#[cfg(any(test, doc))] // Guard needed: constants sub-modules are only pub in doc/test builds.
#[doc(inline)] // Create doc pages at re-export path so rustdoc search links resolve.
pub use constants::{csi, dsr};

This creates pages at both paths (ansi/csi/ AND ansi/constants/csi/), so rustdoc search links work regardless of which path the search index resolves.

Step 7: Macro Module Organization

For modules that define #[macro_export] macros, do NOT use #[macro_use] on module declarations. Instead, use explicit imports at call sites:

rust
// mod.rs - Do NOT use #[macro_use]
pub mod macros;  // ✅ Just declare the module

// At each call site that uses the macro:
use crate::my_macro;  // ✅ Explicit import
my_macro!();

Why: #[macro_use] is a Rust 2015 pattern that depends on module declaration order and breaks silently when modules are reordered. #[macro_export] macros are available at the crate root in Rust 2018+, so use crate::macro_name; works everywhere.

Inner modules: use crate::macro_name; imports do NOT propagate into child mod blocks. Each inner module that uses a macro needs its own import:

rust
use crate::ok;  // Available in this file's scope

mod inner {
    use crate::ok;  // Must import separately - parent scope doesn't propagate
    fn example() { ok!() }
}

Test-only macros: Guard imports with #[cfg(test)] to avoid unused import warnings:

rust
#[cfg(test)]
use crate::assert_eq2;

Benefits of This Pattern

1. Clean, Flat API

Users import directly without unnecessary nesting:

✅ Good (flat, ergonomic):

rust
use my_module::MyType;
use my_module::CONSTANT;

❌ Bad (exposes internal structure):

rust
use my_module::types::MyType;
use my_module::constants::CONSTANT;
2. Refactoring Freedom

Internal reorganization doesn't break external code:

rust
// You can move items between files freely
// External API stays: use my_module::Item;

// Before:
// mod.rs: pub use types::Item;
// types.rs: pub struct Item;

// After refactoring:
// mod.rs: pub use helpers::Item;  // Changed!
// helpers.rs: pub struct Item;    // Moved!

// External code unaffected:
// use my_module::Item;  // Still works!
Show full SKILL.md (835 more words)Show less
3. Avoid Naming Conflicts

Private module names don't pollute the namespace:

rust
// No conflicts with other `constants` modules in the crate
mod constants;  // Private - name hidden
pub use constants::*;  // Items public

// Elsewhere in the crate
mod constants;  // No conflict! This is in a different scope

⚠️ Warning: Re-export Collisions with pub mod

While private module names don't collide, their public contents (including public submodules) will collide if they share the same name and are pulled into the same parent namespace via glob re-exports (pub use module::*;).

If multiple modules in the same hierarchy have submodules with identical names (e.g., several pub mod integration_tests;), glob re-exporting them into a single parent module will cause ambiguous re-export errors, because the module names leak into the public API.

How to solve test module collisions:

  1. The Default: Make test modules private (mod integration_tests;). They do not need to be pub for cargo test to find them. This perfectly encapsulates the module, preventing namespace pollution and collisions.
  2. The Rustdoc Exception: If you must link to a test module in your documentation using intra-doc links, it must be pub mod. In this case, you must use a uniquely prefixed name (e.g., pub mod vt_100_parser_integration_tests; instead of integration_tests) to prevent it from colliding with other public test modules in the global namespace.
4. Encapsulation

Module structure is an implementation detail, not part of the API:

rust
// Internal structure can change without breaking compatibility
// v1.0: mod types; pub use types::*;
// v1.1: mod models; pub use models::*;  // Renamed module
// Users don't care!

Decision Trees

When to Use Private Modules + Public Re-exports

✅ Use this pattern when:

  • Module structure is an implementation detail
  • You want a flat, ergonomic API surface
  • Avoiding potential name collisions across the crate
  • Working with small to medium-sized modules with clear responsibilities
  • Building a library with a stable public API

Example scenarios:

  • Utility modules with helpers, types, constants
  • Internal parser implementation
  • Data structure implementations
When NOT to Use This Pattern

❌ Keep modules public when:

1. Module Structure IS the API

Different domains should be explicit:

rust
pub mod frontend;  // Frontend-specific APIs
pub mod backend;   // Backend-specific APIs

// Users: use my_crate::frontend::Component;
// Users: use my_crate::backend::Database;

Why: The separation is meaningful to users. They WANT to know if they're using frontend or backend APIs.

2. Large Feature Domains

When namespacing provides clarity for 100+ items:

rust
pub mod graphics;   // 100+ graphics-related items
pub mod audio;      // 100+ audio-related items
pub mod physics;    // 100+ physics-related items

// Users: use engine::graphics::Renderer;
// Users: use engine::audio::Mixer;

Why: Flat re-export of 300+ items would be overwhelming. Namespacing aids discovery.

3. Optional/Conditional Features

Make feature boundaries explicit:

rust
#[cfg(feature = "async")]
pub mod async_api;  // Keep separate for clarity

#[cfg(feature = "serde")]
pub mod serialization;

// Users: use my_crate::async_api::Client;

Why: Users need to know which features enable which APIs.

Inner Modules vs. Separate Files

When organizing code into logical groups, choose between inner modules (same file) and separate files based on file size and complexity.

Inner Modules (Same File)

✅ Use inner modules when:

  • File is small-to-medium (under ~300 lines total)
  • Groups are logically related and benefit from proximity
  • Comment banners (// ======) are being used to separate sections
  • Each group is relatively small (~20-50 lines)
rust
// ansi_sequence_generator.rs - Inner module pattern

pub struct AnsiSequenceGenerator;

mod cursor_movement {
    use super::*;
    impl AnsiSequenceGenerator {
        pub fn cursor_position(...) -> String { ... }
        pub fn cursor_to_column(...) -> String { ... }
    }
}

mod screen_clearing {
    use super::*;
    impl AnsiSequenceGenerator {
        pub fn clear_screen() -> String { ... }
        pub fn clear_current_line() -> String { ... }
    }
}

mod color_ops {
    use super::*;
    impl AnsiSequenceGenerator {
        pub fn fg_color(...) -> String { ... }
        pub fn bg_color(...) -> String { ... }
    }
}

Benefits:

  • Single-file cohesion - everything related stays together
  • Easier navigation - no jumping between files
  • Clear grouping - mod keyword is more formal than comment banners
  • Scoped imports - each inner mod can import only what it needs
Separate Files

✅ Use separate files when:

  • Individual groups exceed ~100 lines each
  • Groups have distinct dependencies (different imports)
  • File would exceed ~500 lines total
  • Groups are conceptually independent (could be tested separately)
generator/
├── mod.rs                    # Re-exports + struct definition
├── cursor_movement.rs        # impl AnsiSequenceGenerator { cursor_* }
├── screen_clearing.rs        # impl AnsiSequenceGenerator { clear_* }
├── color_ops.rs              # impl AnsiSequenceGenerator { colors }
└── terminal_modes.rs         # impl AnsiSequenceGenerator { modes }
Code Smell: Comment Banners

If you find yourself writing comment banners like this:

rust
impl MyStruct {
    // ==================== Group A ====================
    fn method_a1() { ... }
    fn method_a2() { ... }

    // ==================== Group B ====================
    fn method_b1() { ... }
    fn method_b2() { ... }
}

This is a signal to formalize the grouping using either inner modules (small file) or separate files (large file). Comment banners are informal and don't provide the same benefits as actual module boundaries (scoped imports, clear boundaries, IDE navigation).

Complete Examples

Example 1: Simple Module Organization
rust
// src/terminal/mod.rs

#![rustfmt::skip]

// Core types
mod position;
mod size;
mod style;

// State management
mod cursor;
mod buffer;

// Public API - flat exports
pub use position::*;
pub use size::*;
pub use style::*;
pub use cursor::*;
pub use buffer::*;

Usage:

rust
use terminal::{Position, Size, Style, Cursor, Buffer};
// Not: use terminal::position::Position;
Example 2: Conditional Visibility for Docs
rust
// src/parser/mod.rs

// Make internal modules public for docs and tests
#[cfg(any(test, doc))]
pub mod vt_100;
#[cfg(not(any(test, doc)))]
mod vt_100;

#[cfg(any(test, doc))]
pub mod escape_sequences;
#[cfg(not(any(test, doc)))]
mod escape_sequences;

// Public API
pub use vt_100::*;
pub use escape_sequences::*;

Now rustdoc can link to these modules:

rust
/// Uses [`vt_100`] for parsing.
///
/// [`vt_100`]: mod@crate::parser::vt_100
Example 3: Mixed Public and Private Modules
rust
// src/rendering/mod.rs

// Public modules (API namespacing)
pub mod backends;     // Different backend implementations
pub mod widgets;      // UI widgets

// Private modules (internal implementation)
mod buffer;
mod diff_engine;

// Selective re-exports
pub use buffer::RenderBuffer;  // This one is public
// diff_engine stays internal

Usage:

rust
use rendering::backends::Crossterm;
use rendering::widgets::Button;
use rendering::RenderBuffer;  // Flat re-export
// Cannot use: rendering::diff_engine  // Private!

Common Mistakes

❌ Mistake 1: Everything Public
rust
// mod.rs - Bad!
pub mod constants;
pub mod types;
pub mod helpers;

Problem: Exposes internal structure, hard to refactor later.

❌ Mistake 2: Forgetting Transitive Visibility
rust
// mod.rs - Bad!
#[cfg(any(test, doc))]
pub mod a;  // Docs link to module b

mod b;  // Private! Rustdoc can't see it

Problem: Rustdoc can't resolve links from a to b.

Fix:

rust
#[cfg(any(test, doc))]
pub mod a;

#[cfg(any(test, doc))]
pub mod b;  // Also conditionally public
#[cfg(not(any(test, doc)))]
mod b;
❌ Mistake 3: Using Conditional Visibility Everywhere
rust
// mod.rs - Overkill!
#[cfg(any(test, doc))]
pub mod utils;
#[cfg(not(any(test, doc)))]
mod utils;

Problem: Only use conditional visibility when:

  • Linking to the module in rustdoc, OR
  • Accessing the module from test code

Simple case: If module items are re-exported and you don't need to link to the module itself, just use private modules.

Reporting Results

After organizing modules:

  • ✅ Organized successfully → "Module structure organized with private modules and public re-exports!"
  • 🔧 Made conditionally public → Report which modules got conditional visibility
  • 📝 Manual review needed → List modules that may need public exposure for API reasons

Supporting Files in This Skill

This skill includes additional reference material:

  • examples.md - 6 complete, working examples of module organization for different scenarios: simple library with internal structure, conditional visibility for documentation, large crate with domain separation, test-only module visibility, gradual refactoring strategy, and avoiding naming conflicts. Each example shows full file structure and implementation. Read this when:
    • Simple library module organization → Example 1
    • Need conditional visibility for docs/tests → Example 2
    • Large crate with multiple domains (graphics/audio/physics) → Example 3
    • Test utilities that should only exist in test builds → Example 4
    • Refactoring from public modules to private + re-exports → Example 5
    • Avoiding module naming conflicts → Example 6
    • Decision tree for when to use which pattern → End of file
  • write-documentation - For documenting module organization and fixing intra-doc links (uses conditional visibility for linking private types)
  • run-clippy - Ensures mod.rs follows patterns

No dedicated command, but used by:

  • /clippy - Checks module organization as part of code quality
  • /fix-intradoc-links - Uses conditional visibility patterns from this skill
  • clippy-runner - Invokes this skill to enforce module patterns

© r3bl-org, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .agents/skills/organize-modules of r3bl-org/r3bl-open-core.

  • SKILL.md
  • examples.md

Open the folder on GitHubat commit 89db352

Compare with similar skills

Organize Modules next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Organize Modules compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Organize Modules this skillr3bl-org/r3bl-open-core485—~5.8kAutomated safety check: PassApache-2.0
Nodejs Backend Patternsever-works/ever-works16218 repos~4kAutomated safety check: PassAGPL-3.0
API DesignerJeffallan/claude-skills12k1 repos~2kAutomated safety check: PassMIT
Pangolin CRUD Endpointsfosrl/pangolin23k—~461Automated safety check: PassCustom licence
Backend PatternshellangleZ/burn-in-cceverywhere-ralph11217 repos~3.3kAutomated safety check: PassNone
API Design Principlesjh941213/my-cc-harness12618 repos~3.4kAutomated safety check: PassNone

Similar skills

  • Nodejs Backend Patterns

    ever-works/ever-works

    Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices.

    162 GitHub starsUsed in 18 repos~4k tokens
    Backend & APIsAuto-check passed
  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 1 repo~2k tokens
    Backend & APIsAuto-check passed
  • Use whenever asked to add, create, or scaffold a CRUD endpoint, router, or entity in this repo's server (create/list/get/update/delete handlers, new…

    23k GitHub stars~461 tokensUpdated today
    Backend & APIsAuto-check passed
  • Backend Patterns

    hellangleZ/burn-in-cceverywhere-ralph

    Backend architecture patterns, API design, database optimization, and server-side best practices for Node.js, Express, and Next.js API routes.

    112 GitHub starsUsed in 17 repos~3.3k tokens
    Backend & APIsAuto-check passed
  • API Design Principles

    jh941213/my-cc-harness

    REST 및 GraphQL API 설계 원칙 가이드. An agent skill from jh941213/my-cc-harness.

    126 GitHub starsUsed in 18 repos~3.4k tokens
    Backend & APIsAuto-check passed
  • API And Interface Design

    dzhalaevd/Donatello

    Guides stable API and interface design. An agent skill from dzhalaevd/Donatello.

    135 GitHub starsUsed in 8 repos~2.6k tokens
    Backend & APIsAuto-check passed

More from r3bl-org/r3bl-open-core

All 25 skills in this repo
  • Analyze Log Files

    r3bl-org/r3bl-open-core

    Analyze log files by stripping ANSI escape sequences first. An agent skill from r3bl-org/r3bl-open-core.

    485 GitHub stars~632 tokensUpdated today
    Auto-check: notes
  • Analyze Performance

    r3bl-org/r3bl-open-core

    Establish performance baselines and detect regressions using flamegraph analysis.

    485 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Check Bounds Safety

    r3bl-org/r3bl-open-core

    Apply type-safe bounds checking patterns using VPIndex/VPLength types instead of usize.

    485 GitHub stars~4.1k tokensUpdated today
    Auto-check passed
  • Release Crate

    r3bl-org/r3bl-open-core

    Publish a crate release to crates.io with changelog, standalone release notes, git tag, and GitHub release.

    485 GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Check Code Quality

    r3bl-org/r3bl-open-core

    Run comprehensive Rust code quality checks including compilation, linting, documentation, and tests.

    485 GitHub stars~3.8k tokensUpdated today
    Auto-check passed
  • Check Test Coverage

    r3bl-org/r3bl-open-core

    Audit and verify test coverage for a specific file or module, ensuring all custom logic branches, state transitions, and boundary conditions are covered while strictly eliminating dependency test…

    485 GitHub stars~1.7k tokensUpdated today
    Auto-check passed

Categories

Questions about Organize Modules

What does Organize Modules do?

Apply private modules with public re-exports (barrel export) pattern for clean API design. Organize Modules is an agent skill from r3bl-org/r3bl-open-core. Apply private modules with public re-exports (barrel export) pattern for clean API design.

When should I use Organize Modules?

Organize Modules fits situations like: creating modules; organizing mod.rs files; before creating commits.

How do I install Organize Modules in Claude Code?

Run `npx skills add r3bl-org/r3bl-open-core --skill organize-modules -a claude-code`. Or copy the skill folder (.agents/skills/organize-modules in r3bl-org/r3bl-open-core) into .claude/skills/organize-modules in your project. Claude Code loads it when a task matches its description.

How do I install Organize Modules in Codex?

Run `npx skills add r3bl-org/r3bl-open-core --skill organize-modules -a codex`. Or copy the skill folder (.agents/skills/organize-modules in r3bl-org/r3bl-open-core) into .agents/skills/organize-modules in your project. Codex loads it when a task matches its description.

Can I use Organize Modules in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add r3bl-org/r3bl-open-core --skill organize-modules -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/organize-modules, .gemini/skills/organize-modules, .github/skills/organize-modules and .opencode/skills/organize-modules in your project.

What does Organize Modules need to run?

Going by SKILL.md and its folder, Organize Modules needs the command-line tools its instructions call (cargo).

Does Organize Modules access the network?

SKILL.md names 2 domains. As links in the text: developer.mozilla.org and en.wikipedia.org. This is read from the text; nothing was executed.

Is Organize Modules safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Organize Modules use?

Organize Modules is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Organize Modules use?

About 5.8k tokens (SKILL.md is roughly 23k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Organize Modules?

Skills that share tags, products or a category with Organize Modules: Nodejs Backend Patterns (ever-works/ever-works, 162 stars), API Designer (Jeffallan/claude-skills, 12k stars), Pangolin CRUD Endpoints (fosrl/pangolin, 23k stars) and Backend Patterns (hellangleZ/burn-in-cceverywhere-ralph, 112 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Organize Modules?

r3bl-org (a GitHub organization) maintains it in r3bl-org/r3bl-open-core, which has 485 GitHub stars. The repository holds 25 skills in this directory. The repository was last updated on October 8, 2026.

Source: r3bl-org/r3bl-open-core on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.