npx skills add ...
npx skills add alirezarezvani/claude-skills --skill senior-frontend
Frontend development skill for React, Next.js, TypeScript, and Tailwind CSS applications. Use when building React components, optimizing Next.js performance, analyzing bundle sizes, scaffolding frontend projects, implementing accessibility, or reviewing frontend code quality.
npx skills add alirezarezvani/claude-skills --skill senior-frontend
Frontend development patterns, performance optimization, and automation tools for React/Next.js applications.
Generate a new Next.js or React project with TypeScript, Tailwind CSS, and best practice configurations.
Run the scaffolder with your project name and template:
Add optional features (auth, api, forms, testing, storybook):
Navigate to the project and install dependencies:
Start the development server:
| Option | Description |
|---|---|
--template nextjs | Next.js 14+ with App Router and Server Components |
--template react | React + Vite with TypeScript |
--features auth | Add NextAuth.js authentication |
--features api | Add React Query + API client |
--features forms | Add React Hook Form + Zod validation |
--features testing | Add Vitest + Testing Library |
--dry-run | Preview files without creating them |
Generate React components with TypeScript, tests, and Storybook stories.
Generate a client component:
Generate a server component:
Generate with test and story files:
Generate a custom hook:
| Option | Description |
|---|---|
--type client | Client component with 'use client' (default) |
--type server | Async server component |
--type hook | Custom React hook |
--with-test | Include test file |
--with-story | Include Storybook story |
--flat | Create in output dir without subdirectory |
--dry-run | Preview without creating files |
Analyze package.json and project structure for bundle optimization opportunities.
Run the analyzer on your project:
Review the health score and issues:
Apply the recommended fixes by replacing heavy dependencies.
Re-run with verbose mode to check import patterns:
| Score | Grade | Action |
|---|---|---|
| 90-100 | A | Bundle is well-optimized |
| 80-89 | B | Minor optimizations available |
| 70-79 | C | Replace heavy dependencies |
| 60-69 | D | Multiple issues need attention |
| 0-59 | F | Critical bundle size problems |
The analyzer identifies these common heavy packages:
| Package | Size | Alternative |
|---|---|---|
| moment | 290KB | date-fns (12KB) or dayjs (2KB) |
| lodash | 71KB | lodash-es with tree-shaking |
| axios | 14KB | Native fetch or ky (3KB) |
| jquery | 87KB | Native DOM APIs |
| @mui/material | Large | shadcn/ui or Radix UI |
Reference: references/react_patterns.md
Share state between related components:
Extract reusable logic:
Share rendering logic:
Reference: references/nextjs_optimization_guide.md
Use Server Components by default. Add 'use client' only when you need:
Reference: references/frontend_best_practices.md
<button>, <nav>, <main>)references/react_patterns.mdreferences/nextjs_optimization_guide.mdreferences/frontend_best_practices.mdreferences/forcing_questions.mdreferences/composition_map.mdBefore this skill scaffolds a component, recommends a framework, or audits a bundle, the following four assumptions MUST be surfaced.
Verifiable success criteria (Karpathy #4) — every recommendation must include:
If any of those three is not stated, the recommendation is incomplete — return to Q2 of the forcing-question library.
The scripts/frontend_decision_engine.py tool encodes these checks: it refuses to recommend a profile without the four assumption inputs and prints the verifiable thresholds for the matched profile.
Four built-in profiles in profiles/ calibrate every recommendation:
| Profile | When to pick | LCP target (mobile-4G p75) | Bundle budget |
|---|---|---|---|
next-app-router | SaaS customer-facing, SEO + dynamic, RSC-first | 2000ms | 150 KB-gzip / route |
remix-or-sveltekit | Mobile-4G primary, low-JS-first, progressive enhancement | 1500ms | 80 KB-gzip / route |
vite-spa | Auth-walled app, desktop/corporate primary | 2500ms | 200 KB init + 80 KB / route |
astro-or-static | Marketing / docs / blog, near-zero write, SEO-critical | 1200ms | 30 KB JS / page |
Pick a profile via:
The tool returns the best-fit profile, the runner-up tradeoff (if within 15%), the stack picks, the anti-patterns to avoid on that profile, and the required CI gates.
To add a custom profile (e.g., your org's internal-tool defaults): copy profiles/vite-spa.json to profiles/<your-org>.json and adjust constraints + success_thresholds.
This skill does NOT reimplement scope owned by the POWERFUL-tier specialists. It forks into them. See references/composition_map.md for the full routing table. Key forks:
| Concern | Fork into |
|---|---|
| WCAG audit, contrast, screen-reader | engineering-team/skills/a11y-audit/ |
| Bundle profiling + runtime perf | engineering/skills/performance-profiler/ |
| Cinematic / scroll-storytelling landing | engineering-team/skills/epic-design/ |
| Apple HIG (iOS / macOS / visionOS) | product-team/skills/apple-hig-expert/ |
| Pre-commit Karpathy review | engineering/karpathy-coder/ |
| Pre-flight architecture grill | engineering/grill-me/ |
The cs-frontend-engineer agent orchestrates these forks via context: fork. Invoke it from another agent with Agent({subagent_type: "cs-frontend-engineer", prompt: "..."}) or via /cs:frontend-review <your problem>.
Before locking any framework or rendering decision, walk the seven forcing questions in references/forcing_questions.md. Discipline:
/tmp/frontend-grill-<date>.md.frontend_decision_engine.py with the seven answers.Summary:
Three surfaces:
/cs:frontend-review <prompt> — full grill + decision engine + composition routing.Agent({subagent_type: "cs-frontend-engineer", prompt: "..."}) — forks context, returns ≤ 200-word digest.python scripts/frontend_decision_engine.py ... — deterministic profile match when inputs are known.See agents/engineering/cs-frontend-engineer.md for the full invocation contract.