database-lens

Assess database migrations, schemas, queries, and transactions for migration safety risks.

30|1|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/atomicinnovation/accelerator --skill database-lens
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-lens
Source: https://github.com/atomicinnovation/accelerator/tree/main/skills/review/lenses/database-lens
Command: npx skills add https://github.com/atomicinnovation/accelerator --skill database-lens

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This lens prevents data loss, downtime, and integrity regressions by evaluating database migrations, schema changes, queries, and transaction usage for real-world production risks.

Core Features & Use Cases

  • Migration Safety Evaluation: Identify rollback hazards, locking implications, zero-downtime compatibility, idempotency issues, and backfill correctness for migrations.
  • Schema and Integrity Assessment: Check constraints, indexes, column types, referential integrity, and appropriate defaults relative to access patterns and data scale.
  • Query and Transaction Review: Detect NULL-handling issues, N+1 patterns, unbounded result sets, improper transaction scoping, and connection pool concerns.
  • Use Case: When a feature introduces several migrations and ORM model changes, run this lens to produce a prioritized migration-risk report that the team can act on before deployment.

Quick Start

Review the repository for database-related changes and produce a migration safety and schema integrity report.

Frequently Asked Questions about database-lens

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check database migrations for locking and rollback hazards?

Database migration safety evaluation identifies table-locking implications, rollback hazards, and zero-downtime compatibility issues. It assesses migration scripts for idempotency and backfill correctness to prevent data loss and downtime during schema changes.

What is the best way to review schema changes and constraints for data integrity?

Schema and integrity assessment reviews constraints, indexes, column types, and referential integrity relative to access patterns. It checks appropriate defaults and data scale to prevent integrity regressions during feature rollouts.

How do I detect N+1 query patterns and improper transaction scoping in my codebase?

Query and transaction review detects N+1 patterns, unbounded result sets, and improper transaction scoping by analyzing SQL files, ORM configurations, and connection settings to flag connection pool concerns and NULL-handling issues.

Does this database review process work with ORM configurations and raw SQL files?

Yes, the database review process applies engine-specific analysis across ORM configurations, raw SQL files, and connection settings. It evaluates schema changes and transaction handling in codebases undergoing refactors or new feature rollouts.

When do I need to evaluate migration idempotency and backfill correctness?

You need to evaluate migration idempotency and backfill correctness whenever a feature introduces schema changes or data migrations. This prevents data loss and integrity regressions by ensuring migrations can safely re-run and populate columns correctly.