run_audit
Audit design system specifications for compliance, including WCAG accessibility checks, token usage, and naming conventions, returning structured findings.
Instructions
Run a design system audit through the agent orchestrator and return a structured findings report.
Prerequisites: No Figma connection required for spec-level audits. For visual/contrast checks, the bridge must be running (WCAG contrast checks query the design system tokens; pixel-level checks use AI vision via analyze_design).
Returns on success: Orchestrator result with audit findings — { success: boolean, results: AuditResult[], summary: string }. Each AuditResult includes { check: string, status: "pass"|"warn"|"fail", details: string, affected?: string[] }.
WCAG checks performed (when focus includes "accessibility"):
WA-101: Color contrast ratio — text/background pairs against 4.5:1 (AA normal) and 3:1 (AA large) thresholds
WA-201: Touch target size — interactive elements checked against 24×24px (AA) and 44×44px (AAA) minimums
WA-202: Focus indicator visibility — focus ring width ≥ 2px and contrast ≥ 3:1
WA-301: Text spacing overrides — specs must tolerate 1.5× line-height and 0.12em letter-spacing
WA-401: Keyboard navigation — component specs checked for keyboard interaction definitions
Error behavior: Never throws — returns success=false with an error message if the orchestrator fails to initialize.
Use this tool vs analyze_design: run_audit operates on specs and the token registry (no screenshot needed); analyze_design operates on a live Figma screenshot with AI vision. Use run_audit for systematic spec compliance; use analyze_design for visual quality review of a specific frame.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| focus | No | Optional focus area to narrow the audit scope. Examples: 'accessibility' (runs all 5 WCAG checks), 'token coverage' (checks which components use design tokens vs hardcoded values), 'naming' (validates spec name conventions), 'contrast' (color contrast only), 'touch-targets' (interactive element sizing only). Omit to run the full default audit suite. |