agentleFS
boxclawaiboxclawai/skills/frontend-developer/SKILL.md

frontend-developer

Skill9 starsChanged 9 months agoMITView on GitHub

Frontend development expert: React, Vue, Angular, Svelte, CSS/Tailwind, responsive design, accessibility (a11y), performance optimization, state management, component architecture, and browser APIs. Use when: (1) building UI components or pages, (2) implementing responsive layouts, (3) optimizing Core Web Vitals or bundle size, (4) fixing CSS/layout issues, (5) adding client-side interactivity or animations, (6) reviewing frontend code for accessibility or performance. NOT for: backend API logic, database operations, or infrastructure.

18 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ai-agents-architect, nextjs-best-practices and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • xfstudioSkill

    ai-agents-architect

    Expert in designing and building autonomous AI agents. Masters tool use, memory systems, planning strategies, and multi-agent orchestration. Use when: build agent, AI agent, autonomous agent, tool use, function calling.

    Also in 3 projects that use this

  • xenitV1Skill

    nextjs-best-practices

    Next.js App Router principles. Server Components, data fetching, routing patterns.

    Also in 3 projects that use this

  • xenitV1Skill

    tailwind-patterns

    Tailwind CSS v4 principles. CSS-first configuration, container queries, modern patterns, design token architecture.

    Also in 3 projects that use this

  • BlockSkill

    frontend-design

    Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

    Also in 3 projects that use this

The file

Files
SKILL.md

Frontend Developer

Expert guidance for building modern, accessible, performant user interfaces.

Core Competencies

1. Component Architecture

Design reusable, composable components following these principles:

Single Responsibility: One component = one purpose
Composition over Inheritance: Compose small components into larger ones
Props Down, Events Up: Unidirectional data flow
Controlled vs Uncontrolled: Know when to use each pattern

React Pattern

// Compound component pattern for flexible APIs
function Select({ children, value, onChange }) {
  return (
    <SelectContext.Provider value={{ value, onChange }}>
      <div role="listbox">{children}</div>
    </SelectContext.Provider>
  );
}
Select.Option = function Option({ value, children }) {
  const ctx = useContext(SelectContext);
  return (
    <div role="option" aria-selected={ctx.value === value}
      onClick={() => ctx.onChange(value)}>
      {children}
    </div>
  );
};

Vue Pattern

<!-- Composable + slot pattern -->
<template>
  <div class="data-table">
    <slot name="header" :columns="columns" />
    <slot name="row" v-for="row in data" :row="row" :key="row.id" />
    <slot name="empty" v-if="!data.length">No data</slot>
  </div>
</template>

2. State Management Decision Tree

Local UI state (toggle, form input) → useState / ref
Shared between siblings → lift state to parent
App-wide (auth, theme, locale) → Context / Pinia / Redux
Server data (API responses) → TanStack Query / SWR
URL state (filters, pagination) → URL search params
Complex async flows → Zustand / Redux + middleware

3. CSS & Layout Strategy

Layout system: CSS Grid (2D) + Flexbox (1D)
Spacing: Use design tokens (--space-1, --space-2, ...)
Typography: Fluid type scale with clamp()
Colors: CSS custom properties + prefers-color-scheme
Responsive: Mobile-first, breakpoint tokens
Animation: prefer-reduced-motion, GPU-composited transforms

Responsive Breakpoints

/* Mobile-first approach */
:root {
  --bp-sm: 640px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;
}

.container {
  width: 100%;
  padding-inline: var(--space-4);
}
@media (min-width: 768px) {
  .container { max-width: 720px; margin-inline: auto; }
}
@media (min-width: 1024px) {
  .container { max-width: 960px; }
}

4. Performance Checklist

MetricTargetHow to Achieve
LCP< 2.5sOptimize critical rendering path, preload hero image
FID/INP< 200msCode-split, defer non-critical JS, use startTransition
CLS< 0.1Set explicit dimensions on images/embeds, font-display: swap
Bundle Size< 200KB gzipTree-shaking, dynamic imports, analyze with bundler plugin
TTI< 3.5sLazy load below-fold, prefetch routes

Code Splitting Pattern

// Route-level splitting
const Dashboard = lazy(() => import('./pages/Dashboard'));
const Settings = lazy(() => import('./pages/Settings'));

// Component-level splitting
const HeavyChart = lazy(() => import('./components/HeavyChart'));

5. Accessibility (a11y) Standards

WCAG 2.1 AA minimum:
- Semantic HTML first (button, nav, main, article)
- ARIA only when native semantics insufficient
- Keyboard navigation: all interactive elements focusable
- Color contrast: 4.5:1 text, 3:1 large text/UI
- Focus indicators: visible, high contrast
- Screen reader: meaningful alt text, aria-labels
- Forms: label + input association, error announcements

Testing a11y

# Automated
npx axe-core/cli http://localhost:3000
npx pa11y http://localhost:3000

# In code
import { axe } from 'jest-axe';
expect(await axe(container)).toHaveNoViolations();

6. Build & Tooling

ToolUse Case
ViteDev server + build (fast HMR, ESM-native)
Turbopack/webpackLarge monorepo builds
ESLint + PrettierCode quality + formatting
StorybookComponent development + visual testing
PlaywrightE2E browser testing
Lighthouse CIPerformance regression in CI

Quick Commands

# Dev server
npm run dev                          # Start Vite dev server
npx storybook dev                    # Start Storybook

# Build & analyze
npm run build                        # Production build
npx vite-bundle-visualizer           # Bundle size analysis

# Testing
npx vitest                           # Unit tests (watch mode)
npx playwright test                  # E2E tests
npx lighthouse http://localhost:3000 --view  # Performance audit

# Code quality
npx eslint . --fix                   # Lint + autofix
npx tsc --noEmit                     # Type check only

Workflow

1. Design review → understand specs, breakpoints, interactions
2. Component tree → map UI into component hierarchy
3. Build atoms → small reusable primitives first
4. Compose pages → assemble atoms into features
5. Accessibility pass → keyboard, screen reader, contrast
6. Performance audit → Lighthouse, bundle analysis
7. Cross-browser test → Chrome, Firefox, Safari, mobile

References

  • Framework patterns: See references/framework-patterns.md
  • CSS recipes: See references/css-recipes.md

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.