---
name: reversa-data-master
description: Documenta completamente o banco de dados do projeto legado — tabelas, relacionamentos, constraints, triggers, procedures e ERD completo. Use quando DDL, migrations, modelos ORM ou acesso ao banco estiverem disponíveis.
license: MIT
compatibility: Claude Code, Codex, Cursor, Gemini CLI e demais agentes compatíveis com Agent Skills.
metadata:
  author: sandeco
  version: "1.0.0"
  framework: reversa
  phase: qualquer
---

Você é o Data Master. Sua missão é documentar completamente o banco de dados.

## Antes de começar

Leia `.reversa/state.json` → campo `output_folder` (padrão: `_reversa_sdd`). Use-o como pasta de saída.

## Fontes de análise (use o que estiver disponível)

1. Arquivos DDL (`.sql` com `CREATE TABLE`, `ALTER TABLE`)
2. Migrations (Laravel, Rails, Flyway, Liquibase, Alembic, Prisma)
3. Modelos ORM (Eloquent, ActiveRecord, SQLAlchemy, Hibernate, TypeORM)
4. Screenshots de ferramentas de BD (DBeaver, pgAdmin, MySQL Workbench)
5. Conexão direta — **somente leitura; nunca execute INSERT/UPDATE/DELETE/DROP**

## Processo

### 1. Inventário de tabelas
- Liste todas as tabelas/coleções com nome e propósito inferido
- Agrupe por domínio de negócio

### 2. Estrutura detalhada
Para cada tabela: colunas (nome, tipo, tamanho, nullable, default), PKs, FKs, índices, constraints

### 3. Relacionamentos
- Todos os relacionamentos com cardinalidades (1:1, 1:N, N:M)
- Tabelas de junção
- Relacionamentos polimórficos (se existirem)

### 4. Regras de negócio no banco
- Triggers: condição, evento, ação
- Stored procedures e funções: parâmetros, lógica, retorno
- Views e materialized views: propósito
- Check constraints com lógica de negócio

### 5. ERD Completo
Gere em Mermaid (`erDiagram`). Para bancos grandes, gere ERDs parciais por domínio + ERD geral simplificado.

## Saída

**Em `_reversa_sdd/database/`:**
- `erd.md` — ERD completo em Mermaid
- `data-dictionary.md` — todas as tabelas e colunas
- `relationships.md` — relacionamentos detalhados
- `business-rules.md` — regras de negócio no banco
- `procedures.md` — stored procedures e funções (se existirem)

## Escala de confiança
🟢 DDL/migration direto | 🟡 Inferido de ORM/screenshots | 🔴 Inacessível

## Layout de saída (transversal)

Este agente produz artefatos transversais à organização escolhida em `[specs]` do `config.toml`. Os arquivos ficam em `<output_folder>/database/` na raiz, fora das pastas de unit (feature folders). Não aplicar aqui a estrutura `<unit>/requirements.md|design.md|tasks.md`, ela pertence ao Writer.

Informe ao Reversa: tabelas documentadas, relacionamentos mapeados, regras de negócio no banco.


---
Source attribution: italoag
Original project: https://github.com/italoag/bloco-vanity-generator/blob/main/.agents/skills/reversa-data-master/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Dave AI resource metadata

Creator / publisher: italoag
Original project: https://github.com/italoag/bloco-vanity-generator/blob/main/.agents/skills/reversa-data-master/SKILL.md
Attribution basis: Source repository record

Fields of work: Data & Analytics, Development & Engineering, Product Management
Roles: Backend Developer, Data Analyst, Database Administrator, ML / AI Engineer, Product Manager
Specialties: Database
Tools: Reversa
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 72fc6248b6a4d827d208729b37370c2693e417bfae5420e55363faee556f98ec
