nextbase-cache-components
Skill827 starsChanged 2 months agoMITView on GitHub
Use for NextBase Cache Components, Partial Prefetching, use cache, React request memoization, Suspense placement, route prerendering, or separating shared cached data from personalized Supabase data.
In this repository23 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/vercel-composition-patterns/AGENTS.mdAGENTS.md
- .agents/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- nextbase-architectureSkill
- nextbase-auth-ssrSkill
- nextbase-database-testingSkill
- nextbase-safe-actions-dataSkill
- nextbase-testingSkill
- nextbase-ui-patternsSkill
- next-cache-components-optimizerSkill
- safe-action-advancedSkill
- safe-action-clientSkill
- safe-action-hooksSkill
- safe-action-middlewareSkill
- safe-action-testingSkill
- shadcnSkill
- supabase-postgres-best-practicesSkill
- supabase-schema-migrationsSkill
- supabaseSkill
- turborepoSkill
- vercel-composition-patternsSkill
- vercel-react-best-practicesSkill
- web-design-guidelinesSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
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
- Distinctive: line 18
Never create an anonymous Supabase client merely to make personalized data cacheable.
- Distinctive: line 22
Keep the route shell and shared headings cacheable when safe.
- Very specific: line 24
Put a focused <Suspense> boundary directly around that dynamic child.
- Distinctive: line 25
Use a stable fallback with the same broad geometry as the resolved UI.
- Distinctive: line 26
Start independent reads before awaiting them and avoid serial waterfalls.
- Very specific: line 28
Keep 'use cache' at the narrowest scope with an explicit, reviewable data contract.
- Distinctive: line 32
After a successful mutation, invalidate the exact path or tag that owns the stale shared data.
- Very specific: line 36
Run the Next.js build to catch prerender/runtime boundary errors.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
NextBase Cache Components
Load next-cache-components-optimizer for current Next.js mechanics and vercel-react-best-practices for React performance guidance.
This project enables cacheComponents and partialPrefetching in apps/web/next.config.ts.
Classify Data First
- Shared, public, deterministic data may be persisted with
'use cache'when it does not read cookies, headers, session state, or user-specific inputs. - Personalized or authorization-sensitive data must stay dynamic and must not enter a shared cache scope.
- React
cache()insrc/rsc-datadeduplicates work during one server render. It is not a persistent cross-request cache.
Never create an anonymous Supabase client merely to make personalized data cacheable. A different client does not change the data's privacy classification.
Composition Pattern
- Keep the route shell and shared headings cacheable when safe.
- Move cookie, claim, search-param, and personalized reads into a dynamic child.
- Put a focused
<Suspense>boundary directly around that dynamic child. - Use a stable fallback with the same broad geometry as the resolved UI.
- Start independent reads before awaiting them and avoid serial waterfalls.
Keep 'use cache' at the narrowest scope with an explicit, reviewable data contract. Do not hide runtime APIs behind helpers called from a cached scope.
Invalidation
After a successful mutation, invalidate the exact path or tag that owns the stale shared data. Personalized dynamic reads normally refresh through navigation or re-render and should not be placed in a shared tag to force reuse.
Verification
Run the Next.js build to catch prerender/runtime boundary errors. Exercise a cold navigation, a prefetched navigation, an anonymous request, and two distinct authenticated users to prove no personalized data crosses requests.
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
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.

