Agent Skills
› NicholasFlemmer/styx-app
› db-migration
db-migration
GitHub管理主进程 SQLite 数据库的 Drizzle 架构变更工作流,涵盖编辑 Schema、生成迁移文件、手动添加约束与触发器、更新种子数据及测试前向/回滚迁移。
Trigger Scenarios
需要修改数据库表结构
执行数据库迁移脚本
验证数据迁移兼容性
Install
npx skills add NicholasFlemmer/styx-app --skill db-migration -g -y
SKILL.md
Frontmatter
{
"name": "db-migration",
"description": "Drizzle schema change workflow for the main-process SQLite - edit schema, generate migration, hand-add CHECK\/triggers, update seed\/fixtures, test forward + rollback, keep audit table append-only.",
"allowed-tools": "Read, Edit, Write, Bash(pnpm:*), Bash(sqlite3:*)",
"argument-hint": "<change summary>"
}
DB migration: $ARGUMENTS
- Edit
apps/desktop/src/main/db/schema.ts. pnpm db:generate→ review SQL inapps/desktop/src/main/db/migrations/; addCHECKconstraints and triggers by hand (drizzle-kit does not emit them for SQLite).audit_entries: additive changes only; theRAISE(ABORT)triggers stay.- Update zod row schemas / mappers in core,
packages/core/src/fixtures/demo.ts, andscripts/seed.ts. - Test: migrate a fresh DB; migrate a DB seeded at the previous version; verify data. Reversible changes get a down migration + test.
- Column-name review: any
token|secret|password|keycolumn that could hold a secret is rejected (onlycredential_ref). pnpm test -F @styx/desktop.
Version History
- 1d72019 Current 2026-10-18 15:22


