atomic-design

star 0

Stack-agnostic Atomic Design component generation. Creates well-structured Atoms, Molecules, and Organisms with design tokens, typing, tests, and quality gates. Works with React, Vue, Blade, or any stack.

BrunoSantanaDeveloper By BrunoSantanaDeveloper schedule Updated 2/24/2026

name: atomic-design description: Stack-agnostic Atomic Design component generation. Creates well-structured Atoms, Molecules, and Organisms with design tokens, typing, tests, and quality gates. Works with React, Vue, Blade, or any stack.

Atomic Design Component Builder

Philosophy: Components are the building blocks of interfaces. Structure them right once, reuse forever. Core Principle: Atomic Design is a METHODOLOGY, not a technology. Stack is an implementation detail.


๐ŸŽฏ Selective Reading Rule (MANDATORY)

File Status When to Read
classification-guide.md ๐Ÿ”ด REQUIRED Always โ€” defines Atom/Molecule/Organism
quality-checklist.md ๐Ÿ”ด REQUIRED Always โ€” the quality gate
stack-react.md โšช Stack-specific When target is React (Vite, CRA)
stack-nextjs.md โšช Stack-specific When target is Next.js (App Router)
stack-vue.md โšช Stack-specific When target is Vue/Nuxt
stack-blade.md โšช Stack-specific When target is Laravel Blade

๐Ÿ”ด Read Classification Guide + Quality Checklist ALWAYS. Then read the stack adapter that matches the project.


1. Stack Detection (ALWAYS FIRST)

Before generating any component, determine the stack:

Auto-Detection

  1. Scan project root for indicators:

    • next.config.* โ†’ Next.js (use stack-nextjs.md)
    • vite.config.* + react in package.json โ†’ React (use stack-react.md)
    • nuxt.config.* or vite.config.* + vue in package.json โ†’ Vue
    • artisan + resources/views/ โ†’ Blade
    • svelte.config.* โ†’ Svelte (use principles, no adapter yet)
    • angular.json โ†’ Angular (use principles, no adapter yet)
  2. If auto-detection fails โ†’ ASK the user

Stack Adapter Loading

Once stack is known:

  1. Read the matching references/stacks/stack-{name}.md
  2. Use its folder structure, file patterns, and templates
  3. If no adapter exists โ†’ apply universal principles from this SKILL.md

2. Component Generation Workflow

Phase 1: Discovery

Before writing ANY code:

  1. Component Name โ€” What is it called? (PascalCase for JS, kebab-case for Blade)
  2. Category โ€” Atom, Molecule, or Organism? (read classification guide if unsure)
  3. Reference โ€” Figma link, screenshot, or text description?
  4. Base Library โ€” Use a UI library base? (shadcn, Headless UI, Radix, none)
  5. Extras โ€” Storybook story? Tests?

๐Ÿ”ด Ask ONE question at a time. Wait for response before next.

Phase 2: Infrastructure Check

BEFORE generating any component code:

Check Action if Missing
Design Tokens file Create starter variables.css (see ยง Token Starter below)
Test framework Ask user: "Install Vitest/PHPUnit/Jest?"
Storybook Ask user: "Install Storybook?" (only if requested)
UI Library Install via CLI if user opted in (e.g., npx shadcn@latest init)

Phase 3: Scaffold & Implement

  1. Create folder structure per stack adapter
  2. Generate ALL required files in sequence:
    • Types/Interface file (FIRST โ€” define the contract)
    • Component implementation
    • Styles (design tokens, BEM naming)
    • Tests (minimum 80% coverage target)
    • Barrel export (index file)
    • Story file (if opted in)
  3. Run quality checklist (see references/quality-checklist.md)

3. Universal Design Principles

Atomic Classification (Summary)

Level What Examples Rule
Atom Smallest indivisible UI element Button, Input, Icon, Label, Badge Cannot be broken down further
Molecule Simple group of atoms working together SearchBar (Input+Button), FormField (Label+Input+Error) 2-3 atoms combined for one purpose
Organism Complex section composed of molecules/atoms Header, Card, Modal, Sidebar, DataTable Self-contained section of interface

๐Ÿ“– Full guide with decision tree: classification-guide.md

Design Token Usage (MANDATORY)

โŒ NEVER hardcode style values:

