install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/pproenca/dot-skills/mui-base" ~/.claude/skills/comeonoliver-skillshub-mui-base && rm -rf "$T"
manifest:
skills/pproenca/dot-skills/mui-base/SKILL.mdsource content
MUI Headless UI Best Practices
Comprehensive style guide for building headless React component libraries following MUI Base UI patterns. Contains 48 rules across 5 categories, prioritized by impact.
When to Apply
Reference these guidelines when:
- Building headless/unstyled component libraries
- Creating compound components with context-based composition
- Implementing accessible UI primitives with ARIA patterns
- Using render props and className callbacks for styling flexibility
- Writing components that support both controlled and uncontrolled modes
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Component Patterns | CRITICAL | |
| 2 | Naming Conventions | HIGH | |
| 3 | Organization | HIGH | |
| 4 | Error Handling | HIGH | |
| 5 | Style | MEDIUM | |
Quick Reference
1. Component Patterns (CRITICAL)
- Use forwardRef with Named Functioncomp-forward-ref-named
- Name Props Parameter componentPropscomp-props-parameter-naming
- Use useRenderElement for DOM Renderingcomp-use-render-element
- Create Context with Undefined Defaultcomp-context-undefined-default
- Context Error Messages with Hierarchycomp-context-error-message
- Use useControlled Hook for Dual Modescomp-use-controlled
- Memoize State Objectscomp-state-memoization
- Memoize Context Provider Valuescomp-context-value-memo
- Plain Function for Non-DOM Rootscomp-plain-function-root
- Hook Namespace Exportscomp-hook-namespace-exports
- Props Destructuring Ordercomp-props-destructure-order
- Add use client Directivecomp-use-client-directive
2. Naming Conventions (HIGH)
- Component Naming as ParentPartname-component-naming
- File Name Matches Primary Exportname-file-matches-export
- Directory Naming kebab-casename-directory-kebab-case
- Part Directory Naming lowercasename-part-directory-lowercase
- Context Naming with Suffixname-context-suffix
- Context Hook as useComponentContextname-context-hook
- Props Interface as ComponentPropsname-props-interface
- State Interface as ComponentStatename-state-interface
- Namespace Type Exportsname-namespace-type-exports
- Event Type Naming Conventionname-event-type
- Constant Naming SCREAMING_SNAKE_CASEname-constants
- Data Attribute Naming lowercasename-data-attributes
- Hook Naming with use Prefixname-hooks
- Ref Variable Naming with Suffixname-refs
- Handler Naming Conventionname-handlers
3. Organization (HIGH)
- Component Directory Structureorg-component-directory
- Dual Barrel Export Patternorg-dual-barrel-exports
- Test File Colocationorg-test-colocation
- Context File Placementorg-context-placement
- Data Attributes Documentation Fileorg-data-attributes-file
- State Attributes Mapping Fileorg-state-attributes-mapping
- CSS Variables Documentation Fileorg-css-vars-file
- Package-Level Wildcard Exportsorg-package-exports
4. Error Handling (HIGH)
- Development-Only Warningserr-dev-only-warnings
- Deduplicated Warning Messageserr-deduplicated-warnings
- Message Prefix Standarderr-message-prefix
- Context Error Guidanceerr-context-error-guidance
- Prop Validation Timingerr-prop-validation-timing
- Cancelable Event Patternerr-cancelable-events
- Event Reason Constantserr-event-reason-constants
- Type-Safe Event Reasonserr-typed-event-reasons
5. Style (MEDIUM)
- React Import as Namespacestyle-react-import
- Internal Import Pathsstyle-internal-imports
- Explicit Undefined in Prop Typesstyle-explicit-undefined
- Default Values in Destructuringstyle-default-values
- JSDoc Documentationstyle-jsdoc-documentation
How to Use
Read individual reference files for detailed explanations and code examples:
- Section definitions - Category structure and impact levels
- Rule template - Template for adding new rules
- Example: comp-forward-ref-named
- Example: org-component-directory
Source
Extracted from MUI Base UI codebase on 2026-01-17.
Full Compiled Document
For the complete guide with all rules expanded:
AGENTS.md