用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/aiFabricoCom/fabrico-collections-codex --skill fabrico-implementing-frontend命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | fabrico-implementing-frontend |
| description | Components, composition, design tokens, and Figma-to-code workflow. |
Provides patterns for building reusable, composable frontend components with design system integration and a structured Figma-to-code workflow.
Define what the UI should look like based on state, not how to manipulate the DOM. Describe the desired outcome through components and state declarations. Let the framework handle reconciliation and updates. Compose complex UIs from simple, predictable building blocks rather than writing step-by-step mutation sequences. Build complex UIs by composing small, focused components rather than creating monolithic ones. Each component should have a single clear responsibility. Prefer children, slots, and compound component patterns over deep prop trees. Always use design tokens (colors, spacing, typography) from the project's design system. Never hardcode visual values. Map Figma specs to existing tokens. If no exact token match exists, find the closest and document the deviation — do not invent tokens without approval. If design context, tokens, or specifications are missing or unclear, stop and ask the user. Do not proceed with assumptions about visual implementation. Missing information produces wrong UI — asking produces correct UI.Use the checklist below and track progress:
Progress:
- [ ] Step 1: Gather design context
- [ ] Step 2: Plan component structure
- [ ] Step 3: Implement components
- [ ] Step 4: Organize modules
- [ ] Step 5: Verify implementation
Step 1: Gather design context
#3B82F6, 16px).Step 2: Plan component structure
Step 3: Implement components
Follow these patterns for every component:
any. Co-locate types in ComponentName.types.ts.export { ComponentName } — no default exports. This ensures consistent imports and simplifies refactoring.Step 4: Organize modules
Apply barrel file rules from the Barrel File Guidelines table below:
index.ts barrel files at public API boundaries — folders whose exports are consumed by other modules.export { Button } from './Button'.Step 5: Verify implementation
fabrico-ui-reviewer subagent — through Codex subagent delegation, custom agent fabrico-ui-reviewer — automatically during $fabrico-implement), defer to that workflow — do not duplicate verification here.fabrico-ui-verifying skill directly to compare the implementation against the Figma design.| State type | When to use | Example |
|---|---|---|
| Local state | UI-only, single component | Modal open/close, input value |
| Lifted state | Shared between 2-3 siblings | Filter applied to a sibling list |
| Context / DI | Deeply nested consumption | Theme, locale, auth status |
| Global store | Complex cross-cutting state | Multi-step form wizard, shopping cart |
| Server cache | Remote data with caching | API responses, paginated lists |
| Rule | Description |
|---|---|
| Create barrel when | Folder exports are consumed by OTHER modules (public API boundary) |
| Avoid barrel when | Internal utils serving a single parent component — import directly |
| Re-export style | Named re-exports only: export { Button } from './Button' |
| Never wildcard | Avoid export * from — breaks tree shaking, hides API surface |
| Keep flat | One level deep — no barrel importing another barrel |
| Test with build | Verify barrel doesn't pull unused code into bundle |
Component:
- [ ] Single responsibility — one clear purpose
- [ ] Typed props — explicit types, sensible defaults
- [ ] Named export — no default exports
- [ ] Design tokens — no hardcoded visual values
- [ ] Error state — handles failure gracefully
- [ ] Loading state — shows progress indicator
- [ ] Empty state — meaningful message when no data
- [ ] Composition — uses children/slots, not prop sprawl
| Anti-Pattern | Instead Do |
|---|---|
Hardcoded colors/spacing (#3B82F6, 16px) | Use design tokens (var(--color-primary-500), theme.spacing(2)) |
| Monolithic component (300+ lines) | Split into composed sub-components |
| Props drilling through 4+ levels | Use context or composition pattern |
| Duplicating existing component | Extend existing with variants |
| Inline styles for theming | Use design system's styling approach |
export default | Named exports for consistency and refactoring |
any type for props | Explicit type definitions |
| Barrel file for internal utils | Direct imports for single-consumer folders |
The patterns above are framework-agnostic. For framework-specific implementation guidance, load the appropriate reference:
./references/react-patterns.md — hooks, JSX composition, error boundaries, memoization patterns.fabrico-ui-verifying - for verifying implementation against Figma designsfabrico-technical-context-discovering - for understanding project conventions before implementingfabrico-ensuring-accessibility — to ensure components meet WCAG 2.1 AA standardsfabrico-optimizing-frontend — for performance considerations during component implementationfabrico-implementing-forms — for form-specific component patterns and validationfabrico-writing-hooks — for custom hook patterns used within componentsfabrico-reviewing-frontend — for frontend-specific code review of implemented components