Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

tidbx-nextjstidbx Next.js 开发

Agent Skill

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

总安装

233

周安装

10

GitHub Stars

24

下载量

82
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/pingcap/agent-rules --skill tidbx-nextjs

简介

用于辅助前端页面、组件和样式开发。

  • 适合生成 React、Next.js 或 Tailwind CSS 相关代码。
  • 使用时需结合项目路由、构建方式和设计系统。
  • 安装命令:npx skills add https://github.com/pingcap/agent-rules --skill tidbx-nextjs
  • 涉及页面改动时应配合本地预览确认视觉效果。

SKILL.md

TiDB Next.js Integration

Set up a Next.js app (App Router) that connects to TiDB, with clear guidance on where database code can run (Node runtime) and how to avoid common serverless pitfalls.

What is different about Next.js (vs plain Node scripts)

  • Full-stack framework: UI and server code live in one project.
  • Server/client split: database code must stay server-side (route handlers, server components, server actions).
  • Multiple runtimes: some routes can run on Edge; TCP database clients must run on Node runtime.
  • File-based routing: API endpoints are files like app/api/*/route.ts.

When to use this skill

  • Build a new Next.js app that reads/writes TiDB
  • Add TiDB to an existing Next.js App Router project
  • Deploy to Vercel (or other serverless platforms) and avoid connection/caching/runtime issues
  • Decide between Prisma/Kysely vs direct mysql2

Key decisions (recommended defaults)

  1. Prefer an ORM/query builder for application code:

- Prisma ORM: tidbx-prisma - Kysely query builder: tidbx-kysely

  1. Use a direct driver (mysql2) only for minimal demos or when you need raw SQL without an ORM.
  2. Run TCP database clients in the Node.js runtime (not Edge).

TiDB Cloud pool settings (mysql2)

  • If you use a connection pool against TiDB Cloud, set the pool idle timeout to <= 300s (e.g. idleTimeout: 300_000).
  • Keep the pool small in serverless environments (often connectionLimit: 1 is enough per function/container).

Available guides

  • guides/quickstart.md -- create a Next.js app and add TiDB (Prisma-first; mysql2 alternative)
  • guides/troubleshooting.md -- runtime/env/caching/connection issues

Quick examples

  • "Add a /api/health route that queries TiDB" -> route handler + pooled connection
  • "Use Prisma in Next.js and deploy to Vercel" -> prisma singleton + route handlers
  • "My route handler fails on Vercel Edge" -> force Node runtime or switch to serverless HTTP driver

Templates

  • templates/route-handler-mysql2.ts -- App Router Route Handler that queries TiDB with mysql2 (Node runtime)
  • templates/tidb-mysql2-pool.ts -- mysql2 pool helper with TLS and serverless-friendly defaults
  • templates/prisma-client.ts -- PrismaClient singleton for Next.js (dev hot reload safe)
  • templates/route-handler-prisma.ts -- Route Handler using Prisma ($queryRaw + CRUD)

Related skills

  • tidbx-prisma -- Prisma ORM (models + migrations + typed client)
  • tidbx-kysely -- Kysely (typed query builder)
  • tidbx-serverless-driver -- TiDB Cloud serverless HTTP driver (for edge-like runtimes)
  • tidbx -- provision/manage TiDB Cloud clusters

Workflow

I will:

  1. Confirm your Next.js routing mode (App Router) and runtime target (Node serverless vs Edge)
  2. Confirm your TiDB deployment (TiDB Cloud vs self-managed) and endpoint type (public vs private)
  3. Recommend Prisma/Kysely by default, unless you explicitly want mysql2
  4. Generate the minimal files (route handler + db client helper) and env vars to get you running

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.43%
按下载量换算29

Claude

32.29%
按下载量换算26

Cursor

16.76%
按下载量换算14

Gemini CLI

9.07%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

来源信息

继续浏览同类 Skills