Skip to main content
ClaudeWave
Skill66 estrellas del repoactualizado 29d ago

db-review

Reviews database schemas, queries, and migrations for correctness, performance, security, and best practices. Use when reviewing SQL migration files or when the user mentions database review, schema review, or query audit.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/tranhieutt/software_development_department /tmp/db-review && cp -r /tmp/db-review/.claude/skills/db-review ~/.claude/skills/db-review
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

When this skill is invoked:

1. **Read the target schema, migration, or query files** in full.

2. **Evaluate schema design**:
   - [ ] All tables have a primary key
   - [ ] Tables have `created_at` and `updated_at` columns
   - [ ] Foreign key relationships defined with proper constraints
   - [ ] Column types are appropriate (don't use VARCHAR(255) for everything)
   - [ ] NULL vs NOT NULL is intentionally chosen and documented
   - [ ] Enum types used for fixed sets of values

3. **Evaluate indexing strategy**:
   - [ ] Every foreign key column is indexed
   - [ ] Columns in frequent WHERE, ORDER BY, or JOIN conditions are indexed
   - [ ] Composite indexes match the query patterns
   - [ ] No over-indexing (too many indexes slow writes)
   - [ ] Unique constraints used where business rules require uniqueness

4. **Evaluate migration safety**:
   - [ ] Migration is reversible (has a down/rollback script)
   - [ ] Adding columns with defaults is safe for zero-downtime
   - [ ] Removing columns uses soft-delete / multi-phase approach
   - [ ] Renaming columns uses multi-phase migration (add → backfill → drop old)
   - [ ] Large table operations consider locking implications

5. **Evaluate data integrity**:
   - [ ] Check constraints for value ranges where appropriate
   - [ ] No orphaned records possible (foreign keys or enforced at app layer)
   - [ ] Soft delete implemented (`deleted_at`) not hard delete for important records

6. **Evaluate query quality** (if queries provided):
   - [ ] No SELECT * in application queries
   - [ ] N+1 queries avoided (eager loading where needed)
   - [ ] Parameterized queries (no string concatenation)
   - [ ] Pagination on all list queries

7. **Output the review**:

```
## Database Review: [Schema/Migration Name]

### Schema Design: [CLEAN / ISSUES FOUND]
[List design problems]

### Indexes: [APPROPRIATE / MISSING / OVER-INDEXED]
[List index recommendations]

### Migration Safety: [SAFE / RISKY / BLOCKING]
[List migration risks and recommendations]

### Data Integrity: [ENFORCED / GAPS FOUND]
[List integrity concerns]

### Query Quality: [CLEAN / ISSUES FOUND]
[List query problems]

### Positive Observations
[What is well-designed]

### Required Changes
[Must-fix before applying]

### Suggestions
[Nice-to-have improvements]

### Verdict: [APPROVED / APPROVED WITH SUGGESTIONS / CHANGES REQUIRED]
```

## Protocol

- **Question**: Auto-starts from argument (schema, migration, or query files)
- **Options**: Skip — single review path
- **Decision**: Skip — verdict is advisory
- **Draft**: Full review shown in conversation only
- **Approval**: Skip — read-only; no files written

## Output

Deliver exactly:

- **Schema score** (X/6 design checks passing)
- **Migration safety**: `SAFE` / `RISKY` / `BLOCKING` with specific risks listed
- **Required changes** — must fix before applying migration (or "None")
- **Verdict**: `APPROVED` / `APPROVED WITH SUGGESTIONS` / `CHANGES REQUIRED`
accessibility-specialistSubagent

The Accessibility Specialist ensures the software is accessible to the widest possible audience. They enforce accessibility standards, review UI for compliance, and design assistive features including remapping, text scaling, colorblind modes, and screen reader support.

ai-programmerSubagent

The AI Programmer implements intelligent system features: recommendation engines, classification pipelines, LLM integrations, decision logic, and autonomous agent behavior. Use this agent for AI/ML feature implementation, model integration, intelligent automation, or AI system debugging.

analytics-engineerSubagent

The Analytics Engineer designs telemetry systems, user behavior tracking, A/B test frameworks, and data analysis pipelines. Use this agent for event tracking design, dashboard specification, A/B test design, or user behavior analysis methodology.

backend-developerSubagent

The Backend Developer builds and maintains server-side logic, APIs, databases, authentication, and integrations. Use this agent for REST/GraphQL API implementation, database operations, authentication systems, background jobs, microservices, server performance, and backend testing. Works from API design contracts and PRDs.

community-managerSubagent

The Community Manager handles user-facing communications, feedback synthesis, support escalation, and community engagement. Use this agent for drafting release announcements, synthesizing user feedback into actionable insights, writing support documentation, or coordinating community-facing communication around releases and incidents.

ctoSubagent

The CTO (Chief Technical Officer) owns the high-level technical vision, architecture decisions, technology choices, and technical strategy. Use this agent for architecture-level decisions, technology evaluations, cross-system conflicts, and when a technical choice will constrain or enable product possibilities. This is the highest technical authority in the department.

data-engineerSubagent

The Data Engineer designs database schemas, builds data pipelines, manages migrations, and owns the data infrastructure. Use this agent for schema design, complex migrations, data modeling, ETL/ELT pipelines, database performance optimization, analytics infrastructure, and data integrity strategies.

devops-engineerSubagent

The DevOps Engineer maintains build pipelines, CI/CD configuration, version control workflow, and deployment infrastructure. Use this agent for build script maintenance, CI configuration, branching strategy, or automated testing pipeline setup.