mcpbeat Sign in

Frontend Patterns Agent Skill

React, Next.js, TypeScript frontend patterns - component design, state management, performance

1k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
521
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/vibeeval/vibecosystem --skill frontend-patterns

The instruction itself

11 sections, as written by the author

Frontend Patterns

Component Design

Composition over Inheritance

// DOGRU: Composition
function Card({ children, header }: { children: ReactNode; header: ReactNode }) {
  return (
    <div className="card">
      <div className="card-header">{header}</div>
      <div className="card-body">{children}</div>
    </div>
  );
}

// Kullanim
<Card header={<h2>Title</h2>}>
  <p>Content here</p>
</Card>

Container/Presenter Pattern

// Container: Data fetching + logic
function UserListContainer() {
  const { data, isLoading } = useQuery(['users'], fetchUsers);
  if (isLoading) return <Skeleton />;
  return <UserList users={data} />;
}

// Presenter: Pure rendering
function UserList({ users }: { users: User[] }) {
  return (
    <ul>
      {users.map(u => <UserItem key={u.id} user={u} />)}
    </ul>
  );
}

State Management

| Cozum | Ne Zaman | Karmasiklik |

|-------|----------|-------------|

| useState | Local component state | Dusuk |

| useReducer | Complex local state | Orta |

| Context | Theme, auth, locale | Dusuk-Orta |

| Zustand | Global client state | Orta |

| React Query | Server state | Orta |

| URL params | Navigation state | Dusuk |

Performance

// React.memo: Expensive render onleme
const ExpensiveList = React.memo(({ items }: { items: Item[] }) => (
  <ul>{items.map(i => <ListItem key={i.id} item={i} />)}</ul>
));

// useMemo: Expensive hesaplama cache
const filtered = useMemo(
  () => items.filter(i => i.status === status),
  [items, status]
);

// useCallback: Referans stabilitesi
const handleClick = useCallback((id: string) => {
  setSelected(id);
}, []);

Next.js Patterns

| Feature | Ne Zaman |

|---------|----------|

| Server Component | Data fetch, no interactivity |

| Client Component | onClick, useState, useEffect |

| Route Handler | API endpoint |

| Middleware | Auth, redirect, rewrite |

| Streaming | Buyuk data, progressive rendering |

shadcn/ui Best Practices

// Theme config: globals.css'te CSS variable kullan
// shadcn/ui dark mode: class strategy (Tailwind darkMode: 'class')

// Component override: cn() ile extend et, fork etme
import { Button } from '@/components/ui/button'
<Button variant="outline" className={cn('custom-class', className)} />

// Compose, override etme:
function SubmitButton({ children, ...props }: ButtonProps) {
  return <Button type="submit" variant="default" {...props}>{children}</Button>
}

// A11y: shadcn radix tabanli, otomatik ARIA ama kontrol et
// Dark mode: CSS variable'lar otomatik switch eder

Performance Budget

| Metrik | Esik | Olcum |

|--------|------|-------|

| LCP (Largest Contentful Paint) | < 2.5s | Core Web Vital |

| CLS (Cumulative Layout Shift) | < 0.1 | Core Web Vital |

| INP (Interaction to Next Paint) | < 200ms | Core Web Vital |

| FCP (First Contentful Paint) | < 1.8s | Lighthouse |

| TTI (Time to Interactive) | < 3.8s | Lighthouse |

| Total JS bundle | < 200KB gzipped | Build analiz |

React Performance Top 10

  • React.memo sadece gercekten expensive render'larda
  • useMemo/useCallback sadece referans stability gerektiginde
  • Code splitting: React.lazy() + Suspense route bazli
  • Image optimization: next/image, lazy loading, WebP/AVIF
  • Virtual scroll: 100+ item listede @tanstack/virtual
  • Debounce: Arama input'unda 300ms debounce
  • Skeleton UI: Loading state icin layout shift onleme
  • Bundle analyze: @next/bundle-analyzer ile kontrol
  • Prefetch: <Link prefetch> kritik navigation'larda

10. Server Component: Default RSC, client sadece interactive icin

Anti-Patterns

| Anti-Pattern | Dogru Yol |

|-------------|-----------|

| Prop drilling (5+ level) | Context veya state library |

| useEffect for derived state | useMemo kullan |

| Index as key | Unique ID kullan |

| Premature optimization | Profiler ile olc, sonra optimize et |

Other skills for the same job

different authors, same section of the catalogue
MCP Builder
by anthropics
vendor ×13

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

30k tokens scripts
Changelog Generator
by frostant
×9

Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.

774 tokens
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
MCP Builder
by JayZeeDesign
×7

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

37k tokens scripts
Vercel React Native Skills
by vercel-labs
vendor ×6

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

39k tokens
Vercel React Best Practices
by ratacat
×5

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

34k tokens
Next Best Practices
by vercel-labs
vendor ×4

Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

20k tokens
Using Git Worktrees
by ZhanlinCui
×4

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification

1k tokens

How to use it

Copy the folder

Take vibeeval/frontend-patterns from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.