home / skills / yellinzero / aico / aico-frontend-design

aico-frontend-design skill

/.codex/skills/aico-frontend-design

This skill converts PRD or story into complete page and component designs with ASCII layouts, interaction flows, and frontend implementation prompts.

npx playbooks add skill yellinzero/aico --skill aico-frontend-design

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
3.8 KB
---
name: aico-frontend-design
description: |
  Transform PRD or story into complete page/component designs with ASCII layouts, component specs, interaction flows, and frontend implementation prompts.

  Use this skill when:
  - User asks to "design the page", "design component", "create page design"
  - User mentions "page design", "component design", "UI design", "layout design"
  - Running /frontend.design command
  - PRD or story is ready and need visual/interaction design before implementation
  - Need to create design spec that frontend developer can implement from

  Prerequisites: Design system must exist at docs/reference/frontend/design-system.md
  Output: ALWAYS write design files to docs/reference/frontend/designs/{name}.md
---

# Design

## Language Configuration

Before generating any content, check `aico.json` in project root for `language` field to determine the output language. If not set, default to English.

## Process

1. **Read design system**: Load `docs/reference/frontend/design-system.md`
2. **Read constraints**: Load `docs/reference/frontend/constraints.md`
3. **Read PRD/story**: Load the source document from `docs/reference/pm/`
4. **For each page/feature**:
   - Define user flow (entry → actions → outcome)
   - Create ASCII layout
   - List all components with variants and props
   - Write content/copy
   - Document all interactions
   - Generate frontend prompt
5. **Save output**: ALWAYS write to `docs/reference/frontend/designs/{name}.md`

## Design File Template

```markdown
# [Name] Design Spec

> Project: [project-name]
> Created: YYYY-MM-DD
> Last Updated: YYYY-MM-DD

## User Flow

1. User enters from [entry point]
2. User sees [initial state]
3. User can [actions]
4. Success: [outcome]

## Layout (ASCII)

┌─────────────────────────────────────┐
│ Header │
├─────────────────────────────────────┤
│ Content │
└─────────────────────────────────────┘

## Sections

### 1. [Section Name]

- **Purpose**: What this section achieves
- **Components**: List of UI components used
- **Content**: Actual text/copy
- **Design notes**: Specific styling details

## Component List

| Component | Variants           | Props          | Notes        |
| --------- | ------------------ | -------------- | ------------ |
| Button    | primary, secondary | size, disabled | Use for CTAs |

## Responsive

- **Desktop**: [layout notes]
- **Tablet**: [layout notes]
- **Mobile**: [layout notes]

## Interactions

| Trigger   | Action      | Feedback                     |
| --------- | ----------- | ---------------------------- |
| Click CTA | Submit form | Show loading → success toast |

---

## Frontend Prompt

<context>
You are implementing [page/component name] for [project].
</context>

<constraints>
Read and follow:
- Design system: docs/reference/frontend/design-system.md
- Frontend constraints: docs/reference/frontend/constraints.md
</constraints>

<requirements>
1. Follow the design system tokens exactly
2. Implement all sections as specified
3. Handle all responsive breakpoints
4. Implement all interactions listed
</requirements>
```

## Key Rules

- ALWAYS define user flow with entry point and success state
- MUST list specific props and variants for each component
- ALWAYS document all triggers and feedback for interactions
- Reference design system, don't duplicate it

## Common Mistakes

- ❌ Skip user flow → ✅ Always define entry point and success state
- ❌ Vague component specs → ✅ List specific props and variants
- ❌ Forget interactions → ✅ Document all triggers and feedback
- ❌ Duplicate design system → ✅ Reference it, don't copy

Overview

This skill transforms a PRD or user story into a complete, developer-ready frontend design file. It produces ASCII layouts, explicit component specs with variants/props, interaction flows, copy, and a frontend implementation prompt. All outputs are written to docs/reference/frontend/designs/{name}.md so developers can pick up implementation immediately.

How this skill works

It first loads the project design system and frontend constraints, then ingests the PRD or story from the PM docs. For each page or feature it defines a user flow (entry → actions → outcome), generates an ASCII layout, enumerates components with exact variants and props, writes content, documents interactions (triggers and feedback), and emits a frontend prompt. The process always references the design system rather than duplicating tokens and ensures the result is saved at docs/reference/frontend/designs/{name}.md.

When to use it

  • When you ask to “design the page”, “design component”, or “create page design”.
  • When a PRD or story is ready and you need visual and interaction design before implementation.
  • When you need a precise design spec a frontend developer can implement from.
  • When running the /frontend.design command or preparing handoff artifacts.
  • When you must ensure designs follow the project design system and frontend constraints.

Best practices

  • Ensure docs/reference/frontend/design-system.md exists and is up to date before running the skill.
  • Provide a clear PRD or story under docs/reference/pm/ with acceptance criteria and edge cases.
  • Name the output clearly; the file will be saved as docs/reference/frontend/designs/{name}.md.
  • Review responsive notes and list breakpoints explicitly in the PRD to avoid ambiguity.
  • Include expected content/copy or mark placeholders; avoid leaving copy unspecified.

Example use cases

  • Convert a login/signup PRD into a design spec with ASCII layout, components (Input, Button, Alert) and interaction table.
  • Design a complex dashboard page: user flow, component table with props, responsive notes, and frontend prompt for implementation.
  • Create a reusable component spec (e.g., card, data table) with variants, prop types, and interaction states for library integration.
  • Produce a mobile-first checkout page spec with success state, error flows, and accessibility notes.
  • Translate a feature story into a step-by-step interaction flow plus code-ready frontend prompt referencing design tokens.

FAQ

What files does the skill read before generating a design?

It reads docs/reference/frontend/design-system.md, docs/reference/frontend/constraints.md, and the PRD/story from docs/reference/pm/.

Where is the final design saved?

Always to docs/reference/frontend/designs/{name}.md — use a clear name matching the page or component for easy discovery.