Draft to Project
Convert UI drafts into frontend pages that fit the current project.
Use When
- User provides a screenshot or HTML mockup and wants it implemented
- User provides a local
file://...html draft or prototype page and wants a real project page based on it
- User wants the page to reuse existing project components
- User wants the page to follow project colors, spacing, tables, forms, and modal styles
Do Not Use
- For backend-only tasks
- For copy or documentation work
- When user explicitly wants a new design system
- When user asks for a full redesign instead of implementing the provided draft
Core Rule
Do not reinvent project UI. Before writing any code:
- Find existing components that match the mockup's elements (buttons, inputs, tables, cards, modals)
- Match project colors, spacing tokens, typography, and border radius
- Reuse existing table, form, and modal patterns
- Write new styles only when no existing component or local pattern fits
Layout Constraint
When the user provides a screenshot, HTML draft, or local file:// page, treat it as the layout baseline by default.
- Preserve the draft's structure unless the user explicitly asks for redesign
- Adapt the visual style to the project, but do not add extra summary blocks, wrappers, or control areas that materially change the page structure unless the user asks for it
- Make necessary adjustments for existing component constraints, responsive behavior, and accessibility
Workflow
- Analyze the screenshot/HTML: identify both the UI elements and the fixed layout structure
- Search the project for existing components that match each element type
- For each element:
- If found: reuse it directly
- If similar but needs adjustment: extend it minimally
- If not found: check if nearby patterns can be adapted
- Apply project style tokens: colors, spacing, typography, radii
- Implement with minimal new styles
- Before finishing, verify: no duplicate styles, all components exist in project, the implemented layout still matches the draft structure, and available checks pass
Style Matching Checklist
Check these against existing project patterns:
- Colors: Use existing color tokens when available; avoid one-off hardcoded colors
- Spacing: Match existing padding/margin values (8px, 12px, 16px, 24px...)
- Typography: Use existing font sizes and weights
- Buttons: Match button variants (primary, secondary, ghost, danger)
- Inputs: Match form input styles and validation feedback
- Tables: Match table header/body/row styles
- Cards: Match card padding, border, shadow patterns
- Modals/Popups: Match modal wrapper, backdrop, header, footer styles
Output
Before non-trivial implementation, state:
- which existing components you will reuse (with file paths)
- which project style tokens you will align to
- whether any new components or styles are necessary (and why)
Example:
Reuse:
- Button: src/components/ui/button.tsx (primary variant)
- Input: src/components/ui/input.tsx
- Table: src/components/data-table.tsx
- Card: src/components/ui/card.tsx
Style alignment:
- Colors: Use project tokens from src/styles/variables.css
- Spacing: 16px padding (matches existing cards)
- Typography: 14px body, 16px headings (matches project)
New styles: None, all elements covered by existing components
1---2name: draft-to-project3description: Convert UI drafts such as screenshots, HTML drafts, local file:// prototype pages, or mockups into frontend pages inside an existing project. Reuse existing components and styles, and keep the provided layout structure close to the source draft unless the user asks for redesign.4---56# Draft to Project78Convert UI drafts into frontend pages that fit the current project.910## Use When1112- User provides a screenshot or HTML mockup and wants it implemented13- User provides a local `file://...html` draft or prototype page and wants a real project page based on it14- User wants the page to reuse existing project components15- User wants the page to follow project colors, spacing, tables, forms, and modal styles1617## Do Not Use1819- For backend-only tasks20- For copy or documentation work21- When user explicitly wants a new design system22- When user asks for a full redesign instead of implementing the provided draft2324## Core Rule2526**Do not reinvent project UI**. Before writing any code:27281. Find existing components that match the mockup's elements (buttons, inputs, tables, cards, modals)292. Match project colors, spacing tokens, typography, and border radius303. Reuse existing table, form, and modal patterns314. Write new styles only when no existing component or local pattern fits3233## Layout Constraint3435When the user provides a screenshot, HTML draft, or local `file://` page, treat it as the layout baseline by default.3637- Preserve the draft's structure unless the user explicitly asks for redesign38- Adapt the visual style to the project, but do not add extra summary blocks, wrappers, or control areas that materially change the page structure unless the user asks for it39- Make necessary adjustments for existing component constraints, responsive behavior, and accessibility4041## Workflow42431. Analyze the screenshot/HTML: identify both the UI elements and the fixed layout structure442. Search the project for existing components that match each element type453. For each element:46 - If found: reuse it directly47 - If similar but needs adjustment: extend it minimally48 - If not found: check if nearby patterns can be adapted494. Apply project style tokens: colors, spacing, typography, radii505. Implement with minimal new styles516. Before finishing, verify: no duplicate styles, all components exist in project, the implemented layout still matches the draft structure, and available checks pass5253## Style Matching Checklist5455Check these against existing project patterns:5657- **Colors**: Use existing color tokens when available; avoid one-off hardcoded colors58- **Spacing**: Match existing padding/margin values (8px, 12px, 16px, 24px...)59- **Typography**: Use existing font sizes and weights60- **Buttons**: Match button variants (primary, secondary, ghost, danger)61- **Inputs**: Match form input styles and validation feedback62- **Tables**: Match table header/body/row styles63- **Cards**: Match card padding, border, shadow patterns64- **Modals/Popups**: Match modal wrapper, backdrop, header, footer styles6566## Output6768Before non-trivial implementation, state:6970- which existing components you will reuse (with file paths)71- which project style tokens you will align to72- whether any new components or styles are necessary (and why)7374Example:7576```77Reuse:78- Button: src/components/ui/button.tsx (primary variant)79- Input: src/components/ui/input.tsx80- Table: src/components/data-table.tsx81- Card: src/components/ui/card.tsx8283Style alignment:84- Colors: Use project tokens from src/styles/variables.css85- Spacing: 16px padding (matches existing cards)86- Typography: 14px body, 16px headings (matches project)8788New styles: None, all elements covered by existing components89```