.cursor/skills/cache-components/SKILL.md
# Cache Components (Next.js) — Skill **Name:** `cache-components` **Purpose:** Build correct cached/dynamic boundaries in Next.js App Router when Cache Components or PPR are in use. Use this skill to avoid request-context leaks and to enforce proper cache invalidation. **Applies when:** `cacheComponents: true`, Partial Prerendering (PPR), `'use cache'`, `cacheLife`, `cacheTag`, `updateTag`, `revalidateTag`. **Do not use when:** Working in the Pages Router or when Cache Components/PPR are not e
npx skillsauth add asymmetric-al/core .cursor/skills/cache-componentsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Name: cache-components
Purpose: Build correct cached/dynamic boundaries in Next.js App Router when Cache Components or PPR are in use.
Use this skill to avoid request-context leaks and to enforce proper cache invalidation.
Applies when: cacheComponents: true, Partial Prerendering (PPR), 'use cache', cacheLife, cacheTag, updateTag, revalidateTag.
Do not use when: Working in the Pages Router or when Cache Components/PPR are not enabled.
<Suspense>.cookies(), headers(), or auth/session inside a 'use cache' scope.'use cache' function/component must be async.'use cache', cacheLife, cacheTag over route-segment config (revalidate, dynamic).updateTag for immediate consistency or revalidateTag for background refresh.'use cache' + cacheTag (and cacheLife if needed).<Suspense>.'use cache'cacheTag<Suspense>async"use cache";
import { cacheLife, cacheTag } from "next/cache";
export async function getProducts(category: string) {
cacheLife("minutes");
cacheTag("products");
cacheTag(`products:${category}`);
}
import { Suspense } from "react";
export default function Page() {
return (
<>
<MainCached />
<Suspense fallback={null}>
<UserPanel />
</Suspense>
</>
);
}
"use server";
import { updateTag } from "next/cache";
export async function updateProduct(id: string) {
updateTag(`product:${id}`);
updateTag("products");
}
'use cache'<Suspense>generateStaticParamsdevelopment
Use when working with Payload CMS projects (payload.config.ts, collections, fields, hooks, access control, Payload API). Use when debugging validation errors, security issues, relationship queries, transactions, or hook behavior.
testing
Use when CI tests fail on main branch after PR merge, or when investigating flaky test failures in CI environments
tools
Use when new translation keys are added to packages to generate new translations strings
data-ai
Pointer to the canonical agent instruction and skill system for this monorepo