Terminal
Terminal/Skill
Builds Next.js App Router apps that read and write TiDB, covering route handlers, Node vs Edge runtimes and Vercel deployment.
By PingCAP (TiDB)
Works with
npx skills add pingcap/agent-rules --skill tidbx-nextjsSet 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.
app/api/*/route.ts.tidbx-prismatidbx-kyselymysql2) only for minimal demos or when you need raw SQL without an ORM.idleTimeout: 300_000).connectionLimit: 1 is enough per function/container).guides/quickstart.md -- create a Next.js app and add TiDB (Prisma-first; mysql2 alternative)guides/troubleshooting.md -- runtime/env/caching/connection issuestemplates/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 defaultstemplates/prisma-client.ts -- PrismaClient singleton for Next.js (dev hot reload safe)templates/route-handler-prisma.ts -- Route Handler using Prisma ($queryRaw + CRUD)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 clustersI will: