home / skills / shotaiuchi / dotclaude / feature-data

feature-data skill

/dotclaude/skills/feature-data

This skill helps design robust data models and schemas for new features, ensuring normalization, constraints, migrations, and optimized access.

npx playbooks add skill shotaiuchi/dotclaude --skill feature-data

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.7 KB
---
name: feature-data
description: >-
  Data modeling and schema design. Apply when designing database
  schemas, migrations, relationships, indexes, data access patterns,
  and storage strategies for new features.
user-invocable: false
---

# Data Modeler Implementation

Design data models and schemas for new features.

## Implementation Checklist

### Schema Design
- Define tables/collections with appropriate column types
- Verify naming conventions follow project standards
- Check for proper normalization or denormalization decisions
- Ensure default values and nullability are correct
- Validate enum types and domain constraints

### Relationships & Constraints
- Define foreign keys and referential integrity rules
- Verify cascade behavior for updates and deletes
- Check for proper unique constraints and composite keys
- Ensure many-to-many relationships use join tables
- Validate orphan record prevention

### Migration Strategy
- Create reversible migration scripts
- Verify zero-downtime migration compatibility
- Check data backfill requirements for new columns
- Ensure migration ordering and dependency resolution
- Validate rollback procedures and data safety

### Query Optimization
- Define indexes for common query patterns
- Verify query plans for critical access paths
- Check for efficient join strategies
- Ensure pagination uses cursor or keyset approach
- Validate bulk operation performance

## Output Format

Report implementation status:

| Status | Description |
|--------|-------------|
| Complete | Fully implemented and verified |
| Partial | Implementation started, needs remaining work |
| Blocked | Cannot proceed due to dependency or decision needed |
| Skipped | Not applicable to this feature |

Overview

This skill helps design and validate data models and schema decisions for new features. It guides schema layout, relationships, migration safety, and query optimization to reduce runtime issues and enable scalable data access. The output is a clear implementation status and practical recommendations.

How this skill works

I inspect the proposed feature requirements and existing data models, then evaluate schema definitions, constraints, and migration plans. I verify relationships, indexes, and query patterns for performance and correctness. I produce a concise status report (Complete, Partial, Blocked, Skipped) and concrete remediation steps when gaps are found.

When to use it

  • Designing new tables/collections or modifying existing schemas
  • Planning or reviewing database migrations and rollbacks
  • Defining relationships, foreign keys, and cascade rules
  • Optimizing queries, indexes, and bulk operations
  • Deciding normalization vs. denormalization for feature-specific access patterns

Best practices

  • Start with a small, well-documented schema draft and iterate with concrete queries in mind
  • Prefer reversible, ordered migrations and include backfill and rollback plans
  • Model foreign keys and unique constraints to enforce domain rules rather than relying on application code
  • Index only for identified critical access paths and use keyset pagination for high-volume reads
  • Document nullable fields, default values, and enum domains to avoid ambiguous states

Example use cases

  • Add a feature-specific activity log with efficient reads and compact storage; design table, retention, and index strategy
  • Introduce a many-to-many relationship (e.g., users ↔ tags) and ensure join table, unique constraints, and cascade behavior are correct
  • Add a non-nullable column in production: plan zero-downtime migration, backfill strategy, and reversible scripts
  • Optimize a hotspot query: review query plan, add targeted indexes, and suggest keyset pagination to improve throughput

FAQ

What does the status report cover?

It covers schema design, relationships/constraints, migration strategy, and query optimization, marked as Complete, Partial, Blocked, or Skipped.

How do you handle zero-downtime migrations?

By recommending phased migrations: add nullable columns or shadow fields, backfill asynchronously, flip reads/writes, then make fields non-nullable with a final migration and verified rollback steps.