🎯

frontend-development

🎯Skill

from carvalab/k-skills

VibeIndex|
What it does

Develops Next.js applications using TypeScript, Server Components, and Server Actions, optimizing for performance and minimal client-side JavaScript.

πŸ“¦

Part of

carvalab/k-skills(9 items)

frontend-development

Installation

πŸ“‹ No install commands found in docs. Showing default command. Check GitHub for actual instructions.
Quick InstallInstall with npx
npx skills add carvalab/k-skills --skill frontend-development
5Installs
-
AddedFeb 4, 2026

Skill Details

SKILL.md

Next.js App Router development with TypeScript. Server Components, Server Actions, caching, MUI. Use when creating pages, components, fetching data, or building features.

Overview

# Frontend Development

Next.js (latest) App Router with TypeScript. Server-first architecture.

> Related Skills:

>

> - kavak-documentation - USE FIRST for Kavak-specific patterns, GitLab CI, Docker templates

> - vercel-react-best-practices - USE THIS for performance (bundle size, waterfalls, caching, re-renders, memoization)

> - Check .claude/CLAUDE.md for project-specific conventions

> - Check .cursor/rules/* for project-specific conventions

>

> MCP:

>

> - Use kavak-platform/plati_query tool to query Kavak internal documentation before implementing

> - Use next-devtools MCP server if available for debugging, route inspection, and build analysis

Quick Start

| Task | Pattern |

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

| New page | Server Component by default |

| Data fetching | Server Component async fetch |

| Mutations | Server Actions + Zod + revalidatePath |

| Styling | MUI sx prop, inline if <100 lines |

| State | Server = fetch, Client = useState only when needed |

Core Principles

  1. Server by Default: Components are Server Components unless they need useState/useEffect/events
  2. Server Actions for Mutations: Replace API routes for internal app logic
  3. Opt-in Caching: Use 'use cache' directive for explicit caching
  4. Minimal Client JS: Keep 'use client' components small and leaf-level
  5. Type Everything: Strict TypeScript, Zod for runtime validation

> Performance: For bundle optimization, waterfalls, memoization, see vercel-react-best-practices

Server vs Client Decision

```

Need useState/useEffect/onClick? β†’ 'use client'

Need browser APIs (localStorage)? β†’ 'use client'

Just rendering data? β†’ Server Component (default)

```

Rule: Keep Client Components small. Most of tree stays server-rendered.

Data Fetching Pattern

```typescript

// app/users/page.tsx - Server Component (default)

export default async function UsersPage() {

const users = await db.user.findMany(); // Runs on server

return ;

}

```

No TanStack Query needed - Server Components handle data fetching natively.

Server Actions Pattern

```typescript

// app/actions.ts

'use server';

import { z } from 'zod';

import { revalidatePath } from 'next/cache';

const schema = z.object({ title: z.string().min(1) });

export async function createPost(formData: FormData) {

const parsed = schema.safeParse({ title: formData.get('title') });

if (!parsed.success) return { error: parsed.error.flatten() };

await db.post.create({ data: parsed.data });

revalidatePath('/posts');

return { success: true };

}

```

When to use Server Actions vs API Routes:

  • Server Actions β†’ Internal mutations, form submissions
  • Route Handlers β†’ Public APIs, webhooks, large uploads, streaming

Critical Rules

Never

```typescript

// ❌ Large 'use client' at top of tree

'use client'; // Marks entire subtree as client

// ❌ Expose secrets to client

const apiKey = process.env.SECRET_KEY; // In client component

// ❌ Old MUI Grid syntax

```

Always

```typescript

// βœ… Small leaf-level client components

// βœ… Validate Server Action inputs with Zod

// βœ… MUI Grid size prop

```

File Conventions

```

app/

β”œβ”€β”€ layout.tsx # Root layout (Server)

β”œβ”€β”€ page.tsx # Home page

β”œβ”€β”€ loading.tsx # Loading UI (Suspense fallback)

β”œβ”€β”€ error.tsx # Error boundary ('use client')

β”œβ”€β”€ not-found.tsx # 404 page

β”œβ”€β”€ users/

β”‚ β”œβ”€β”€ page.tsx # /users

β”‚ β”œβ”€β”€ [id]/

β”‚ β”‚ └── page.tsx # /users/:id

β”‚ └── actions.ts # Server Actions

└── api/

└── webhook/

└── route.ts # Route Handler (public API)

```

Common Workflows

New Feature

  1. Create app/{route}/page.tsx (Server Component)
  2. Add loading.tsx for Suspense boundary
  3. Create Server Actions in actions.ts
  4. Add Client Components only where needed

Performance Issue

β†’ Run vercel-react-best-practices skill for optimization rules

Styling Component

  1. Use MUI sx prop with SxProps
  2. Inline styles if <100 lines, separate .styles.ts if >100
  3. Grid: size={{ xs: 12, md: 6 }}

References

| Reference | When to Use |

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

| references/nextjs.md | App Router, RSC, Server Actions, caching |

| references/component-patterns.md | React.FC, hooks order, dialogs, forms |

| references/styling.md | MUI sx prop, Grid, theming |

| references/typescript.md | Types, generics, Zod validation |

| references/project-structure.md | features/ vs components/, organization |

Performance/Optimization β†’ vercel-react-best-practices skill

Technology Stack

| Layer | Technology |

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

| Framework | Next.js (App Router, latest) |

| Type Safety | TypeScript (strict) + Zod |

| Data Fetching | Server Components (async) |

| Mutations | Server Actions + revalidatePath |

| Client State | useState (minimal) |

| Styling | MUI (latest) |

| Forms | Server Actions + useActionState |

Note: TanStack Query only if you need real-time polling or complex optimistic updates. See references/data-fetching.md.