skills/en/tao-database-design/SKILL.md
Database schema design with normalization, indexing strategy, migration planning, and constraint patterns. Use when designing database schemas, planning migrations, optimizing queries, or reviewing data models.
npx skillsauth add andretauan/tao tao-database-designInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use when designing schemas, planning migrations, optimizing queries, or reviewing data models.
deleted_at instead of actual DELETE when data is valuable| Element | Convention | Example |
|---------|-----------|---------|
| Table | plural, snake_case | order_items |
| Column | singular, snake_case | total_amount |
| Primary key | id | id |
| Foreign key | {table_singular}_id | user_id, order_id |
| Index | idx_{table}_{columns} | idx_users_email |
| Unique | uq_{table}_{columns} | uq_users_email |
| Boolean | is_/has_ prefix | is_active, has_verified |
| Timestamp | _at suffix | created_at, published_at |
down method)-- Safe column add (non-blocking)
ALTER TABLE users ADD COLUMN bio TEXT;
-- Safe column rename (two-step for zero-downtime)
-- Step 1: Add new column
ALTER TABLE users ADD COLUMN display_name VARCHAR(255);
-- Step 2: Migrate data
UPDATE users SET display_name = name;
-- Step 3: (next release) Drop old column
ALTER TABLE users DROP COLUMN name;
SELECT * — always specify columnstesting
Estratégia de pirâmide de testes com análise de cobertura, identificação de edge cases e planejamento de testes. Use ao planejar testes, melhorar cobertura, identificar edge cases ou escrever especificações de teste.
development
Auditoria de segurança alinhada ao OWASP Top 10 com checklist para injection, XSS, autenticação, autorização, gestão de secrets e vulnerabilidades comuns. Use ao auditar segurança, revisar código de auth ou hardening de aplicação.
development
Metodologia de refatoração segura com detecção de code smells, transformação passo-a-passo e prevenção de regressão. Use ao refatorar código, reduzir dívida técnica ou melhorar estrutura.
testing
Decomposição expert de tarefas para criar PLAN.md no TAO. Quebra features em fases e tarefas com critérios de aceite, estimativas e dependências. Use ao planejar trabalho, criar fases ou decompor features.