--- name: atomic-design argument-hint: "Describe the component hierarchy or reuse/composition problem (atom/molecule/organism/template/page)" description: > Methodology and best practices for organising UI components using the Atomic Design system (atoms, molecules, organisms, templates, pages). Use this skill when the request is about component hierarchy decisions, reuse-first decomposition, design-system structure, or choosing the right atomic level for a UI change. For Drupal, apply Atomic Design through the component system already used by the project. Trigger phrases: "atomic design", "atoms", "molecules", "organisms", "templates", "pages", "component hierarchy", "design system structure", "component library", "Brad Frost", "component composition", "ui architecture", "create component", "new component", "add component", "implement design", "figma", "frontend component", "sdc", "twig component", "paragraph type", "drupal frontend". --- # Atomic Design Workflow Before substantial project work, load `docs/AGENT_PROJECT.md` and `docs/agent-project.json`; use them to identify the actual theme, component system, paths, and commands. Do not assume SDC is installed or preferred. # Atomic Design Brad Frost's methodology that decomposes UIs into five hierarchical levels for consistent, reusable component libraries. In this codebase, apply these principles to Drupal SDC components under `web/themes/custom/[theme_name]/components/`. For detailed SDC metadata and Twig-runtime constraints, pair this skill with `drupal-sdc-components` and `drupal-sdc-styleguide-safe`. ## Do Not Use When - The task is a small in-place style or copy edit that does not involve component decomposition or hierarchy decisions. - The request is purely operational (build/deploy/config import) with no UI architecture concern. - A narrower domain skill should lead (for example `drupal-search-ui-ajax` for Select2 AJAX regressions). --- ## ⚠️ Reuse First — Always Before creating any component, scan the existing codebase for a matching one: 1. Search `atoms/`, `molecules/`, `organisms/` for a component that already does the job (exact match or close enough to extend). 2. If one exists, **use or extend it** — do not duplicate it. 3. If a similar one exists but needs a new variant, **add the variant** to the existing component via an input/prop. 4. Only create a new component when nothing suitable exists. This applies at every level. A new organism that needs a button must use the existing `Button` atom, not inline a `