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:
| Focus | Question before analysis | Handoff output |
|---|---|---|
| Model and relationships | Entities, cardinality, keys, ownership, and tenant scope | Object-level coverage |
| Constraints and access | Unique/not-null/check rules tied to requirements; indexes tied to real query patterns and data volume | Integrity and index risks |
| Transactions and concurrency | Transaction boundaries, isolation, concurrent writes, and failure handling | Unassessed race conditions |
| Lifecycle and privacy | Retention, deletion, ownership, privacy rules, and backup scope | Source-backed lifecycle gaps |
| Migration and recovery | Compatibility, backfill, partial failure, rollback, backup/restore, and recovery readiness | Preconditions 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.
| State | Meaning | How this Skill should handle it |
|---|---|---|
| known | Directly supported by the supplied material | Keep the source, version, and time with the judgment |
| missing | Needed for this pass but not supplied | Name the smallest evidence action and limit the conclusion |
| conflicting | Sources disagree | Show both sources and route the conflict to an owner |
| stale | Present but outside the relevant version or time window | Mark freshness; old evidence is not current proof |
| out_of_scope | Related but excluded from this pass | Keep the boundary explicit |
| assumptions | Temporarily adopted to continue analysis | State 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:
| Layer | How to write it | Application here |
|---|---|---|
| Fact | What the supplied material directly shows | Cite the source, version, input, or run record for the focus |
| Evidence-backed Inference | What several facts support together | Show the inference chain and retain uncertainty |
| Recommendation | The smallest next action | Name the evidence, review, execution, or regression path |
| Human Decision | What an accountable person must decide | Leave 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
| Material | What to provide | What to do when it is missing |
|---|---|---|
| Domain rules | Order identity, refund uniqueness, status lifecycle, and retention | Tie each invariant to a source |
| Access patterns | Lookup, reporting, pagination, writes, and tenant filters | Do not choose indexes from table shape alone |
| Change plan | Migration, backfill, rollback, volume, and recovery | Mark 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 field | Conditional example |
|---|---|
| Object/scope and source | refund.payment_id in the supplied, versioned DDL; attach the explicit refund rule and schema excerpt |
| Design rule and finding | If the requirement permits one refund per payment, the excerpt shows no matching unique constraint; other enforcement is not yet known |
| Status | missing until application, transaction, and full-schema evidence are reviewed; not yet a confirmed defect |
| Impact/severity | Not scored until the business impact and affected data scope are supplied |
| Constraint/index risk | No matching constraint is visible in the excerpt; query and index risks need actual access patterns and volume |
| Transaction/concurrency | Request transaction boundaries, isolation, and concurrent-write behavior; do not infer them from the table |
| Migration/rollback | Check existing duplicates, backfill order, compatibility, and rollback evidence before recommending a constraint change |
| Owner/close/validation | A 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 field | Why it exists | Example status |
|---|---|---|
| Data-object coverage | Entities, constraints, access patterns, ownership, and lifecycle by object | Source and gaps |
| Migration and rollback | Compatibility, backfill, partial failure, rollback, backup, and recovery | Preconditions |
| Validation preparation | Smallest isolated check for the named design risk | Owner 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
- API Design Quality Review: https://inaodeng.com/en/qaskills/api-design-quality-review/ — connects data rules to API contracts.
- Technical Design Quality Review: https://inaodeng.com/en/qaskills/technical-design-quality-review/ — reviews the wider architecture.
- Disaster Recovery Testing: https://inaodeng.com/en/qaskills/disaster-recovery-testing/ — checks restore and data recovery assumptions.
Common traps
- Reviewing columns without lifecycle states.
- Adding an index without a query or volume assumption.
- 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
-
Awesome QA Skills GitHub: https://github.com/naodeng/awesome-qa-skills
-
Database Design Quality Review details: https://inaodeng.com/en/qaskills/database-design-quality-review/
More Resources
- Personal website: https://inaodeng.com/en/
- AI-generated test detection project: https://github.com/AI-Native-QA-Lab/ai-test-auditor
- DeepSeek QA Workbench: https://github.com/naodeng/dsh-qa
- More AI testing skills: https://inaodeng.com/en/qaskills/
- More testing wiki: https://inaodeng.com/en/wiki/
- More AI Wiki: https://inaodeng.com/en/AIWiki/