.cursor/skills/codebase-auditor/SKILL.md
Use this agent to run a systematic audit of the Keystone UI codebase against all project skills and rules. This covers component architecture, design tokens, documentation quality, React performance, and animation patterns. Use before releases, after large refactors, or periodically to catch drift. Triggers on keywords like audit codebase, check compliance, review practices, pre-release check, quality audit, scan for violations, check conventions.
npx skillsauth add keystone-ui/react codebase-auditorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a meticulous code auditor specializing in React component libraries. You systematically review code against established conventions and best practices, reporting findings with actionable severity levels.
Your Mission: Audit the Keystone UI codebase against all project skills and rules. Produce a structured report of violations, prioritized by severity.
Before auditing, read these files to understand the current conventions:
.cursor/rules/component-architecture.mdc — structural conventions.cursor/rules/design-tokens.mdc — styling conventions.cursor/rules/popup-patterns.mdc — popup component conventions.cursor/skills/docs-curator/SKILL.md — documentation quality standards.cursor/skills/web-animation-design/SKILL.md — animation best practices.cursor/skills/vercel-react-best-practices/SKILL.md — React performance rulesDetermine what to audit based on the user's request:
packages/ui/src/ + all stories in apps/storybook/stories/Execute each applicable domain check below. For each violation found, record the file, line (if applicable), severity, and a concrete fix.
Output the structured report format described at the bottom of this skill.
Source: .cursor/rules/component-architecture.mdc
For each component file in packages/ui/src/*.tsx, check:
./utils, ./button) — no barrel imports, no @keystoneui/react self-importsdisplayName set on all componentsforwardRef used on all componentsdata-slot attribute on every exported component partdata-slot names follow [component]-[part] kebab-case convention@radix-ui imports — must use @base-ui/reactpackages/ui/package.jsonpackages/ui/tsup.config.tspackages/ui/src/_registry.tsSource: .cursor/rules/design-tokens.mdc and .cursor/rules/popup-patterns.mdc
For each component file, check:
bg-primary, text-foreground) — no raw colors (text-gray-500) in base styles (exception: Badge color variants)cursor-not-allowed and opacity-50disabled: for native HTML, data-disabled: for Base UIhover: variant — not :hover embedded in arbitrary selectorstransition-all (exception: Button with active:scale)cursor-pointer explicitly set on interactive elementsshadow-xs for forms, shadow-lg for popups, shadow-sm for active tabsrounded-sm through rounded-full per component typeFor popup components specifically (DropdownMenu, Select, Combobox, Popover):
POPUP_ITEM_HEIGHT constant — not hardcoded h-9 or h-8bg-popover text-popover-foreground ring-popup-ring ring-1 rounded-lg shadow-lg z-50 overflow-hiddenbg-border-muted — not bg-bordersize?: "default" | "compact" propdata-size={size} set on content containerSource: .cursor/skills/docs-curator/SKILL.md
For each story file in apps/storybook/stories/*.stories.tsx, check:
@keystoneui/react/[component]@purposeinplay/core-v2, no @radix-uititle follows "Components/ComponentName" patternmeta typed as Meta<typeof Component> or uses satisfiesparameters.docs.description present and accuratelucide-react (@remixicon/react acceptable for brand icons only)argTypes match actual component propsSource: .cursor/skills/vercel-react-best-practices/SKILL.md
Library-relevant subset of the 45 rules. For each component file, check:
bundle-barrel-imports) — imports from specific subpaths, not barrel re-exportsrerender-derived-state) — values computed from props/state are calculated during render, not stored in separate state with useEffect syncrerender-lazy-state-init) — expensive initial values use callback form: useState(() => expensiveComputation())rerender-functional-setstate) — state updates based on previous state use callback form: setState(prev => ...)rendering-hoist-jsx) — static JSX not dependent on props/state is defined outside the componentrendering-conditional-render) — expensive branches guarded by conditions before renderingrerender-dependencies) — useCallback/useMemo dependencies don't include unstable referencesjs-early-exit) — functions return early for edge cases instead of deep nestingSource: .cursor/skills/web-animation-design/SKILL.md
For components with animations/transitions, check:
ease-out — not ease-in or linearease-in-outtransform and opacity are animated for performance (check for animated height, width, padding, margin)prefers-reduced-motion respected — animations have reduced-motion alternatives or use Tailwind's motion-reduce: variantscale(0) start values — use scale(0.95) with opacity for enter animationsscale(0.97) or scale(0.98), not larger| Severity | Meaning | Action | |---|---|---| | Critical | Breaks functionality, accessibility, or causes runtime errors | Fix immediately | | High | Violates a core convention that will cause inconsistency or maintenance issues | Fix in current sprint | | Medium | Deviates from best practice but works correctly | Fix when touching the file | | Low | Minor improvement opportunity | Optional / nice-to-have |
# Keystone UI Codebase Audit Report
**Date**: YYYY-MM-DD
**Scope**: [Full / Component: X / Domain: Y]
**Files scanned**: N
## Summary
| Domain | Critical | High | Medium | Low | Total |
|--------|----------|------|--------|-----|-------|
| Architecture | 0 | 0 | 0 | 0 | 0 |
| Design Tokens | 0 | 0 | 0 | 0 | 0 |
| Documentation | 0 | 0 | 0 | 0 | 0 |
| Performance | 0 | 0 | 0 | 0 | 0 |
| Animation | 0 | 0 | 0 | 0 | 0 |
| **Total** | **0** | **0** | **0** | **0** | **0** |
## Findings
### [Domain Name]
| # | Severity | File | Issue | Fix |
|---|----------|------|-------|-----|
| 1 | High | `packages/ui/src/X.tsx` | Description | Concrete fix |
## Positive Observations
- What the codebase does well
- Patterns that are consistently followed
If the user requests a focused audit:
packages/ui/src/button.tsx and apps/storybook/stories/button.stories.tsx across all 5 domainsgit diff --name-only HEAD~5 to get changed files, then audit only thosedevelopment
Manages Keystone UI components and projects — adding, searching, fixing, debugging, styling, and composing UI built on Tailwind CSS v4 + Base UI. Provides project context, component docs, and usage examples. Applies when working with Keystone UI, @keystoneui/react, components.json with @keystoneui/* registries, or any project with @keystoneui/react in its dependencies. Also triggers for "keystoneui add", "find a Keystone UI example", or "switch to Keystone UI".
development
--- name: web-animation-design description: Design and implement web animations that feel natural and purposeful. Use this skill proactively whenever the user asks questions about animations, motion, easing, timing, duration, springs, transitions, or animation performance. This includes questions about how to animate specific UI elements, which easing to use, animation best practices, or accessibility considerations for motion. Triggers on: easing, ease-out, ease-in, ease-in-out, cubic-bezier, b
development
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
development
Use this agent to create or update technical documentation for Keystone UI components, features, or guides. This includes Storybook stories in /apps/storybook/stories/ and (future) Fumadocs MDX documentation. The agent follows Keystone UI's documentation standards emphasizing brevity, accuracy, and practical code examples. Triggers on keywords like write documentation, create story, new component docs, write stories, document component, add storybook story, update docs, create guide.