Token导航 LogoToken导航

Agent Skill · 研究检索

nextjs-static-shells(Next.js static shells 搜索)

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

nextjs-static-shells 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 41,613。

总安装 1,152周安装 48GitHub Stars 55下载 384核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:nextjs-static-shells(Next.js static shells 搜索)
来源仓库:https://github.com/joelhooks/joelclaw
仓库路径:skills/nextjs-static-shells
安装命令:
npx skills add https://github.com/joelhooks/joelclaw --skill nextjs-static-shells
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/joelhooks/joelclaw --skill nextjs-static-shells

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于生成和管理 Next.js 静态站点外壳(shells),提升部署效率。适合在 Codex、Claude、Cursor 等宿主中快速搭建基础页面框架。使用时需结合项目内容和 SEO 需求,确保静态生成的性能优化。

安装方式:GitHub 仓库,命令为 npx skills add <repo> --skill nextjs-static-shells。注意:需确认权限范围和维护状态,避免触发不必要的文件读写或网络请求。

来源仓库内路径:skills/nextjs-static-shells

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/joelhooks/joelclaw --skill nextjs-static-shell…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

nextjs-static-shells 怎么安装?

在终端执行 npx skills add https://github.com/joelhooks/joelclaw --skill nextjs-static-shells。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

nextjs-static-shells 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

nextjs-static-shells 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/joelhooks/joelclaw --skill nextjs-static-shells 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

nextjs-static-shells 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

nextjs-static-shells 用的人多吗?

公开数据是累计安装 1,152 次,近一周安装 48 次,下载 384 次,GitHub 55 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

nextjs-static-shells 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
nextjs-static-shells

Next.js static shells 搜索 · 本页

1,15255执行命令未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Static-First Next.js 16 Patterns

Build a static shell first, then cut small dynamic holes where personalization or request-specific behavior is required.

  • Static shell = deterministic, cacheable, fast first paint
  • Dynamic holes = isolated request/user behavior streamed with Suspense
  • Client interactivity = provider islands, not global client sprawl

Route Architecture: Entry + Static + Slots

Pattern

  1. Entry component (server, request-aware)

- Reads params/search/auth/session/cookies - Validates access, resolves IDs, prepares dynamic props

  1. Static renderer (server, 'use cache')

- Renders deterministic layout/content - Accepts dynamic UI as slot props (ReactNode)

  1. Dynamic slots

- Injected from entry component - Suspense-wrapped where rendered in static shell

Why This Works

  • Static shell stays cacheable
  • Dynamic behavior is explicit and narrow
  • Streaming keeps UI responsive
  • No accidental full-route dynamic bailout
import { Suspense, type ReactNode } from 'react';

type PageProps = { params: Promise<{ slug: string }> };

/** Request-aware server entry. */
export default async function PageEntry({ params }: PageProps) {
  const { slug } = await params;

  const staticData = await getStaticData(slug); // deterministic
  const userData = await getUserData(); // request-dependent

  const dynamicPanel = <PersonalizedPanel userData={userData} />;

  return <PageStatic data={staticData} panel={dynamicPanel} />;
}

type PageStaticProps = {
  data: StaticData;
  panel?: ReactNode;
};

/** Cached static shell. Keep request-volatile reads out. */
async function PageStatic({ data, panel }: PageStaticProps) {
  'use cache';

  return (
    <main>
      <Hero data={data.hero} />
      <Content data={data.content} />
      <Suspense fallback={<PanelSkeleton />}>{panel}</Suspense>
    </main>
  );
}

Cache Components Setup & Mechanics

Enable

// next.config.ts
import type { NextConfig } from 'next'

const nextConfig: NextConfig = {
  cacheComponents: true,
}

export default nextConfig

Replaces the old experimental.ppr flag.

Three Content Types

TypeCharacteristicExample
StaticSynchronous, pure computation<header><h1>Our Blog</h1></header>
Cached ('use cache')Async but deterministic for given inputsdb.posts.findMany() with cacheLife('hours')
Dynamic (Suspense)Runtime/request-specific, must be freshcookies(), user session, notifications