/* BAD */
.button { background-color: #0070f3; padding: 16px; }

โœ… ALWAYS use design tokens:

/* GOOD */
.button { background-color: var(--color-primary); padding: var(--spacing-md); }

Token Starter Template

If no token file exists, create variables.css (or equivalent):

:root {
  /* Colors */
  --color-primary: #0070f3;
  --color-secondary: #7928ca;
  --color-text: #333;
  --color-text-light: #666;
  --color-background: #fff;
  --color-border: #e1e1e1;

  /* Spacing Scale */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;

  /* Typography */
  --font-size-sm: 14px;
  --font-size-md: 16px;
  --font-size-lg: 18px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
}

Note: If the project already has a Design System (e.g., via /ds-init), use those tokens instead. Do NOT create a duplicate token file.

BEM Naming (Default Methodology)

Block:    .button
Element:  .button__icon
Modifier: .button--primary

Nesting in SCSS/CSS:
.card {
  &__header { }
  &__body { }
  &--featured { }
}

Exception: If the stack convention differs (e.g., Tailwind utility-first), follow stack adapter instructions. BEM is the fallback.

Type Safety (MANDATORY)

Every component MUST have typed props/parameters:

Stack Mechanism
React/Vue (TS) TypeScript interface with Readonly<T>
React (JS) PropTypes + JSDoc
Vue (SFC) defineProps<T>() with TypeScript
Blade PHPDoc on Component class + @props

โŒ FORBIDDEN: any, unknown as prop types, untyped parameters.

Testing (MANDATORY)

Requirement Standard
Coverage target 80% minimum
Test location Colocated with component
What to test Rendering, props, interactions, disabled states, a11y basics

Accessibility (MANDATORY)

  • Semantic HTML elements (not div for everything)
  • ARIA attributes where needed
  • Keyboard navigable
  • Sufficient color contrast (WCAG 2.1 AA)
  • Focus indicators visible

4. Restrictions & Prohibitions

โŒ Absolute Prohibitions

  • NO hardcoded style values (colors, spacing, font sizes)
  • NO untyped props/parameters (any, missing types)
  • NO monolithic files (split types, styles, tests)
  • NO business logic inside components (extract to hooks/composables/services)
  • NO static text hardcoded (extract to data/i18n files)
  • NO dangerouslySetInnerHTML or v-html without sanitization

โœ… Mandatory Requirements

  • MUST check for design tokens before creating component
  • MUST create ALL required files per stack adapter
  • MUST use design tokens for ALL style values
  • MUST type ALL props/parameters
  • MUST colocate tests with components
  • MUST use barrel exports (index file)

5. Composition with UI Libraries

When user opts to use a base UI library:

Library Check Install Command
shadcn/ui components.json exists? npx shadcn@latest init
Headless UI In package.json? npm install @headlessui/react
Radix In package.json? npm install @radix-ui/react-*

Hybrid Styling Rule

When composing with a UI library:

  • Use the library's API for behavior and base structure
  • Use BEM/token styles for custom visual overrides
  • Do NOT rebuild what the library provides

6. Decision Process Summary

For EVERY component:

1. DETECT STACK
   โ””โ”€โ”€ Auto-scan or ask user
   โ””โ”€โ”€ Load stack adapter

2. CLASSIFY
   โ””โ”€โ”€ Atom, Molecule, or Organism?
   โ””โ”€โ”€ Use classification guide if unsure

3. CHECK INFRASTRUCTURE
   โ””โ”€โ”€ Tokens exist? Tests? Storybook?
   โ””โ”€โ”€ Create/install as needed

4. GENERATE
   โ””โ”€โ”€ Types FIRST, then component, styles, tests, exports
   โ””โ”€โ”€ Use adapter templates

5. QUALITY GATE
   โ””โ”€โ”€ Run quality-checklist.md
   โ””โ”€โ”€ ALL items must pass before done

Related Skills

Skill Relationship
frontend-design Design principles (colors, typography, UX) โ€” use BEFORE atomic-design
clean-code Code quality standards โ€” always active
testing-patterns Testing strategies โ€” complements test generation
design-system-enforcement Ensures DS compliance โ€” post-generation audit
shadcn-ui shadcn/ui integration details โ€” when using shadcn base
Install via CLI
npx skills add https://github.com/BrunoSantanaDeveloper/flyeelab-agent-kit --skill atomic-design
Repository Details
star Stars 0
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator
BrunoSantanaDeveloper
BrunoSantanaDeveloper Explore all skills →