skills/database/tech-drizzle/SKILL.md
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.
npx skillsauth add ravnhq/ai-toolkit tech-drizzleInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Lightweight, headless TypeScript ORM with zero dependencies. Drizzle excels at:
.with() without manual joinsCore patterns: one table per file, relational API for nested queries, prepared statements for hot paths, transactions for consistency.
When working with Drizzle ORM:
defineRelations() for one-to-many, many-to-many; enables nested queriesdb.transaction()drizzle-kit migrate:dev before push; review generated SQLInferSelectModel for runtime types from schemaPatterns are organized by concern:
with() for nested data, partial columns, filteringSee rules/ for implementation patterns and examples.
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.
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.
Error: Running unprepared queries in tight loops
Cause: Query compiled every execution; no reuse of parsed SQL
Solution: Use .prepare() with placeholders; execute multiple times with different params
Error: Manual joins in code; fetching parent then children separately
Cause: Not using relational API; writing complex join logic
Solution: Define relations, use .with() to fetch nested data in single query
Error: Column not included in result when selecting from relation
Cause: Selecting from nested relation without explicitly including columns
Solution: Use columns: { id: true, name: true } to specify nested relation columns
Error: Transaction rolls back unexpectedly; no clear error
Cause: Unhandled promise rejection inside db.transaction()
Solution: Wrap transaction operations in try/catch; all errors must be caught
Error: Schema types not updating after migration
Cause: drizzle-kit didn't regenerate types; cache stale
Solution: Run drizzle-kit generate after migration changes
testing
Transform user requests into detailed, precise prompts for AI models. Use when users say 'promptify', 'promptify this', 'rewrite this prompt', 'make this prompt better/more specific', or explicitly request prompt engineering or improvement of their request for better AI responses.
tools
Manage AI skills from the Ravn AI Toolkit via corvus CLI — install, update, remove, search, and configure skills for any project. Use when: (1) Installing AI skills into a project, (2) Updating installed skills to latest versions, (3) Browsing or searching available skills, (4) Configuring global or per-project skill sets, (5) Troubleshooting corvus setup. Triggers on: "install skills", "add skills", "update skills", "corvus", "skill manager", "browse skills", "set up AI rules".
development
Generate a gallery of design variations for a UI component. Takes an existing component (referenced by name, pasted code, or screenshot) and produces N distinct rendered alternatives in a single comparison page. Use when exploring visual directions, generating mockups, comparing design approaches for a component, creating A/B candidates, or when anyone says "show me options" or "give me variations" for a UI element.
tools
Create custom QA agent personalities for project-specific testing needs. Guided builder that asks about the specialty, tools, and test scenarios, then generates a personality file and registers it in the QA config. Trigger on "create a QA personality", "add a custom test agent", "build a webhook tester", or when the user needs a project-specific QA agent. Also triggered by /qa-create-personality.