Token导航 LogoToken导航

Agent Skill · 研究检索

nextjs-architecture(Next.js 架构)

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

nextjs-architecture 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 54,512。

总安装 509周安装 21GitHub Stars 3下载 166核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/alpoxdev/hypercore --skill nextjs-architecture

这个 Skill 是做什么的

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

nextjs-architecture 用于强制执行 Next.js 官方架构规范,确保路由与组件边界合规。适用于审查或生成 React/Next.js 代码,支持 App Router 与 Server Component 校验。基于框架文档作为权威依据,优先遵循官方而非本地自定义规则。

安装前需确认项目为有效 Next.js 工程且已启用 App Router。注意不处理样式或构建细节,仅聚焦架构层面验证。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

nextjs-architecture 怎么安装?

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

nextjs-architecture 支持哪些 AI 工具?

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

nextjs-architecture 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

nextjs-architecture 是免费的吗?

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

nextjs-architecture 用的人多吗?

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

nextjs-architecture 安全吗?

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

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

值得选的地方

  • 同时适配 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-architecture

Next.js 架构 · 本页

5093接触敏感数据未明确通过

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

SKILL.md 原文

Next.js Architecture Enforcement

Overview

Enforces official Next.js architecture rules before code changes. Validate that the target is actually a Next.js project, determine whether App Router is in use, then apply strict rules for routing, Server and Client Component boundaries, server-first data fetching, Server Actions, Route Handlers, Proxy, and environment setup.

This skill is official-first. Treat the Next.js documentation as the source of truth. If a repo-local convention is stricter than the framework, label it clearly instead of silently presenting it as a framework rule.

OPERATING MODE: This skill is self-contained. Do not block on external orchestration just to apply architecture rules. If the user wants exhaustive verification, keep verifying. Otherwise proceed with this skill's own validation flow.

IMPORTANT: App Router is the default path for this skill. If the repo is Pages Router only, apply only the shared platform and boundary checks and do not force App Router-only file conventions unless the user is migrating or explicitly adding app/.

IMPORTANT: Prefer Server Actions for internal UI writes, especially forms and app-originated mutations. Use Route Handlers when the surface is genuinely HTTP-native, such as webhooks, feeds, CORS-sensitive endpoints, or machine-readable/public endpoints.

IMPORTANT: Treat every Server Action as a reachable POST entry point. Validation, authentication, authorization, and return-value filtering must happen inside the action or the delegated server-only data layer, not only in the page that renders the form.

Quick Surface Chooser

Use this table before reading the full gates:

If the task sounds like...Default surfaceDo not default to...
Add a form or internal app mutation in App RouterServer Actionroute.ts
Add a webhook, feed, CORS endpoint, or public machine-readable endpointRoute HandlerServer Action
Fetch initial page data for UIServer ComponentClient-first fetching without a real need
Need redirect logic before render across many requestsnext.config.* or Proxy, with Proxy lastServer Action
Client Component imports DB code or private envmove the code behind a server-only boundaryleaving secrets in client-reachable code
Pages Router only repo and no migration requestedshared Next.js safety checks onlyforcing App Router file conventions

If the task matches one of these rows, start there, then read the linked rule file in Step 2 for detail.

Trigger Examples

Positive

  • Audit this Next.js app before I add more App Router routes.
  • Refactor a Next.js feature so Server Components, client boundaries, caching, and server actions follow the official docs.
  • Add a Next.js Route Handler or Server Action and keep the architecture compliant.

Negative

  • Create a generic React architecture guide.
  • Review a Remix or TanStack Start app.

Boundary

  • Make a tiny copy-only text change in a Next.js page. Direct editing can be enough if no architectural boundary is affected, but touched files still need a quick boundary check.
  • This repo is Pages Router only and I am not migrating to App Router. This skill still applies for shared Next.js platform, env, and boundary checks, but App Router-specific file rules must be relaxed.

Step 1: Project Validation

Before any work, confirm a Next.js project and detect router mode:

rg -n '"next"' package.json
find . -maxdepth 3 \( -path './app' -o -path './src/app' -o -path './pages' -o -path './src/pages' \)
test -f next.config.ts -o -f next.config.mjs -o -f next.config.js