'use cache' Scope Levels

// File level — entire module cached
'use cache'
export default async function Page() { /* ... */ }

// Component level
export async function CachedComponent() {
  'use cache'
  const data = await fetchData()
  return <div>{data}</div>
}

// Function level
export async function getData() {
  'use cache'
  return db.query('SELECT * FROM posts')
}

Cache Profiles with cacheLife()

import { cacheLife } from 'next/cache'

async function getData() {
  'use cache'
  cacheLife('hours')  // Built-in: 'default' | 'minutes' | 'hours' | 'days' | 'weeks' | 'max'
  return fetch('/api/data')
}

// Or inline config:
async function getDataCustom() {
  'use cache'
  cacheLife({
    stale: 3600,      // 1h — serve stale while revalidating
    revalidate: 7200, // 2h — background revalidation interval
    expire: 86400,    // 1d — hard expiration
  })
  return fetch('/api/data')
}

Built-in profile shortcuts: 'use cache' alone → 5m stale / 15m revalidate. 'use cache: remote' → platform KV. 'use cache: private' → allows runtime APIs (compliance escape hatch).

Cache Invalidation

import { cacheTag } from 'next/cache'

async function getProduct(id: string) {
  'use cache'
  cacheTag('products', `product-${id}`)
  return db.products.findUnique({ where: { id } })
}

updateTag() — immediate, same-request invalidation:

'use server'
import { updateTag } from 'next/cache'

export async function updateProduct(id: string, data: FormData) {
  await db.products.update({ where: { id }, data })
  updateTag(`product-${id}`)  // caller sees fresh data
}

revalidateTag() — background stale-while-revalidate:

'use server'
import { revalidateTag } from 'next/cache'

export async function createPost(data: FormData) {
  await db.posts.create({ data })
  revalidateTag('posts')  // next request sees fresh data
}

Cache Key Generation (Automatic)

Keys derived from: build ID + function location hash + serializable arguments + closure variables. No manual keyParts like unstable_cache.

async function Component({ userId }: { userId: string }) {
  const getData = async (filter: string) => {
    'use cache'
    // cache key = userId (closure) + filter (argument)
    return fetch(`/api/users/${userId}?filter=${filter}`)
  }
  return getData('active')
}

What Cannot Live Inside 'use cache'

Hard rule: No per-request volatility inside cached boundaries.

Banned inside 'use cache'Why
cookies(), headers()Request-specific
searchParamsRequest-specific
Session/auth readsUser-specific
Hidden user logic in helper callsInvisible request dependency
Side effects tied to request lifecycleNon-deterministic
Math.random(), Date.now()Execute once at build time inside cache

Fix: Extract Outside, Pass as Arguments

// Wrong — runtime API inside 'use cache'
async function CachedProfile() {
  'use cache'
  const session = (await cookies()).get('session')?.value  // Error!
  return <div>{session}</div>
}

// Correct — extract in entry, pass as prop
async function ProfilePage() {
  const session = (await cookies()).get('session')?.value
  return <CachedProfile sessionId={session} />
}

async function CachedProfile({ sessionId }: { sessionId: string }) {
  'use cache'
  // sessionId becomes part of cache key automatically
  const data = await fetchUserData(sessionId)
  return <div>{data.name}</div>
}

Exception: 'use cache: private' allows cookies() / headers() for compliance cases where refactoring is impractical.


RSC Boundary Rules

These interact directly with the static shell pattern.

Async Client Components Are Invalid

Client components cannot be async. Only Server Components can be async.

// Bad
'use client'
export default async function UserProfile() {
  const user = await getUser()  // Cannot await in client
  return <div>{user.name}</div>
}

// Good — fetch in server entry, pass data down
// page.tsx (server)
export default async function Page() {
  const user = await getUser()
  return <UserProfile user={user} />
}

// UserProfile.tsx (client)
'use client'
export function UserProfile({ user }: { user: User }) {
  return <div>{user.name}</div>
}

Non-Serializable Props Kill the Boundary

Props from Server → Client must be JSON-serializable.

