design-lab

0xdesign/design-plugin · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/0xdesign/design-plugin --skill design-lab
0 commentsdiscussion
summary

This skill implements a complete design exploration workflow: interview, generate variations, collect feedback, refine, preview, and finalize.

skill.md

Design Lab Skill

This skill implements a complete design exploration workflow: interview, generate variations, collect feedback, refine, preview, and finalize.

CRITICAL: Cleanup Behavior

All temporary files MUST be deleted when the process ends, whether by:

  • User confirms final design → cleanup, then generate plan
  • User aborts/cancels → cleanup immediately, no plan generated

Never leave .claude-design/ or __design_lab routes behind. If the user says "cancel", "abort", "stop", or "nevermind" at any point, confirm and then delete all temporary artifacts.


Phase 0: Preflight Detection

Before starting the interview, automatically detect:

Package Manager

Check for lock files in the project root:

  • pnpm-lock.yaml → use pnpm
  • yarn.lock → use yarn
  • package-lock.json → use npm
  • bun.lockb → use bun

Framework Detection

Check for config files:

  • next.config.js or next.config.mjs or next.config.tsNext.js
    • Check for app/ directory → App Router
    • Check for pages/ directory → Pages Router
  • vite.config.js or vite.config.tsVite
  • remix.config.jsRemix
  • nuxt.config.js or nuxt.config.tsNuxt
  • astro.config.mjsAstro

Styling System Detection

Check package.json dependencies and config files:

  • tailwind.config.js or tailwind.config.tsTailwind CSS
  • @mui/material in dependencies → Material UI
  • @chakra-ui/react in dependencies → Chakra UI
  • antd in dependencies → Ant Design
  • styled-components in dependencies → styled-components
  • @emotion/react in dependencies → Emotion
  • .css or .module.css files → CSS Modules

Design Memory Check

Look for existing Design Memory file:

  • docs/design-memory.md
  • DESIGN_MEMORY.md
  • .claude-design/design-memory.md

If found, read it and use to prefill defaults and skip redundant questions.

Visual Style Inference (CRITICAL)

DO NOT use generic/predefined styles. Extract visual language from the project:

If Tailwind detected, read tailwind.config.js or tailwind.config.ts:

// Extract and use:
theme.colors      // Color palette
theme.spacing     // Spacing scale
theme.borderRadius // Radius values
theme.fontFamily  // Typography
theme.boxShadow   // Elevation system

If CSS Variables exist, read globals.css, variables.css, or :root definitions:

:root {
  --color-*     /* Color tokens */
  --spacing-*   /* Spacing tokens */
  --font-*      /* Typography tokens */
  --radius-*    /* Border radius tokens */
}

If UI library detected (MUI, Chakra, Ant), read the theme configuration:

  • MUI: theme.ts or createTheme() call
  • Chakra: theme/index.ts or extendTheme() call
  • Ant: ConfigProvider theme prop

Always scan existing components to understand patterns:

  • Find 2-3 existing buttons → note their styling patterns
  • Find 2-3 existing cards → note padding, borders, shadows
  • Find existing forms → note input styles, label placement
  • Find existing typography → note heading sizes, body text

Store inferred styles in the Design Brief for consistent use across all variants.


Phase 1: Interview

Use the AskUserQuestion tool for all interview steps. Adapt questions based on Design Memory if it exists.

Step 1.1: Scope & Target

Ask these questions (can combine into single AskUserQuestion with multiple questions):

Question 1: Scope

  • Header: "Scope"
  • Question: "Are we designing a single component or a full page?"
  • Options:
    • "Component" - A reusable UI element (button, card, form, modal, etc.)
    • "Page" - A complete page or screen layout

Question 2: New or Redesign

  • Header: "Type"
  • Question: "Is this a new design or a redesign of something existing?"
  • Options:
    • "New" - Creating something from scratch
    • "Redesign" - Improving an existing component/page

If "Redesign" selected, ask: Question 3: Existing Path

  • Header: "Location"
  • Question: "What is the file path or route of the existing UI?"
  • Options: (let user provide via "Other")

If target is unclear, propose a name based on repo patterns and confirm.

Step 1.2: Pain Points & Inspiration

Question 1: Pain Points

  • Header: "Problems"
  • Question: "What are the top pain points with the current design (or what should this new design avoid)?"
  • Options:
    • "Too cluttered/dense" - Information overload, hard to scan
    • "Unclear hierarchy" - Primary actions aren't obvious
    • "Poor mobile experience" - Doesn't work well on small screens
    • "Outdated look" - Feels old or inconsistent with brand
  • multiSelect: true

