gerar-test-fixture-brlisted
Install: claude install-skill roldaobatista/roldao-method
# gerar-test-fixture-br
Gera dados sintéticos brasileiros **matematicamente válidos** mas obviamente fake (padrão sequencial). Resolve o conflito entre:
- Validadores rejeitam "111.111.111-11" (todos iguais)
- Hook `no-test-data-in-fixtures` rejeita CPF real
- Dev coloca CPF real e vaza em CI/log
## Quando usar
- Antes de criar fixture/seed novo.
- Em fluxo de teste E2E que precisa de payload com CPF/CNPJ válido.
- Em demo/sandbox que precisa parecer real sem ser real.
## Uso
```bash
python3 scripts/gerar.py cpf 5
python3 scripts/gerar.py cnpj 3
python3 scripts/gerar.py cnpj-alfa 2
python3 scripts/gerar.py pis 4 # PIS/PASEP/NIS válido por módulo 11
python3 scripts/gerar.py cep 4
python3 scripts/gerar.py telefone 3
python3 scripts/gerar.py email 2
python3 scripts/gerar.py nome 2
python3 scripts/gerar.py razao-social 2
python3 scripts/gerar.py all 1 # 1 fixture completa: nome, CPF, PIS, email, telefone, CEP
```
> **Windows:** substitua `python3` por `python` (o instalador oficial do Python no Windows cria apenas `python.exe`). No Git Bash, `python3` so existe via alias do user.
## Saída
Sempre escreve no stdout, 1 por linha. Pode pipar para arquivo:
```bash
python3 scripts/gerar.py cpf 100 > tests/fixtures/cpfs.txt
```
## Regras de geração
- **CPF:** prefixo `123456789` + DV calculado por módulo 11 → resultado obviamente sequencial.
- **CNPJ numérico:** prefixo `12345678000` + sequência + DV → obviamente sintético.
- **CNPJ alfanumérico (jul/2026+):** pr