nextjs-project-standard
Next.js 14+ 项目规范,涵盖 App Router、SSR/SSG、流式渲染、路由与布局、数据获取、中间件、元数据与 SEO。当用户在 Next.js 项目中创建、修改页面或模块时自动激活。
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/bovinphang/nextjs-project-standardWhat This Skill Does
The nextjs-project-standard skill is a specialized architectural assistant designed for OpenClaw to enforce consistency, performance, and security across Next.js 14+ projects using the App Router. It acts as an expert technical consultant, ensuring that your codebase adheres to modern React server component paradigms, optimal data fetching strategies, and effective routing patterns. By leveraging this skill, you can automate the creation of boilerplate code, validate directory structures, and ensure that your implementation of metadata, streaming (Suspense), and rendering patterns (SSR/SSG/ISR) follows industry best practices. It essentially acts as a guardrail for your development workflow, helping you avoid common pitfalls like over-using client-side state or improper route grouping.
Installation
To integrate this skill into your environment, run the following command in your terminal:
clawhub install openclaw/skills/skills/bovinphang/nextjs-project-standard
Use Cases
- Project Initialization: Establishing a standardized folder structure, including route groups, API route organization, and common utility directories.
- Component Development: Determining whether a specific UI module should be a Server Component or a Client Component based on interaction requirements.
- Performance Optimization: Refactoring existing pages to use ISR (Incremental Static Regeneration) or streaming components via Suspense for a faster First Contentful Paint (FCP).
- SEO Management: Generating boilerplate for dynamic
generateMetadatafunctions to ensure high search engine visibility. - Auth & Middleware: Structuring authentication logic within
middleware.tsto protect routes effectively without degrading site performance.
Example Prompts
- "I need to set up a new dashboard route in my Next.js 14 project using a route group for authentication. Can you generate the folder structure and the necessary layout.tsx?"
- "How can I optimize my product detail page for SEO using generateMetadata and implement ISR with a 60-second revalidation time?"
- "Refactor my current page.tsx to use streaming with Suspense for data fetching so that the page isn't blocked by slow API requests."
Tips & Limitations
To maximize the efficiency of this skill, ensure you are utilizing the latest version of Next.js. While the skill is excellent at enforcing architectural standards, remember that it cannot replace your own judgment regarding business logic complexity. Always verify that sensitive environment variables are handled in server-side logic only. The skill strictly enforces the 'use client' directive; ensure you are not unnecessarily putting this at the top of every file, as it prevents Server Component optimizations.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-bovinphang-nextjs-project-standard": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-read, file-write
Related Skills
legacy-web-standard
针对 JavaScript + jQuery + HTML/CSS 传统前端项目的开发与维护规范。当用户在非框架项目中工作,涉及 jQuery、原生 JS、传统多页面应用(MPA)、模板引擎渲染页面、或维护遗留代码时自动激活。
accessibility-check
审查或改进前端 UI 的语义结构、键盘支持、焦点管理、标签以及常见的 WCAG 相关问题,并将报告保存为 Markdown 文件。当用户提到无障碍、accessibility、a11y、WCAG,或在实现交互组件时自动激活。
security-review
前端代码安全审查,检测 XSS、CSRF、敏感数据泄露、不安全的用户输入处理和依赖风险,并将报告保存为 Markdown 文件。当用户要求安全检查、安全审查,或代码涉及用户输入、认证、支付、文件上传等敏感操作时自动激活。
test-and-fix
执行项目校验命令(lint、type-check、test、build),分析失败原因,安全修复问题,并将总结报告保存为 Markdown 文件。当用户要求检查、验证、测试代码改动时自动激活。
frontend-code-review
从架构、可维护性、类型安全、可访问性、样式一致性、性能和可测试性等角度审查前端代码,并将报告保存为 Markdown 文件。当用户要求代码审查、Review、评审代码质量时自动激活。