agentleFS
HarambeeAIHarambeeAI/bayes-ship/skills/frontend-patterns/SKILL.md

frontend-patterns

Skill1 starsChanged 7 months agoMITView on GitHub

React and Next.js patterns for state management, component architecture, rendering, forms, and data fetching. Use when implementing frontend tasks. Source: everything-claude-code.

87 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use brand-discovery, agent-sort and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ysyecustSkill

    brand-discovery

    Use when a brand needs to discover or articulate its identity through structured multi-session interviews. Covers purpose, positioning, audience, personality, voice, narrative, and founder-brand tension across 8 modules using laddering, 5 Whys, and projective techniques. Produces a resumable session with disk-persisted state and a master brandbook (90_SYNTHESIS.md).

    Also in 6 projects that use this

  • niloykumarbarmanSkill

    agent-sort

    Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

    Also in 14 projects that use this

  • royaluniondesign-sysSkill

    configure-ecc

    Interactive installer for Everything Claude Code — guides users through selecting and installing skills and rules to user-level or project-level directories, verifies paths, and optionally optimizes installed files.

    Also in 12 projects that use this

  • loulanyueSkill

    nuxt4-patterns

    Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData.

    Also in 10 projects that use this

  • ronmkrSkill

    vite-patterns

    Vite build tool patterns including config, plugins, HMR, env variables, proxy setup, SSR, library mode, dependency pre-bundling, and build optimization. Activate when working with vite.config.ts, Vite plugins, or Vite-based projects.

    Also in 8 projects that use this

  • royaluniondesign-sysSkill

    content-hash-cache-pattern

    Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation.

    Also in 16 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 26 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Prefer composition over prop drilling (use Context or Zustand for shared state).

    line 11
  2. Very specific:

    Use Server Actions for form submissions in Next.js 15

    line 52
  3. Very specific:

    Do NOT use useEffect for data fetching in Next.js App Router (use Server Components)

    line 58
  4. Distinctive:

    Do NOT put all state in a global store (most state is local)

    line 59
  5. Very specific:

    Do NOT use any type. Type everything.

    line 60
  6. Distinctive:

    Do NOT skip loading and error states.

    line 61

“Common” is measured: kept by at least 6 in 10 of the 26 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Frontend Patterns

Component architecture

  • One component per file. File name matches component name.
  • Props interface defined above the component.
  • Prefer composition over prop drilling (use Context or Zustand for shared state).
  • Server Components by default in Next.js App Router. Client Components only when needed (interactivity, hooks).

State management

// Local state for component-specific data
const [isOpen, setIsOpen] = useState(false)

// Server state for API data (use React Query / SWR)
const { data: invoices, isLoading } = useQuery({
  queryKey: ['invoices'],
  queryFn: fetchInvoices
})

// Global state for cross-component concerns (Zustand)
const useStore = create((set) => ({
  selectedInvoice: null,
  setSelected: (inv) => set({ selectedInvoice: inv })
}))

Data fetching in Next.js

// Server Component (preferred — no client JS, no loading state)
async function InvoicePage({ params }: { params: { id: string } }) {
  const invoice = await getInvoice(params.id)
  return <InvoiceDetail invoice={invoice} />
}

// Client Component (only when interactivity needed)
'use client'
function InvoiceForm() {
  const [formData, setFormData] = useState(initialState)
  // ...
}

Forms

  • Use Server Actions for form submissions in Next.js 15
  • Validate on client (UX) AND server (security)
  • Show inline errors next to the field, not in a toast

Anti-patterns

  • Do NOT use useEffect for data fetching in Next.js App Router (use Server Components)
  • Do NOT put all state in a global store (most state is local)
  • Do NOT use any type. Type everything.
  • Do NOT skip loading and error states. Every async operation needs both.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.