
Core Components
Apply your core component library and design-token rules so agents stop hard-coding spacing, colors, and typography in UI code.
Overview
core-components is an agent skill for the Build phase that enforces core UI library usage and design-token spacing, color, and typography instead of hard-coded values.
Install
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill core-componentsWhat is this skill?
- Mandates core-library components instead of raw platform primitives for consistent behavior
- Documents spacing tokens ($1–$8) with explicit pixel values to block magic numbers
- Maps semantic color tokens ($textPrimary, $statusError, etc.) against hard-coded hex/RGB anti-patterns
- Includes typography token table from $xs through $2xl for agent-generated JSX
- Positions design tokens as the single source of truth for padding, margin, and status colors
- Documented spacing tokens from $1 (4px) through $8 (32px)
- Typography token scale from $xs (12px) through $2xl
Adoption & trust: 499 installs on skills.sh; 40.1k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent keeps emitting raw divs, magic pixel padding, and hex colors that drift from your design system.
Who is it for?
Indie frontend work where a token-based component library already exists and you want agents to follow it by default.
Skip if: Greenfield projects with no design tokens defined yet, or backend-only tasks with no UI output.
When should I use this skill?
Use when building UI, applying design tokens, or working with the core component library per SKILL.md description.
What do I get? / Deliverables
Generated UI code uses shared components and token names so styling stays consistent with your library.
- UI code using library components and tokens
- Fewer hard-coded style values in agent-generated patches
Recommended Skills
Journey fit
How it compares
Use as procedural design-system guardrails instead of ad-hoc "make it look nice" prompts without token tables.
Common Questions / FAQ
Who is core-components for?
Solo builders and small teams using a shared UI kit who want Claude, Cursor, or similar agents to respect tokens and library components.
When should I use core-components?
During Build frontend work whenever the agent writes layouts, forms, or screens that should match your design system.
Is core-components safe to install?
It is documentation-only guidance with no network calls; still review the Security Audits panel on this page for the parent skill pack.
SKILL.md
READMESKILL.md - Core Components
# Core Components ## Design System Overview Use components from your core library instead of raw platform components. This ensures consistent styling and behavior. ## Design Tokens **NEVER hard-code values. Always use design tokens.** ### Spacing Tokens ```tsx // CORRECT - Use tokens <Box padding="$4" marginBottom="$2" /> // WRONG - Hard-coded values <Box padding={16} marginBottom={8} /> ``` | Token | Value | |-------|-------| | `$1` | 4px | | `$2` | 8px | | `$3` | 12px | | `$4` | 16px | | `$6` | 24px | | `$8` | 32px | ### Color Tokens ```tsx // CORRECT - Semantic tokens <Text color="$textPrimary" /> <Box backgroundColor="$backgroundSecondary" /> // WRONG - Hard-coded colors <Text color="#333333" /> <Box backgroundColor="rgb(245, 245, 245)" /> ``` | Semantic Token | Use For | |----------------|---------| | `$textPrimary` | Main text | | `$textSecondary` | Supporting text | | `$textTertiary` | Disabled/hint text | | `$primary500` | Brand/accent color | | `$statusError` | Error states | | `$statusSuccess` | Success states | ### Typography Tokens ```tsx <Text fontSize="$lg" fontWeight="$semibold" /> ``` | Token | Size | |-------|------| | `$xs` | 12px | | `$sm` | 14px | | `$md` | 16px | | `$lg` | 18px | | `$xl` | 20px | | `$2xl` | 24px | ## Core Components ### Box Base layout component with token support: ```tsx <Box padding="$4" backgroundColor="$backgroundPrimary" borderRadius="$lg" > {children} </Box> ``` ### HStack / VStack Horizontal and vertical flex layouts: ```tsx <HStack gap="$3" alignItems="center"> <Icon name="user" /> <Text>Username</Text> </HStack> <VStack gap="$4" padding="$4"> <Heading>Title</Heading> <Text>Content</Text> </VStack> ``` ### Text Typography with token support: ```tsx <Text fontSize="$lg" fontWeight="$semibold" color="$textPrimary" > Hello World </Text> ``` ### Button Interactive button with variants: ```tsx <Button onPress={handlePress} variant="solid" size="md" isLoading={loading} isDisabled={disabled} > Click Me </Button> ``` | Variant | Use For | |---------|---------| | `solid` | Primary actions | | `outline` | Secondary actions | | `ghost` | Tertiary/subtle actions | | `link` | Inline actions | ### Input Form input with validation: ```tsx <Input value={value} onChangeText={setValue} placeholder="Enter text" error={touched ? errors.field : undefined} label="Field Name" /> ``` ### Card Content container: ```tsx <Card padding="$4" gap="$3"> <CardHeader> <Heading size="sm">Card Title</Heading> </CardHeader> <CardBody> <Text>Card content</Text> </CardBody> </Card> ``` ## Layout Patterns ### Screen Layout ```tsx const MyScreen = () => ( <Screen> <ScreenHeader title="Page Title" /> <ScreenContent padding="$4"> {/* Content */} </ScreenContent> </Screen> ); ``` ### Form Layout ```tsx <VStack gap="$4" padding="$4"> <Input label="Name" {...nameProps} /> <Input label="Email" {...emailProps} /> <Button isLoading={loading}>Submit</Button> </VStack> ``` ### List Item Layout ```tsx <HStack padding="$4" gap="$3" alignItems="center" borderBottomWidth={1} borderColor="$borderLight" > <Avatar source={{ uri: imageUrl }} size="md" /> <VStack flex={1}> <Text fontWeight="$semibold">{title}</Text> <Text color="$textSecondary" fontSize="$sm">{subtitle}</Text> </VStack> <Icon name="chevron-right" color="$textTertiary" /> </HStack> ``` ## Anti-Patterns ```tsx // WRONG - Hard-coded values <View style={{ padding: 16, backgroundColor: '#fff' }}> // CORRECT - Design tokens <Box padding="$4" backgroundColor="$backgroundPrimary"> // WRONG - Raw platform components import { View, Text } from 'react-native'; // CORRECT - Core components i