convez.ai
SkillDesenvolvimento WebIntermediário
4thel00z

Frontend Skills

4thel00z/frontend-skills

React, Next.js e Tailwind otimizados para performance e mudanças baratas

Ver no GitHub
InicialPluginScore · de 0 a 100

Skill Claude especializado em construir aplicações React, Next.js e Tailwind com foco em performance e manutenibilidade. Inclui diagrama de decisão para arquitetura de componentes, catálogo de padrões UI, regras de cache e 70+ boas práticas indexadas por impacto.

Instalação

$npx convez-ai 4thel00z/frontend-skills

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
1
Forks
0
Acompanhando
0
Saúde
28%
Último commit
há 6 meses
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Arquitetar componentes server vs. client em Next.js com decisões corretas
  • Implementar estratégias de cache granulares com 'use cache' e cacheLife
  • Construir UI patterns padrão (forms, tabelas, modais) com acessibilidade
  • Evitar erros comuns em 70+ cenários documentados antes/depois
  • Design com Tailwind seguindo temas semânticos e dark mode

Veredito

Skill bem estruturado com decision trees práticas e catálogos de padrões testados. Reduz erros arquiteturais comuns em Next.js/React ao oferecer regras claras de quando usar Server Components, Client Components e Server Actions — diferencial real para quem constrói aplicações de verdade.

README

A tradução para o português deste README ainda está na fila.


A Claude Code skill for building production React, Next.js, and Tailwind apps the way the platforms want to be built. A decision-tree an agent can actually apply: where code runs, what to cache, what crosses the boundary — plus 70+ rules indexed by impact for when you need to go deep.

Features

  • Where-does-this-run flowchart — One diagram resolves Server Component vs. Client Component vs. Server Action vs. Route Handler, so the agent doesn't 'use client' to make an error go away
  • Top-Impact Rules — Ten rules ranked by what they cost when wrong: barrel imports (200–800ms), waterfalls (2–10×), force-dynamic everywhere, Date across the boundary, async client components
  • Next.js 16 Cache Components — Per-section 'use cache' + cacheLife + cacheTag instead of blanket dynamic = 'force-dynamic'; covers the unstable_* import alias caveat
  • Composition Over Booleans — Compound components (<TabBar.Root/Bar/Tab/Panel>), lift state into providers, explicit variants — kills the prop explosion before it starts
  • Tailwind That Themes — Semantic CSS variables (--color-bg, --color-fg), dark-mode discipline, cn + cva patterns, the inline pre-hydration script that prevents the white flash
  • Design Principles — Hierarchy via weight+contrast (not just size), the grey-text-on-color trap, light-from-above shadow systems, empty-state design, the "one decision you wouldn't have made" signature touch
  • UI Patterns Catalog — Standard shapes for shells, nav, forms, tables, modals, drawers, toasts — when to build vs. reach for @radix-ui / @headlessui / cmdk / sonner, with accessibility shape for each
  • Common Mistakes Catalog — 17 before/after diffs covering everything from <a> for internal nav to try/catch around redirect()
  • TDD-Tested — Built via the superpowers:writing-skills RED→GREEN→REFACTOR cycle: baseline agent ran the scenario without the skill, 8 failures catalogued, skill written against them, verification agent reproduced the fix on every one

Installation

Via skills CLI (recommended)

bunx skills add 4thel00z/frontend-skills
# or
npx skills add 4thel00z/frontend-skills

Manual install (Claude Code)

Personal:

git clone https://github.com/4thel00z/frontend-skills.git /tmp/frontend-skills-src \
  && cp -r /tmp/frontend-skills-src/skills/frontend-skills ~/.claude/skills/ \
  && rm -rf /tmp/frontend-skills-src

Project-local:

git clone https://github.com/4thel00z/frontend-skills.git /tmp/frontend-skills-src \
  && cp -r /tmp/frontend-skills-src/skills/frontend-skills .claude/skills/ \
  && rm -rf /tmp/frontend-skills-src

The skill auto-loads on next session start.

Codex / other agents

Personal skills for Codex live in ~/.agents/skills/:

git clone https://github.com/4thel00z/frontend-skills.git /tmp/frontend-skills-src \
  && cp -r /tmp/frontend-skills-src/skills/frontend-skills ~/.agents/skills/ \
  && rm -rf /tmp/frontend-skills-src

Quickstart

1. Trigger the skill

The skill activates automatically when you ask the agent to write or refactor React, Next.js, or Tailwind code. You can also invoke it directly:

/frontend-skills

Triggers include: building pages and components, data fetching (fetch, server actions, route handlers), cache directives, RSC boundary errors, component API design, Tailwind class composition, performance reviews.

2. Answer the four questions first

Before any new component, the agent runs the where-does-this-run decision:

QuestionIf yes
Needs useState, useEffect, event handlers, browser API?Client Component ('use client')
Mutation (form submit, write)?Server Action ('use server')
External clients / webhooks consume it?Route Handler (route.ts)
None of the aboveServer Component (default)

