code-showcase-core-components – skill Lập trình cho agent AI
Thư viện thành phần cốt lõi và các mẫu design system. Dùng khi xây dựng UI, sử dụng design token hoặc làm việc với thư viện component.
Cài skill code-showcase-core-components bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/code-showcase-core-components-002fc.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /code-showcase-core-components – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/code-showcase-core-components-002fc.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $code-showcase-core-components – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/code-showcase-core-components-002fc.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /code-showcase-core-components – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/code-showcase-core-components-002fc.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /code-showcase-core-components – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Core Components
When to Use
Use this skill when you need core component library and design system patterns. Use when building UI, using design tokens, or working with the component library.
This entry describes the upstream project's component API/token names, not a bundled component library or universal React Native API. Verify actual exports, tokens and props in the target repository before using snippets. CardProps/variantStyles, handlers and imported components are illustrative dependencies; token use alone does not prove contrast, labeling or behavior.
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
// 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
// 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
<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:
<Box
padding="$4"
backgroundColor="$backgroundPrimary"
borderRadius="$lg"
>
{children}
</Box>HStack / VStack
Horizontal and vertical flex layouts:
<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:
<Text
fontSize="$lg"
fontWeight="$semibold"
color="$textPrimary"
>
Hello World
</Text>Button
Interactive button with variants:
<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:
<Input
value={value}
onChangeText={setValue}
placeholder="Enter text"
error={touched ? errors.field : undefined}
label="Field Name"
/>Card
Content container:
<Card padding="$4" gap="$3">
<CardHeader>
<Heading size="sm">Card Title</Heading>
</CardHeader>
<CardBody>
<Text>Card content</Text>
</CardBody>
</Card>Layout Patterns
Screen Layout
const MyScreen = () => (
<Screen>
<ScreenHeader title="Page Title" />
<ScreenContent padding="$4">
{/* Content */}
</ScreenContent>
</Screen>
);Form Layout
<VStack gap="$4" padding="$4">
<Input label="Name" {...nameProps} />
<Input label="Email" {...emailProps} />
<Button isLoading={loading}>Submit</Button>
</VStack>List Item Layout
<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
// 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
import { Box, Text } from 'components/core';
// WRONG - Inline styles
<Text style={{ fontSize: 18, fontWeight: '600' }}>
// CORRECT - Token props
<Text fontSize="$lg" fontWeight="$semibold">Component Props Pattern
When creating components, use token-based props:
interface CardProps {
padding?: '$2' | '$4' | '$6';
variant?: 'elevated' | 'outlined' | 'filled';
children: React.ReactNode;
}
const Card = ({ padding = '$4', variant = 'elevated', children }: CardProps) => (
<Box
padding={padding}
backgroundColor="$backgroundPrimary"
borderRadius="$lg"
{...variantStyles[variant]}
>
{children}
</Box>
);Integration with Other Skills
- react-ui-patterns: Use core components for UI states
- testing-patterns: Mock core components in tests
- storybook: Document component variants
Limitations
- Use this skill only when the task clearly matches its upstream source and local project context.
- Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.
- Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.
Skill liên quan
- code-showcase-react-ui-patterns – Các mẫu UI React hiện đại cho trạng thái loading, xử lý lỗi và lấy dữ liệu. Dùng khi xây…
- code-showcase-systematic-debugging – Phương pháp gỡ lỗi bốn giai đoạn với phân tích nguyên nhân gốc. Dùng khi điều tra lỗi…
- code-showcase-testing-patterns – Mẫu test Jest, factory function, chiến lược mock và quy trình TDD. Dùng khi viết unit…
- code-simplification – Đơn giản hóa code cho dễ hiểu. Dùng khi tái cấu trúc code để rõ ràng hơn mà không đổi…
- code-simplifier – Đơn giản hóa và tinh chỉnh code cho rõ ràng, nhất quán và dễ bảo trì, đồng thời giữ…
- react-native-architecture – Xây dựng ứng dụng React Native production với Expo, navigation, native module, đồng bộ…
- karpathy-coder – Dùng khi viết, review hoặc commit code để áp dụng 4 nguyên tắc code của Karpathy — nêu…
- codebase-cleanup-refactor-clean – Bạn là chuyên gia tái cấu trúc code, chuyên về nguyên tắc clean code, các mẫu thiết kế…