db-design

Deep database design workflow—entities and relationships, keys and constraints, normalization vs denormalization, indexing strategy, integrity, and operational concerns. Use when designing OLTP schemas or reviewing greenfield data models.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "db-design" with this command: npx skills add codekungfu/db-design

DB Design

Good OLTP design balances integrity, write paths, query patterns, and evolution—not “third normal form everywhere.”

When to Offer This Workflow

Trigger conditions:

  • Greenfield service schema or major new domain
  • Performance or integrity issues from ad-hoc tables
  • Multi-tenant isolation questions

Initial offer:

Use six stages: (1) domain & access patterns, (2) entities & relationships, (3) keys & constraints, (4) normalization trade-offs, (5) indexing & performance, (6) operations & evolution). Confirm RDBMS and scale expectations.


Stage 1: Domain & Access Patterns

Goal: List critical queries and writes: QPS, joins, filters, hot rows.

Exit condition: Top access paths ranked by business importance.


Stage 2: Entities & Relationships

Goal: ER model; cardinality; optional vs required relationships.

Practices

  • Clear table names; avoid opaque “data” blobs unless documented

Stage 3: Keys & Constraints

Goal: Primary keys (surrogate vs natural); foreign keys with explicit ON DELETE policy; unique constraints for business rules.

Multi-tenant

  • tenant_id on rows that need isolation; composite keys or indexes as appropriate

Stage 4: Normalization Trade-offs

Goal: Normalize to reduce update anomalies; denormalize read hotspots with documented trade-offs.


Stage 5: Indexing & Performance

Goal: Indexes serve real queries; watch write amplification and index bloat.


Stage 6: Operations & Evolution

Goal: Migration strategy (expand/contract); backup/restore; PII columns flagged.


Final Review Checklist

  • Access patterns drive schema
  • Keys, FKs, and constraints explicit
  • Multi-tenant isolation if applicable
  • Normalization decisions justified
  • Index plan aligned with queries
  • Migration and ops considerations noted

Tips for Effective Guidance

  • NULL semantics and defaults matter for bugs and migrations.
  • Pair with db-migrate for online schema changes.

Handling Deviations

  • Document stores: embed vs reference with consistency story.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

技能使用积分榜

技能使用积分榜 v1.2 — OpenClaw 技能使用追踪与积分管理系统。 触发场景: (1) 用户询问技能使用榜单、积分统计 (2) 用户要求查看技能调用记录、错误日志 (3) 用户要求查看某技能的使用详情 (4) 用户要求生成每日/历史积分报告 (5) 用户询问"今天情况如何"、"工作流复盘" 核心功能:...

Registry SourceRecently Updated
Automation

OpenClaw Continuity

Structured continuity and follow-up skill for OpenClaw agents. Use when an agent needs to decide whether natural user dialogue should stay as casual chat, be...

Registry SourceRecently Updated
Automation

Test Continuity

Structured continuity and follow-up skill for OpenClaw agents. Use when an agent needs to decide whether natural user dialogue should stay as casual chat, be...

Registry SourceRecently Updated
220Profile unavailable
Automation

Pilot Service Agents Data

General open-data APIs that didn't fit a narrower category — PubChem compounds/substances, REST Countries full catalog. Use this skill when: 1. Compound or s...

Registry SourceRecently Updated
240Profile unavailable