원클릭으로
conventions-db
Apply when writing or modifying database schema, queries, or migrations.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Apply when writing or modifying database schema, queries, or migrations.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | conventions-db |
| description | Apply when writing or modifying database schema, queries, or migrations. |
Apply when writing or modifying database schema, queries, or migrations.
/apps/api/src/db/schema.tsbun run db:push)schema.ts and delete in dependency order: delete the
parent with cascade FKs first (removing referencing rows),
then delete restrict-FK targets last.Schema changes must be additive across at least one deploy. Add new tables/columns/indexes first, deploy code that can read and write both shapes, backfill separately when needed, switch reads/writes, then drop the old shape in a later release.
Remember the deploy order: migrations run before the new API tasks finish rolling out. Old API tasks can serve requests against the new schema during the rollout, and a failed rollout can leave the old API running on the new schema.
Drizzle does not generate down migrations. If a migration succeeds and the application rollout fails, rollback is a manual forward fix unless the old application remains schema-compatible.
Do not include irreversible schema operations in the same release as risky application code. Split them into a small migration-only release or an additive preparatory release.
Destructive or backwards-incompatible SQL requires an explicit acknowledgement
in the migration file. scripts/check-migration-safety.ts blocks guarded
operations such as DROP, TRUNCATE, DELETE FROM, table/column renames,
dropped constraints, column type changes, and disabling row-level security
unless the file includes:
-- stella-migration-safety: reviewed destructive-change - <why this is safe and how rollback is handled>
Treat existing large-table changes as lock-sensitive. Prefer CREATE INDEX CONCURRENTLY, avoid table rewrites in request-critical tables, and backfill
in bounded batches outside the schema migration when the data volume can grow.
db.query.*.findFirst,
findMany) over SQL-like syntax (select().from().where()).
Use SQL-like syntax only for cross-table filtering,
aggregations, unions.limit and a cursor or
offset. Never return an unbounded findMany without a limit.WHERE, ORDER BY, or
JOIN. Lead composite indexes with the tenant-scoping column.WHERE clauses.
Fetch by an indexed column, then validate the JSONB content
in application code. Narrow the discriminated union with a
type guard instead of using as casts.SELECT ... FOR UPDATE lock from the read that makes the decision, re-checking the
status inside that same locked read, or express the precondition directly
in the mutating statement's WHERE clause and check the affected-row
count instead of trusting the earlier read. A plain read followed by an
unconditional write is a race between concurrent requests. See
apps/api/src/handlers/invoices/lock-invoice.ts for the reference
implementation shared by the invoice update/transition/delete handlers.Drive the stella command-line client (@stll/cli), a legal-workspace CLI whose command surface is generated from the stella MCP tool registry. Covers install, OAuth login, the full command tree grouped by domain, JSON output for scripting, the --input escape hatch for deep payloads, cursor pagination, destructive-op confirmation, and exit codes.
Apply when writing or reviewing React effects in apps/web. Direct useEffect is banned; use the sanctioned wrappers or a better primitive.
Apply when a performance-guard check (network baseline, bundle baseline, DB query count, loader-prefetch lint, RC bailouts) fails or when touching a hot route/endpoint.
Internationalization conventions for Stella. Apply when adding or modifying user-facing strings.
Apply when building or modifying user-facing UI components.
Review and update third-party dependencies. Use this when asked to upgrade packages, survey new minor or major releases for useful features, assess whether Stella can adopt them, or validate whether a release looks suspicious before bumping it.