ai-infrastructure-hugg…
Hugging Face Inference SDK patterns for TypeScript/Node.js — InferenceClient setup, chat completion, text generation, streaming,…
Drizzle ORM, queries, migrations
Claude Code
$ npx -y skills add agents-inc/skills --skill api-database-drizzle --agent claude-code
Codex
$ npx skills add agents-inc/skills --skill api-database-drizzle -a codex -y
Cursor
$ npx skills add agents-inc/skills --skill api-database-drizzle -a cursor -y
Gemini CLI
$ npx skills add agents-inc/skills --skill api-database-drizzle -a gemini-cli -y
GitHub Copilot
$ npx skills add agents-inc/skills --skill api-database-drizzle -a github-copilot -y
OpenCode
$ npx skills add agents-inc/skills --skill api-database-drizzle -a opencode -y
Windsurf
$ npx skills add agents-inc/skills --skill api-database-drizzle -a windsurf -y
name: api-database-drizzle description: Drizzle ORM, queries, migrations
> **Quick Guide:** Use Drizzle ORM for type-safe queries, Neon serverless Postgres for edge-compatible connections. Schema-first design with automatic TypeScript types. Use RQB v2 with `defineRelations()` and object-based `where` syntax. Relational queries with `.with()` avoid N+1 problems. Use transactions for atomic operations.
---
<critical_requirements>
**(You MUST set `casing: 'snake_case'` in Drizzle config to map camelCase JS to snake_case SQL)**
**(You MUST use `tx` parameter (NOT `db`) inside transaction callbacks to ensure atomicity)**
**(You MUST use `.with()` for relational queries to avoid N+1 problems - fetches all data in single SQL query)**
**(You MUST use `defineRelations()` for RQB v2 - the old `relations()` per-table syntax is deprecated)**
</critical_requirements>
---
**Detailed Resources:**
---
**Auto-detection:** drizzle-orm, @neondatabase/serverless, neon-http, db.query, db.transaction, drizzle-kit, pgTable, defineRelations, drizzle-seed
**When to use:**
**When NOT to use:**
---
<patterns>
Configure Drizzle with Neon for serverless/edge compatibility. Key setup requirements:
export const db = drizzle(sql, {
schema,
casing: "snake_case", // Maps camelCase JS to snake_case SQL
});Full connection setup, WebSocket config, and Drizzle Kit config in [examples/core.md](examples/core.md).
---
Define tables with TypeScript types using Drizzle's schema builder:
export const companies = pgTable("companies", {
id: uuid("id").primaryKey().defaultRandom(),
name: varchar("name", { length: 255 }).notNull(),
slug: varchar("slug", { length: 255 }).unique(),
deletedAt: timestamp("deleted_at"), // Soft delete
createdAt: timestamp("created_at").defaultNow(),
});Full schema examples (enums, relations, junction tables, identity columns) in [examples/core.md](examples/core.md).
---
Fetch related data efficiently in a single SQL query using `.with()`:
const job = await db.query.jobs.findFirst({
where: and(eq(jobs.id, jobId), isNull(jobs.deletedAt)),
with: {
company: { with: { locations: true } },
jobSkills: { with: { skill: true } },
},
});
// Result is fully typed: job.company.name, job.jobSkills[0].skill.nameFull relational query examples, N+1 anti-patterns, and dynamic filtering in [examples/queries.md](examples/queries.md).
</patterns>
---
The following patterns are documented with full examples in [examples/](examples/):
Performance optimization (indexes, prepared statements, pagination) is documented in [reference.md](reference.md#performance-optimization).
---
<red_flags>
**Gotchas & Edge Cases:**
The official skills marketplace for Agents Inc. 230+ skills covering everything from React and Prisma to Redis, ElevenLabs, and infrastructure tooling. Pick the skills that match your stack and install them via Claude Code. Need more control?
Hugging Face Inference SDK patterns for TypeScript/Node.js — InferenceClient setup, chat completion, text generation, streaming,…
LiteLLM proxy server setup, TypeScript client patterns via OpenAI SDK, model routing, fallbacks, load balancing, spend tracking,…
Serverless GPU compute platform for AI model deployment — web endpoints, GPU functions, model serving, and TypeScript client…
Local LLM inference with the Ollama JavaScript client -- chat, streaming, tool calling, vision, embeddings, structured output,…
Replicate SDK patterns for TypeScript/Node.js -- client setup, predictions, streaming, webhooks, file handling, model versioning,…
Together AI SDK patterns for TypeScript — client setup, chat completions, streaming, structured output, function calling,…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.