Question 2: Visual Inspiration

  • Header: "Visual style"
  • Question: "What products or brands should I reference for visual inspiration?"
  • Options:
    • "Stripe" - Clean, minimal, trustworthy
    • "Linear" - Dense, keyboard-first, developer-focused
    • "Notion" - Flexible, content-focused, playful
    • "Apple" - Premium, spacious, refined
  • multiSelect: true

Question 3: Functional Inspiration

  • Header: "Interactions"
  • Question: "What interaction patterns should I emulate?"
  • Options:
    • "Inline editing" - Edit in place without modals
    • "Progressive disclosure" - Show more as needed
    • "Optimistic updates" - Instant feedback, sync in background
    • "Keyboard shortcuts" - Power user efficiency

Step 1.3: Brand & Style Direction

Question 1: Brand Adjectives

  • Header: "Brand tone"
  • Question: "What 3-5 adjectives describe the desired brand feel?"
  • Options:
    • "Minimal" - Clean, simple, uncluttered
    • "Premium" - High-end, polished, refined
    • "Playful" - Fun, friendly, approachable
    • "Utilitarian" - Functional, efficient, no-nonsense
  • multiSelect: true

Question 2: Density

  • Header: "Density"
  • Question: "What information density do you prefer?"
  • Options:
    • "Compact" - More information visible, tighter spacing
    • "Comfortable" - Balanced spacing, easy scanning
    • "Spacious" - Generous whitespace, focused attention

Question 3: Dark Mode

  • Header: "Dark mode"
  • Question: "Is dark mode required?"
  • Options:
    • "Yes" - Must support dark mode
    • "No" - Light mode only
    • "Nice to have" - Support if easy, not required

Step 1.4: Persona & Jobs-to-be-Done

Question 1: Primary User

  • Header: "User"
  • Question: "Who is the primary end user?"
  • Options:
    • "Developer" - Technical, keyboard-oriented
    • "Designer" - Visual, detail-oriented
    • "Business user" - Efficiency-focused, less technical
    • "End consumer" - General public, varied technical ability

Question 2: Context

  • Header: "Context"
  • Question: "What's the primary usage context?"
  • Options:
    • "Desktop-first" - Primarily used on larger screens
    • "Mobile-first" - Primarily used on phones
    • "Both equally" - Must work well on all devices

Question 3: Key Tasks

  • Header: "Key tasks"
  • Question: "What are the top 3 tasks users must complete?"
  • (Let user provide via "Other" - this is open-ended)

Step 1.5: Constraints

Question 1: Must-Keep Elements

  • Header: "Keep"
  • Question: "Are there elements that must be preserved?"
  • Options:
    • "Existing copy/labels" - Keep current text
    • "Current fields/inputs" - Keep form structure
    • "Navigation structure" - Keep current nav
    • "None" - Free to change everything

Question 2: Technical Constraints

  • Header: "Constraints"
  • Question: "Any technical constraints?"
  • Options:
    • "No new dependencies" - Use existing libraries only
    • "Use existing components" - Build on current design system
    • "Must be accessible (WCAG)" - Strict accessibility requirements
    • "None" - No special constraints
  • multiSelect: true

Phase 2: Generate Design Brief

After the interview, create a structured Design Brief as JSON and save to .claude-design/design-brief.json:

{
  "scope": "component|page",
  "isRedesign": true|false,
  "targetPath": "src/components/Example.tsx",
  "targetName": "Example",
  "painPoints": ["Too dense", "Primary action unclear"],
  "inspiration": {
    "visual": ["Stripe", "Linear"],
    "functional": ["Inline validation"]
  },
  "brand": {
    "adjectives": ["minimal", "trustworthy"],
    "density": "comfortable",
    "darkMode": true
  },
  "persona": {
    "primary": "Developer",
    "context": "desktop-first",
    "keyTasks": ["Complete checkout", "Review order", "Apply discount"]
  },
  "constraints": {
    "mustKeep": ["existing fields"],
    "technical": ["no new dependencies", "WCAG accessible"]
  },
  "framework": "nextjs-app",
  "packageManager": "pnpm",
  "stylingSystem": "tailwind"
}

Display a summary to the user before proceeding.


Phase 3: Generate Design Lab

Directory Structure

Create all files under .claude-design/:

.claude-design/
├── lab/
│   ├── page.tsx                 # Main lab page (framework-specific)
│   ├── variants/
│   │   ├── VariantA.tsx
│   │   ├── VariantB.tsx
│   │   ├── VariantC.tsx
│   │   ├── VariantD.tsx
│   │   └── VariantE.tsx
│   ├── components/
│   │   └── LabShell.tsx         # Lab layout wrapper
│   ├── feedback/                # Interactive feedback system
│   │   ├── types.ts             # TypeScript interfaces
│   │   ├── selector-utils.ts    # Element identification
│   │   ├── format-utils.ts      # Feedback formatting
│   │   ├── FeedbackOverlay.tsx  # Main overlay component
│   │   └── index.ts             # Module exports
│   └── data/
│       └── fixtures.ts          # Shared mock data
├── design-brief.json
└── run-log.md