Interpretation:

  • No next dependency found: stop, this skill does not apply.
  • app/ or src/app/ present: full App Router mode.
  • pages/ or src/pages/ present without App Router: shared Next.js mode only.
  • Mixed app/ and pages/: prefer App Router rules for touched app/ code and avoid breaking legacy pages/ code without explicit migration intent.

Step 2: Read Architecture Rules

Load the detailed rules reference:

REQUIRED: Read architecture-rules.md in this skill directory before writing code.

Then read the relevant rule files for the change:

  • rules/routes.md - App Router structure, special files, route groups, private folders, and segment boundaries
  • rules/execution-model.md - Server vs Client Components, use client, providers, serializable props, and server-only
  • rules/data-fetching.md - server data fetching, streaming, cache intent, dynamic rendering triggers, and revalidation
  • rules/server-actions.md - use server, validation, auth, authz, DAL delegation, revalidation, redirect ordering, and side-effect rules
  • rules/route-handlers.md - when route.ts is justified, method handling, caching defaults, and HTTP-only surfaces
  • rules/platform.md - environment variables, next.config.*, typedRoutes, Proxy, and deployment-sensitive setup

If framework behavior may have drifted, also read:

  • references/official/nextjs-docs.md - official doc map for the rules this skill depends on

Step 3: Pre-Change Validation Checklist

Before writing any code, verify the planned change against these gates:

Brownfield Adoption Rule

  • Do not treat every untouched legacy deviation as an immediate project-wide failure.
  • Safety and boundary issues still block immediately, especially in touched files.
  • Legacy pages/ code can remain in place when the task is local and non-migratory.
  • Any file you touch should be brought into compliance unless that would require a materially risky migration.

Gate 1: Routing and File Conventions

CheckRule
page.tsx, layout.tsx, loading.tsx, error.tsx, not-found.tsx, or route.ts placed outside the expected segment structure?BLOCKED
route.ts and page.tsx created at the same route segment?BLOCKED
App Router feature work done in pages/ even though app/ already exists for that surface?BLOCKED unless explicitly requested
Route groups or private folders used without understanding URL impact?WARNING. (group) does not affect URL, _folder stays private
Segment needs loading/error/not-found UX but no boundary exists?WARNING. Add loading.tsx, error.tsx, or not-found.tsx intentionally

Gate 2: Server and Client Boundaries

CheckRule
Interactive component missing 'use client'?BLOCKED
'use client' added high in the tree without need?BLOCKED. Keep client boundaries as narrow as possible
Client Component imports server-only code, secrets, DB clients, or process.env private values?BLOCKED
Server-only helper missing import 'server-only' or equivalent protected placement?WARNING. Add a clear server-only boundary
Client Component props include broad DB records or non-serializable values?BLOCKED
Context provider placed at the document root when a deeper boundary works?WARNING. Render providers as deep as possible

Gate 3: Data Fetching and Caching

CheckRule
Initial page data fetched in a Client Component when a Server Component can do it?BLOCKED unless there is a real client-only need
Layout reads uncached runtime data and blocks same-segment loading.tsx without a closer <Suspense> boundary?BLOCKED
Cache behavior is accidental or unclear?BLOCKED. Choose and explain the cache strategy
Sensitive or privileged reads happen outside a DAL/server-only module without justification?WARNING for prototypes, BLOCKED for production-oriented code
Mutation completes without revalidatePath, revalidateTag, redirect, or another freshness strategy where the UI depends on new data?BLOCKED

Gate 4: Server Actions

CheckRule
Internal UI mutation or form submit implemented with route.ts even though a Server Action fits?BLOCKED unless real HTTP semantics are required
Action trusts form data, params, headers, or search params without validation or re-verification?BLOCKED
Action relies only on page-level auth checks?BLOCKED. Re-authorize inside the action
Action returns raw database rows or broad internal objects?BLOCKED
Action performs DB or secret-heavy work directly when a server-only DAL exists or should exist?WARNING for small code, BLOCKED for repeated domain logic
Action mutates during rendering instead of from an explicit action path (form, event, transition)?BLOCKED
redirect() called before required revalidation?BLOCKED. Revalidate first, then redirect

Gate 5: Route Handlers and Proxy

