component-consistency
Skill0 starsChanged 5 months agoMITView on GitHub
Ambient enforcement that prevents raw primitives, hardcoded design values, duplicate components, and inconsistent patterns in UI code. Activates when editing UI files.
In this repository18 other files it gives its agents.
- app-icon-gridSkill
- archive-manualSkill
- commitSkill
- component-locatorSkill
- debug-triageSkill
- gemini-iconSkill
- parity-auditorSkill
- prd-writingSkill
- refactor-and-safety-passSkill
- release-helperSkill
- smellSkill
- streamdeck-aerospace-rewireSkill
- streamdeck-workspace-buttonSkill
- svg-icon-renderSkill
- test-conventionsSkill
- verification-gateSkill
- work-breakdownSkill
- yt-audioSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
24 rules. About 0 are common, 21 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈21
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Before creating any UI element, do ALL of these:
- Distinctive: line 28
Do NOT use raw primitives when the project has wrapped versions.
- Distinctive: line 55
Action: If a wrapped version exists, use it.
- Distinctive: line 59
Do NOT use literal values when the project has a token/theme system:
- Very specific: line 61
Colors: No hex (#FF0000), RGB (rgb()), HSL literals.
- Very specific: line 62
Spacing: No pixel literals for margin/padding (16, 24).
- Very specific: line 63
Font sizes: No numeric font sizes (fontSize: 14).
- Distinctive: line 64
Border radius: No literal radius values. Use radius tokens or Tailwind rounded classes.
- Distinctive: line 65
Shadows: No hardcoded shadow values.
- Distinctive: line 71
Do NOT create a new component when an existing one can be extended:
- Distinctive: line 73
Before creating a new component, search for similar ones by purpose (not just name).
- Distinctive: line 74
If one exists, add a prop or variant instead of duplicating.
- Distinctive: line 75
If the existing component is in a different package/module, import it rather than copying.
- Distinctive: line 77
Action: If a similar component exists, propose extending it with a new prop/variant.
- Distinctive: line 81
Do NOT mix approaches within the same project:
- Distinctive: line 83
Styling: Don't mix inline styles, StyleSheet, styled-components, and Tailwind in the same project unless the project already mixes them …
- Distinctive: line 84
Component libraries: Don't import from multiple UI kits (e.g., both MUI and Chakra) unless the project already does.
- Distinctive: line 85
State patterns: Follow the project's established state management pattern.
- Distinctive: line 86
Navigation: Use the project's existing navigation approach.
- Distinctive: line 88
Action: Check 2-3 existing files in the same area to identify the established pattern.
- Distinctive: line 95
Genuine gap: No existing component or token covers the use case (note this in your response).
- Distinctive: line 101
When writing UI code:
- Distinctive: line 103
Stop and search: before writing any UI element — run the pre-build checklist.
- Distinctive: line 106
Do NOT block the user's workflow with excessive warnings.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Component Consistency
You are an ambient consistency enforcer for UI code. Before writing any UI element, verify it aligns with the project's existing components, tokens, and patterns.
Pre-Build Checklist
Before creating any UI element, do ALL of these:
- Search for existing components — use the component-locator skill or grep the project's component directories (
components/,ui/,shared/,primitives/). - Check for design tokens — look for a theme file, token definitions, or Tailwind config. Use those values, not literals.
- Search for similar patterns — grep for similar UI patterns already in the codebase. Extend rather than duplicate.
P1: Raw Primitives
Do NOT use raw primitives when the project has wrapped versions. Search for a wrapped alternative before reaching for these:
React Native
| Raw Primitive | Search for wrapper named |
TextInput | Input, TextField, FormInput, SearchInput |
TouchableOpacity, Pressable | Button, IconButton, TouchableRow, Pressable (project-wrapped) |
Image | Avatar, CachedImage, FastImage, Icon |
ScrollView | ScreenWrapper, ScrollContainer, PageScroll |
FlatList | List, InfiniteList, VirtualizedList (project-wrapped) |
Text | Typography, Label, Heading, Body, Caption |
View | Box, Card, Container, Row, Stack |
Modal | BottomSheet, Dialog, Overlay, Sheet |
ActivityIndicator | Spinner, Loading, Skeleton |
React / Next.js
| Raw Primitive | Search for wrapper named |
<input> | Input, TextField, FormField |
<button> | Button, IconButton, LinkButton |
<img> | Image (next/image), Avatar, Picture |
<a> | Link (next/link), NavLink, TextLink |
<select> | Select, Dropdown, Combobox, Picker |
<textarea> | TextArea, RichTextInput |
<dialog> | Modal, Dialog, Sheet, Drawer |
<table> | DataTable, Table (project-wrapped), Grid |
Action: If a wrapped version exists, use it. If not, note it and proceed with the primitive.
P2: Hardcoded Design Values
Do NOT use literal values when the project has a token/theme system:
- Colors: No hex (
#FF0000), RGB (rgb()), HSL literals. Use theme colors or Tailwind classes. - Spacing: No pixel literals for margin/padding (
16,24). Use spacing tokens or Tailwind spacing. - Font sizes: No numeric font sizes (
fontSize: 14). Use typography tokens or Tailwind text classes. - Border radius: No literal radius values. Use radius tokens or Tailwind rounded classes.
- Shadows: No hardcoded shadow values. Use elevation tokens or Tailwind shadow classes.
Action: Grep for theme/token files (theme.*, tokens.*, tailwind.config.*, colors.*, spacing.*). If tokens exist, use them.
P3: Duplicate Components
Do NOT create a new component when an existing one can be extended:
- Before creating a new component, search for similar ones by purpose (not just name).
- If one exists, add a prop or variant instead of duplicating.
- If the existing component is in a different package/module, import it rather than copying.
Action: If a similar component exists, propose extending it with a new prop/variant. Only create new if the use case is genuinely distinct.
P4: Inconsistent Patterns
Do NOT mix approaches within the same project:
- Styling: Don't mix inline styles, StyleSheet, styled-components, and Tailwind in the same project unless the project already mixes them intentionally.
- Component libraries: Don't import from multiple UI kits (e.g., both MUI and Chakra) unless the project already does.
- State patterns: Follow the project's established state management pattern.
- Navigation: Use the project's existing navigation approach.
Action: Check 2-3 existing files in the same area to identify the established pattern. Follow it.
Acceptable Deviations
These are valid reasons to skip the rules above:
- Prototyping: Flagged with
// TODO: replace with <ComponentName>comment. - Genuine gap: No existing component or token covers the use case (note this in your response).
- Performance: A measured performance concern justifies a lower-level primitive (cite the concern).
- Third-party constraint: A library requires specific raw elements.
Enforcement Behavior
When writing UI code:
- Stop and search before writing any UI element — run the pre-build checklist.
- Report what was found — briefly mention which existing components/tokens apply.
- Note gaps — if nothing exists, say so and proceed.
- Do NOT block the user's workflow with excessive warnings. Be concise: one line per finding.
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.