Cannot passFix
Functions (except Server Actions)Define inside client component
Date objects.toISOString() on server
Map, SetObject.fromEntries() / Array.from()
Class instancesPass plain object

Server Actions ('use server') can be passed to client components — they're the exception.


Async Patterns (Next.js 15+)

params, searchParams, cookies(), headers() are all async. Type them as Promise<...> and await in the entry component.

type PageProps = {
  params: Promise<{ slug: string }>
  searchParams: Promise<{ query?: string }>
}

export default async function Page({ params, searchParams }: PageProps) {
  const { slug } = await params
  const { query } = await searchParams
  // ...
}

For synchronous client components that need params, use React.use():

import { use } from 'react'

export default function Page({ params }: { params: Promise<{ slug: string }> }) {
  const { slug } = use(params)
}

Suspense Boundary Requirements

useSearchParams Always Needs Suspense

Without Suspense, the entire page becomes CSR:

// Bad — entire page CSR bailout
'use client'
import { useSearchParams } from 'next/navigation'
export default function SearchBar() {
  const searchParams = useSearchParams()
  return <div>Query: {searchParams.get('q')}</div>
}

// Good — isolated in Suspense
import { Suspense } from 'react'
export default function Page() {
  return (
    <Suspense fallback={<SearchSkeleton />}>
      <SearchBar />
    </Suspense>
  )
}

Quick Reference

HookSuspense Required
useSearchParams()Always
usePathname()Yes in dynamic routes
useParams()No
useRouter()No

Provider Islands (Client Providers Done Cleanly)

Rule

Mount client providers as low as possible and only where interactivity is needed.

  • Good: feature-level provider island
  • Bad: global root provider for local feature state

Pattern

Server entry passes typed initial state. Client provider resolves inside 'use client' boundary. Hooks stay inside island.

'use client';

import { createContext, useContext, useMemo } from 'react';

type FeatureState = { enabled: boolean };
type FeatureContextValue = { state: FeatureState };

const FeatureContext = createContext<FeatureContextValue | null>(null);

export function FeatureProvider({
  children,
  initialState,
}: {
  children: React.ReactNode;
  initialState: FeatureState;
}) {
  const value = useMemo(() => ({ state: initialState }), [initialState]);
  return <FeatureContext.Provider value={value}>{children}</FeatureContext.Provider>;
}

export function useFeature() {
  const ctx = useContext(FeatureContext);
  if (!ctx) throw new Error('useFeature must be used within FeatureProvider');
  return ctx;
}

Data Fetching in the Static Shell Model

Decision Tree

NeedPattern
Read data in server componentFetch directly — no API layer
Mutation from UIServer Action ('use server')
External API / webhook / mobile clientRoute Handler
Client component needs dataPass from server parent (preferred) or Route Handler

Avoiding Waterfalls

// Bad — sequential
const user = await getUser();
const posts = await getPosts();

// Good — parallel
const [user, posts] = await Promise.all([getUser(), getPosts()]);

// Better — streaming with Suspense (each section independent)
<Suspense fallback={<UserSkeleton />}><UserSection /></Suspense>
<Suspense fallback={<PostsSkeleton />}><PostsSection /></Suspense>

Preload Pattern

import { cache } from 'react';

export const getUser = cache(async (id: string) => {
  return db.user.findUnique({ where: { id } });
});

export const preloadUser = (id: string) => {
  void getUser(id);  // fire-and-forget, deduped by cache()
};

Link Preloading Strategy

Rules

  • Preload static/common routes aggressively
  • Disable prefetch for personalized/query-heavy/volatile URLs
  • Preload shell, defer user-specific data behind dynamic boundaries
  • generateStaticParams boosts prefetch hit quality for common paths
import Link from 'next/link';

/** Static/common route: keep default prefetch. */
<Link href={`/docs/${slug}`}>Read next</Link>

/** Personalized or volatile route: disable speculative prefetch. */
<Link href={`/certificate/${userId}?name=${encodeURIComponent(name)}`} prefetch={false}>
  View certificate
</Link>

Preload Decision Checklist

  • Is route static and frequently visited? → preload
  • Is route personalized or volatile? → don't preload
  • Is user data deferred behind Suspense/dynamic island? → preload shell only
  • Is there measured nav improvement? → keep prefetch; otherwise cut it

