AgentSkillsCN

reviewing-base-ui-usage

审查代码库中 Base UI 组件的使用情况。当您被要求审查、审计或检查使用 @base-ui/react 组件的代码时,此功能将助您快速发现问题、识别不当模式与无障碍性隐患,并依据官方的 Base UI 规范提出优化建议。

SKILL.md
--- frontmatter
name: reviewing-base-ui-usage
description: Reviews Base UI component usage in codebases. Use when asked to review, audit, or check code using @base-ui/react components. Identifies incorrect patterns, accessibility issues, and suggests improvements based on official Base UI conventions.

Base UI Usage Review

Review Base UI (@base-ui/react) component usage for correctness, accessibility, and adherence to official patterns.

Quick Reference

  • Package name: @base-ui/react (NOT @base-ui-components/react or @mui/base)
  • Import pattern: import { Button } from '@base-ui/react/button'
  • Render prop pattern: render={<a />} or render={(props, state) => <button {...props} />}
  • State functions: className={(state) => ...}, style={(state) => ...}
  • Data attributes: Components expose data-* attributes for styling (e.g., data-disabled, data-open)
  • Event prevention: Use event.preventBaseUIHandler() to skip component's internal handler

Review Process

  1. Verify import paths - Must be @base-ui/react/*
  2. Check render prop usage - Verify correct element/callback form, props spread
  3. Verify component structure - See each component's Structure section
  4. Run component checklist - Each component file has error patterns to flag
  5. Audit accessibility - Check for required semantic components (Title, Label, etc.)
  6. Review styling approach - Confirm state-aware styling patterns

Reference Files

Component Reference

Each component file contains: Structure (required nesting), Gotchas (traps), Review Checklist (error patterns to flag).

Layout & Navigation

Overlays & Popups

Form Controls

Feedback & Status

  • Progress - Task progress indicator
  • Meter - Static measurement display

Miscellaneous

  • Avatar - User avatar with fallback
  • Separator - Visual divider
  • Composite - Internal keyboard navigation (not for direct use)