java/src/main/resources/targets/claude/skills/conditional/review/x-review-db/SKILL.md
Database specialist review: validates schema design, migration safety, query optimization, connection management, transaction boundaries, and data integrity patterns.
npx skillsauth add edercnj/claude-environment x-review-dbInstall 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.
Review code changes for database best practices: schema design, migration safety, query optimization, connection pool management, transaction boundaries, data integrity constraints, index strategy, and zero-downtime migration patterns.
Include this skill when database != "none" in the project configuration.
/x-review-db 42 -- review PR #42 for database patterns/x-review-db src/main/resources/db/migration/ -- review migration files/x-review-db -- review all current database changes| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| target | String | No | (current changes) | PR number or file paths to review |
| Pack | Files | Purpose |
|------|-------|---------|
| database-patterns | skills/database-patterns/SKILL.md | Schema design, migration patterns, query optimization |
Each item scores 0 (missing), 1 (partial), or 2 (fully compliant).
| # | Item | Score | |---|------|-------| | DB-01 | Tables have primary keys (no heap tables) | /2 | | DB-02 | Foreign keys defined for referential integrity | /2 | | DB-03 | Column types appropriate (no VARCHAR for dates, no TEXT for short strings) | /2 | | DB-04 | NOT NULL constraints on required columns | /2 | | DB-05 | Naming convention followed (snake_case, singular table names, descriptive columns) | /2 |
| # | Item | Score | |---|------|-------| | DB-06 | Migration is reversible (rollback script provided) | /2 | | DB-07 | Zero-downtime migration (expand/contract pattern for breaking changes) | /2 | | DB-08 | Migration tested against production-like data volume | /2 | | DB-09 | No data loss in migration (data preserved or migrated) | /2 | | DB-10 | Migration idempotent (safe to re-run) | /2 |
| # | Item | Score | |---|------|-------| | DB-11 | Indexes exist for columns used in WHERE, JOIN, ORDER BY | /2 | | DB-12 | No SELECT * (explicit column selection) | /2 | | DB-13 | Pagination for large result sets (LIMIT/OFFSET or cursor-based) | /2 | | DB-14 | No N+1 queries (batch fetching or JOIN used) | /2 |
| # | Item | Score | |---|------|-------| | DB-15 | Connection pool configured with appropriate size | /2 | | DB-16 | Transaction boundaries at use case level (not repository) | /2 | | DB-17 | Read-only transactions for queries (no unnecessary write locks) | /2 | | DB-18 | Connection timeout and validation query configured | /2 |
| # | Item | Score | |---|------|-------| | DB-19 | Unique constraints for business-unique fields | /2 | | DB-20 | Soft delete or audit trail for critical data (no hard delete without justification) | /2 |
Read the database patterns knowledge pack:
skills/database-patterns/SKILL.mdDetermine scope: migration files, entity classes, repository classes, configuration.
Check table design, constraints, naming conventions.
Verify reversibility, zero-downtime compatibility, data preservation.
Check for N+1, missing indexes, unbounded queries.
Verify transaction boundaries, read-only flags, connection management.
Produce the scored report.
ENGINEER: Database
STORY: [story-id or change description]
SCORE: XX/40
STATUS: PASS | FAIL | PARTIAL
### PASSED
- [DB-XX] [Item description]
### FAILED
- [DB-XX] [Item description]
- Finding: [file:line] [issue description]
- Fix: [remediation guidance]
### PARTIAL
- [DB-XX] [Item description]
- Finding: [partial compliance details]
| Scenario | Action | |----------|--------| | No database code found | Report INFO: no database code discovered | | No migration files found | Skip DB-06 to DB-10 and note N/A | | Database type not recognized | Warn and proceed with generic patterns |
tools
Documentation automation v2: stack-aware generation from documentation.targets.
development
Generates or updates CI/CD pipelines per project stack with actionlint validation.
tools
Generates ADRs from architecture-plan mini-ADRs with sequential numbering and index update.
development
Formats source code; first step of the pre-commit chain (format -> lint -> compile).