agentleFS
Gzyms69Gzyms69/agent-setup-bundle/skills/skill-frontend-architect/SKILL.md

skill-frontend-architect

Skill0 starsChanged 3 months agoMITView on GitHub

Master Frontend Architecture, Next.js 15+ App Router, React Server Components (RSC), Client Island Boundaries, State Orchestration (Zustand, React Query), WCAG 2.1/2.2 AA Accessibility, and Clean Component Systems. Use when designing application structure, managing server/client boundaries, structuring modular components, orchestrating complex state, or enforcing strict accessibility gates.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Material UI (MUI): Use sx prop for one-off styles, styled() for reusable components.

    line 58
  2. Very specific:

    Server Component Primacy: Keep high-traffic routes (page.tsx, layout.tsx) as Server Components to stream data with zero client-side …

    line 67
  3. Very specific:

    Isolate Client State: Never add "use client" at the top of a page layout.

    line 68
  4. Distinctive:

    Every component must satisfy these non-negotiable accessibility criteria before deployment:

    line 96
  5. Very specific:

    Keyboard Accessibility: Every interactive element must be focusable via Tab and triggerable via Enter or Space.

    line 97
  6. Distinctive:

    Focus Trapping: When a modal, drawer, or dialog is open, trap keyboard focus within the modal window.

    line 100
  7. Distinctive:

    Before completing a frontend architecture task, verify:

    line 107

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Frontend Architect Skill

This skill provides expert architectural guidance for structuring production-grade React and Next.js applications, defining clean client/server module boundaries, orchestrating local and global state, enforcing WCAG 2.1/2.2 AA accessibility standards, and achieving elite Web Vitals.

[!NOTE]

  • For Art Direction, Visual Philosophy, Aesthetics, Fontjoy Typography, and Color Theory, activate skill-creative-design.
  • For Motion Animations (motion.dev), CSS Subgrid, Container Queries, and 21st.dev Components (BKLit, Kokonut, Origin, Cult, Animata), activate skill-design-engineering.

1. Framework & Application Architecture

Select the simplest architecture that satisfies project constraints and SEO requirements:

Goal / ContextRecommended ArchitecturePrimary Rationale & Constraints
Public Web App / SEO-drivenNext.js 15+ (App Router)Hybrid SSR/SSG, React Server Components (RSC), streaming hydration, dynamic routing, and search engine discoverability.
Internal Dashboard / Heavy SPAVite + React (or TanStack Router)Zero server overhead, rapid HMR development cycles, rich client-side data state, and no SSR hydration pitfalls.
Content-First / MarketingAstroIslands architecture, zero client-side JavaScript baseline, markdown/MDX native rendering, and instant LCP.
Cross-Platform MobileReact Native / FlutterNative compilation, shared mobile business logic, and native hardware access.

2. UI Ecosystem & Component Library Decision Matrix

Adhere to the architectural paradigm of the chosen UI library. For the complete catalog, doc links, and install commands of all 30 ecosystem tools, see references/ui-ecosystem-matrix.md.

                      ┌─────────────────────────────────────────┐
                      │        UI Stack Selection Tree          │
                      └────────────────────┬────────────────────┘
                                           │
         ┌─────────────────────────────────┼─────────────────────────────────┐
         │                                 │                                 │
         ▼                                 ▼                                 ▼
┌──────────────────┐             ┌──────────────────┐             ┌──────────────────┐
│ Modern Standard  │             │ Enterprise Data  │             │ Creative Motion  │
│ Tailwind+shadcn  │             │ AntD v5 / Mantine│             │ Motion / 21st.dev│
└──────────────────┘             └──────────────────┘             └──────────────────┘

Strategic AI Execution Rules by Paradigm:

  • Modern Standard (Tailwind CSS + Radix UI + shadcn/ui):
    • shadcn/ui is code injection, not an npm dependency. Never import directly from shadcn/ui. Place components in @/components/ui/ and leverage the CLI (npx shadcn@latest add <component>).
    • Combine with headless Radix primitives to guarantee uncompromised WCAG 2.1/2.2 AA accessibility.
  • Enterprise & Data-Dense (Ant Design v5, BlueprintJS, PrimeReact):
    • Ant Design v5: Strictly use <ConfigProvider theme={{ ... }}> design tokens. Avoid ad-hoc CSS overrides.
    • BlueprintJS: Desktop-first analytics. Do not use for mobile-first consumer apps.
    • PrimeReact / TanStack Table: Ideal for virtualization, tree-grids, complex multi-column sorting, and cell editing.
  • Component Suites & Ecosystems (Mantine v7, HeroUI, MUI, Chakra v3):
    • Mantine v7: Leverage Mantine hooks (useDisclosure, useForm) alongside components; adhere strictly to CSS Modules / PostCSS.
    • HeroUI (d. NextUI): Require HeroUIProvider at root; utilize Tailwind-based theme tokens.
    • Material UI (MUI): Use sx prop for one-off styles, styled() for reusable components. Specify Material Design 2 or 3.
  • Creative Flair & Motion (Motion, Kokonut UI, BKLit UI, Origin UI, Cult UI, 21st.dev):
    • Delegate to skill-design-engineering for code recipes, Subgrid layout math, and 120fps motion physics.

3. Server Components (RSC) & Client Island Boundaries

In Next.js 15+ App Router, enforce strict boundary discipline:

  • Server Component Primacy: Keep high-traffic routes (page.tsx, layout.tsx) as Server Components to stream data with zero client-side JavaScript.
  • Isolate Client State: Never add "use client" at the top of a page layout. Isolate interactive and animated elements into leaf-node client components:
    // Good: Small interactive leaf island
    // app/components/ThemeToggle.tsx
    "use client";
    import { useState } from "react";
    export function ThemeToggle() { ... }
  • Hydration Isolation: Wrap dynamic Vanilla JS or Canvas elements in suppressHydrationWarning to prevent React from resetting listeners during hydration.

4. 6-Level State Selection Matrix

Choose the simplest state scope that satisfies requirements. Avoid prop-drilling deeper than 3 levels:

1. Local state (useState, useReducer)  → Component-specific UI state (e.g. dropdown open, form input)
2. Lifted state                       → Shared between 2-3 immediate sibling components
3. URL state (searchParams)           → Filters, search query, pagination, shareable view state
4. Context API                        → Read-heavy, write-rare configurations (e.g. theme, locale, auth user)
5. Server state (TanStack Query, SWR) → Remote data fetching, caching, deduplication, optimistic mutations
6. Global store (Zustand)             → Complex client-side state shared app-wide (e.g. audio player, canvas editor)

5. WCAG 2.1 / 2.2 AA Accessibility (QA Gate)

Every component must satisfy these non-negotiable accessibility criteria before deployment:

  • Keyboard Accessibility: Every interactive element must be focusable via Tab and triggerable via Enter or Space. Never attach click handlers to static div tags without role="button", tabIndex={0}, and onKeyDown.
  • Touch Target Size: Interactive targets must meet minimum physical size criteria (minimum 24x24px, recommended 44x44px bounding area).
  • ARIA Labelling: Provide descriptive labels for icon buttons (e.g. <button aria-label="Close dialog"><XIcon /></button>) and link input elements to <label htmlFor="..."> tags.
  • Focus Trapping: When a modal, drawer, or dialog is open, trap keyboard focus within the modal window. Return focus to the trigger element upon dismissal.
  • Reduced Motion: Respect user preferences via useReducedMotion() from motion/react or CSS @media (prefers-reduced-motion: reduce).

6. Verification Checklist

Before completing a frontend architecture task, verify:

  • SSOT Audit: Codebase audited for existing components, hooks, and endpoints (no duplicate implementations).
  • Type & Build Check: Component compiles without TypeScript errors (npx tsc --noEmit) and produces no runtime console warnings.
  • Boundary Check: "use client" restricted to interactive leaf nodes; page roots remain Server Components where applicable.
  • Accessibility Gate: Full keyboard navigation (Tab, Enter, Space, Esc) and WCAG 2.1/2.2 AA contrast verified.
  • Responsive Check: Free from horizontal overflow across mobile (320px), tablet (768px), and desktop (1440px) viewports.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.