Feedback System Setup (CRITICAL - NEVER SKIP)

The FeedbackOverlay is the PRIMARY feature of the Design Lab. Without it, users cannot provide interactive feedback. NEVER generate a Design Lab without the FeedbackOverlay.

Reliability Strategy: To avoid import path issues across different project configurations, create the FeedbackOverlay directly in the route directory (e.g., app/design-lab/FeedbackOverlay.tsx), NOT in .claude-design/. This ensures a simple relative import (./FeedbackOverlay) always works.

Required Files in Route Directory:

app/design-lab/           # or app/__design_lab/ if underscores work
├── page.tsx              # Main lab page with variants
└── FeedbackOverlay.tsx   # Self-contained overlay component (copy from templates)

Template Source: design-and-refine/templates/feedback/FeedbackOverlay.tsx

Why this approach:

  • .claude-design/ paths can fail due to bundler configurations
  • Relative imports from the same directory always work
  • The route directory gets deleted during cleanup anyway

Route Integration

Next.js App Router: Create app/__design_lab/page.tsx that imports from .claude-design/lab/

Next.js Pages Router: Create pages/__design_lab.tsx that imports from .claude-design/lab/

Vite React:

  • If React Router exists: add route to /__design_lab
  • If no router: create a conditional render in App.tsx based on ?design_lab=true query param

Other frameworks: Create the most appropriate temporary route for the detected framework.

Variant Generation Guidelines

IMPORTANT: Read DESIGN_PRINCIPLES.md for UX, interaction, and motion best practices. But DO NOT use predefined visual styles—infer them from the project.

Apply universal principles (from DESIGN_PRINCIPLES.md):

  • UX: Nielsen's heuristics, cognitive load reduction, progressive disclosure
  • Component behavior: Button states, form anatomy, card structure
  • Interaction: Feedback patterns, state handling, optimistic updates
  • Motion: Timing (150-300ms), easing (ease-out entrances, ease-in exits)
  • Accessibility: Focus states, ARIA patterns, touch targets (44px min)

Infer visual styles from the project:

  • Colors → from Tailwind config, CSS variables, or existing components
  • Typography → from existing headings, body text in the codebase
  • Spacing → from the project's spacing scale or existing patterns
  • Border radius → from existing cards, buttons, inputs
  • Shadows → from existing elevated components

Each variant MUST explore a different design axis. Do not create minor variations—make them meaningfully distinct. Use the project's existing visual language for all variants.

Variant A: Information Hierarchy Focus

  • Restructure content hierarchy (what's most important?)
  • Apply Gestalt proximity—group related items closer
  • One primary action per view
  • Use existing typography scale to create clear levels

Variant B: Layout Model Exploration

  • Try a different layout approach (card vs list vs table vs split-pane)
  • Apply card anatomy or table behavior patterns from DESIGN_PRINCIPLES
  • Consider responsive behavior at each breakpoint
  • Use the project's existing grid/layout system

Variant C: Density Variation

  • If brief says "comfortable", try a more compact version
  • If brief says "compact", try a more spacious version
  • Use the project's existing spacing tokens—just apply them differently
  • Show the tradeoffs: more visible data vs easier scanning

Variant D: Interaction Model

how to use design-lab

How to use design-lab on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add design-lab
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/0xdesign/design-plugin --skill design-lab

The skills CLI fetches design-lab from GitHub repository 0xdesign/design-plugin and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/design-lab

Reload or restart Cursor to activate design-lab. Access the skill through slash commands (e.g., /design-lab) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Installation Steps

  1. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 5.Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use When

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid When

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.641 reviews
  • Chaitanya Patil· Dec 24, 2024

    design-lab reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Anaya Huang· Dec 20, 2024

    We added design-lab from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Ama Patel· Dec 8, 2024

    design-lab reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Anaya Iyer· Nov 27, 2024

    I recommend design-lab for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Rahul Santra· Nov 23, 2024

    design-lab is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Piyush G· Nov 15, 2024

    I recommend design-lab for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Omar Martin· Nov 11, 2024

    Keeps context tight: design-lab is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Anika Singh· Nov 11, 2024

    Solid pick for teams standardizing on skills: design-lab is focused, and the summary matches what you get after install.

  • Hiroshi Diallo· Oct 18, 2024

    Useful defaults in design-lab — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Pratham Ware· Oct 14, 2024

    Keeps context tight: design-lab is the kind of skill you can hand to a new teammate without a long onboarding doc.

showing 1-10 of 41

1 / 5