foundation-database
Set up database with schema, migrations, and connection management
SKILL.md.claude/skills/foundation-database/SKILL.md
GitHubFoundation — Database
Set up database layer: schema design, migrations, connection management, seed data.
Input
Database type: $ARGUMENTS (default: detect from project config or ask)
Process
- Read the architecture doc for data model requirements
- Design the initial schema based on the architecture
- Set up:
- Database connection management (pooling, retries)
- Migration framework (alembic, knex, diesel, etc.)
- Initial migration with the schema
- Seed data for development
- Connection configuration from environment
- Create database utility functions (CRUD helpers if appropriate)
- Add database to docker-compose if using Docker
- Write tests that use a test database
Rules
- Migrations must be reversible
- Connection pooling from the start
- Never hardcode connection strings
- Test database must be separate from dev database
- Seed data must be idempotent