From bitwarden-software-engineer
Bitwarden database architecture, migrations, and dual-ORM strategy. Use when working with .sql files, stored procedures, EF migrations, or database schema changes.
npx claudepluginhub bitwarden/ai-plugins --plugin bitwarden-software-engineerThis skill uses the workspace's default tool permissions.
Bitwarden maintains two parallel data access implementations:
Generates safe, reversible database migrations from schema diffs and model changes for PostgreSQL, MySQL, Prisma, Django, Rails, Laravel.
Guides safe database migrations for schema changes, data backfills, rollbacks, and zero-downtime deployments across PostgreSQL, MySQL, and ORMs like Prisma, Drizzle, Kysely, Django, TypeORM.
Provides zero-downtime SQL migration strategies for PostgreSQL, MySQL, and SQL Server including scripts, rollback procedures, validation checks, and performance optimizations. Use for production database schema changes.
Share bugs, ideas, or general feedback.
Bitwarden maintains two parallel data access implementations:
Every database change requires both implementations. Repository interfaces abstract both — when a stored procedure performs specific operations, the EF implementation must replicate identical behavior.
Bitwarden Cloud uses zero-downtime deployments with a multi-phase migration strategy:
util/Migrator/DbScripts): Runs before code deployment. Must be backwards-compatible.util/Migrator/DbScripts_transition): Runs after deployment. Handles batched data migrations only — no schema changes.util/Migrator/DbScripts_finalization): Runs at the next release. Removes backwards-compatibility scaffolding.Simple additive changes (new nullable column, new table, new stored procedure) only need Phase 1.
Always defer to the developer on migration phasing. The multi-phase approach is complex and context-dependent. When a database change is needed, write the migration script for Phase 1 and ask the developer whether additional phases are required.
src/Sql/dbo — Master schema source of truthsrc/Sql/dbo_finalization — Future schema stateutil/Migrator/DbScripts_manual — Exceptional cases (index rebuilds)When implementing Dapper repository methods, stored procedures, or MSSQL migration scripts, activate the implementing-dapper-queries skill.
When implementing EF Core repositories, generating EF migrations, or working with PostgreSQL/MySQL/SQLite, activate the implementing-ef-core skill.
These are the most frequently violated conventions. Claude cannot fetch the linked docs at runtime, so these are inlined here:
YYYY-MM-DD_##_Description.sql (e.g., 2025-06-15_00_AddVaultColumn.sql)dbo schema — never create objects in other schemasPK_TableName (primary key), FK_Child_Parent (foreign key), IX_Table_Column (index), DF_Table_Column (default)IF NOT EXISTS / IF COL_LENGTH(...) guards before schema changes in migration scripts[DatabaseData] attribute — this runs the test against all configured database providers