AI Prompts
Machine-readable rules for AI coding assistants (Cursor, Windsurf, Copilot, Claude, GPT)
Recommendation: Use the Machine-Readable format for best results. AI models parse structured rules more accurately than prose.
Structured format optimized for AI parsing. Copy to system prompt or rules file.
# FT Design System - AI Rules
# Version: 5.0.5 | Components: 134
## WORKFLOW CONTRACT (MANDATORY)
- Before writing/modifying UI code, read relevant files under specs/
- Before commit or PR, run: npm run check:tokens
- Before commit or PR for UI/component changes, run: npm run check:consistency
- Before commit or PR for component size/variant changes, run: npm run check:size-contract
- Before commit or PR touching explorer configs, run: npm run check:explorer-inspector
- Before merging dependency updates, run: npm run check:drift
- For PR reviews, follow: specs/review-checklist.md
## IMPORTS
css: import 'ft-design-system/styles';
components: import { Button, Input, Table } from 'ft-design-system';
provider: import { FTProvider } from 'ft-design-system';
## FORBIDDEN (Never generate these)
- Arbitrary background/text/border with hex: bg-[ #HEX ], text-[ #HEX ]
- Arbitrary with CSS vars: bg-[ var(--name) ], text-[ var(--name) ]
- Dimension overrides on components: h-[ X ], w-[ X ], rounded-[ X ], p-[ X ]
- CSS vars with underscore: var(--some_token)
- CSS vars with slash: var(--some/token)
- Hardcoded font: fontSize: '16px'
## REQUIRED
- Components are AI-protected by default
- Use size prop: size="sm"|"md"|"lg"
- Use variant prop for styling
- Table rows must have 'id' field
- Table columns use 'title' not 'header'
## COMPONENT API
Button: variant=primary|secondary|destructive|text|link|ghost|dashed, size=sm|md|lg
Input: label, placeholder, error, helperText, size=sm|md|lg
Badge: variant=primary|secondary|danger|success|warning|neutral (NOT 'error')
Table: compose with TableHeader/TableBody/TableRow/TableHead/TableCell
Modal: open, onOpenChange, children=ModalContent
## COLORS (use Tailwind classes)
primary-700 → bg-primary-700
critical → text-critical
positive → text-positive
## SPACING (8-point grid, use --spacing-x* canonical names)
--spacing-x0: 0px, --spacing-x1: 4px, --spacing-x2: 8px, --spacing-x3: 12px
--spacing-x4: 16px, --spacing-x5: 20px, --spacing-x6: 24px, --spacing-x7: 28px
--spacing-x8: 32px, --spacing-x9: 36px, --spacing-x10: 40px, --spacing-x11: 44px
--spacing-x12: 48px, --spacing-x13: 52px, --spacing-x14: 56px, --spacing-x15: 60px
--spacing-x16: 64px, --spacing-x20: 80px, --spacing-x24: 96px, --spacing-x38: 152px
Half-steps: --spacing-x1-5: 6px, --spacing-x2-5: 10px, --spacing-x3-5: 14px
## TYPOGRAPHY (rem-based)
text-xs-rem=12px, text-xxs-rem=10px, text-sm-rem=14px
text-md-rem=16px, text-lg-rem=20px, text-xl-rem=24px
text-xxl-rem=28px, text-3xl-rem=36px, text-4xl-rem=48px
text-3_5xl-rem=40px, text-5xl-rem=72px
## BORDER RADIUS
--radius-none=0px, --radius-sm=4px, --radius-md=8px, --radius-lg=12px, --radius-xl=16px, --radius-2xl=20px, --radius-3xl=24px, --radius-4xl=28px, --radius-2xs=2px, --radius-smd=6px, --radius-full=9999px
## EXAMPLES
<Button variant="primary" size="md">Save</Button>
<Input label="Email" size="md" />
<Table><TableHeader><TableRow><TableHead>Name</TableHead></TableRow></TableHeader><TableBody><TableRow><TableCell>John</TableCell></TableRow></TableBody></Table>
<Badge variant="danger">Error</Badge>Why Machine-Readable?
Better Parsing
Structured key-value format is easier for LLMs to parse than prose. Rules are unambiguous.
Smaller Context
~50% smaller than prose version. Leaves more context window for your code.
Clear Forbidden List
Explicit FORBIDDEN section prevents common AI mistakes like hardcoded colors.
API Reference
Component API specs in scannable format. AI knows exact prop names and values.
Machine-Readable Resources
ft-design-system/registry134 components with metadata
ft-design-system/schemaProps, types, descriptions
ft-design-system/examples785+ code examples