Database Design Engineering logo

Database Design Engineering

Community
peterbamuhigire
database-design-engineering

Use when designing or reviewing relational or document-backed data architecture for SaaS platforms, ERP systems, APIs, analytics stores, or mobile sync. Covers domain modeling, tenancy, indexing, migrations, event stream data contract and schema evolution, integrity, retention, and performance tradeoffs.

Overview

Publisherpeterbamuhigire
Repositorychwezi-dev-engine
Skill namedatabase-design-engineering
Stars
29
Forks
6
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by peterbamuhigire on GitHub. Read the source before you install it.

Installation

Install the Database Design Engineering AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/peterbamuhigire/chwezi-dev-engine/tree/main/skills/backend-databases/database-design-engineering
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/peterbamuhigire/chwezi-dev-engine.git /tmp/chwezi-dev-engine
mkdir -p .claude/skills
cp -r /tmp/chwezi-dev-engine/skills/backend-databases/database-design-engineering .claude/skills/database-design-engineering
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Database Design Engineering in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Database Design Engineering on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Database Design Engineering is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Database Design Engineering

Acknowledgement: Shared by Peter Bamuhigire, techguypeter.com, +256 784 464178.

Use When

  • Use when designing or reviewing relational or document-backed data architecture for SaaS platforms, ERP systems, APIs, analytics stores, or mobile sync. Covers domain modeling, tenancy, indexing, migrations, integrity, retention, and performance tradeoffs.

Do Not Use When

  • The task is query tuning or production incident diagnosis without a schema-design decision; use the database operations or reliability skill.
  • The datastore is a search index, cache, or vector store whose source-of-truth semantics belong elsewhere.

Required Inputs

InputRequiredWhy it matters
Domain entities, invariants, and lifecycle rulesyesDetermines tables, keys, constraints, and valid state transitions
Read and write access patternsyesDrives indexes, transaction boundaries, and denormalization choices
Data volume, growth, and retention expectationsyesExposes scaling and archival constraints
Existing schema and migration constraintsconditionalEnables safe evolution without data loss or prolonged locking

Workflow

Model invariants and ownership, choose keys and relationships, enforce integrity in the database, design indexes from verified access paths, plan reversible expand-contract migrations, then test concurrency, rollback, and representative query plans.

Quality Standards

The schema enforces material invariants with types, constraints, and transactions rather than application convention alone. Each index supports a named query, and every migration states lock, backfill, compatibility, rollback, and validation behavior.

Outputs

OutputConsumerAcceptance condition
Logical and physical schemaApplication and data engineersIdentifies ownership, keys, constraints, relationships, types, and intentional denormalization
Index and transaction planImplementersLinks access patterns to indexes and defines concurrency behavior
Migration packetRelease and operations teamsIncludes sequencing, compatibility window, backfill, validation, rollback, and risk notes

Evidence Produced

CategoryArtifactFormatExample
Data safetyMigration planMarkdown doc per skill-composition-standards/references/migration-plan-template.mddocs/data/migration-2026-04-16-add-tenant-column.md
Data safetyEntity modelMarkdown doc per skill-composition-standards/references/entity-model-template.mddocs/data/entity-model-billing.md
Data safetyAccess pattern registerMarkdown doc per skill-composition-standards/references/access-patterns-template.mddocs/data/access-patterns-billing.md

References

  • Use the references/ directory for deep detail after reading the core workflow below.

Use this skill when schema choices will shape correctness, performance, or future maintainability. It complements vendor-specific database skills by focusing on design logic that survives framework changes.

Load Order

  1. Load world-class-engineering.
  2. Load this skill to design the data model and lifecycle.
  3. Load engine-specific parent skills afterward: mysql-engineering or postgresql-engineering.

Database Workflow

1. Model the Domain

Define:

  • Core entities and their lifecycles.
  • Ownership and tenancy boundaries.
  • Transactional invariants.
  • Reporting and audit requirements.
  • Retention, archival, and deletion rules.
  • The release and migration constraints for live data.

Model events and states, not just forms and screens.

2. Choose the Storage Shape

Prefer relational design when:

  • Consistency matters.
  • Multi-table invariants exist.
  • Reporting and joins are central.

Prefer document or key-value structures for:

  • Flexible metadata.
  • Cached projections.
  • Denormalized read models or unstructured payloads.

Do not use schemaless storage as a substitute for undecided modeling.

3. Define Table Boundaries

  • One table should represent one durable business concept or event stream.
  • Separate current state from append-only history when auditability matters.
  • Distinguish master data, transactions, and derived projections.
  • Avoid overloading one table with mutually exclusive concepts.

4. Design for Scale and Safety

  • Add tenant or ownership keys early.
  • Design indexes around real query predicates and sort order.
  • Keep writes idempotent where retries are possible.
  • Plan archival, purging, and partitioning before large-volume tables arrive.
  • Use expand-contract migrations for live systems.
  • Separate transactional truth from projections, integrations, and analytical read models.
  • Design test-data and backfill strategies for major schema evolution before the first risky migration.

Core Standards

Integrity

  • Enforce invariants at the strongest reasonable layer: schema, transaction, application, worker.
  • Use foreign keys where ownership is mandatory and module boundaries permit it.
  • Use append-only ledgers for financial and audit-critical domains.
  • Never encode important business rules only in UI validation.

Tenancy

  • Every tenant-scoped table must carry the tenant key.
  • Every tenant-scoped query must constrain by tenant key.
  • Every unique constraint must reflect tenancy where appropriate.
  • Cross-tenant analytics should use controlled derived datasets, not raw shared queries.

Indexing

  • Index for the access path, not for column popularity.
  • Prefer composite indexes that match filter plus sort order.
  • Remove duplicate or low-value indexes that tax writes.
  • Validate index usefulness against actual queries and execution plans.

Migrations

  • Make every migration forward-safe and observable.
  • Prefer additive changes, backfills, then cutovers, then cleanup.
  • Keep application code compatible across deployment overlap where possible.
  • Rehearse destructive or high-volume changes before production.
  • Tag migrations with rollback posture: reversible, compensating-only, or forward-fix-only.
  • For web projects, provide a root pull-time migration script that reads the app's environment database settings, compares tracked migrations with live migration history, and applies only missing migrations.
  • Never bundle seeds into the normal migration-apply path. Demo data, reference seeds, fixtures, and production bootstrap scripts must require a separate explicit command.

Operable Data Systems

  • Emit release markers and migration identifiers into logs and dashboards where possible.
  • Track replication lag, queue lag, backfill progress, and lock or saturation risk on critical stores.
  • Treat long-running migrations and backfills as operational workflows with owners and stop conditions.
  • Document how data correctness will be verified after migration, replay, or recovery.

Scale, Replication, and Change Data

  • Know which queries must read current truth and which can tolerate replica lag.
  • Design outbox, CDC, or projection pipelines so integration needs do not corrupt the transactional model.
  • Budget storage, index, and retention cost for hot tables before volume becomes painful.
  • Validate the hottest access paths with execution plans, cardinality assumptions, and realistic filters.

Decision Heuristics

Normalize when:

  • Data duplication would create correctness risk.
  • Multiple workflows update the same fact.

Denormalize when:

  • Read performance or query simplicity clearly outweighs duplication cost.
  • The source of truth remains obvious.
  • Refresh or reconciliation strategy is explicit.

Use soft delete when:

  • Recovery, auditability, or legal hold matters.

Use hard delete when:

  • Data minimization or cost pressure is stronger and downstream references are safely handled.

Deliverables

For substantive database work, produce:

  • Entity and lifecycle summary.
  • Table or collection design.
  • Index plan.
  • Migration strategy.
  • Data verification and rollback posture.
  • Data retention and audit plan.
  • Top 5 critical queries or access patterns.
  • Projection, outbox, or replication notes where external reads or integrations exist.

Review Checklist

  • Domain entities reflect real business concepts.
  • Tenant and ownership boundaries are explicit.
  • Invariants are protected at durable layers.
  • Indexes match real access paths.
  • Migrations support live deployment safety.
  • Migration verification and rollback posture are explicit.
  • Audit, retention, and archival rules are documented.
  • Reporting needs do not distort the transactional model without justification.
  • Replica lag, projections, or CDC assumptions are explicit where they matter.

References

Capability contract

Design schemas and migration plans by default. Apply DDL, backfills, retention jobs, or production queries only with explicit database and environment authority.

Degraded mode

If workload samples or schema access are unavailable, provide a read-only logical design and mark index, capacity, and migration claims unverified.

Domain Anti-Patterns

  • Omitting foreign-key or application integrity rules. Fix: state enforcement explicitly.
  • Indexing every column. Fix: derive indexes from measured access paths.
  • Mixing tenant data without a tenant key. Fix: enforce isolation in schema and queries.
  • Shipping destructive migrations in one step. Fix: use expand-contract.
  • Retaining data indefinitely. Fix: define retention and deletion ownership.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Database Design Engineering AI skill do?

Use when designing or reviewing relational or document-backed data architecture for SaaS platforms, ERP systems, APIs, analytics stores, or mobile sync. Covers domain modeling, tenancy, indexing, migrations, event stream data contract and schema evolution, integrity, retention, and performance tradeoffs.

Why use Database Design Engineering on TypingMind?

Because you install it once and use it with any model. Database Design Engineering is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Database Design Engineering in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/peterbamuhigire/chwezi-dev-engine/tree/main/skills/backend-databases/database-design-engineering. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Database Design Engineering?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Database Design Engineering?

As many as you like. As long as a model supports skills, you can use Database Design Engineering with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Database Design Engineering AI skill free?

Yes. It is published on GitHub by peterbamuhigire under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