generate_code
Generate shadcn/ui and Tailwind React components from a design spec, writing files into atomic design folders. Includes optional AI layout scoring.
Instructions
Generate shadcn/ui + Tailwind code from a saved spec and write files into atomic design folders (atoms → components/ui/, molecules/organisms/templates → components//).
Returns: { entryFile, files[], generatedAt, findings[], critique? }. For page specs, critique is an AI layout score (0-100) + hierarchy/spacing/consistency notes when ANTHROPIC_API_KEY is set — informational only, never blocks. Errors: isError if specName is not found. isError with { blocked: true, findings } if a critical quality-gate finding (raw hex/color when tokens exist, a token-pair contrast failure, or a strict-mode skill-compliance violation) prevented the write — pass force:true to write anyway after reviewing the findings.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Set true to write files despite critical quality-gate findings. Only pass this after reviewing the findings and intentionally deciding to override them. | |
| specName | Yes | Name of the spec to generate code for (case-sensitive, must match a spec returned by get_specs). |