跳到正文
TakoAPI
返回技能列表

next-best-practices

由 tuanvidev 提供

Web & Frontend Development
1.1k下载量由 clawskills.sh 提供
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling.

描述

该技能的功能

A coding assistant skill that enforces Next.js conventions during code writing and review. Covers RSC boundaries, async API migration for Next.js 15+, metadata, image and font optimization, error handling, and bundling.

Consolidates Next.js-specific rules that are otherwise spread across multiple official docs pages, covering patterns that generic linters miss.

何时使用

  • Catching async client component errors before they reach production
  • Migrating to Next.js 15 async params, cookies, and headers APIs
  • Generating OG images with next/og for social sharing
  • Debugging hydration errors caused by browser API misuse
  • Configuring next/image for remote sources and LCP priority loading

示例工作流

输入

User asks: review my Next.js page component that uses params and cookies

智能体
  1. 1

    Check if params and cookies are awaited per Next.js 15 async API rules

  2. 2

    Detect any async client components, which are invalid in RSC boundaries

  3. 3

    Verify error boundaries (error.tsx, not-found.tsx) exist for the route

  4. 4

    Check that images use next/image instead of bare img tags

  5. 5

    Flag any non-serializable props passed across RSC boundaries

输出

A list of violations with specific fixes referencing Next.js 15 patterns

安装

clawhub install tuanvidev/next-best-practices

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接