Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Frontend Patterns

ASecurity

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

530 stars
0 votes
0 copies
1 views
Added 5/29/2026
ai-agentstypescriptreactnextjsnodeapifrontendperformance

Works with

cliapi

Security Analysis

A100/100

Scanned 5/29/2026

$npx -y skills add vibeeval/vibecosystem --skill frontend-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Frontend Patterns?

Add the live security badge to your README — it updates automatically with every re-scan.

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

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

Download with Pro
Files
SKILL.md
---
name: frontend-patterns
description: React, Next.js, TypeScript frontend patterns - component design, state management, performance
---

# Frontend Patterns

## Component Design

### Composition over Inheritance

```tsx
// 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

```tsx
// 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

```tsx
// 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

```typescript
// 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

1. `React.memo` sadece gercekten expensive render'larda
2. `useMemo`/`useCallback` sadece referans stability gerektiginde
3. Code splitting: `React.lazy()` + `Suspense` route bazli
4. Image optimization: `next/image`, lazy loading, WebP/AVIF
5. Virtual scroll: 100+ item listede `@tanstack/virtual`
6. Debounce: Arama input'unda 300ms debounce
7. Skeleton UI: Loading state icin layout shift onleme
8. Bundle analyze: `@next/bundle-analyzer` ile kontrol
9. 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 |

Attribution

vibeevalvibeeval
View sourceSee grades on GitHubMore from vibeeval →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

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 (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698461 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →