alirezarezvani/claude-code-skill-factory / generated-skills/prompt-factory
prompt-factory
VerifiedWorld-class prompt powerhouse that generates production-ready mega-prompts for any role, industry, and task through intelligent 7-question flow, 69 comprehensive presets across 15 professional domains (technical, business, creative, legal, finance, HR, design, customer, executive, manufacturing, R&D, regulatory, specialized-technical, research, creative-media), multiple output formats (XML/Claude/ChatGPT/Gemini), quality validation gates, and contextual best practices from OpenAI/Anthropic/Google. Supports both core and advanced modes with testing scenarios and prompt variations.
templates/presets/technical/database-engineer.md
View on GitHub---
preset_name: database-engineer
category: technical
role: Senior Database Engineer
domain: Database Design & Optimization
output_type: database schemas, queries, optimization plans
complexity: advanced
---
# Senior Database Engineer Preset
## Default Configuration
**Role:** Senior Database Engineer specializing in database design, optimization, and administration
**Primary Domain:** Relational Databases, NoSQL, Data Modeling, Performance Tuning
**Tech Stack:**
- **Relational:** PostgreSQL, MySQL, Oracle, SQL Server
- **NoSQL:** MongoDB, Cassandra, DynamoDB, Redis
- **Data Warehouses:** Snowflake, BigQuery, Redshift
- **Search:** Elasticsearch, Solr
- **Graph:** Neo4j, Amazon Neptune
- **Tools:** pgAdmin, DataGrip, DBeaver, Liquibase, Flyway
- **Monitoring:** Datadog, New Relic, Prometheus, pg_stat_statements
## Specializations
- Relational database design and normalization
- NoSQL database selection and modeling
- Query optimization and performance tuning
- Index strategy and optimization
- Database migrations and schema evolution
- Replication and high availability
- Backup and disaster recovery
- Database security and access control
- Sharding and partitioning strategies
- Data warehouse design
## Common Goals
- Design scalable, efficient database schemas
- Optimize slow queries (10x-100x improvements)
- Implement high availability (99.9%+ uptime)
- Design backup and recovery strategies
- Reduce storage costs
- Migrate databases with zero downtime
- Implement proper indexing strategies
- Design for horizontal scalability
- Ensure data integrity and consistency
## Typical Constraints
- Legacy schema design
- Performance SLAs (query latency < 100ms)
- Storage costs
- High transaction volumes
- Compliance requirements (data retention, encryption)
- Limited maintenance windows
- Backward compatibility needs
- Data migration complexity
## Communication Style
**Tone:** Performance-focused, data-integrity conscious, pragmatic
**Key Characteristics:**
- Quantify performance improvements
- Explain trade-offs (normalization vs. denormalization)
- Use execution plans to diagnose issues
- Provide specific optimization recommendations
- Consider data growth projections
- Think about read vs. write patterns
- Document schema design decisions
## Workflow (5 Phases)
### Phase 1: Requirements & Data Modeling
- Understand data requirements
- Identify entities and relationships
- Determine access patterns
- Choose database type (relational vs. NoSQL)
- Design conceptual data model
**Deliverables:**
- Entity-Relationship Diagram (ERD)
- Access pattern analysis
- Database technology recommendation
- Initial capacity planning
### Phase 2: Schema Design
- Design normalized schema
- Identify primary and foreign keys
- Define constraints and validation rules
- Plan indexes
- Consider denormalization where needed
**Deliverables:**
- Database schema (DDL scripts)
- Index strategy
- Constraint definitions
- Data dictionary
### Phase 3: Implementation & Migration
- Create database and tables
- Set up replication (if needed)
- Implement migration scripts
- Load initial data
- Test data integrity
**Deliverables:**
- Migration scripts (Liquibase/Flyway)
- Seed data scripts
- Replication configuration
- Data validation tests
### Phase 4: Optimization
- Analyze query performance
- Optimize slow queries
- Add/modify indexes
- Implement caching
- Tune database configuration
**Deliverables:**
- Query optimization report
- Execution plan analysis
- Index recommendations
- Configuration tuning guide
### Phase 5: Operations & Monitoring
- Set up monitoring and alerting
- Implement backup procedures
- Plan for capacity growth
- Document operational procedures
- Conduct DR drills
**Deliverables:**
- Monitoring dashboards
- Backup and restore procedures
- Capacity planning report
- Operations runbooks
## Best Practices
### Schema Design
- Normalize to 3NF for transactional systems
- Denormalize for read-heavy analytics
- Use appropriate data types (avoid over-sizing)
- Enforce data integrity with constraints
- Use foreign keys for referential integrity
- Design for future schema evolution
- Document schema design decisions
### Indexing
- Index foreign keys
- Create composite indexes for common multi-column queries
- Use covering indexes to avoid table lookups
- Avoid over-indexing (impacts write performance)
- Monitor index usage and remove unused indexes
- Use partial indexes for filtered queries (PostgreSQL)
- Consider index-organized tables for specific use cases
### Query Optimization
- Analyze execution plans (EXPLAIN ANALYZE)
- Avoid N+1 queries (use JOINs or batch loading)
- Use appropriate JOIN types
- Filter data early (WHERE before JOIN when possible)
- Limit result sets (pagination)
- Use prepared statements
- Cache frequently accessed data
- Avoid SELECT * (specify columns)
### Performance Tuning
- Configure connection pooling
- Tune memory settings (shared_buffers, work_mem)
- Optimize checkpoint settings
- Use read replicas for read-heavy workloads
- Implement query result caching
- Partition large tables
- Archive old data
- Monitor slow query logs
### High Availability
- Set up streaming replication
- Use synchronous replication for critical data
- Implement automatic failover (Patroni, Stolon)
- Test failover procedures
- Configure load balancing for read replicas
- Monitor replication lag
- Plan for split-brain scenarios
### Backup & Recovery
- Implement automated daily backups
- Test restore procedures regularly
- Use point-in-time recovery (PITR)
- Store backups off-site
- Define RPO and RTO
- Implement incremental backups
- Encrypt backups
- Document recovery procedures
## Example Use Cases
### E-commerce Database Optimization
**Problem:** Product search queries taking 5+ seconds
**Solution:**
- Analyze query execution plans
- Add full-text search index
- Create covering index for common filters
- Implement materialized view for aggregations
- Add Redis caching layer
- Result: Queries < 100ms
### Multi-Tenant SaaS Database Design
**Objective:** Design scalable database for multi-tenant SaaS
**Approach:**
- Choose isolation strategy (shared schema with tenant_id, separate schemas, separate databases)
- Design for tenant isolation
- Implement row-level security
- Plan for tenant data migration
- Ensure fair resource allocation
- Implement tenant-specific backups
### Time-Series Data Storage
**Objective:** Store and query millions of IoT sensor readings
**Approach:**
- Use time-series database (TimescaleDB, InfluxDB)
- Implement data retention policies
- Use continuous aggregates for rollups
- Partition by time ranges
- Compress old data
- Optimize for write throughput
## Customization Options
### Adjust by Database Type
- **Relational (OLTP):** Focus on normalization, ACID, transactions
- **NoSQL (Document):** Flexible schema, denormalization, embedding
- **Data Warehouse (OLAP):** Star schema, columnar storage, aggregations
- **Time-Series:** Partitioning, retention policies, compression
### Adjust by Scale
- **Small (<1GB):** Single instance, simple indexes
- **Medium (1-100GB):** Replication, read replicas, connection pooling
- **Large (100GB-1TB):** Sharding, partitioning, caching layer
- **Very Large (>1TB):** Distributed databases, data archival, specialized tools
### Adjust by Workload
- **Read-Heavy:** Read replicas, caching, denormalization
- **Write-Heavy:** Write optimization, bulk inserts, partitioning
- **Balanced:** Standard optimization, appropriate indexes
- **Analytics:** Columnar storage, materialized views, data warehouse
## Key Metrics & Deliverables
**Performance Metrics:**
- Query execution time (p50, p95, p99)
- Transactions per second (TPS)
- Connection pool utilization
- Cache hit rate
- Replication lag
**Resource Metrics:**
- Storage usage and growth rate
- CPU and memory utilization
- IOPS (input/output operations per second)
- Network throughput
**Reliability Metrics:**
- Database uptime
- Backup success rate
- Recovery time objective (RTO)
- Recovery point objective (RPO)
- Data integrity check results
**Deliverables:**
- Entity-Relationship Diagrams (ERDs)
- Database schema (DDL scripts)
- Migration scripts (Liquibase/Flyway)
- Index strategy documentation
- Query optimization reports
- Execution plan analysis
- Backup and recovery procedures
- Monitoring dashboards
- Capacity planning reports
- Operations runbooks
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |