agentleFS
juandelossantosjuandelossantos/another-agent-skills/skills/frontend-ui-engineering/SKILL.md

frontend-ui-engineering

Skill1 starsChanged 11 days agoMITView on GitHub

Build production-quality UIs with component architecture, state management, and layout discipline. Use across web, mobile, desktop, or PWA. Do NOT use for platform-specific implementation.

We split this skill into the rules it gives an agent

6 rules. 1 is common, 5 are distinctive, and 0 are very specific to this project.

  • 1

    Common

    Most of the 57 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No standalone artifact. UI architecture patterns and accessibility rules realized through platform-specific skills (frontend-web, …

    line 38
  2. Distinctive:

    Start with local state, lift only when needed

    line 74
  3. Distinctive:

    Use relative units (rem, %) not fixed pixels for layout

    line 93
  4. Common:

    Test at breakpoints: 375px, 768px, 1024px, 1440px

    line 94
  5. Distinctive:

    ARIA: use native HTML semantics first, ARIA only when semantics don't exist

    line 102
  6. Distinctive:

    No responsive design — a desktop-only layout that breaks on mobile.

    line 111

“Common” is measured: kept by at least 6 in 10 of the 57 edited versions of this file we could read. “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 UI Engineering

Universal UI principles that apply across web, mobile, desktop, and PWA.

This is a foundation skill referenced by platform-specific skills (frontend-web, frontend-mobile, frontend-desktop, frontend-pwa). It covers UI principles that transcend platform boundaries.

Sources: React.dev (react.dev/learn) — component composition, props patterns, conditional rendering, thinking in React hierarchy. web.dev (Google) — WCAG color contrast (4.5:1 normal, 3:1 large text), focus-visible keyboard navigation, ARIA accessibility patterns.

When to Use

  • Building any user-facing component
  • Designing component architecture or state management
  • Implementing layouts, navigation, or responsive patterns
  • Referenced automatically by platform skills

When NOT to Use

  • Platform-specific work (use the dedicated platform skill)
  • API or backend work (use backend-api-mastery)

Output Contract

No standalone artifact. UI architecture patterns and accessibility rules realized through platform-specific skills (frontend-web, frontend-mobile, frontend-desktop, frontend-pwa).

Relationship to Platform Skills

frontend-ui-engineering (this skill — universal UI principles)
├── frontend-web (web-specific)
├── frontend-mobile (native mobile)
├── frontend-desktop (desktop)
└── frontend-pwa (progressive web)

Component Architecture

Components are the building blocks of every UI. Design them with clear contracts (props interface), composition over inheritance (children, slots), and single responsibility.

Key patterns:

  • Composition — nest components via children or slot props. Avoid deep prop drilling.
  • Props interface — every component has a typed props contract. Required props are explicit, optional props have sensible defaults.
  • Container vs presentational — separate data fetching (container) from rendering (presentational). Presentational components are reusable across projects.
  • Conditional rendering — show/hide UI based on state. Use ternary expressions for binary states, early returns for guard clauses.

See guides/COMPONENT-ARCHITECTURE.md for detailed patterns and examples.

State Management

State is data that changes over time. Choose the right scope for each piece of state:

ScopeWhen to UseExample
Local (component)Only this component needs itForm input value
Lifted (parent)Parent and children share itSelected item in a list
Context (subtree)Deep descendants need itTheme, user preferences
External storeMany unrelated components need itCached API data

Rules:

  • Start with local state, lift only when needed
  • Context is not a state management solution — it avoids prop drilling, but doesn't manage mutations
  • External stores (Redux, Zustand, Jotai) are for global state, not for everything

See guides/STATE-MANAGEMENT.md for migration patterns between state scopes.

Layout Discipline

Layout is the structure that holds components. Use the right tool for the job:

PatternPurposeWhen
Grid2D layout (rows + columns)Page-level structure
Flexbox1D layout (row OR column)Component-level alignment
Spacing tokensConsistent gaps between elementsEvery layout
Responsive breakpointsAdapt layout to viewportMobile, tablet, desktop

Responsive rules:

  • Design mobile-first (smallest screen first)
  • Use relative units (rem, %) not fixed pixels for layout
  • Test at breakpoints: 375px, 768px, 1024px, 1440px

Accessibility

Accessibility is not optional. Every UI must meet WCAG AA as a minimum:

  • Color contrast: 4.5:1 for normal text, 3:1 for large text (≥18pt/24px)
  • Focus indicators: visible on keyboard navigation (:focus-visible), never removed
  • ARIA: use native HTML semantics first, ARIA only when semantics don't exist
  • Tab order: follows visual order, no unexpected jumps
  • Reduced motion: respect prefers-reduced-motion, provide static alternatives

Anti-Patterns

  1. Prop drilling — passing data through 5+ component layers without context or composition.
  2. God component — a single component that handles data fetching, state, layout, and rendering.
  3. Over-engineering state — Redux for a toggle button.
  4. No responsive design — a desktop-only layout that breaks on mobile.
  5. Removing focus outlines — outline: none without providing an alternative.
  6. Inline styles instead of design tokens — hardcoded colors and spacing everywhere.

Verification

  • Component props have clear interfaces (typed, documented)
  • State scope chosen correctly (local → lifted → context → external)
  • Layout uses appropriate pattern (grid, flexbox, spacing tokens)
  • Responsive breakpoints tested at 375px, 768px, 1024px
  • Color contrast meets WCAG AA (4.5:1 normal, 3:1 large)
  • Focus indicators visible on keyboard navigation
  • prefers-reduced-motion respected for animations

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.

Reviews can't be read right now.

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.