Design Compliance
Run a fully autonomous design system compliance audit on a page or component of the Hexagone Web application. The skill discovers source files, recursively analyzes the full component tree, visually inspects the rendered page (light + dark mode), detects all violations against the Hexagone design system rules, auto-fixes every violation in place, and prints a structured report — all without asking the user for confirmation.
When to Use This Skill
Activate when the user:
- Says "design-compliance" followed by a URL, component name, or page name
- Asks to audit or check design system compliance on a page or component
- Wants to enforce PrimeVue / Tailwind / Hexagone token conventions on existing code
- Says "check the design", "audit the UI", "design review" on Hexagone code
Core Principles
1. Full Autonomy
- The entire pipeline runs without asking questions during execution
- If no argument is provided, ask the user what to review — then run autonomously
- Files are edited in place without confirmation
- Changes are NOT committed — the developer reviews the diff
2. Single Standard (No Per-MF Exceptions)
- Composition API with — always
- Tailwind CSS 4 — always
- Pinia for state management — always
- PrimeVue 4 native components — always (no hexa-compat in new/modified code)
- for scoped token overrides — always (never for visual styling)
3. Hexagone-Specific
This skill is tailored to the Hexagone Web monorepo stack:
- PrimeVue 4.3 with (extends Aura)
- Tailwind CSS 4
- 3-layer token system: (PrimeVue), (shell only), beta-scss (legacy, forbidden)
- Vue.js 3.5 with TypeScript
4. Fix Everything
The skill auto-fixes ALL violations — mechanical (import renames, class swaps) AND structural (component replacements, template rewrites). No report-only mode. No asking before editing.
Source of Truth (Priority Order)
The skill builds its ruleset from these sources, checked in order:
-
Explicit rules files (override everything if present):
- or
docs/design-system/design-rules.md
- (root and per-MF)
.github/copilot-instructions.md
or .github/instructions/*.md
-
Framework configuration:
- — PrimeVue preset (tokens, color scheme)
- — Shell chrome tokens ()
- — Tailwind configuration
- — PrimeVue version, dependencies
-
Codebase patterns:
- Existing "good" components as implicit conventions
- Router configuration for route-to-component mapping
Input Modes
The skill accepts three types of input, all converging to the same pipeline:
URL Mode
/design-compliance http://localhost:5173/hexagone-etab/vue/patients
- Use the URL directly for visual inspection
- Reverse-map the URL path to a route in the router config
- Find the component file for that route
- Recursively resolve all local imports
Component Name Mode
/design-compliance PatientDashboard
- Glob for matching files: , ,
- If multiple matches, review all of them
- For each matched component, resolve the route it belongs to (if any) for visual inspection
- Recursively resolve all local imports
Page Name Mode
/design-compliance Patients
- Search the router configuration files for a route named "Patients" or with path
- Find the component assigned to that route
- Construct the URL for visual inspection
- Recursively resolve all local imports
No Argument
Ask the user what to review. Do not assume.
Workflow
Step 1: Discover Source of Truth
-
Read explicit rules files (if they exist in the project):
- Glob for , ,
- Glob for
.github/copilot-instructions.md
, .github/instructions/*.md
- Extract design system rules, anti-patterns, token conventions
-
Read framework configuration:
- Find and read the PrimeVue preset file (usually or )
- Find and read shell tokens (usually )
- Read to confirm PrimeVue version and dependencies
- Read Tailwind config if present
-
Build the merged ruleset — combine all sources into a single checklist of rules to enforce
Step 2: Resolve Target Files
Based on the input mode:
-
Parse the user's input to determine the mode (URL, component name, or page name)
-
Find the entry-point file(s):
- URL → parse the path, search router files (, ) for matching route, get the component
- Component name → glob for , ,
- Page name → search router config for route name or path match
-
Recursively resolve the component tree:
- Read each file
- Extract all local imports (skip , , , , )
- Follow each import to its file, repeat until no new local components are found
- Build the full file list to review
-
Report the discovered tree to the user:
Found 12 files in component tree for PatientDashboard:
- frontend/gap-mf/src/views/PatientDashboard.vue (entry)
- frontend/gap-mf/src/components/PatientHeader.vue
- frontend/gap-mf/src/components/PatientTimeline.vue
- ...
Step 3: Static Code Analysis
For each file in the component tree, check ALL violation categories:
Category 1: Wrong Component
- Raw , , , , when PrimeVue equivalents exist
- , , , , (hexa-compat) — should be PrimeVue native
- Any hexa-components (, , , etc.) — should be PrimeVue native
- Fix: replace with the correct PrimeVue component, update imports, adapt props/slots
Category 2: Wrong Token Layer
- Hardcoded colors: , , in or inline styles
- beta-scss classes: , , , etc. in templates
- tokens used outside shell components (Header, Sidebar, Navigation)
- Arbitrary Tailwind values: , ,
- Fix: replace with tokens, Tailwind theme classes, or overrides
Category 3: Misuse
- prop used for visual styling: , , , , , , ,
- Fix: move visual overrides to prop or with tokens
Category 4: Import Violations
- Uppercase PrimeVue imports: →
- v3 component names: → , → , → , → , / → ////, →
- Named imports from barrel:
import { InputText } from "primevue"
→ default import
- Fix: rewrite the import statement, update component registration and template usage
Category 5: Dark Mode Violations
- nested inside — must use a separate unscoped block
- Hardcoded light-only colors without dark mode variant
- Fix: move dark mode styles to a separate block, use tokens that auto-switch
Category 6: i18n Violations
- Hardcoded text strings in templates (labels, placeholders, titles, messages, error text)
- Exceptions: single characters (, , , ), numbers, CSS class names, prop values that are not user-visible
- Fix: extract to locale file, replace with (Composition API) or (Options API)
Category 7: Accessibility
- or PrimeVue with only an icon and no
- Form fields without associated (no / pair, no wrapper)
- Context menus (right-click handlers) — app must work on tablets
- Hover-only interactions (/ without click alternative)
- Missing on tags
- Fix: add , wrap in , replace hover with click, add text
Category 8: Framework Conventions
- Options API (
export default { data(), methods, computed }
) instead of
- Missing on
- Vuex/pathify usage instead of Pinia
- / / / instead of Pinia
- Inline styles () instead of Tailwind classes or scoped CSS with tokens
- in new code (acceptable only to counter beta-scss legacy conflicts)
- Fix: rewrite to Composition API with , migrate state to Pinia, replace inline styles
Step 4: Visual Inspection
Prerequisite: Check if a dev server is running by probing common ports (5173, 5174, 3000, 8080).
If no dev server is detected, skip visual inspection entirely and proceed to Step 5 with code-only results.
If a dev server is running:
4a. Navigate to the Page
-
Determine the URL:
- If the user provided a URL, use it directly
- If a component/page name was provided, construct the URL from the route config
- If the route cannot be determined, skip visual inspection
-
Open the page in a headless browser (Playwright)
-
Handle authentication:
- If a login page is detected (look for login form, redirect), authenticate:
- After login, navigate to the target page
4b. Light Mode Inspection
- Take a full-page screenshot
- Analyze computed styles on key elements:
- Check for hardcoded colors not matching token values
- Check for non-standard spacing (values that don't align with the Tailwind spacing scale)
- Check for inconsistent border-radius across sibling elements
- Visual heuristics:
- Misaligned elements (inconsistent padding/margins between siblings)
- Broken or inconsistent responsive behavior
- Elements overflowing their containers
- Inconsistent font sizes within the same context
4c. Dark Mode Inspection
- Toggle dark mode: execute
document.documentElement.classList.add('p-dark')
in the browser
- Take a second full-page screenshot
- Check for:
- Elements with hardcoded light colors that don't adapt (white backgrounds, dark text on dark bg)
- tokens not switching correctly
- Contrast issues (text unreadable against background)
- Visual artifacts from non-token-based styling
4d. Capture Results
Compile all visual issues with:
- Element selector or description
- Issue description
- Severity (P1: broken/unreadable, P2: inconsistent, P3: minor polish)
Step 5: Auto-Fix All Violations
For every violation found (code + visual):
- Prioritize fixes: P1 (broken) → P2 (inconsistent) → P3 (polish)
- Edit files in place using the Edit tool
- Respect existing patterns: when fixing, match the style of surrounding code
- Handle cascading fixes: if replacing a component changes its API (props, slots, events), update all usages in the template
- Update imports: add new PrimeVue imports, remove unused ones
- Do NOT commit — leave changes unstaged for the developer to review
Step 6: Generate Report
Print a structured report to the terminal:
markdown
## Design Compliance Report
**Target:** [component/page name or URL]
**Files analyzed:** [count]
**Violations found:** [count]
**Violations fixed:** [count]
**Visual inspection:** [performed (light + dark) / skipped (no dev server)]
### Files in Component Tree
|---|------|------------|
| 1 | `frontend/gap-mf/src/views/PatientDashboard.vue` | 5 |
| 2 | `frontend/gap-mf/src/components/PatientHeader.vue` | 2 |
| ... | ... | ... |
### Violations Fixed
#### Category 1: Wrong Component ([count])
|------|------|--------|-------|
| `PatientDashboard.vue` | 42 | `<button @click="save">` | `<Button @click="save" label="..." />` |
#### Category 2: Wrong Token Layer ([count])
|------|------|--------|-------|
| `PatientHeader.vue` | 15 | `color: #006875` | `color: var(--p-primary-500)` |
#### Category 3: pt Misuse ([count])
...
#### Category 4: Import Violations ([count])
...
#### Category 5: Dark Mode Violations ([count])
...
#### Category 6: i18n Violations ([count])
...
#### Category 7: Accessibility ([count])
...
#### Category 8: Framework Conventions ([count])
...
### Visual Inspection Results
[If performed]
#### Light Mode
- [Issue 1: description — severity]
- [Issue 2: description — severity]
#### Dark Mode
- [Issue 1: description — severity]
- [Issue 2: description — severity]
### Summary
- **Total violations:** [count]
- **Auto-fixed:** [count]
- **Remaining (manual review needed):** [count, if any]
Violation Reference
PrimeVue v3 → v4 Renamed Components
| v3 (FORBIDDEN) | v4 (CORRECT) | Import Path |
|---|
| | |
| | |
| | |
| | |
| / | / / / / | , etc. |
| | |
HTML → PrimeVue Mapping
| Raw HTML | PrimeVue Replacement |
|---|
| from |
| from |
| <Checkbox :binary="true">
from |
| from |
| from |
| from |
| + from , |
| from |
| from |
hexa-compat → PrimeVue Mapping
| hexa-compat | PrimeVue Native |
|---|
| from |
| <Message severity="error">
from |
| from |
| from |
| from |
| from |
Token Layer Rules
| Context | Allowed | Forbidden |
|---|
| Business pages (views, components) | , Tailwind classes, | , beta-scss classes, hardcoded colors |
| Shell components (Header, Sidebar, Nav) | , | beta-scss classes, hardcoded colors |
| New code (any) | Tailwind CSS 4 classes, tokens | beta-scss classes, inline styles, |
beta-scss → Modern Equivalents
| beta-scss Class | Tailwind / Token Replacement |
|---|
| or |
| or |
| var(--hexa-chrome-bg-accent)
(shell only) |
| (shell only) |
| Tailwind grid or |
| , , | Tailwind , , |
| |
| |
| |
| or var(--p-content-border-radius)
|
| |
Edge Cases
No Files Found
If the glob/search finds no matching files:
- Tell the user: "No files found matching '[input]'. Try a URL, a .vue component name, or a route path."
- Stop
Dev Server Not Running
- Skip visual inspection entirely
- Run code-only analysis and auto-fixes
- Note in the report: "Visual inspection skipped — no dev server detected on ports 5173, 5174, 3000, 8080"
Authentication Fails
- If login with / fails, skip visual inspection
- Note in the report: "Visual inspection skipped — authentication failed"
- Continue with code-only analysis
Large Component Tree (20+ files)
- Process all files — do not skip or sample
- Organize the report by file for readability
- Use parallel sub-agents if the tree exceeds 10 files (one sub-agent per batch of 5 files)
Mixed MF Files
If the component tree spans multiple micro-frontends (e.g., shared package imports):
- Apply the same single standard to all files
- Note in the report which MF each file belongs to
File Already Compliant
If a file has zero violations:
- Include it in the file list with "0 violations"
- Do not edit it
Important Notes
- This skill modifies files. It edits files in place to fix violations. Changes are NOT committed.
- The developer reviews the diff. After the skill runs, the developer should to verify all changes.
- i18n keys: when extracting hardcoded text, use descriptive dot-notation keys matching the component name and context (e.g., , )
- PrimeVue docs: for component API details, fetch
https://primevue.org/<component>.md
- Recursive resolution stops at: , , , , , , (treat shared package as a library boundary)
- Shell components (Header, Sidebar, Navigation, Breadcrumbs) are allowed to use tokens — do not flag these