nextjs
Next.js 14/15 App Router patterns — server components, data fetching, caching, server actions
Works with
--- name: nextjs description: Next.js 14/15 App Router patterns — server components, data fetching, caching, server actions license: MIT --- # nextjs **Layer 2 — Framework Pack** Next.js 14/15 App Router patterns. Server components, data fetching, caching, server actions, and the specific mistakes agents make from Pages Router training data contamination. ## Philosophy Next.js is where the "judgment not knowledge" principle matters most. The framework underwent a fundamental paradigm shift from Pages Router to App Router. Server components changed how data fetching works. Server actions changed how mutations work. The caching model changed between Next.js 14 and 15. LLMs trained on pre-App-Router content produce code that technically runs but uses wrong patterns — `getServerSideProps` in App Router projects, `useEffect` for data fetching that should happen on the server, `'use client'` on every component because the agent doesn't understand the server-first model. This pack establishes the App Router mental model as the default and explicitly corrects the most common Pages Router contamination patterns. ## What's Included | Type | Files | Coverage | |------|-------|----------| | Patterns | 7 | Server components, data fetching, routing/layouts, server actions, caching, middleware, metadata | | Anti-patterns | 5 | Pages Router patterns, use-client-everywhere, useEffect data fetching, client-side routing, wrong caching | | Constitution | 1 | 6 Next.js-specific principles | | Gate | 1 | Next.js pattern compliance check | ## Overrides When installed alongside `react`, this pack overrides React's data-fetching pattern. In Next.js, data fetching happens in server components, not via TanStack Query in client components (unless you specifically need client-side real-time data). ## Key Mental Model **Server-first.** Components are server components by default. They run on the server, have direct access to databases and file systems, and ship zero JavaScript to the browser. Only add `'use client'` when you need interactivity (event handlers, hooks, browser APIs). Most components (70-90% in a typical app) should remain server components.
More Performance skills
seo-audit
coreyhaines31/marketingskills
When the user wants to audit, review, or diagnose SEO issues on their site. Also use when the user mentions "SEO audit," "technical SEO," "why am I not ranking," "SEO issues," "on-page SEO," "meta tags review," "SEO health check," "my traffic dropped," "lost rankings," "not showing up in Google," "site isn't ranking," "Google update hit me," "page speed," "core web vitals," "crawl errors," or "indexing issues." Use this even if the user just says something vague like "my SEO is bad" or "help with SEO" — start with an audit. For building pages at scale to target keywords, see programmatic-seo. For adding structured data, see schema. For AI search optimization, see ai-seo.
competitor-profiling
coreyhaines31/marketingskills
When the user wants to research, profile, or analyze competitors from their URLs. Also use when the user mentions 'competitor profile,' 'competitor research,' 'competitor analysis,' 'profile this competitor,' 'analyze competitor,' 'competitive intelligence,' 'competitor deep dive,' 'who are my competitors,' 'competitor landscape,' 'competitor dossier,' 'competitive audit,' or 'research these competitors.' Input is a list of competitor URLs. Output is structured competitor profile markdown files. For creating comparison/alternative pages from profiles, see competitors. For sales-specific battle cards, see sales-enablement.
prospecting
coreyhaines31/marketingskills
When the user wants to find, qualify, and build a list of prospects to reach out to — across B2B SaaS, general B2B, or local small businesses. Also use when the user mentions "prospecting," "build a prospect list," "find prospects," "find leads," "lead gen list," "find SaaS companies that," "find B2B companies," "find local businesses," "ICP-fit accounts," "who should we go after," "outbound list," "target account list," "find clients near me," "businesses without websites," "prospect research," "qualified leads," "find my first customers," "early adopters," "design partners," "beta users," or "who has this problem." Use this for the list-building and qualification phase. For writing the outbound copy after the list is built, see cold-email. For deep competitive research on specific accounts, see competitor-profiling.

