.agentconf/skills/database-skill/SKILL.md
Implement database-related changes in this repository, including schema changes via entities, repository/query patterns, transactions, and data migrations. Use when working on migrations, DB schema updates, or app logic that touches the database.
npx skillsauth add 6529-collections/6529seize-backend database-skillInstall 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.
Apply this skill any time work involves database schema, queries, repositories, or migrations.
src/entities (sometimes documented as src/entitites).I, example: IMyThing.tsI and suffixed with Entity, example: MyThingEntitybigint Unix epoch milliseconds for time fields over SQL datetime/date.@Entity(TABLE_NAME), add/use a table constant in src/constants/db-tables.ts (example: MY_THINGS_TABLE).my_things).*Repository, sometimes *Db).await sqlExecutor.executeNativeQueriesInTransaction(async (connection) => {
// do all the transactional stuff here by passing the connection with context
});
ctx: RequestContext the last argument of repository functions.try {
ctx.timer?.start(`${this.constructor.name}->nameOfTheCalledRepositoryFunction`);
// do whatever you need to do here
} finally {
ctx.timer?.stop(`${this.constructor.name}->nameOfTheCalledRepositoryFunction`);
}
ctx.connection when present, so operations participate in caller-provided transactions.Api* classes in repositories.src/constants/db-tables.ts instead of hardcoded table names whenever possible.execute<T>() and oneOrNull<T>().npm run migrate:new migration-name
migrations/.down migration path; do not implement revert logic.I*.ts file, *Entity class).bigint for time where applicable.src/constants/db-tables.ts.*Db classes.ctx: RequestContext as last parameter.ctx.connection when available.Api* models in repositories.development
Create, improve, or review Codex/OpenAI Agent Skills and SKILL.md files. Use when writing a new skill, updating an existing skill, designing skill frontmatter and trigger behavior, choosing scripts/references/assets, validating skill structure, or turning repeatable Codex workflows into reusable skills.
development
Write, open, iterate, merge, and optionally deploy pull requests in the 6529 SEIZE backend with clear PR descriptions, safe validation notes, review-bot follow-up, DCO-signed commits only when explicitly requested, backend/API checks, lambda deployment planning, and staging or production deployment gates. Use when preparing PR bodies, creating PRs, responding to CodeRabbit or Claude review bots, deciding whether a PR is ready, merging, or carrying a backend/API PR through staging/prod rollout.
development
Add or change identity notification types in the 6529 SEIZE backend by updating notification causes, domain data types, DB-to-domain mappers, UserNotifier creation methods, push notification rendering/settings, notification API mappings, OpenAPI enums, and tests. Use when adding new notification types, creating identity notifications, changing notification payloads, or extending push/API notification behavior.
testing
Implement database-related changes in this repository, including schema changes via TypeORM entities, repository/query patterns, request-context transactions, DB tests, and explicit data migrations. Use when working on DB schema updates, repositories or *Db classes, SQL queries, transactions, data backfills, or app logic that reads or writes MySQL data.