cache-components
Expert guidance for Next.js Cache Components and Partial Prerendering (PPR).
Skill by sangrokjung
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/sangrokjung-cache-components
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: frontend, backend, data, writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/cache-components
What's inside
- Skill name
cache-components- Description
- Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.
- License
- MIT
- Instructions
- 457 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Files (4)
- PATTERNS.md
- REFERENCE.md
- SKILL.md
- TROUBLESHOOTING.md
SKILL.md (first lines)
# Next.js Cache Components
> **Auto-activation**: This skill activates automatically in projects with `cacheComponents: true` in next.config.
## Project Detection
When starting work in a Next.js project, check if Cache Components are enabled:
```bash
# Check next.config.ts or next.config.js for cacheComponents
grep -r "cacheComponents" next.config.* 2>/dev/null
```
If `cacheComponents: true` is found, apply this skill's patterns proactively when:
- Writing React Server Components
- Implementing data fetching
- Creating Server Actions with mutations
- Optimizing page performance
- Reviewing existing component code
Cache Components enable **Partial Prerendering (PPR)** - mixing static HTML shells with dynamic streaming content for optimal performance.
## Philosophy: Code Over Configuration
Cache Components represents a shift from **segment configuration** to **compositional code**:
| Before (Deprecated) | After (Cache Components) |
| --------------------------------------- | ----------------------------------------- |
| `export const revalidate = 3600` | `cacheLife('hours')` inside `'use cache'` |
| `export const dynamic = 'force-static'` | Use `'use cache'` and Suspense boundaries |
| All-or-nothing static/dynamic | Granular: static shell + cached + dynamic |
**Key Principle**: Components co-locate their caching, not just their data. Next.js provides build-time feedback to guide you toward optimal patterns.
## Core Concept
```
┌─────────────────────────────────────────────────────┐
│ Static Shell │
│ (Sent immediately to browser) │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Header │ │ Cached │ │ Suspense │ │
│ │ (static) │ │ Content │ │ Fallback │ │
│ └─────────────┘ └─────────────┘ └──────┬──────┘ │
│ │ │
│ ┌──────▼──────┐ │
│ │ Dynamic │ │
│ │ (streams) │ │
│ └─────────────┘ │
└─────────────────────────────────────────────────────┘
```
## Mental Model: The Caching Decision Tree
When writing a React Server Component, ask these questions in order:
```
┌─────────────────────────────────────────────────────────┐
│ Does this component fetch data or perform I/O? │
└─────────────────────┬───────────────────────────────────┘
│
┌──────────▼──────────┐
│ YES │ NO → Pure component, no action needed
└──────────┬──────────┘
│
┌─────────────────▼─────────────────┐
│ Does it depend on request context? │
│ (cookies, headers, searchParams) │
└─────────────────┬─────────────────┘
│
┌────────────┴────────────┐
│ │
┌────▼────┐ ┌─────▼─────┐
│ YES │ │ NO │
└────┬────┘ └─────┬─────┘
│ │
│ ┌─────▼─────────────────┐
│ │ Can this be cached? │
│ │ (same for all users?) │
│ └─────┬─────────────────┘
│ │
│ ┌──────────┴──────────┐
│ │ │
│ ┌────▼────┐ ┌─────▼─────┐
│ │ YES │ │ NO │
│ └────┬────┘ └─────┬─────┘
│ │ │
│ ▼ │
│ 'use cache' │
│ + cacheTag() │
│ + cacheLife() │
│ │
└──────────────┬─────────────────────┘
│
▼
Wrap in <Suspense>
(dynamic streaming)
```
**Key insight**: The `'use cache'` directive is for data that's the _same across users_. User-specific data stays dynamic with Suspense.
## Quick Start
### Enable Cache Components
```typescript
// next.config.ts
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
cacheComponents: true,
}
export default nextConfig
```
### Basic UsageFrom sangrokjung/claude-forge, MIT.
More from sangrokjung/claude-forge
- 0.776score
humanize-korean
sangrokjung
Clean up translation-ese and AI-writing tics in Korean prose so it reads like a person wrote it — content (facts, numbers, proper nouns, quotes) stays 100%…
SkillBFreshness: B★ 863Claude Code +9 - 0.776score
systematic-debugging
sangrokjung
Structured debugging methodology — use before proposing fixes for any error or failure.
SkillBFreshness: B★ 863Claude Code +9 - 0.776score
cc-dev-agent
sangrokjung
Use when starting Claude Code projects, writing CLAUDE.md/spec.md, dispatching subagents, or requesting Agent Teams parallel development.
SkillBFreshness: B★ 863Claude Code +9 - 0.776score
relay
sangrokjung
Session relay — compresses what's been done so far (writes a one-liner for /compact) and generates a "next task" prompt (a baton) for the user to hand off.
SkillBFreshness: B★ 863Claude Code +9 - 0.776score
skill-factory
sangrokjung
Analyze session work and automatically convert reusable patterns into Claude Code skills.
SkillBFreshness: B★ 863Claude Code +9 - 0.776score
session-wrap
sangrokjung
Use when wrapping up a session before ending.
SkillBFreshness: B★ 863Claude Code +9 - 0.776score
review-loop
sangrokjung
Run the adversarial verification loop — implement, then hand the change to a fresh checker that did not write it, fix what it finds, and re-dispatch until…
SkillBFreshness: B★ 863Claude Code +9 - 0.776score
frontend-code-review
sangrokjung
Trigger when the user requests a review of frontend files (e.g., `.tsx`, `.ts`, `.js`).
SkillBFreshness: B★ 863Claude Code +9 - 0.776score
harness-diet
sangrokjung
Measure and shrink the always-loaded context of a Claude Code harness (CLAUDE.md + rules without paths frontmatter) back under budget — migrate narrative to…
SkillBFreshness: B★ 863Claude Code +9 - 0.773score
continuous-learning-v2
sangrokjung
Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents.
SkillBFreshness: B★ 863Claude Code +9 - 0.773score
korean-spell-check
sangrokjung
Use Nara/PNU Korean spell-check surfaces conservatively to proofread Korean text, chunk long input, and return change-focused correction suggestions.
SkillBFreshness: B★ 863Claude Code +9 - 0.772score
loop-forge
sangrokjung
Turn a one-line description of a repetitive task into a reusable, self-guarding slash command.
SkillBFreshness: B★ 863Claude Code +9
Compare and alternatives
Featured in
Signals
- Stars
- 863
- Forks
- 184
- Open issues
- 22
- Last commit (this folder)
- Feb 23, 2026 (8 months ago)
- Last release
- Aug 25, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/sangrokjung/claude-forge
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from sangrokjung
- 0.776score
relay
sangrokjung
Session relay — compresses what's been done so far (writes a one-liner for /compact) and generates a "next task" prompt (a baton) for the user to hand off.
SkillBFreshness: B★ 863Claude Code +9 - 0.776score
humanize-korean
sangrokjung
Clean up translation-ese and AI-writing tics in Korean prose so it reads like a person wrote it — content (facts, numbers, proper nouns, quotes) stays 100%…
SkillBFreshness: B★ 863Claude Code +9 - 0.776score
cc-dev-agent
sangrokjung
Use when starting Claude Code projects, writing CLAUDE.md/spec.md, dispatching subagents, or requesting Agent Teams parallel development.
SkillBFreshness: B★ 863Claude Code +9 - 0.776score
frontend-code-review
sangrokjung
Trigger when the user requests a review of frontend files (e.g., `.tsx`, `.ts`, `.js`).
SkillBFreshness: B★ 863Claude Code +9 - 0.776score
harness-diet
sangrokjung
Measure and shrink the always-loaded context of a Claude Code harness (CLAUDE.md + rules without paths frontmatter) back under budget — migrate narrative to…
SkillBFreshness: B★ 863Claude Code +9 - 0.776score
review-loop
sangrokjung
Run the adversarial verification loop — implement, then hand the change to a fresh checker that did not write it, fix what it finds, and re-dispatch until…
SkillBFreshness: B★ 863Claude Code +9
Cite this page
cache-components skill. Agent Mart. https://agentmart.dev/skills/sangrokjung-cache-components (last updated 2026-10-24)