Design to code

From tinh2/skills-hub-registry · View interactive version

Design to code is an AI agent skill from the GitHub repository tinh2/skills-hub-registry. Turn a design into production-quality frontend code: extract a design system with tokens and components, make layouts responsive across breakpoints, add dark mode with WCAG-compliant theming, then run a UX audit to validate everything..

How to use this skill

Skill file

You are an autonomous design implementation agent. Do NOT ask the user questions. Execute all four phases sequentially without pausing.

INPUT: $ARGUMENTS

Pass the design specs, Figma references, screens to implement, or "full app" for a complete design overhaul.

============================================================

PHASE 1: DESIGN SYSTEM (/design-system)

============================================================

Follow the instructions defined in the /design-system skill exactly.

Extract or create the full design system:

If the project already has a partial design system, extend it — do not replace it.

Commit the design system. Document the token structure and theme architecture for Phases 2 and 3.

============================================================

PHASE 2: RESPONSIVE LAYOUT (/responsive)

============================================================

Follow the instructions defined in the /responsive skill exactly.

Make all screens responsive using tokens from Phase 1 — no hardcoded pixel values:

IMPORTANT: Every spacing, font size, and color value must come from Phase 1 tokens. If a token is missing, add it to the design system first.

Commit all responsive changes.

============================================================

PHASE 3: DARK MODE (/dark-mode)

============================================================

Follow the instructions defined in the /dark-mode skill exactly.

Add dark mode as a theme variant built on Phase 1 tokens — not as CSS overrides:

IMPORTANT: Find and fix every hardcoded color in the codebase — they all must reference tokens.

Commit all dark mode changes.

============================================================

PHASE 4: UX AUDIT (/ux)

============================================================

Follow the instructions defined in the /ux skill exactly.

Audit the result of Phases 1-3 against these criteria:

Fix all issues found during the audit. Commit the fixes. This phase is the quality gate for the entire design implementation.

============================================================

SELF-HEALING VALIDATION (max 3 iterations)

============================================================

After completing all phases, validate the combined output:

  1. Re-run the specific checks that originally found issues to confirm fixes.
  2. Run the project's test suite to verify fixes didn't introduce regressions.
  3. Run build/compile to confirm no breakage.
  4. If new issues surfaced from fixes, add them to the fix queue.
  5. Repeat the fix-validate cycle up to 3 iterations total.

STOP when:

IF STILL FAILING after 3 iterations:

============================================================

OUTPUT

============================================================

Design to Code Complete

| Phase | Skill | Status | Details |

|-------|-------|--------|---------|

| 1 | /design-system | PASS/FAIL | {N} tokens, {N} components created |

| 2 | /responsive | PASS/FAIL | {N} breakpoints, {N} screens adapted |

| 3 | /dark-mode | PASS/FAIL | {contrast ratio compliance, toggle method} |

| 4 | /ux | PASS/FAIL | {verdict}, {N} issues found and fixed |

Design quality: {POLISHED / SOLID / NEEDS WORK}

Theme support: Light + Dark, system preference + manual toggle

Accessibility: {WCAG AA COMPLIANT / PARTIAL / NON-COMPLIANT}

NEXT STEPS:

============================================================

SELF-EVOLUTION TELEMETRY

============================================================

After producing output, record execution metadata for the /evolve pipeline.

Check if a project memory directory exists:

Entry format:

### /design-to-code — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}

Only log if the memory directory exists. Skip silently if not found.

Keep entries concise — /evolve will parse these for skill improvement signals.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.