ui-consistency
Skill0 starsChanged 6 months agoApache-2.0View on GitHub
Use when asked for any frontend UI change — modals, forms, buttons, tables, layouts, colors, or spacing. Runs pattern inspection before writing code; never skip for small changes.
In this repository37 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- auto-mergeSkill
- auto-shipSkill
- backlog-burn-downSkill
- cloud-infra-plannerSkill
- daily-statusSkill
- decision-briefSkill
- deploy-shieldSkill
- eddSkill
- expo-build-and-sdk-upgrade-checkerSkill
- git-workflowSkill
- handle-reviewSkill
- hr-resume-screenerSkill
- img-prompt-genSkill
- instagram-carouselSkill
- integratekitSkill
- investor-deck-builderSkill
- investor-form-fillerSkill
- playwright-test-generationSkill
- qa-handoffSkill
- razorpay-integrationSkill
- resume-hiring-managerSkill
- resume-recruiterSkill
- review-queueSkill
- safe-push-workflowSkill
- ship-issueSkill
- skill-fixerSkill
- skill-reviewerSkill
- tech-mentorSkill
- your-skill-nameSkill
- test-case-generatorSkill
- test-case-reviewerSkill
- test-scenario-planningSkill
- triage-issuesSkill
- wp-maintenance-conductorSkill
- x-twitter-scraperSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. About 0 are common, 16 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
If the project ships a Claude design system file, that file is the Pattern Inventory and Step 1 is skipped.
- Distinctive: line 32
Do NOT activate when: the change is purely back-end with no UI output
- Distinctive: line 33
Do NOT skip for small changes — small changes break consistency most often
- Distinctive: line 45
Use Glob to search the project root and common config directories for any of these file names (case-insensitive):
- Distinctive: line 58
Read the file in full.
- Distinctive: line 59
Treat its contents as the authoritative Pattern Inventory — it replaces Step 2 entirely.
- Very specific: line 60
Add a one-line note to your response: _"Using project design system at <path>."_
- Distinctive: line 102
Before writing a single line of code, read existing components to verify and extend the Pattern Inventory with component-type-specific …
- Very specific: line 123
Modals: read every step/view the modal can show.
- Distinctive: line 127
If the user referenced a specific component ("make it like the modal on the billing page"), find and read that exact file in full before …
- Distinctive: line 131
Write the code. Rules:
- Very specific: line 133
Framework classes over inline styles: Use utility classes from the Pattern Inventory.
- Distinctive: line 134
Match, don't improve: If existing modals use a specific cancel button class, use that class exactly.
- Distinctive: line 136
Cover every state: If the component has multiple steps or views, style all of them using the same patterns.
- Distinctive: line 138
Respect framework mixing rules: Never mix frameworks within a single file if the Pattern Inventory found file-type boundaries.
- Very specific: line 139
No new color values: Do not introduce any hex color (#xxxxxx) or RGB value that does not already exist in the codebase.
- Distinctive: line 143
Before presenting your code, run through this checklist:
- Distinctive: line 152
If any answer is "no", fix it before responding.
- Distinctive: line 181
Inline styles are legacy: If you encounter ad-hoc inline styles in existing components, treat them as technical debt — do not replicate the …
- Distinctive: line 182
Pattern Inventory is the source of truth: If the inventory contradicts something you think you know about the project's stack, trust the …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
UI Consistency
Inspect existing patterns before writing any frontend code — match, don't improve.
If the project ships a Claude design system file, that file is the Pattern Inventory and Step 1 is skipped. If not, conventions are inferred by scanning existing components.
When to use
- Activate when: the user asks for ANY frontend UI change, fix, or addition (modals, forms, buttons, tables, layouts, colors, spacing, components, flows)
- Activate when: the user says "make it look like X", "similar to another page", or "fix the styling"
- Activate when: the user shares a screenshot and asks for a UI match
- Activate when: the user asks to change button color, padding, or any visual property
- Do NOT activate when: the change is purely back-end with no UI output
- Do NOT skip for small changes — small changes break consistency most often
Prerequisites
- Access to the frontend source directory (
resources/js/,src/,assets/, or equivalent) - Existing components of the same type are present in the codebase (for reference reading)
- (Optional) A design system file (
DESIGN_SYSTEM.md,design-tokens.json, etc.) in the project root
Steps
Step 1: Claude Design System Check
Use Glob to search the project root and common config directories for any of these file names (case-insensitive):
DESIGN_SYSTEM.md design-system.md design-system.json
design-tokens.md design-tokens.json design-tokens.ts
claude-design.md claude-design.json
tokens.json tokens.tsAlso check package.json for a dependency whose name contains design-system, design-tokens, or @anthropic.
If a design system file is found:
- Read the file in full.
- Treat its contents as the authoritative Pattern Inventory — it replaces Step 2 entirely.
- Add a one-line note to your response: "Using project design system at
<path>." - Skip Step 2 and proceed directly to Step 3, using the design system as the inventory source of truth.
If no design system file is found: proceed to Step 2. Do not invent tokens or assume a design system exists.
Step 2: Frontend Pattern Scan
Dispatch an Explore agent scoped to the frontend source directory (resources/js/, src/, assets/, or wherever components live). Instruct it to return findings directly in this conversation as a Pattern Inventory. No files should be written.
What to extract:
- CSS framework — What framework is in use? (Bootstrap, Tailwind, custom, mixed?) What version? Are there multiple frameworks in the same project?
- Component file types —
.vue,.tsx,.jsx,.svelte, plain.html? Where do they live? - Button patterns — What utility/component classes appear on
<button>elements? List every distinct combination observed. Do action and cancel buttons differ? - Color utilities — What color classes, CSS variables, or hex values appear? Which are used for destructive actions, confirmations, and neutral actions?
- Spacing conventions — What margin/padding classes or values dominate in component templates?
- Overlay/modal approach — Are modals driven by CSS framework JS (
data-bs-*,data-modal-*), a Vue/React state variable (v-if,useState), a dedicated component library, or a custom overlay? - Form patterns — Label placement, validation error display, required field markers.
- Typography — Heading tags and text utility classes used in components.
- Framework mixing rules — Are there file-type boundaries for different frameworks (e.g. Tailwind only in Blade, Bootstrap only in Vue)?
Output format — summarise findings as a Pattern Inventory block:
## Pattern Inventory (discovered)
- CSS framework: <name + version>
- Component type: <.vue / .tsx / etc.>
- Framework mixing: <rule if any>
- Buttons — action: <classes> | cancel: <classes> | destructive: <classes>
- Colors — destructive: <class> | confirm: <class> | neutral: <class>
- Spacing — dominant: <classes>
- Modals — driven by: <approach> | typical states: <n>
- Forms — layout: <approach> | errors: <approach> | required: <approach>
- Typography — headings: <tags+classes> | body: <classes>This inventory is the source of truth for all remaining steps.
Step 3: Inspect Before You Touch
The Pattern Inventory from Step 2 must exist before starting this step.
Before writing a single line of code, read existing components to verify and extend the Pattern Inventory with component-type-specific detail.
3a — Locate related components
Find 2–3 components that are the closest match to what you are about to build or change (same type: modal → read other modals, form → read other forms, table → read other tables). Read the full file — template, script/logic, and any scoped styles.
3b — Extend the Pattern Inventory for this component type
| Area | What to check |
| Buttons | Exact utility/component classes in sibling files; confirm match with Step 2; note any deviations |
| Colors | Color utility classes or CSS variables; hex colors in inline styles; destructive / confirm / neutral usage |
| Spacing | Dominant margin/padding classes; spacing inside modals (title↔body, body↔footer); form field spacing |
| Modal/overlay | Structure, state-toggling mechanism (v-if/v-show/step variable), footer content per state |
| Forms | Label layout; validation error display; required field markers |
| Typography | Heading tags + text utility classes; font size utilities |
3c — Check ALL interactive states
This is the most commonly missed step.
- Modals: read every step/view the modal can show. If it uses
v-if="step === 2", read what's in that block. - Buttons: note what buttons appear in each state — do not add new button variants that don't exist elsewhere.
- Forms: note what happens after submission (loading state? success message? redirect?).
If the user referenced a specific component ("make it like the modal on the billing page"), find and read that exact file in full before proceeding.
Step 4: Apply What You Found
Write the code. Rules:
- Framework classes over inline styles. Use utility classes from the Pattern Inventory. Only use
style=""when no utility class equivalent exists — if you must, always add the comment:<!-- intentional inline: no framework equivalent -->. - Match, don't improve. If existing modals use a specific cancel button class, use that class exactly. Consistency is the goal, not design improvement — unless the user explicitly asks.
- Copy the button pattern exactly. The most common failure is adding button colors that don't exist elsewhere. Use only the button classes observed in the Pattern Inventory.
- Cover every state. If the component has multiple steps or views, style all of them using the same patterns. Do not style only the first visible state.
- Resolve conflicts before writing code. If the user's request contradicts the Pattern Inventory (e.g., they ask for a color or style that does not exist in the codebase), stop and surface the conflict: "The Pattern Inventory has no [X] — do you want me to match existing patterns or override?" Do not silently pick one.
- Respect framework mixing rules. Never mix frameworks within a single file if the Pattern Inventory found file-type boundaries.
- No new color values. Do not introduce any hex color (
#xxxxxx) or RGB value that does not already exist in the codebase.
Step 5: Self-Check Before Responding
Before presenting your code, run through this checklist:
- Did I read at least 2 existing components of the same type?
- Did I read ALL interactive states of the reference component (not just the first view)?
- Are all button classes copied from what I observed — not invented?
- Are there any inline hex colors I added? If yes, remove them.
- Did I violate the framework mixing rules from the Pattern Inventory? If yes, fix.
- Does every step/state of my component follow the same pattern as the rest?
If any answer is "no", fix it before responding.
Output
- Format: Code (component file —
.vue,.tsx,.jsx, etc.) with CSS utility classes matching the Pattern Inventory - Location: Inline in chat, ready to paste into the relevant component file
- Example: A new confirmation modal that exactly matches the overlay pattern, button styles, and spacing found in existing modals — no new color values, no inline styles, no framework mixing
Example
User says: "Add a delete confirmation modal to the users table"
Claude does: Runs the design system check, scans existing modal components, builds the Pattern Inventory, extends it with modal-specific detail from sibling files, then writes the modal following all observed patterns across every state (open, confirming, loading).
Result: A complete modal component using the project's exact button classes, overlay approach, and spacing — visually identical to every other modal in the codebase.
Common Mistakes
| Mistake | Fix |
| Skipping Step 2 and assuming the CSS framework | Step 2 is mandatory — run the Explore agent first |
| Using a button class not found in the Pattern Inventory | Only use what was observed; check the inventory |
| Styling only step 1 of a multi-step modal | Read every state branch and apply the same patterns throughout |
| Using framework JS to control component visibility | Check the Pattern Inventory for the modal approach; use component state if the framework is JS-driven |
| Copying an inline style from an existing component | Check if a framework utility class covers it; only replicate if there is genuinely no alternative |
| Mixing CSS frameworks within a single file | Check the framework mixing rules in the Pattern Inventory and respect them |
Notes
- Inline styles are legacy: If you encounter ad-hoc inline styles in existing components, treat them as technical debt — do not replicate the inline style, use the framework utility equivalent. Only replicate if there is genuinely no utility class for it.
- Pattern Inventory is the source of truth: If the inventory contradicts something you think you know about the project's stack, trust the inventory. It was derived from what is actually in the codebase.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

