Syntic
← All skills
EngineeringFreeCommunityv1.0.0

Frontend Architect

Use when architecting React/Next.js features, optimizing performance, or reviewing frontend design patterns.

About this skill

Use when architecting React/Next.js features, optimizing performance, or reviewing frontend design patterns.

SKILL.md

frontend-architect.SKILL.md

Place it in your Syntic skills folder. For Syntic Code, install in your local skills directory, review the contents and run it in a controlled environment first.

SKILL.md
---
name: Frontend Architect
description: Use when architecting React/Next.js features, optimizing performance, or reviewing frontend design patterns.
category: Engineering
version: 1.0.0
tools: []
---

# Frontend Architecture

Build fast, accessible, maintainable interfaces across React and Next.js.

## Core Stack

- **Framework**: Next.js 14+ App Router, React 18+ Server Components
- **Styling**: Tailwind CSS with design tokens, CSS Modules for animations
- **State**: TanStack Query (server), Zustand (client)
- **Forms**: React Hook Form + Zod validation
- **Testing**: Vitest (units), Playwright (e2e), Testing Library (integration)

## Component Architecture

- Default to Server Components. Add `'use client'` only for hooks/events/browser APIs.
- Structure: page > layout > feature > UI primitive.
- Co-locate: ComponentName/index.tsx, ComponentName.test.tsx, types.ts.
- Extract UI primitives → components/ui/.
- Keep components under 150 lines.

## Performance Standards

Core Web Vitals targets: LCP < 2.5s, FID < 100ms, CLS < 0.1.
- Use `next/image` with explicit width/height (prevent layout shift).
- Lazy load below-fold: `dynamic(() => import(...), { ssr: false })`.
- `React.memo` only on expensive renders with stable primitive props.
- Prefetch likely routes: `<Link prefetch>`.
- Bundle check: no chunk > 200KB gzipped.

## Rendering Strategy

- **SSG**: Content changing < 1/hour. Use `generateStaticParams`.
- **SSR**: Personalized or fresh data needed per request.
- **ISR**: Periodic changes. Set `revalidate` based on freshness needs.
- **Client-side fetch**: Real-time only (chat, notifications, live dashboards).

## Data Fetching

- Server Components: `async/await` direct fetch. No useEffect for initial loads.
- TanStack Query for client-side data: caching, refetching, optimistic updates.
- Suspense boundaries + `loading.tsx` for loading states.
- `error.tsx` boundary files for error handling.

## Accessibility

- Keyboard accessible: Tab, Enter, Space, Escape all work.
- Semantic HTML: `<button>` (actions), `<a>` (nav), `<nav>`, `<main>`, `<aside>`.
- Icon-only buttons: add `aria-label`.
- Dynamic regions: add `aria-live="polite"`.
- Color contrast WCAG AA: 4.5:1 (normal text), 3:1 (large).
- Test with VoiceOver (macOS), NVDA (Windows).

## Styling Conventions

- Tailwind for layout/spacing/typography.
- Extract repeated classes into component variants (not @apply).
- CSS custom properties for theme values.
- Dark mode via `dark:` variant. Respect `prefers-color-scheme`.
- Avoid inline styles except calculated positions.

## State Management

- Server state (API) → TanStack Query. Client state (UI toggles) → Zustand/context.
- Never duplicate server state into client stores.
- URL state (`useSearchParams`) for filters/pagination/view modes (shareable).
- Avoid global for single-subtree data; use composition instead.

## Before Completing

- Run `tsc --noEmit` for type safety.
- Check Lighthouse scores for affected pages.
- Verify keyboard navigation end-to-end.
- Test responsive: 320px, 768px, 1024px, 1440px breakpoints.

Install

Syntic App

  1. 1Create a dedicated folder for this skill in your local skills library.
  2. 2Place SKILL.md into that folder.
  3. 3Restart Syntic and invoke this skill on matching tasks.

Syntic Code (CLI)

  1. 1Save SKILL.md in your local Syntic Code skills directory.
  2. 2Keep related files in the same skill folder.
  3. 3Run in a safe environment and validate outputs.