skills/mp-components-audit/SKILL.md
Audits the codebase for design-system component usage — finds native elements and detached styles that should use the project's own components (Button, Input, date picker, etc.), components used with the wrong/missing variant, repeated styles that should become a variant, and hardcoded colors that bypass theme tokens. Use when: "audit component usage", "design system audit", "find raw buttons", "are we using our components correctly", "component usage audit"
npx skillsauth add MartinoPolo/mpx-claude-code mp-components-auditInstall 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.
Find where the codebase hand-codes UI that the project's own design-system components already provide, and where those components are used with manual styling that a variant should own. Report findings; optionally autofix the mechanical ones. $ARGUMENTS
scan-path (optional) — root to audit. Default: repo src/ (or repo root if no src/).autofix — autofix/autofix=true forces the fix phase ON; autofix=false forces OFF; omitted → report only.Trust the component's built-in props (variants, sizes, icon slotting) instead of re-applying styles by hand. When a recurring visual need has no variant (e.g. an always-purple button), add a variant to the component or componentize the pattern — never detach a styled native element from the component it should be.
Discovery is generalized — no config assumed. Auto-detect, then read real APIs.
**/lib/components/**, **/components/**, **/ui/**. Strong signals: a directory of single-purpose folders each with a .svelte/.tsx + an index.ts + a variants file.package.json and imports for bits-ui, shadcn, radix-ui, cva, tailwind-variants (tv). If the project is shadcn-svelte / Bits UI, treat rules-per-project/shadcn-svelte.md as the canonical anti-pattern source and feed its rules to the audit agents.*_variants.ts, cva()/tv() configs, prop/type declarations) to learn actual variant/intent/size values and icon-slot conventions. Read prop names from the source rather than assuming them.button→Button, input→Input, calendar/date field→date picker, etc.).The inventory string seeds every sub-agent prompt — agents must audit against the components that actually exist, not a generic list.
Spawn Explore sub-agents in parallel, roughly one per base component or component group (per user preference), each given: the inventory, the exclusion set, and one axis checklist from CHECKLISTS.md. For large component sets, run the agents run_in_background: true and process findings as each returns.
Audit axes (see CHECKLISTS.md for the concrete patterns per axis):
<button>, <input>, <select>, <textarea>, <hr>, animate-pulse divs, styled spans, callout divs that should be the design-system component.<Button class="rounded-lg">, color overrides defeating intent/variant), wrong variant, missing size="icon", manual icon sizing.#hex, oklch(...), bg-gray-*, bg-white, text-black) bypassing semantic theme tokens.Every finding must be { axis, file, line, current code, suggested fix, confidence }.
file:line, drop anything inside the exclusion set, and apply the skip list (see below).COMPONENT-AUDIT.md only if findings exist; otherwise report a clean result in conversation.Report shape:
## Native element → component (A)
- `path:line` — current → suggested fix
## Improper variant/prop usage (B)
- `path:line` — current → suggested fix
## Componentize / add-variant recommendations (C)
- pattern (N occurrences) — proposed variant/component + call-sites
## Hardcoded theme-color bypass (D)
- `path:line` — current → suggested fix
Run only when autofix is ON and actionable findings exist. Apply A, B, D, and C-clear. Leave C-judgment as recommendations in the report — those are debatable abstractions for the user to decide.
mp-executor sub-agent (sonnet) with the concrete per-finding instructions plus the requirement to fix only in-scope findings and preserve each component's public API when refactoring internals.npm run check/pnpm check/tsc). Distinguish pre-existing errors from new ones.text-white on a filled primary button, decorative brand colors).Stack: [shadcn-svelte | Bits UI | custom | ...]
Components folder: [path]
Inventory: [N components]
Findings:
- A native→component: [N]
- B improper variant: [N]
- C recommendations: [N]
- D color bypass: [N]
Report: [COMPONENT-AUDIT.md | none]
Autofix: [applied A/B/D/C-clear: N | report only | not requested]
New variants added: [list | none]
Typecheck: [clean | N new errors | not run]
tools
Show current project progress. Displays phase status and next steps. Use when: "show status", "project progress", "what's done"
data-ai
Unified project setup. Auto-detects state and orchestrates mpx skills/agents for init, conversion, or restructure.
testing
Track bugs/issues in .mpx/ phase system. Parses reports, finds related phases, adds fix tasks or creates bugfix phases. Use when: "track this bug", "add issue to project", "log this bug", "add bug to checklist"
development
Project workflow guidance for spec-driven development. Background knowledge auto-loaded when relevant.