Agent Skills
› muratgur/ordinus
› sqlite-minimal-persistence
sqlite-minimal-persistence
GitHub保守使用SQLite持久化本地状态,仅在明确需要时创建最小表结构。避免预建无关表,强制主进程拥有数据并通过IPC访问,确保类型安全与迁移测试覆盖。
触发场景
涉及 better-sqlite3、Drizzle schema 或数据库引导逻辑
讨论 app_meta、迁移或持久化边界设计
提议添加新的产品数据表
安装
npx skills add muratgur/ordinus --skill sqlite-minimal-persistence -g -y
SKILL.md
Frontmatter
{
"name": "sqlite-minimal-persistence",
"description": "Extend Ordinus SQLite persistence conservatively. Use when touching better-sqlite3, Drizzle schema, database bootstrap, app_meta, migrations, durable state, persistence boundaries, or proposals to add new product tables."
}
SQLite Minimal Persistence
Objective
Use SQLite as durable local app state without designing product tables before the workflow model is clear.
Current Policy
- The minimum database starts with
app_meta. - Add new tables only when the product behavior needs durable state now.
- Avoid adding agent, task, provider, schedule, inbox, or run schemas speculatively.
- Keep secrets out of ordinary product tables unless a secure storage decision has been made.
- Treat SQLite as main-process owned. Renderer must access state only through typed IPC.
Workflow
- Confirm the requested behavior truly needs persistence.
- Check whether existing
app_metaor settings-level storage is sufficient. - If a table is necessary, define the smallest schema that supports the current behavior.
- Add Drizzle schema and bootstrap/migration logic together.
- Keep data access behind main-process services.
- Update
db.getStatusonly if the status surface needs to show new bootstrap information. - Run typecheck, lint, build, and a runtime smoke test that opens the app.
Design Guidance
- Prefer durable state for user-visible history, resumable work, and app configuration.
- Prefer filesystem storage for large artifacts and generated files, with database metadata later when needed.
- Prefer explicit timestamps and schema versioning for local migrations.
- Keep schema names product-oriented and stable.
Red Flags
- A table is added because a future module might need it.
- Renderer imports database code.
- Database writes are mixed into UI event handlers.
- Migration behavior is not exercised by opening the app.
版本历史
- f507122 当前 2026-07-05 18:19