Decision Matrix

ScenarioPattern
Static content + personalized controlsEntry (dynamic) + cached static renderer + slot injection
Cacheable deterministic server work'use cache' boundary
Pure client interactivityLocal 'use client' provider island
Faster navigationTargeted prefetch + static params coverage

Common Failure Modes + Fixes

  1. Whole route goes dynamic unexpectedly

- Cause: request-bound reads (cookies(), headers()) leak into static shell - Fix: move those reads to entry component, pass slot props

  1. Client hydration is too heavy

- Cause: global provider mounted at root for feature-local state - Fix: push provider down to feature/layout segment

  1. Prefetch waste and noisy network

- Cause: prefetching personalized/query-heavy links - Fix: prefetch={false} for volatile URLs

  1. Static shell blocked by dynamic work

- Cause: dynamic components rendered without Suspense seams - Fix: wrap dynamic slots in Suspense with small fallbacks

  1. Unclear ownership of data flow

- Cause: mixed static/dynamic logic in one component - Fix: enforce Entry vs Static renderer split with strict prop contracts

  1. useSearchParams causes full-page CSR bailout

- Cause: missing Suspense boundary around search-param-reading component - Fix: always wrap useSearchParams consumers in Suspense

  1. Date/Map/class props silently break client components

- Cause: non-serializable props passed across RSC→client boundary - Fix: serialize on server (.toISOString(), Object.fromEntries(), plain objects)

  1. unstable_cache still in codebase

- Cause: pre-v16 caching pattern not migrated - Fix: replace with 'use cache' + cacheTag() + cacheLife() — no manual key arrays needed


Migration from Previous Versions

Old ConfigReplacement
experimental.pprcacheComponents: true
dynamic = 'force-dynamic'Remove (default behavior)
dynamic = 'force-static''use cache' + cacheLife('max')
revalidate = NcacheLife({revalidate: N})
unstable_cache()'use cache' directive

unstable_cache → 'use cache'

// Before
const getCachedUser = unstable_cache(
  async (id) => getUser(id),
  ['my-app-user'],
  { tags: ['users'], revalidate: 60 }
)

// After
async function getCachedUser(id: string) {
  'use cache'
  cacheTag('users')
  cacheLife({ revalidate: 60 })
  return getUser(id)
}

Key differences: no manual cache keys (auto from args + closures), tags via cacheTag(), revalidation via cacheLife().


Limitations

  • Edge runtime not supported — requires Node.js
  • Static export not supported — needs server
  • Non-deterministic values (Math.random(), Date.now()) execute once at build time inside 'use cache'

For request-time randomness outside cache:

import { connection } from 'next/server'

async function DynamicContent() {
  await connection()  // defer to request time
  const id = crypto.randomUUID()
  return <div>{id}</div>
}

Implementation Sequence

  1. Identify static vs dynamic inputs per route
  2. Split pages into Entry + cached Static renderer
  3. Convert personalized bits into typed slots
  4. Add Suspense around slot render points
  5. Refactor providers into client islands
  6. Apply prefetch rules to navigation links
  7. Add static params for high-traffic static routes
  8. Measure before/after (TTFB, shell paint, nav latency, prefetch traffic)

PR Acceptance Criteria

  • Static shell renders without waiting on user-specific data
  • Cached boundaries contain no request-volatile reads
  • Dynamic UI only appears via explicit slot boundaries
  • Client providers are feature-scoped unless globally justified
  • Personalized/volatile links have prefetch explicitly disabled
  • Navigation to common static routes is preloaded and measurably faster
  • useSearchParams consumers wrapped in Suspense
  • No non-serializable props crossing RSC→client boundary
  • No unstable_cache — migrated to 'use cache' directive

平台分布

Codex

33.4%
按下载量换算128

Claude

29.61%
按下载量换算114

Cursor

19.01%
按下载量换算73

Gemini CLI

8.73%
按下载量换算34

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/joelhooks/joelclaw --skill nextjs-static-shells 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills