一键导入
db-patterns
Database access patterns, query rules, and migration conventions using Drizzle ORM + Neon. Loaded when writing queries, repositories, or migrations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Database access patterns, query rules, and migration conventions using Drizzle ORM + Neon. Loaded when writing queries, repositories, or migrations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Audit and refactor the entire codebase for code quality. Finds components that are too large or mix concerns, logic that belongs in custom hooks, inline types that should be extracted, and client components that could be server components. Produces a prioritised list of issues and fixes them all. Use when the user asks to clean up code, split components, improve code quality, or refactor the project.
Review the entire project from the perspective of a potential customer and a growth-focused CEO. Scans landing copy, product UX, API routes, DB schema, auth flow, pricing, email, and configuration — reporting specific conversion blockers, trust issues, UX problems, security gaps, and missing elements. Each finding has a severity label and a concrete fix. Use whenever the user asks for a customer review, growth review, conversion audit, or "what can be improved."
Analytics event tracking in this Next.js project — trackEvent() stub in lib/analytics.ts, Vercel Analytics auto-pageviews already wired in app/layout.tsx, and how to swap in a real provider (PostHog, Mixpanel). Use this skill whenever the user asks about analytics, tracking custom events, replacing the analytics stub, or measuring user behaviour.
Full SEO layer for this Next.js project — root layout metadata, page-level static/dynamic metadata, OG images (static + dynamic), sitemap.ts, robots.ts, JSON-LD structured data, canonical URLs, Twitter cards, and comparison/vs pages. Use this skill whenever the user asks about SEO, metadata, open graph, OG image, sitemap, robots.txt, JSON-LD, structured data, canonical URLs, Twitter cards, or adding a competitor comparison page.
Full project initialization after cloning the boilerplate. Installs dependencies, walks through .env setup, configures the database, and writes a project-specific CLAUDE.md. Run this once after cloning. Triggers on /init-project.
REST API structure, error handling, and response shapes for Next.js App Router routes. Loaded when writing or reviewing API route handlers.
| name | db-patterns |
| description | Database access patterns, query rules, and migration conventions using Drizzle ORM + Neon. Loaded when writing queries, repositories, or migrations. |
db/
├── drizzle.ts ← db client; all tables + relations registered here
└── schema.ts ← re-exports all table schemas for drizzle-kit
modules/[name]/
├── [name].schema.ts ← pgTable definition
├── [name].relations.ts ← Drizzle relations (required for `with`)
└── [name].repo.ts ← all DB queries for this entity
[name].repo.tsUse db.query.* for reads with relations, db.insert/update/delete for writes:
// read with relation
db.query.postTable.findMany({
where: eq(postTable.authorId, userId),
orderBy: (t, { desc }) => [desc(t.createdAt)],
with: { author: { columns: { id: true, name: true } } },
});
// write — always .returning()
const [post] = await db.insert(postTable).values(data).returning();
const [updated] = await db
.update(postTable)
.set(data)
.where(eq(postTable.id, id))
.returning();
await db.delete(postTable).where(eq(postTable.id, id));
columns: — never fetch everything when only a subset is usedwith: for eager loading relations (requires [name].relations.ts — see drizzle-relations skill)npx drizzle-kit generate # generate SQL migration from schema changes
npx drizzle-kit push # apply migration to DB (dev)
migrations/Every new table AND its relations file must be added to db/drizzle.ts:
import { newTable } from '@/modules/new/new.schema';
import { newRelations } from '@/modules/new/new.relations';
export const db = drizzle(sql, {
schema: {
// ...existing entries
newTable,
newRelations,
},
});
Also add to db/schema.ts:
export * from '@/modules/new/new.schema';
db in route handlers — go through the repo layerWHERE or JOINdeletedAt soft delete if explicitly requested