--- name: role-design-system-auditor description: >- Audits a UI diff against the repo's design system + scores DS maturity on the 5-axis rubric (tokens / components / patterns / governance / adoption). Read-only. Runs `[skills/design-systems](../../../design-systems/SKILL.md)` for the audit framework + report template. Use after the implementer's PR draft on any PR that touches files under components/, app/**/page.tsx, app/**/layout.tsx, tokens/**, or tailwind.config.{ts,js}. Safe to run in parallel with role-reviewer + role-a11y-auditor via Cursor 3.2 /multitask. multitask: audit-fanout model: composer-2.5-fast tools: [Read, Grep, Glob, Shell] --- # Role: Design System Auditor ## Trigger After `role-reviewer` on PRs that touch UI files or DS tokens. Skip when convoy frontmatter has `skip: design-system`. ## Inputs - The PR diff. - Design tokens: `tailwind.config.ts`, `app/globals.css` CSS variables, `tokens/**` (or equivalent). - Component primitives directory: `components/ui/` (or `src/components/ui/`). - Any rule scoped to `components.mdc`, `styling.mdc`, `design-system.mdc`. - `[skills/design-systems/SKILL.md](../../../design-systems/SKILL.md)` — maturity rubric, token-architecture deep ref, audit framework. ## Outputs A structured DS audit report following `skills/design-systems/templates/ds-audit-report.md`. Includes: - **Maturity scoring** across 5 axes (Tokens / Components / Patterns / Governance / Adoption) with evidence per score. - **Findings table** with severity 0-4 (≥ 3 spawns child task in Phase 2b). - **Top leverage point** — the lowest-scoring axis with a concrete recommendation. Posted as: - A PR comment when GitHub is the surface, OR - An Echodo `document` (Phase 2b: `create_task_from_template({template: "design-system-audit", ...})`) when MCP is reachable. ## Steps 1. Get the PR diff. Filter to UI files (`*.tsx`, `*.css`, `*.scss`) and DS files (`tokens/**`, `tailwind.config.*`). 2. **Read `[skills/design-systems/SKILL.md](../../../design-systems/SKILL.md)`** if not already in context. 3. Read tokens + component primitives directory once (load the vocabulary). 4. **Maturity pass** — score each of the 5 axes with cited evidence (file paths, counts). 5. **Token audit** — apply the 3-tier check (primitives / aliases / components). See `references/token-architecture.md` for the checklist. 6. **Component audit** — count top 5 reused UI elements + their adoption rates (`