Tech drizzle

From ravnhq/ai-toolkit · View interactive version

Tech drizzle is an AI agent skill from the GitHub repository ravnhq/ai-toolkit. Drizzle ORM typesafe schema design, relational queries, prepared statements, migrations, and transactions. Use when working with Drizzle ORM, writing database queries, managing migrations, or optimizing query performance with prepared statements.

How to use this skill

Skill file

Drizzle ORM TypeSafe Database Access

Lightweight, headless TypeScript ORM with zero dependencies. Drizzle excels at:

Core patterns: one table per file, relational API for nested queries, prepared statements for hot paths, transactions for consistency.

Workflow

When working with Drizzle ORM:

  1. Design schema — Tables, columns, constraints; one file per table
  2. Define relations — defineRelations() for one-to-many, many-to-many; enables nested queries
  3. Choose query style — Relational API for nested data (prefer), SQL builder for flexibility
  4. Optimize hot paths — Use prepared statements with placeholders for repeated queries
  5. Handle transactions — Wrap multi-operation writes in db.transaction()
  6. Test migrations — drizzle-kit migrate:dev before push; review generated SQL
  7. Type extraction — Use InferSelectModel for runtime types from schema

Rules

Patterns are organized by concern:

See rules/ for implementation patterns and examples.

Examples

Positive Trigger

User: "Define a Drizzle schema for orders with relations to users and products."

Expected behavior: Use tech-drizzle guidance, apply schema design with relational queries and type inference.

Non-Trigger

User: "Write a raw SQL migration for adding a column to the users table."

Expected behavior: Do not prioritize tech-drizzle; choose a more relevant skill or proceed without it.

Troubleshooting

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.