spec-first-copilot 0.4.0 → 0.5.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +156 -148
- package/bin/cli.js +52 -52
- package/lib/init.js +89 -89
- package/package.json +11 -4
- package/templates/.ai/memory/napkin.md +68 -68
- package/templates/.github/agents/backend-coder.md +215 -215
- package/templates/.github/agents/db-coder.md +165 -165
- package/templates/.github/agents/doc-writer.md +48 -51
- package/templates/.github/agents/frontend-coder.md +222 -222
- package/templates/.github/agents/infra-coder.md +341 -341
- package/templates/.github/agents/reviewer.md +99 -99
- package/templates/.github/agents/security-reviewer.md +153 -153
- package/templates/.github/copilot-instructions.md +194 -175
- package/templates/.github/instructions/docs.instructions.md +123 -123
- package/templates/.github/instructions/sensitive-files.instructions.md +32 -32
- package/templates/{docs/Desenvolvimento → .github}/rules.md +229 -229
- package/templates/.github/skills/sf-design/SKILL.md +180 -181
- package/templates/.github/skills/sf-dev/SKILL.md +349 -349
- package/templates/.github/skills/sf-discovery/SKILL.md +405 -405
- package/templates/.github/skills/sf-extract/SKILL.md +284 -284
- package/templates/.github/skills/sf-feature/SKILL.md +130 -130
- package/templates/.github/skills/sf-merge-delta/SKILL.md +145 -142
- package/templates/.github/skills/sf-plan/SKILL.md +178 -178
- package/templates/.github/skills/sf-session-finish/SKILL.md +120 -120
- package/templates/.github/skills/sf-setup-projeto/SKILL.md +123 -123
- package/templates/{docs/_templates/estrutura/API.template.md → .github/templates/estrutura/apiContracts.template.md} +151 -144
- package/templates/.github/templates/estrutura/architecture.template.md +158 -0
- package/templates/{docs/_templates/estrutura/Seguranca.template.md → .github/templates/estrutura/conventions.template.md} +202 -138
- package/templates/{docs/_templates/estrutura/ADRs.template.md → .github/templates/estrutura/decisions.template.md} +99 -91
- package/templates/.github/templates/estrutura/domain.template.md +148 -0
- package/templates/{docs/_templates → .github/templates}/feature/PRD.template.md +256 -256
- package/templates/{docs/_templates → .github/templates}/feature/Progresso.template.md +136 -136
- package/templates/{docs/_templates → .github/templates}/feature/TRD.template.md +204 -200
- package/templates/{docs/_templates → .github/templates}/feature/backlog-extraido.template.md +154 -154
- package/templates/{docs/_templates → .github/templates}/feature/context.template.md +42 -42
- package/templates/{docs/_templates → .github/templates}/feature/extract-log.template.md +38 -38
- package/templates/{docs/_templates → .github/templates}/feature/projetos.template.yaml +73 -73
- package/templates/{docs/_templates → .github/templates}/feature/sdd.template.md +372 -372
- package/templates/{docs/_templates → .github/templates}/feature/tasks.template.md +115 -115
- package/templates/{docs/_templates → .github/templates}/global/progresso_global.template.md +57 -57
- package/templates/docs/_templates/estrutura/Arquitetura.template.md +0 -82
- package/templates/docs/_templates/estrutura/Infraestrutura.template.md +0 -104
- package/templates/docs/_templates/estrutura/Modelo_Dados.template.md +0 -99
- package/templates/docs/_templates/estrutura/Stack.template.md +0 -78
- package/templates/docs/_templates/estrutura/Visao.template.md +0 -82
- /package/templates/docs/{Desenvolvimento/.gitkeep → .gitkeep} +0 -0
- /package/templates/{docs/Estrutura → workspace/Input}/.gitkeep +0 -0
- /package/templates/{docs/PM → workspace/Input/setup_projeto}/.gitkeep +0 -0
- /package/templates/{docs/PM/setup_projeto → workspace/Output}/.gitkeep +0 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# Arquitetura
|
|
2
|
+
|
|
3
|
+
> Arquitetura do sistema: containers, componentes, stack tecnológica, ambientes e deploy.
|
|
4
|
+
> C4 Níveis 2-3 + camadas da stack + infraestrutura de runtime.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!--
|
|
9
|
+
=============================================================================
|
|
10
|
+
INSTRUÇÕES PARA O AGENTE (não incluir no arquivo gerado)
|
|
11
|
+
=============================================================================
|
|
12
|
+
|
|
13
|
+
ORIGEM: Gerado pelo /setup-projeto a partir do TRD §2 (Stack), §3 (Arquitetura)
|
|
14
|
+
e §6 (Infraestrutura — ambientes, deploy, CI/CD, rollback).
|
|
15
|
+
ATUALIZAÇÃO: /merge-delta quando features adicionam containers, componentes,
|
|
16
|
+
dependências de stack ou mudam ambientes/deploy.
|
|
17
|
+
|
|
18
|
+
COMO GERAR:
|
|
19
|
+
1. Ler TRD §3 (Arquitetura) — containers, padrões de comunicação, padrões de design
|
|
20
|
+
2. Ler TRD §2 (Stack) — tecnologias por camada, versões
|
|
21
|
+
3. Ler TRD §6 (Infraestrutura) — ambientes, deploy, CI/CD, rollback
|
|
22
|
+
4. Montar diagrama C4 Nível 2 mostrando TODOS os containers e conexões
|
|
23
|
+
5. Para cada container relevante, listar componentes internos (C4 Nível 3)
|
|
24
|
+
6. Documentar stack principal com versões EXATAS (não "latest")
|
|
25
|
+
7. Documentar ambientes (URLs, bancos, branches) e pipeline CI/CD concreto
|
|
26
|
+
|
|
27
|
+
O QUE NÃO VAI AQUI:
|
|
28
|
+
- Variáveis de ambiente → conventions.md
|
|
29
|
+
- Monitoramento e observabilidade → conventions.md
|
|
30
|
+
- Segurança (auth, CORS, rate limiting) → conventions.md
|
|
31
|
+
- Alternativas descartadas de stack → conventions.md
|
|
32
|
+
- Entidades e modelo de dados → domain.md
|
|
33
|
+
|
|
34
|
+
REGRAS:
|
|
35
|
+
- Versões fixadas (18.3.1, não ^18.0.0)
|
|
36
|
+
- Cada container tem: tecnologia, responsabilidade, porta, tipo de comunicação
|
|
37
|
+
- Padrões de design precisam de justificativa (não apenas nome)
|
|
38
|
+
- Pipeline CI/CD deve ser concreto — passos reais e ferramentas
|
|
39
|
+
- Rollback strategy obrigatória — "como voltar se der errado?"
|
|
40
|
+
|
|
41
|
+
=============================================================================
|
|
42
|
+
-->
|
|
43
|
+
|
|
44
|
+
## Diagrama de Containers (C4 Nível 2)
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
<!-- Representação textual dos containers e suas conexões -->
|
|
48
|
+
<!-- Usar formato: [Container] --protocolo--> [Container] -->
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Containers
|
|
52
|
+
|
|
53
|
+
| Container | Tecnologia | Responsabilidade | Porta | Comunicação |
|
|
54
|
+
|-----------|-----------|-----------------|-------|-------------|
|
|
55
|
+
| | | | | |
|
|
56
|
+
|
|
57
|
+
## Componentes Principais (C4 Nível 3)
|
|
58
|
+
|
|
59
|
+
<!-- Repetir esta seção para cada container que tenha componentes internos relevantes -->
|
|
60
|
+
|
|
61
|
+
### {{Container}}
|
|
62
|
+
|
|
63
|
+
| Componente | Responsabilidade | Dependências internas | Dependências externas |
|
|
64
|
+
|------------|-----------------|----------------------|----------------------|
|
|
65
|
+
| | | | |
|
|
66
|
+
|
|
67
|
+
## Padrões de Comunicação
|
|
68
|
+
|
|
69
|
+
### Síncrona (request/response)
|
|
70
|
+
|
|
71
|
+
| De | Para | Protocolo | Formato | Observações |
|
|
72
|
+
|----|------|-----------|---------|-------------|
|
|
73
|
+
| | | | | |
|
|
74
|
+
|
|
75
|
+
### Assíncrona (eventos/filas)
|
|
76
|
+
|
|
77
|
+
| Produtor | Tópico/Fila | Consumer | Formato | Garantia |
|
|
78
|
+
|----------|-------------|----------|---------|----------|
|
|
79
|
+
| | | | | at-least-once / exactly-once |
|
|
80
|
+
|
|
81
|
+
## Padrões de Design Adotados
|
|
82
|
+
|
|
83
|
+
| Padrão | Onde é usado | Justificativa | Ref decisão |
|
|
84
|
+
|--------|-------------|---------------|-------------|
|
|
85
|
+
| | | | |
|
|
86
|
+
|
|
87
|
+
## Stack Principal
|
|
88
|
+
|
|
89
|
+
| Camada | Tecnologia | Versão | Justificativa |
|
|
90
|
+
|--------|-----------|--------|---------------|
|
|
91
|
+
| Frontend | | | |
|
|
92
|
+
| Backend | | | |
|
|
93
|
+
| Banco de Dados | | | |
|
|
94
|
+
| ORM/Query Builder | | | |
|
|
95
|
+
| Autenticação | | | |
|
|
96
|
+
| Testes | | | |
|
|
97
|
+
| CI/CD | | | |
|
|
98
|
+
|
|
99
|
+
<!-- Adicionar camadas conforme necessidade: Mobile, Cache, Fila, Monitoramento, etc. -->
|
|
100
|
+
|
|
101
|
+
## Bibliotecas e Dependências por Camada
|
|
102
|
+
|
|
103
|
+
<!-- Repetir bloco para cada camada com dependências relevantes -->
|
|
104
|
+
|
|
105
|
+
### {{Camada}}
|
|
106
|
+
|
|
107
|
+
| Pacote | Versão | Para quê |
|
|
108
|
+
|--------|--------|----------|
|
|
109
|
+
| | | |
|
|
110
|
+
|
|
111
|
+
## Ambientes
|
|
112
|
+
|
|
113
|
+
| Ambiente | URL | Banco | Propósito | Branch |
|
|
114
|
+
|----------|-----|-------|-----------|--------|
|
|
115
|
+
| Local | `localhost:{{PORT}}` | local | Desenvolvimento | qualquer |
|
|
116
|
+
| Staging | | | Testes e homologação | develop |
|
|
117
|
+
| Produção | | | Usuários finais | main |
|
|
118
|
+
|
|
119
|
+
## Deploy
|
|
120
|
+
|
|
121
|
+
### Estratégia
|
|
122
|
+
|
|
123
|
+
| Aspecto | Decisão |
|
|
124
|
+
|---------|---------|
|
|
125
|
+
| Plataforma | <!-- Docker? Serverless? VPS? Cloud provider? --> |
|
|
126
|
+
| Orquestração | <!-- Kubernetes? ECS? PM2? --> |
|
|
127
|
+
| Build | <!-- Docker multi-stage? Build nativo? --> |
|
|
128
|
+
| Estratégia de deploy | <!-- Rolling? Blue-green? Canary? --> |
|
|
129
|
+
|
|
130
|
+
### Pipeline CI/CD
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
push → lint → test → build → deploy(staging) → aprovação → deploy(prod)
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
| Etapa | Ferramenta | Trigger | Timeout |
|
|
137
|
+
|-------|-----------|---------|---------|
|
|
138
|
+
| Lint | <!-- eslint, ruff --> | push | |
|
|
139
|
+
| Testes | <!-- jest, pytest --> | push | |
|
|
140
|
+
| Build | <!-- docker build --> | push em main/develop | |
|
|
141
|
+
| Deploy staging | <!-- CD tool --> | push em develop | |
|
|
142
|
+
| Deploy produção | <!-- CD tool --> | aprovação manual | |
|
|
143
|
+
|
|
144
|
+
### Rollback
|
|
145
|
+
|
|
146
|
+
| Cenário | Procedimento | Responsável |
|
|
147
|
+
|---------|-------------|-------------|
|
|
148
|
+
| Bug em produção | <!-- Reverter deploy? Hotfix? --> | |
|
|
149
|
+
| Migration com erro | <!-- Rollback da migration? --> | |
|
|
150
|
+
| Serviço externo fora | <!-- Fallback? Circuit breaker? --> | |
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Changelog
|
|
155
|
+
|
|
156
|
+
| Data | Feature | Tipo | Descrição |
|
|
157
|
+
|------|---------|------|-----------|
|
|
158
|
+
| | | | |
|
|
@@ -1,138 +1,202 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
=============================================================================
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
|
55
|
-
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
|
107
|
-
|
|
108
|
-
|
|
|
109
|
-
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
|
137
|
-
|
|
138
|
-
|
|
1
|
+
# Convenções
|
|
2
|
+
|
|
3
|
+
> Regras transversais do sistema: autenticação, autorização, CORS, rate limiting,
|
|
4
|
+
> LGPD, auditoria, variáveis de ambiente, monitoramento, códigos de erro de domínio
|
|
5
|
+
> e versionamento de dependências. Padrões que todo código segue.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<!--
|
|
10
|
+
=============================================================================
|
|
11
|
+
INSTRUÇÕES PARA O AGENTE (não incluir no arquivo gerado)
|
|
12
|
+
=============================================================================
|
|
13
|
+
|
|
14
|
+
ORIGEM: Gerado pelo /setup-projeto a partir do TRD §7 (Segurança),
|
|
15
|
+
§6 (Infra — env vars, domínios, monitoramento), §5 (API — códigos de erro
|
|
16
|
+
de domínio) e §2 (Stack — alternativas descartadas, versionamento).
|
|
17
|
+
ATUALIZAÇÃO: /merge-delta quando features adicionam permissões, papéis,
|
|
18
|
+
dados pessoais, variáveis de ambiente, códigos de erro ou alteram políticas.
|
|
19
|
+
|
|
20
|
+
COMO GERAR:
|
|
21
|
+
1. Ler TRD §7 (Segurança) — autenticação, autorização, CORS, LGPD
|
|
22
|
+
2. Ler TRD §6 (Infra) — variáveis de ambiente, domínios, monitoramento
|
|
23
|
+
3. Ler TRD §5 (API) — códigos de erro do domínio (reutilizáveis)
|
|
24
|
+
4. Ler TRD §2 (Stack) — alternativas descartadas e versionamento de dependências
|
|
25
|
+
5. Autenticação: método, expiração, hash, refresh strategy
|
|
26
|
+
6. Autorização: papéis e matriz de permissões (RBAC/ABAC)
|
|
27
|
+
7. LGPD: mapear TODOS dados pessoais com base legal específica
|
|
28
|
+
8. Auditoria: O QUE é logado, ONDE, POR QUANTO TEMPO
|
|
29
|
+
9. Variáveis de ambiente: NUNCA valores reais, só exemplos
|
|
30
|
+
|
|
31
|
+
O QUE NÃO VAI AQUI:
|
|
32
|
+
- Rotas, paginação, filtros, catálogo de endpoints → apiContracts.md
|
|
33
|
+
- Containers, ambientes, deploy → architecture.md
|
|
34
|
+
- Entidades, tabelas → domain.md
|
|
35
|
+
|
|
36
|
+
REGRAS:
|
|
37
|
+
- Matriz de permissões é DINÂMICA — cresce a cada feature (via merge-delta)
|
|
38
|
+
- Dados pessoais da LGPD precisam de base legal ESPECÍFICA
|
|
39
|
+
- Nunca armazenar senhas em texto plano (hash obrigatório)
|
|
40
|
+
- Secrets nunca no código — sempre variáveis de ambiente
|
|
41
|
+
- Rate limiting obrigatório em endpoints públicos (login, registro)
|
|
42
|
+
- Auditoria obrigatória para operações destrutivas
|
|
43
|
+
- Códigos de erro do domínio são globais — reutilizáveis por múltiplos endpoints
|
|
44
|
+
|
|
45
|
+
=============================================================================
|
|
46
|
+
-->
|
|
47
|
+
|
|
48
|
+
## Autenticação
|
|
49
|
+
|
|
50
|
+
| Aspecto | Implementação |
|
|
51
|
+
|---------|--------------|
|
|
52
|
+
| Método | <!-- JWT? Session? OAuth2? --> |
|
|
53
|
+
| Expiração access token | <!-- Ex: 15min --> |
|
|
54
|
+
| Refresh token | <!-- Existe? Expiração? Rotação? --> |
|
|
55
|
+
| Hash de senha | <!-- bcrypt rounds? argon2? --> |
|
|
56
|
+
| Header | <!-- Authorization: Bearer {token} --> |
|
|
57
|
+
| Armazenamento (client) | <!-- httpOnly cookie? localStorage? --> |
|
|
58
|
+
|
|
59
|
+
### Fluxo de autenticação
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
<!-- Descrever o fluxo: login → token → refresh → logout -->
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Autorização
|
|
66
|
+
|
|
67
|
+
### Modelo
|
|
68
|
+
|
|
69
|
+
| Aspecto | Decisão |
|
|
70
|
+
|---------|---------|
|
|
71
|
+
| Tipo | <!-- RBAC / ABAC / RBAC + ABAC --> |
|
|
72
|
+
| Onde é verificado | <!-- Middleware? Decorator? Service? --> |
|
|
73
|
+
| Granularidade | <!-- Por rota? Por recurso? Por campo? --> |
|
|
74
|
+
|
|
75
|
+
### Papéis
|
|
76
|
+
|
|
77
|
+
| Papel | Descrição | Herda de |
|
|
78
|
+
|-------|-----------|----------|
|
|
79
|
+
| | | <!-- Hierarquia: admin herda de user? --> |
|
|
80
|
+
|
|
81
|
+
### Matriz de Permissões
|
|
82
|
+
|
|
83
|
+
> Atualizada a cada feature via /merge-delta.
|
|
84
|
+
|
|
85
|
+
| Recurso | Ação | {{role_1}} | {{role_2}} | {{role_N}} |
|
|
86
|
+
|---------|------|------------|------------|------------|
|
|
87
|
+
| | criar | | | |
|
|
88
|
+
| | ler | | | |
|
|
89
|
+
| | editar | | | |
|
|
90
|
+
| | deletar | | | |
|
|
91
|
+
|
|
92
|
+
## CORS
|
|
93
|
+
|
|
94
|
+
| Aspecto | Configuração |
|
|
95
|
+
|---------|-------------|
|
|
96
|
+
| Allowed Origins | <!-- Configurável por ambiente --> |
|
|
97
|
+
| Allowed Methods | `GET, POST, PUT, PATCH, DELETE` |
|
|
98
|
+
| Allowed Headers | `Authorization, Content-Type` |
|
|
99
|
+
| Credentials | <!-- true/false --> |
|
|
100
|
+
| Max Age | <!-- Preflight cache em segundos --> |
|
|
101
|
+
|
|
102
|
+
## Rate Limiting
|
|
103
|
+
|
|
104
|
+
| Categoria | Limite | Janela | Resposta |
|
|
105
|
+
|-----------|--------|--------|----------|
|
|
106
|
+
| Login/Registro | <!-- Ex: 5 req --> | <!-- Ex: 15min --> | 429 + Retry-After |
|
|
107
|
+
| API autenticada | <!-- Ex: 100 req --> | <!-- Ex: 1min --> | 429 + Retry-After |
|
|
108
|
+
| API pública | <!-- Ex: 30 req --> | <!-- Ex: 1min --> | 429 + Retry-After |
|
|
109
|
+
| Upload | <!-- Ex: 10 req --> | <!-- Ex: 1h --> | 429 + Retry-After |
|
|
110
|
+
|
|
111
|
+
## LGPD / Privacidade
|
|
112
|
+
|
|
113
|
+
### Dados pessoais coletados
|
|
114
|
+
|
|
115
|
+
| Dado | Base legal | Finalidade | Retenção | Criptografado? |
|
|
116
|
+
|------|-----------|------------|----------|----------------|
|
|
117
|
+
| | <!-- Consentimento / Contrato / Legítimo interesse / Obrigação legal --> | | | |
|
|
118
|
+
|
|
119
|
+
### Direitos do titular
|
|
120
|
+
|
|
121
|
+
| Direito | Implementação | Endpoint/Fluxo |
|
|
122
|
+
|---------|--------------|----------------|
|
|
123
|
+
| Acesso aos dados | | |
|
|
124
|
+
| Correção | | |
|
|
125
|
+
| Exclusão (right to be forgotten) | | <!-- Soft delete? Hard delete? Anonimização? --> |
|
|
126
|
+
| Portabilidade | | <!-- Formato de exportação? --> |
|
|
127
|
+
| Revogação de consentimento | | |
|
|
128
|
+
|
|
129
|
+
## Auditoria
|
|
130
|
+
|
|
131
|
+
| O que é logado | Quando | Onde armazena | Retenção |
|
|
132
|
+
|----------------|--------|---------------|----------|
|
|
133
|
+
| Login/Logout | sempre | | |
|
|
134
|
+
| Alteração de dados sensíveis | sempre | | |
|
|
135
|
+
| Operações destrutivas (DELETE) | sempre | | |
|
|
136
|
+
| Falhas de autenticação | sempre | | |
|
|
137
|
+
| Mudanças de permissão | sempre | | |
|
|
138
|
+
|
|
139
|
+
## Proteção de Dados em Trânsito e Repouso
|
|
140
|
+
|
|
141
|
+
| Aspecto | Implementação |
|
|
142
|
+
|---------|--------------|
|
|
143
|
+
| TLS | <!-- Versão mínima? --> |
|
|
144
|
+
| Dados sensíveis em repouso | <!-- Criptografia? Quais campos? --> |
|
|
145
|
+
| Backup | <!-- Criptografado? Frequência? --> |
|
|
146
|
+
|
|
147
|
+
## Variáveis de Ambiente
|
|
148
|
+
|
|
149
|
+
> NUNCA colocar valores reais aqui. Apenas nomes, descrição e exemplos.
|
|
150
|
+
|
|
151
|
+
| Variável | Ambientes | Obrigatória | Descrição | Exemplo |
|
|
152
|
+
|----------|-----------|-------------|-----------|---------|
|
|
153
|
+
| `DATABASE_URL` | todos | sim | Conexão com banco | `postgres://user:pass@host:5432/db` |
|
|
154
|
+
| `JWT_SECRET` | todos | sim | Chave de assinatura JWT | `sua-chave-secreta-aqui` |
|
|
155
|
+
| `NODE_ENV` | todos | sim | Ambiente atual | `development` / `production` |
|
|
156
|
+
|
|
157
|
+
## Domínios e DNS
|
|
158
|
+
|
|
159
|
+
| Domínio | Aponta para | Certificado | Gerenciado por |
|
|
160
|
+
|---------|-------------|-------------|----------------|
|
|
161
|
+
| | | <!-- Let's Encrypt? AWS ACM? --> | |
|
|
162
|
+
|
|
163
|
+
## Monitoramento e Observabilidade
|
|
164
|
+
|
|
165
|
+
| Aspecto | Ferramenta | O que monitora |
|
|
166
|
+
|---------|-----------|----------------|
|
|
167
|
+
| Logs | <!-- Ex: CloudWatch, Datadog --> | |
|
|
168
|
+
| APM | <!-- Ex: New Relic, Sentry --> | |
|
|
169
|
+
| Uptime | <!-- Ex: Pingdom, UptimeRobot --> | |
|
|
170
|
+
| Alertas | <!-- Ex: PagerDuty, Slack --> | |
|
|
171
|
+
|
|
172
|
+
## Códigos de Erro do Domínio
|
|
173
|
+
|
|
174
|
+
> Códigos reutilizáveis por múltiplos endpoints. Novos códigos são adicionados via /merge-delta.
|
|
175
|
+
|
|
176
|
+
| Código | Descrição | HTTP padrão |
|
|
177
|
+
|--------|-----------|-------------|
|
|
178
|
+
| <!-- Ex: DUPLICATE_EMAIL --> | <!-- Email já cadastrado --> | <!-- 409 --> |
|
|
179
|
+
|
|
180
|
+
## Alternativas Tecnológicas Descartadas
|
|
181
|
+
|
|
182
|
+
> Decisões já tomadas. Se alguém perguntar "por que não usamos X?", a resposta está aqui.
|
|
183
|
+
|
|
184
|
+
| Tecnologia escolhida | Alternativa considerada | Por que descartamos | Ref decisão |
|
|
185
|
+
|----------------------|------------------------|---------------------|-------------|
|
|
186
|
+
| | | | |
|
|
187
|
+
|
|
188
|
+
## Convenções de Versionamento de Dependências
|
|
189
|
+
|
|
190
|
+
| Aspecto | Convenção |
|
|
191
|
+
|---------|-----------|
|
|
192
|
+
| Versionamento | <!-- Semver? Pinned? --> |
|
|
193
|
+
| Lock files | <!-- package-lock.json? yarn.lock? --> |
|
|
194
|
+
| Atualização | <!-- Dependabot? Manual? Periodicidade? --> |
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Changelog
|
|
199
|
+
|
|
200
|
+
| Data | Feature | Tipo | Descrição |
|
|
201
|
+
|------|---------|------|-----------|
|
|
202
|
+
| | | | |
|