Database design quality review checks whether a supplied schema and migration plan support stated business invariants. An ERD or field name alone cannot establish uniqueness, tenant isolation, retention, or query performance.

Why this Skill is needed

Database Design Quality Review evaluates whether a schema can preserve business invariants, support access patterns, isolate tenants, and evolve safely.

What the Skill does

Use this Skill before implementation to review supplied ERDs, DDL, ORM schemas, and migration or recovery plans. It covers entities, relationships, keys, constraints, indexes, tenancy, lifecycle, access patterns, transactions, concurrency, migration, and recovery, including incomplete or conflicting inputs that need a bounded review and handoffs that must surface unverified items.

Awesome QA Skills: https://github.com/naodeng/awesome-qa-skills organizes Skills by language and testing stage. The series overview: https://inaodeng.com/en/blog/ai-testing/introduction_of_awesome_qa_skills/ explains the shared installation model; this guide stays with Database Design Quality Review.

A good review starts from invariants and real queries. It asks what prevents two refunds for one payment, what stops a cross-tenant lookup, and what happens when a migration stops halfway.

What it does not do

The Database Design Quality Review Skill reviews supplied ERDs, DDL, ORM schemas, and migration or recovery plans before implementation. It does not replace:

  • Confirmation of rules, scope, and risk by the accountable domain owner.
  • A real environment, account, dataset, log, or run record; static analysis does not become runtime evidence by itself.
  • Authorization for release, compliance, production actions, or residual-risk acceptance.
  • A Human decision when supplied sources conflict.

What it checks

Connect each focus area to an observable input, a judgment, and a closeable next action. Start with a small matrix based on the source Skill’s output contract:

FocusQuestion before analysisHandoff output
Model and relationshipsEntities, cardinality, keys, ownership, and tenant scopeObject-level coverage
Constraints and accessUnique/not-null/check rules tied to requirements; indexes tied to real query patterns and data volumeIntegrity and index risks
Transactions and concurrencyTransaction boundaries, isolation, concurrent writes, and failure handlingUnassessed race conditions
Lifecycle and privacyRetention, deletion, ownership, privacy rules, and backup scopeSource-backed lifecycle gaps
Migration and recoveryCompatibility, backfill, partial failure, rollback, backup/restore, and recovery readinessPreconditions and validation owner

If a row has only a conventional expectation and no source or validation method, keep it open instead of turning it into a pass.

Audit inputs before you start

Before reviewing a database object, classify the supplied schema, requirements, workload, migration, and recovery evidence into six states. A gap is not automatically a defect, but it must not disappear inside the conclusion.

StateMeaningHow this Skill should handle it
knownDirectly supported by the supplied materialKeep the source, version, and time with the judgment
missingNeeded for this pass but not suppliedName the smallest evidence action and limit the conclusion
conflictingSources disagreeShow both sources and route the conflict to an owner
stalePresent but outside the relevant version or time windowMark freshness; old evidence is not current proof
out_of_scopeRelated but excluded from this passKeep the boundary explicit
assumptionsTemporarily adopted to continue analysisState how and when the assumption will be checked

Keep the input version, scope, environment, evidence locations, and accountable owner together. Without a run record, deliver analysis, design, or a validation plan—not an execution pass.

From problem to structured Finding

Connect the source, scope, evidence state, analysis, owner, action, close condition, and validation before writing the conclusion. The case below keeps this Skill’s identifier and domain context.

Keep the decision layers separate

For each DB-## finding, separate facts, evidence-backed inferences, recommendations, and Human decisions:

LayerHow to write itApplication here
FactWhat the supplied material directly showsCite the source, version, input, or run record for the focus
Evidence-backed InferenceWhat several facts support togetherShow the inference chain and retain uncertainty
RecommendationThe smallest next actionName the evidence, review, execution, or regression path
Human DecisionWhat an accountable person must decideLeave scope, risk acceptance, resources, and release meaning to the owner

A complete case

This case follows Input, Analysis, Finding, Decision, and Validation. When material is incomplete, keep missing, conflicting, or assumptions visible instead of turning them into a pass.

Input

MaterialWhat to provideWhat to do when it is missing
Domain rulesOrder identity, refund uniqueness, status lifecycle, and retentionTie each invariant to a source
Access patternsLookup, reporting, pagination, writes, and tenant filtersDo not choose indexes from table shape alone
Change planMigration, backfill, rollback, volume, and recoveryMark irreversible steps

Use a request like this:

Use the database-design-quality-review Skill.

Task: review a multi-tenant order and refund schema before the first production migration
Inputs: [requirements, versions, links, logs, reports, or data paths]
Scope: [included and excluded objects]
Unknowns: [missing environment, accounts, data, or permissions]
Expected output: [risk-ordered findings, evidence status, and next actions]

Audit the inputs first. Separate facts, assumptions, and open questions. Do not claim execution without a run record.