3. Apply the Top-Impact Rules

#RuleCost when wrong
1No dynamic = 'force-dynamic' on Next 16+. Use 'use cache' + <Suspense>.Every optimization blocked
2Promise.all for independent awaits2–10× latency
3optimizePackageImports for every icon/UI lib200–800 ms cold start
4next/link, next/image, next/font — never raw <a>, <img>, font URLsPrefetch, layout shift, font swap
5Serialize props across Server→Client (Date → ISO, Map → object)Silent crash on .getFullYear()
6No async Client ComponentsRuntime error
7Dynamic work in <Suspense> with a real skeletonPage blocks on slowest fetch
8Composition over booleans (3rd boolean = refactor)Combinatorial state explosion
9No try/catch around redirect() / notFound()Navigation silently breaks
10Pair every Tailwind color with dark: (or use semantic tokens)White flashes in dark mode

4. Reach for the references when you need depth

ls ~/.claude/skills/frontend-skills/references/
# common-mistakes.md   composition.md   nextjs.md   react-performance.md   tailwind.md
  • nextjs.md — Cache Components, RSC boundaries, async params, file conventions, data patterns, error handling, image/font
  • react-performance.md — Waterfalls, bundle traps, server cache (react.cache, LRU, hoist static I/O), re-render and rendering optimization
  • composition.md — Compound components, lift state into provider, React 19 use()/Context, no forwardRef
  • tailwind.md — Design tokens, dark mode, cn + cva, when to extract vs. repeat utilities
  • design-principles.md — Hierarchy, whitespace, color, depth, polish — applied to Tailwind
  • ui-patterns.md — Shells, navigation, forms, tables, modals, toasts — composition + a11y shape per pattern
  • common-mistakes.md — 17 before/after diagnoses

Before / After

Real baseline output from a Claude subagent asked to build a Next.js 16 dashboard (no skill loaded):

// app/dashboard/page.tsx
export const dynamic = "force-dynamic"

export default async function Page() {
  const [user, posts] = await Promise.all([
    db.user.findUnique({ where: { id: CURRENT_USER_ID } }),
    db.posts.findMany({ where: { authorId: CURRENT_USER_ID } }),
  ])
  // … then renders <a href={`/posts/${id}`}> for each link
}
// next.config.ts has no optimizePackageImports despite lucide-react imports across 3 files

Same agent, same prompt, with the skill loaded:

// app/dashboard/page.tsx
export default async function DashboardPage() {
  const sessionCookie = (await cookies()).get('session')?.value
  if (!sessionCookie) redirect('/login')
  const { userId } = await verifySession(sessionCookie)

  return (
    <main className="mx-auto max-w-3xl space-y-8 px-6 py-10">
      <Suspense fallback={<ProfileCardSkeleton />}>
        <CachedProfile userId={userId} />
      </Suspense>
      <Suspense fallback={<PostsListSkeleton />}>
        <CachedPosts userId={userId} />
      </Suspense>
      <Suspense fallback={<NotificationsListSkeleton />}>
        <LiveNotifications userId={userId} />
      </Suspense>
    </main>
  )
}

async function CachedProfile({ userId }: { userId: string }) {
  'use cache'
  cacheLife('hours')
  cacheTag(`user-${userId}`)
  // …
}

Plus optimizePackageImports: ['lucide-react'] in next.config.ts, <Link prefetch> for internal nav, compound <TabBar.Root/Bar/Tab/Panel> instead of TabItem[], ISO-string serialization at the RSC boundary, and semantic CSS variables for theming.

Eight baseline failures, all fixed.

Architecture

Layout follows the skills.sh convention — skills live under skills/<skill-name>/, with reference material in references/.

frontend-skills/
├── README.md                              This file
├── logo.jpg                               Wordmark
└── skills/
    └── frontend-skills/
        ├── SKILL.md                       Decision tree, top 10 rules, common mistakes index (1272 words)
        └── references/
            ├── nextjs.md                  Next.js 16 App Router (2324 words)
            ├── react-performance.md       70 rules, ranked by impact (1873 words)
            ├── ui-patterns.md             Standard UI patterns + a11y shape (1877 words)
            ├── design-principles.md       Hierarchy, whitespace, color, depth, polish (2324 words)
            ├── common-mistakes.md         17 before/after diagnoses (1574 words)
            ├── composition.md             Compound components, state, React 19 (1311 words)
            └── tailwind.md                Design tokens, dark mode, cn/cva (1288 words)

SKILL.md frontmatter

---
name: frontend-skills
description: Use when writing, reviewing, or refactoring React 19, Next.js
  14+ / 16 App Router, or Tailwind CSS code. Triggers on tasks involving
  Server/Client Components, data fetching, cache directives, route
  handlers, image/font optimization, component API design, or Tailwind
  class composition.
---

The description follows CSO guidance: triggering conditions only, no workflow summary. This prevents agents from "following the description" instead of reading the skill.

License

MIT

Ver o original no GitHub

Bom para

Relacionados