CheckRule
Internal UI mutation implemented as route.ts even though a Server Action fits better?BLOCKED unless real HTTP semantics are required
Route Handler used for webhooks, feeds, CORS, or public machine endpoints?ALLOWED
Route Handler uses NextResponse.next() to forward like Proxy?BLOCKED
Proxy added when redirects, rewrites, headers, or render-time logic would be enough?BLOCKED. Proxy is last resort
proxy.ts not placed at project root or src/ root level next to app or pages?BLOCKED
Proxy matcher is missing or too broad for the actual need?BLOCKED

Gate 6: Platform and Environment

CheckRule
.env* files assumed to load from src/?BLOCKED. They belong at project root
Client code reads non-NEXT_PUBLIC_ env vars?BLOCKED
Runtime client env needed but treated as build-time inlined config?BLOCKED. Expose via server path/API instead
Multi-proxy or reverse-proxy deployment uses Server Actions without checking serverActions.allowedOrigins needs?WARNING
Next config toggles caching, routing, or server action behavior without clear intent?BLOCKED
Typed route safety would materially reduce routing mistakes but typedRoutes is ignored in a TypeScript codebase?WARNING. Consider enabling it intentionally

Step 3.5: Auto-Remediation Policy

Auto-fix directly when the issue is local, reversible, and low-risk.

  • narrow an overly broad 'use client' boundary
  • add loading.tsx, error.tsx, or not-found.tsx for a touched segment
  • move privileged reads into a server-only helper or DAL
  • add server-only markers and tighten client props
  • add missing revalidation after a Server Action mutation
  • move a misused internal route.ts mutation to a Server Action when the change is small and local
  • tighten Proxy matcher scope or move simple redirects into next.config.*
  • correct .env / NEXT_PUBLIC_ usage and explicit config wiring

Do not auto-apply broad or potentially breaking migrations without explicit justification.

  • mass route tree rewrites
  • Pages Router to App Router migrations across large surfaces
  • sweeping cache model changes
  • turning many Route Handlers into Server Actions in one pass
  • deployment-sensitive Server Action origin or encryption-key changes

Step 4: Implementation

Carry these acceptance criteria into the active task:

- [ ] Next.js project mode validated before editing
- [ ] App Router rules applied only where they actually fit
- [ ] Routing files live in the correct route segment structure
- [ ] Server and Client Component boundaries are explicit and minimal
- [ ] Client code cannot reach server-only data, env, or modules
- [ ] Data fetching and caching strategy is intentional
- [ ] Server Actions are the default surface for internal UI writes
- [ ] Server Actions validate input, re-authorize, and return minimal data
- [ ] Route Handlers exist only for real HTTP-native needs
- [ ] Proxy is used only when simpler surfaces are insufficient
- [ ] Environment handling and next.config setup are boundary-safe

Step 5: Post-Change Verification

After writing code, verify:

  1. project mode still matches the edited surface (app/, pages/, or mixed)
  2. route segment file placement is valid
  3. 'use client' boundaries are as small as possible
  4. client code does not import server-only modules or private env
  5. data freshness after mutations is explicit (revalidatePath, revalidateTag, redirect flow, or documented alternative)
  6. Route Handlers and Proxy usage are still justified
  7. next.config.*, env loading, and deployment-sensitive settings remain coherent

Quick Reference: App Router Shape

app/
├── layout.tsx
├── page.tsx
├── dashboard/
│   ├── page.tsx
│   ├── loading.tsx
│   ├── error.tsx
│   ├── not-found.tsx
│   ├── _components/
│   └── _lib/
├── api/
│   └── webhooks/
│       └── route.ts
└── (marketing)/
    └── about/
        └── page.tsx

Key meaning:

  • (group) organizes routes without affecting the URL
  • _folder is a private implementation folder and does not become a route segment
  • route.ts is for HTTP handling, not page UI
  • loading.tsx, error.tsx, and not-found.tsx are route-segment boundaries, not general-purpose components

平台分布

Codex

36.33%
按下载量换算60

Claude

31.63%
按下载量换算53

Cursor

19.45%
按下载量换算32

Gemini CLI

9.08%
按下载量换算15

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

继续浏览同类 Skills