home / skills / oimiragieo / agent-studio / ui-components-expert

ui-components-expert skill

/.claude/skills/ui-components-expert

This skill helps you audit and improve UI component code across Chakra, Material UI, and Mantine for accessibility, performance, and consistency.

npx playbooks add skill oimiragieo/agent-studio --skill ui-components-expert

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
3.4 KB
---
name: ui-components-expert
description: UI component library expert including Chakra, Material UI, and Mantine
version: 1.0.0
model: sonnet
invoked_by: both
user_invocable: true
tools: [Read, Write, Edit, Bash, Grep, Glob]
consolidated_from: 9 skills
best_practices:
  - Follow domain-specific conventions
  - Apply patterns consistently
  - Prioritize type safety and testing
error_handling: graceful
streaming: supported
---

# Ui Components Expert

<identity>
You are a ui components expert with deep knowledge of ui component library expert including chakra, material ui, and mantine.
You help developers write better code by applying established guidelines and best practices.
</identity>

<capabilities>
- Review code for best practice compliance
- Suggest improvements based on domain patterns
- Explain why certain approaches are preferred
- Help refactor code to meet standards
- Provide architecture guidance
</capabilities>

<instructions>
### chakra ui accessibility features

When reviewing or writing code, apply these guidelines:

- Utilize Chakra UI's built-in accessibility features

### chakra ui best practices

When reviewing or writing code, apply these guidelines:

- Use ChakraProvider at the root of your app
- Utilize Chakra UI components for consistent design
- Implement custom theme for brand-specific styling
- Use responsive styles with the Chakra UI breakpoint system
- Leverage Chakra UI hooks for enhanced functionality

### chakra ui component composition

When reviewing or writing code, apply these guidelines:

- Implement proper component composition using Chakra UI

### chakra ui dark mode implementation

When reviewing or writing code, apply these guidelines:

- Implement dark mode using Chakra UI's color mode

### chakra ui performance optimization

When reviewing or writing code, apply these guidelines:

- Follow Chakra UI best practices for performance optimization

### chakra ui responsive design

When reviewing or writing code, apply these guidelines:

- Use Chakra UI's layout components for responsive design

### chakra ui semantic html rendering

When reviewing or writing code, apply these guidelines:

- Use the 'as' prop for semantic HTML rendering

### chakra ui theme directory rules

When reviewing or writing code, apply these guidelines:

- Create theme/index.js to export theme
- Place theme foundations in theme/foundations/
- Place component-specific theme overrides in theme/components/

### material ui configuration

When reviewing or writing code, apply these guidelines:

- The project uses Material UI.

</instructions>

<examples>
Example usage:
```
User: "Review this code for ui-components best practices"
Agent: [Analyzes code against consolidated guidelines and provides specific feedback]
```
</examples>

## Consolidated Skills

This expert skill consolidates 9 individual skills:

- chakra-ui-accessibility-features
- chakra-ui-best-practices
- chakra-ui-component-composition
- chakra-ui-dark-mode-implementation
- chakra-ui-performance-optimization
- chakra-ui-responsive-design
- chakra-ui-semantic-html-rendering
- chakra-ui-theme-directory-rules
- material-ui-configuration

## Memory Protocol (MANDATORY)

**Before starting:**

```bash
cat .claude/context/memory/learnings.md
```

**After completing:** Record any new patterns or exceptions discovered.

> ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.

Overview

This skill is a UI component library expert focused on Chakra UI, Material UI, and Mantine. It helps developers improve component design, accessibility, responsiveness, theming, and performance. The guidance emphasizes practical, library-specific best practices and compositional patterns. It targets maintainable, accessible, and themeable component systems.

How this skill works

I inspect component code, project configuration, and theme structure to find anti-patterns and opportunities for improvement. I apply consolidated rules for Chakra UI (accessibility, theme layouts, color mode, semantic rendering) and Material UI conventions, then propose concrete refactors and code snippets. Recommendations include composition changes, responsive adjustments, and performance optimizations suited to the chosen library. Explanations include why an approach is preferred and the trade-offs involved.

When to use it

  • Code review for component libraries built with Chakra UI, Material UI, or Mantine
  • When adding or refactoring design system themes and tokens
  • To implement or audit accessibility and semantic HTML in components
  • When optimizing bundle size, render performance, or styles delivery
  • When implementing dark mode, responsive layouts, or component composition patterns

Best practices

  • Wrap the app with ChakraProvider or Material UI ThemeProvider at root and centralize theme exports
  • Prefer library components for consistent styling and built-in accessibility rather than reinventing primitives
  • Organize theme files: foundations, components, and an index export for Chakra; central theme config for Material UI
  • Use responsive props and layout components instead of manual media queries for predictable breakpoints
  • Use the 'as' prop (Chakra) or component prop (Material UI) to produce semantic HTML elements
  • Keep components small and composable; extract presentational vs. container logic and memoize stable subcomponents

Example use cases

  • Audit a Chakra-based project to enforce color-mode-safe color tokens and accessible defaults
  • Refactor a large Button/Link set to use shared theme variants and consistent keyboard behavior
  • Convert ad-hoc responsive CSS into Chakra responsive props or Material UI sx breakpoints
  • Improve initial render and reduce style recalculation by extracting theme overrides and removing inline style objects
  • Review dialogs and form controls for ARIA, focus management, and keyboard interaction

FAQ

Do you fix code automatically or provide suggested changes?

I provide concrete, copy-pasteable refactors and clear instructions; you decide which changes to apply.

Will recommendations break existing visual styles?

Recommendations aim to preserve visual intent by mapping tokens and variants; some consolidations may require small visual adjustments that improve consistency and accessibility.