Design Fidelity Auditor
Author: OpenAI Codex | Version: 2.1.1| Maturity: stable | License: MIT
Compatibility: Requires file-reading support. Works best in agents with shell access for fast repository inspection and line-level evidence collection.
Audit UI implementation against the source of design truth.
This skill is a design-governance and implementation-review skill. Its job is to identify where shipped or generated UI code has drifted away from the intended design system, distinguish direct evidence from inference, and produce a remediation-focused report that another engineer or agent can act on immediately.
Use it after code generation, during design QA, before merging UI-heavy changes, or when a team suspects that hand-tuned styling has bypassed tokens and system rules.
Use This Skill When
- The user asks whether UI code still matches a design system, token set, or
DESIGN.md.
- A generated interface needs a post-generation compliance pass before implementation continues.
- A pull request introduces custom CSS, Tailwind values, inline styles, or ad-hoc classes that may bypass the system.
- A team wants a structured fidelity scorecard instead of a loose design review.
- A downstream skill needs a
design_system_violation_report or fidelity_scorecard as input.
Do Not Use This Skill For
- Inventing a new design language when no design reference exists.
- Replacing accessibility review, visual regression testing, or browser-based QA.
- Acting as a full brand strategist or product designer.
- Auto-rewriting large UI surfaces unless the user explicitly asks for implementation changes after the audit.
Responsibilities
This skill is responsible for:
- locating the most authoritative design reference available
- checking whether implementation uses approved tokens and system primitives
- identifying concrete design drift with file and line evidence whenever possible
- distinguishing hard violations from softer consistency risks
- proposing remediation that preserves the system's language
This skill is not responsible for:
- maintaining shared design infrastructure across repositories
- storing cross-project memory or policy centrally
- performing pixel-perfect screenshot diffing on its own
- overriding the design system because a local implementation "looks better"
Inputs
Consume the strongest evidence available. Typical inputs include:
design_system_reference
Examples: DESIGN.md, token files, Tailwind config, theme files, component guidelines, Storybook docs, Figma export notes, Stitch output, screenshots with annotations.
ui_code
Examples: CSS, SCSS, Tailwind class strings, JSX, TSX, Vue SFCs, Angular templates, inline styles, component libraries.
component_snapshot optional
Used only as secondary evidence. Do not infer token names from screenshots alone unless the design reference is missing.
constraints optional
Examples: read-only, focus on colors, tailwind-only, report top 5 issues, stay concise.
Evidence Priority
When multiple references disagree, use this order:
- Explicit project token source or theme configuration
- Current canonical design-system document such as
DESIGN.md
- Repository component patterns already established in primary UI primitives
- Recent generated output notes or screenshots
- General design best practices
State when the evidence is incomplete or contradictory. Never present inference as policy.
Memory Model
Use the lightest memory boundary that fits the task.
- Runtime memory: Keep the active audit scope, evidence, and findings in working memory during the current task.
- Project-local memory: Persist an audit report only when the user asks for a saved artifact or when a local review workflow clearly benefits from one.
- Preferred local persistence path: when saving a report in-repo, prefer the
reports/ directory so downstream tools and maintainers have a predictable handoff location.
- Shared memory: Out of scope for this skill. If drift trends need to be aggregated across teams or repositories, integrate with a dedicated shared-memory or governance skill instead of embedding that concern here.
Do not silently promote temporary audit observations into persistent memory. Only persist findings that are stable, evidenced, and useful beyond the current review.
Workflow
Follow this sequence unless the user asks for a narrower review.
- Establish scope.
Identify the files or components under review, the design authority, and whether the output should stay in chat or be written to disk.
- Record telemetry when applicable.
If the skill was selected by a dispatcher and logging is enabled, log the dispatch event before performing deeper audit work.
- Gather design evidence.
Read the strongest available reference files first: token definitions, theme config,
DESIGN.md, component primitives, and any style conventions that function as policy.
- Inspect implementation evidence.
Read the relevant UI code and capture precise file and line references where possible.
- Classify findings.
Separate:
- direct violations
- probable drift risks
- unknowns caused by missing or ambiguous design guidance
- Score carefully.
Produce a scorecard that rewards alignment but does not fake precision. If evidence is partial, lower confidence instead of overconfident scoring.
- Recommend remediation.
Suggest the smallest system-aligned fix for each issue. Prefer token adoption, primitive reuse, or config-level cleanup over one-off overrides.
- Deliver the audit artifact.
Use the output contract in
assets/audit-report-template.md. If the user wants a saved artifact, prefer writing it under reports/ and optionally validate it with scripts/validate_audit_report.py.
Severity Model
Classify each finding as one of:
Critical
Breaks core design-system policy, brand safety, or global consistency. Examples: hardcoded brand colors replacing token usage in shared primitives.
High
Clear system bypass or repeated drift likely to spread. Examples: many arbitrary Tailwind values, custom font stack in reusable layout primitives.
Medium
Local inconsistency that should be corrected but is unlikely to destabilize the whole system alone.
Low
Minor cleanup or future-risk observation. Examples: redundant local alias, weak naming, slightly inconsistent token choice where guidance is ambiguous.
Unknown
Potential issue, but the design reference is incomplete or conflicting. Do not force a stronger severity without evidence.
Output Contract
Produce a markdown report with these sections, in this order:
# Design Fidelity Audit: <scope>
## Audit Summary
## Design Authority Reviewed
## Scope and Evidence
## Fidelity Scorecard
## Findings
## Remediation Priorities
## Confidence and Unknowns
## Recommended Next Step
Within the report:
- Include overall confidence:
High, Medium, or Low.
- Separate observed evidence from inferred risk.
- Include file references and line numbers when available.
- Use stable terminology:
design system, token, primitive, violation, drift risk, unknown.
- Avoid fake percentages when the audit scope is too small or too incomplete.
Fidelity Scorecard Dimensions
Score only the dimensions that can be supported by evidence:
- Color and semantic token usage
- Spacing and sizing scale discipline
- Typography alignment
- Border radius, elevation, and motion primitives
- State fidelity for hover, focus, active, disabled, and error states
- Primitive reuse and local override risk
If a dimension cannot be evaluated, mark it Not assessed.
Handoff Contract
When invoked by a dispatcher-led workflow, accept these fields when available:
intent
current_artifact_type
target_artifact_type
repo_context
design_system_reference
constraints
allowed_write_risk
Return a result shaped for downstream consumption:
deliverable: markdown audit report
artifact_type: fidelity_scorecard or design_system_violation_report
confidence: High, Medium, or Low
recommended_next_step: best follow-up action
follow_on_skill_type: optional hint such as execution, review, or design
Telemetry Contract
When this skill participates in a dispatcher-led workflow:
- log
HANDOFF selections with --skill design-fidelity-auditor
- include the normalized
intent
- keep the
reason concrete and audit-specific
- treat telemetry as part of operational correctness, not optional polish
If telemetry cannot be recorded because the logger is unavailable, say so explicitly in the operating notes or final audit context rather than silently skipping it.
Quality Bar
A strong audit should:
- tell another engineer exactly what drift exists and why it matters
- preserve the design system's terminology instead of replacing it with generic advice
- distinguish project policy from opinion
- give remediation that can be implemented without guesswork
- remain useful even when the design reference is partial, incomplete, or evolving
Guardrails
- System first: prioritize the documented design system over local aesthetic preference.
- Evidence first: do not claim a violation unless you can point to code or a missing system-aligned reference.
- No silent redesign: audit and recommend; do not rewrite large surfaces unless the user explicitly requests implementation.
- No invented tokens: if the correct token is unknown, say so and describe the required characteristics instead.
- No false certainty: when references are ambiguous, mark the finding as
Unknown or reduce confidence.
- Keep scope honest: if only one component was reviewed, do not generalize to the whole product.
Escalation Rules
Pause and say so when:
- no trustworthy design authority exists
- multiple references conflict and the conflict changes the conclusion materially
- the user appears to want implementation changes rather than an audit artifact
- the review would be stronger with visual references, but only code is available
Bundled Resources
README.md
Human-facing repository guide and installation notes.
assets/audit-report-template.md
Default output skeleton for audit reports.
examples/sample-audit-report.md
Example of a concise but production-grade audit deliverable.
fixtures/basic-button/
Minimal fixture for local regression testing.
evals/evals.json
Prompt-based regression checks for trigger quality and output quality.
scripts/validate_audit_report.py
Structural validator for saved reports.
scripts/score_audit_report.py
Lightweight benchmark helper for fixture-based report scoring.
reports/
Default location for saved audit artifacts when project-local persistence is requested.
1---2name: design-fidelity-auditor3description: Audit implemented UI code for design-system drift. Use to verify CSS, Tailwind, JSX, TSX, Vue, or Angular components honor the project's canonical design tokens, typography, spacing scale, interaction states, and visual conventions.4---56# Design Fidelity Auditor78> **Author:** OpenAI Codex | **Version:** 2.1.1| **Maturity:** stable | **License:** MIT 9> **Compatibility:** Requires file-reading support. Works best in agents with shell access for fast repository inspection and line-level evidence collection.101112Audit UI implementation against the source of design truth.1314This skill is a design-governance and implementation-review skill. Its job is to identify where shipped or generated UI code has drifted away from the intended design system, distinguish direct evidence from inference, and produce a remediation-focused report that another engineer or agent can act on immediately.1516Use it after code generation, during design QA, before merging UI-heavy changes, or when a team suspects that hand-tuned styling has bypassed tokens and system rules.1718## Use This Skill When1920- The user asks whether UI code still matches a design system, token set, or `DESIGN.md`.21- A generated interface needs a post-generation compliance pass before implementation continues.22- A pull request introduces custom CSS, Tailwind values, inline styles, or ad-hoc classes that may bypass the system.23- A team wants a structured fidelity scorecard instead of a loose design review.24- A downstream skill needs a `design_system_violation_report` or `fidelity_scorecard` as input.2526## Do Not Use This Skill For2728- Inventing a new design language when no design reference exists.29- Replacing accessibility review, visual regression testing, or browser-based QA.30- Acting as a full brand strategist or product designer.31- Auto-rewriting large UI surfaces unless the user explicitly asks for implementation changes after the audit.3233## Responsibilities3435This skill is responsible for:3637- locating the most authoritative design reference available38- checking whether implementation uses approved tokens and system primitives39- identifying concrete design drift with file and line evidence whenever possible40- distinguishing hard violations from softer consistency risks41- proposing remediation that preserves the system's language4243This skill is not responsible for:4445- maintaining shared design infrastructure across repositories46- storing cross-project memory or policy centrally47- performing pixel-perfect screenshot diffing on its own48- overriding the design system because a local implementation "looks better"4950## Inputs5152Consume the strongest evidence available. Typical inputs include:5354- `design_system_reference`55 Examples: `DESIGN.md`, token files, Tailwind config, theme files, component guidelines, Storybook docs, Figma export notes, Stitch output, screenshots with annotations.56- `ui_code`57 Examples: CSS, SCSS, Tailwind class strings, JSX, TSX, Vue SFCs, Angular templates, inline styles, component libraries.58- `component_snapshot` optional59 Used only as secondary evidence. Do not infer token names from screenshots alone unless the design reference is missing.60- `constraints` optional61 Examples: `read-only`, `focus on colors`, `tailwind-only`, `report top 5 issues`, `stay concise`.6263## Evidence Priority6465When multiple references disagree, use this order:66671. Explicit project token source or theme configuration682. Current canonical design-system document such as `DESIGN.md`693. Repository component patterns already established in primary UI primitives704. Recent generated output notes or screenshots715. General design best practices7273State when the evidence is incomplete or contradictory. Never present inference as policy.7475## Memory Model7677Use the lightest memory boundary that fits the task.7879- Runtime memory: Keep the active audit scope, evidence, and findings in working memory during the current task.80- Project-local memory: Persist an audit report only when the user asks for a saved artifact or when a local review workflow clearly benefits from one.81- Preferred local persistence path: when saving a report in-repo, prefer the `reports/` directory so downstream tools and maintainers have a predictable handoff location.82- Shared memory: Out of scope for this skill. If drift trends need to be aggregated across teams or repositories, integrate with a dedicated shared-memory or governance skill instead of embedding that concern here.8384Do not silently promote temporary audit observations into persistent memory. Only persist findings that are stable, evidenced, and useful beyond the current review.8586## Workflow8788Follow this sequence unless the user asks for a narrower review.89901. Establish scope.91 Identify the files or components under review, the design authority, and whether the output should stay in chat or be written to disk.922. Record telemetry when applicable.93 If the skill was selected by a dispatcher and logging is enabled, log the dispatch event before performing deeper audit work.943. Gather design evidence.95 Read the strongest available reference files first: token definitions, theme config, `DESIGN.md`, component primitives, and any style conventions that function as policy.964. Inspect implementation evidence.97 Read the relevant UI code and capture precise file and line references where possible.985. Classify findings.99 Separate:100 - direct violations101 - probable drift risks102 - unknowns caused by missing or ambiguous design guidance1036. Score carefully.104 Produce a scorecard that rewards alignment but does not fake precision. If evidence is partial, lower confidence instead of overconfident scoring.1057. Recommend remediation.106 Suggest the smallest system-aligned fix for each issue. Prefer token adoption, primitive reuse, or config-level cleanup over one-off overrides.1078. Deliver the audit artifact.108 Use the output contract in `assets/audit-report-template.md`. If the user wants a saved artifact, prefer writing it under `reports/` and optionally validate it with `scripts/validate_audit_report.py`.109110## Severity Model111112Classify each finding as one of:113114- `Critical`115 Breaks core design-system policy, brand safety, or global consistency. Examples: hardcoded brand colors replacing token usage in shared primitives.116- `High`117 Clear system bypass or repeated drift likely to spread. Examples: many arbitrary Tailwind values, custom font stack in reusable layout primitives.118- `Medium`119 Local inconsistency that should be corrected but is unlikely to destabilize the whole system alone.120- `Low`121 Minor cleanup or future-risk observation. Examples: redundant local alias, weak naming, slightly inconsistent token choice where guidance is ambiguous.122- `Unknown`123 Potential issue, but the design reference is incomplete or conflicting. Do not force a stronger severity without evidence.124125## Output Contract126127Produce a markdown report with these sections, in this order:1281291. `# Design Fidelity Audit: <scope>`1302. `## Audit Summary`1313. `## Design Authority Reviewed`1324. `## Scope and Evidence`1335. `## Fidelity Scorecard`1346. `## Findings`1357. `## Remediation Priorities`1368. `## Confidence and Unknowns`1379. `## Recommended Next Step`138139Within the report:140141- Include overall confidence: `High`, `Medium`, or `Low`.142- Separate observed evidence from inferred risk.143- Include file references and line numbers when available.144- Use stable terminology: `design system`, `token`, `primitive`, `violation`, `drift risk`, `unknown`.145- Avoid fake percentages when the audit scope is too small or too incomplete.146147### Fidelity Scorecard Dimensions148149Score only the dimensions that can be supported by evidence:150151- Color and semantic token usage152- Spacing and sizing scale discipline153- Typography alignment154- Border radius, elevation, and motion primitives155- State fidelity for hover, focus, active, disabled, and error states156- Primitive reuse and local override risk157158If a dimension cannot be evaluated, mark it `Not assessed`.159160## Handoff Contract161162When invoked by a dispatcher-led workflow, accept these fields when available:163164- `intent`165- `current_artifact_type`166- `target_artifact_type`167- `repo_context`168- `design_system_reference`169- `constraints`170- `allowed_write_risk`171172Return a result shaped for downstream consumption:173174- `deliverable`: markdown audit report175- `artifact_type`: `fidelity_scorecard` or `design_system_violation_report`176- `confidence`: `High`, `Medium`, or `Low`177- `recommended_next_step`: best follow-up action178- `follow_on_skill_type`: optional hint such as `execution`, `review`, or `design`179180## Telemetry Contract181182When this skill participates in a dispatcher-led workflow:183184- log `HANDOFF` selections with `--skill design-fidelity-auditor`185- include the normalized `intent`186- keep the `reason` concrete and audit-specific187- treat telemetry as part of operational correctness, not optional polish188189If telemetry cannot be recorded because the logger is unavailable, say so explicitly in the operating notes or final audit context rather than silently skipping it.190191## Quality Bar192193A strong audit should:194195- tell another engineer exactly what drift exists and why it matters196- preserve the design system's terminology instead of replacing it with generic advice197- distinguish project policy from opinion198- give remediation that can be implemented without guesswork199- remain useful even when the design reference is partial, incomplete, or evolving200201## Guardrails202203- System first: prioritize the documented design system over local aesthetic preference.204- Evidence first: do not claim a violation unless you can point to code or a missing system-aligned reference.205- No silent redesign: audit and recommend; do not rewrite large surfaces unless the user explicitly requests implementation.206- No invented tokens: if the correct token is unknown, say so and describe the required characteristics instead.207- No false certainty: when references are ambiguous, mark the finding as `Unknown` or reduce confidence.208- Keep scope honest: if only one component was reviewed, do not generalize to the whole product.209210## Escalation Rules211212Pause and say so when:213214- no trustworthy design authority exists215- multiple references conflict and the conflict changes the conclusion materially216- the user appears to want implementation changes rather than an audit artifact217- the review would be stronger with visual references, but only code is available218219## Bundled Resources220221- `README.md`222 Human-facing repository guide and installation notes.223- `assets/audit-report-template.md`224 Default output skeleton for audit reports.225- `examples/sample-audit-report.md`226 Example of a concise but production-grade audit deliverable.227- `fixtures/basic-button/`228 Minimal fixture for local regression testing.229- `evals/evals.json`230 Prompt-based regression checks for trigger quality and output quality.231- `scripts/validate_audit_report.py`232 Structural validator for saved reports.233- `scripts/score_audit_report.py`234 Lightweight benchmark helper for fixture-based report scoring.235- `reports/`236 Default location for saved audit artifacts when project-local persistence is requested.