一键导入
drizzle-tenant-queries
Use this skill when you write or review any Drizzle DB read/write and must enforce strict `workspace_id` tenant isolation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use this skill when you write or review any Drizzle DB read/write and must enforce strict `workspace_id` tenant isolation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use this skill when you need to diagnose and fix React 19 performance issues (render churn, slow updates, Suspense/Transitions, memoization, profiling, and React Compiler).
Write clean, behavior-focused unit/integration tests that remain trustworthy when code is written or modified by agents (prevents “test weakening”, enforces invariants, and adds CI guardrails).
Use this skill when you are creating or updating Agent Skills in your project (structure, YAML frontmatter, naming, and progressive disclosure).
Use this skill when designing or refactoring boundaries, responsibilities, and change drivers using practical software architecture “hard parts” thinking + SRP.
Use this skill when you need a Bun runbook (dev, build, lint, typecheck, tests, migrations, and verification steps).
Use this skill when you need a thorough code hygiene pass (dead code, lint escapes, consistency, formatting drift, and subtle smells) on touched files.
| name | drizzle-tenant-queries |
| description | Use this skill when you write or review any Drizzle DB read/write and must enforce strict `workspace_id` tenant isolation. |
Use this skill whenever you write or review Drizzle ORM queries. Goal: absolute tenant isolation and correctness for money/time data.
workspaceId server-side via your tenant/workspace guard (Server Actions / Server Components); never trust client params.db.query.table.findMany({ where: eq(table.workspaceId, workspaceId), ... })where with the entity ID.Example (list projects with client):
const rows = await db.query.projects.findMany({
where: eq(projects.workspaceId, workspaceId),
with: { client: true },
});
Example (update invoice guarded):
await db
.update(invoices)
.set({ status: "draft" })
.where(
and(eq(invoices.id, invoiceId), eq(invoices.workspaceId, workspaceId))
);
cache() when reused within a request.getClientsByWorkspace, getProjectsByWorkspace, getInvoiceWithItems (scoped).Tenant-safe caching rules:
cache() is safe when the function arguments include workspaceId.next/cache) must include workspace identity in keys/tags.See also: nextjs-cost-performance skill
inArray(...) or use Drizzle relations (with).Promise.all for independent reads.workspace_id, foreign keys, timestamps) via migrations.