Analysis

Use a conditional example, not an assumed business rule: if a supplied requirement explicitly says that each payment may have at most one refund, and the supplied DDL shows no matching constraint, record a possible enforcement gap. Check whether the application or transaction design provides the rule before calling it a defect. If partial refunds or multiple refund rows are allowed, or the requirement is absent, mark that rule missing or unassessed instead of inferring it from column names. A migration review should then ask how existing rows are checked, how conflicts are handled, and what rollback is available; do not run the migration.

The handoff should preserve the input version, time window, evidence index, owner, and next validation action. The Skill can organize uncertainty; it cannot manufacture the missing artifact.

Finding

Example finding: turn one problem into a handoff

The field example below shows the recording pattern; it is not an execution result.

Use the source prompt’s DB-## finding contract. This redacted example is conditional on the supplied requirement and DDL; it does not assert a defect in a real database.

DB-01 fieldConditional example
Object/scope and sourcerefund.payment_id in the supplied, versioned DDL; attach the explicit refund rule and schema excerpt
Design rule and findingIf the requirement permits one refund per payment, the excerpt shows no matching unique constraint; other enforcement is not yet known
Statusmissing until application, transaction, and full-schema evidence are reviewed; not yet a confirmed defect
Impact/severityNot scored until the business impact and affected data scope are supplied
Constraint/index riskNo matching constraint is visible in the excerpt; query and index risks need actual access patterns and volume
Transaction/concurrencyRequest transaction boundaries, isolation, and concurrent-write behavior; do not infer them from the table
Migration/rollbackCheck existing duplicates, backfill order, compatibility, and rollback evidence before recommending a constraint change
Owner/close/validationA data or domain owner confirms the invariant; a database owner supplies the full DDL and migration plan for isolated review; retain the reviewed sources, with no production query or migration claimed

This handoff lets the next reviewer trace the concern to its source and see which evidence or decision remains open.

Decision

The accountable owner confirms the decision question and risk trade-off; the Skill does not make that choice.

Validation

Before closing the finding, run the stated validation and retain the raw artifact. Without an execution record, the status remains unverified.

How a Finding enters the next stage

Handoff output

Output fieldWhy it existsExample status
Data-object coverageEntities, constraints, access patterns, ownership, and lifecycle by objectSource and gaps
Migration and rollbackCompatibility, backfill, partial failure, rollback, backup, and recoveryPreconditions
Validation preparationSmallest isolated check for the named design riskOwner and required evidence

Do not write “passed” without execution identity, time, environment, inputs, and raw results. A static review can prepare the query, constraint, migration, or recovery validation; it cannot claim that one ran.

Next-stage route

At minimum, hand off the source, evidence state, owner, close condition, and validation action; the next-stage conclusion remains bounded by the evidence state.

How to prepare better input

If the first request contains only a one-line goal, keep the output limited. Add the source version, affected objects, environment, known defects, and decision owner to move from a plausible checklist to a useful review.

A richer input changes the answer here because entities, relationships, keys, constraints, indexes, tenancy, lifecycle, migration, and recovery must be tied to evidence rather than inferred from a familiar pattern.

Best practices

  • Start with the highest-impact invariant or migration concern, then request the smallest missing artifact needed to assess it.
  • Review constraints and indexes alongside access patterns, transactions, concurrency, lifecycle, migration, rollback, and recovery; do not derive business rules from names.

Working with other Skills

Common traps

  1. Reviewing columns without lifecycle states.
  2. Adding an index without a query or volume assumption.
  3. Calling a migration reversible when data transformation loses the old representation.

Install and invoke

Install the English Skill from its language directory. The series overview carries the shared installation instructions.

npx skills add https://github.com/naodeng/awesome-qa-skills/tree/main/skills/en --skill database-design-quality-review

After installation, invoke it with the database-design-quality-review Skill and attach the real project material.

FAQ

Can the review happen before database choice?

Yes. Invariants and access patterns should exist before a technology-specific design is finalized.

What if product rules conflict with legacy data?

Keep the conflict visible and plan a data decision; do not hide it in a nullable column.

The example above is a design and review pattern, not an execution result. Keep static analysis, runtime evidence, human approval, and release acceptance separate.

References

Source Skill and execution contract

The complete execution contract lives in the Database Design Quality Review prompt: https://github.com/naodeng/awesome-qa-skills/tree/main/skills/en/testing-types/database-design-quality-review/prompts/database-design-quality-review.md. Read it before invoking the Skill; the prompt defines the detailed workflow and output contract. The source directory: https://github.com/naodeng/awesome-qa-skills/tree/main/skills/en/testing-types/database-design-quality-review contains the entry point and supporting assets where they exist.

The entry point centers entities, relationships, keys, constraints, indexes, tenancy, lifecycle, migration, and recovery. Keep its decision boundary visible and do not turn a static design into an execution claim.

Further reading

More Resources

Share