Skip to content
Back to skills

Frontend Standards

ASecurity

Component patterns, state management, styling conventions, and rendering strategies for modern frontend development.

  • 7 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added May 27, 2026
developmentreactnextjsnodeapifrontendperformance

Works with

  • cli
  • api

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add Vimalk0703/shipworthy --skill frontend-standards --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Frontend Standards?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Frontend Standards
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vimalk0703-frontend-standards/badge)](https://www.skillsdirectory.com/skills/vimalk0703-frontend-standards)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: frontend-standards
description: Component patterns, state management, styling conventions, and rendering strategies for modern frontend development.
invoke_when: Use when writing React/Next.js components, managing state, styling UI, or making frontend architecture decisions.
---

# Frontend Standards

## Component Patterns

### File Organization
- One component per file
- Co-locate styles, tests, and types with the component
- Name files after the component: `UserProfile.tsx`

### Component Rules
- Prefer function components over class components
- Keep components small — if it exceeds ~150 lines, split it
- Extract custom hooks for reusable logic
- Props interfaces defined above the component

### Server vs Client Components (Next.js App Router)
- Default to server components (no `'use client'`)
- Add `'use client'` ONLY when needed: useState, useEffect, event handlers, browser APIs
- Keep client components as leaf nodes (small, focused)
- Never make a layout or page a client component unless absolutely necessary

## State Management

### Local State
- `useState` for component-specific state
- `useReducer` for complex state logic within a component

### Shared State
- Lift state to the nearest common parent
- Use React Context for truly global state (theme, auth, locale)
- Consider Zustand or Jotai for complex client state
- Server state: use TanStack Query or SWR (not manual fetch + useState)

### Rules
- State should live as close to where it's used as possible
- Avoid prop drilling beyond 2 levels — use Context or composition
- Never store derived data in state (compute it)
- Never mutate state directly — always create new references

## Styling

- Prefer Tailwind CSS or CSS Modules — not inline styles
- Follow the project's established styling approach (check architecture.md)
- Design tokens (colors, spacing, typography) from a single source
- Responsive by default — mobile-first approach

## Data Fetching

- Server components: fetch directly (Next.js) or in loaders
- Client components: use data fetching libraries (TanStack Query, SWR)
- Show loading states for async data
- Handle error states — don't assume fetches succeed
- Implement optimistic updates for better UX on mutations

## Performance

- Use `React.memo` only when profiling shows re-render problems
- Lazy-load routes and heavy components
- Optimize images (next/image, WebP, explicit dimensions)
- Avoid unnecessary re-renders (stable references, proper deps arrays)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…