spec-first-copilot 0.6.0-beta.9 → 0.7.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 +252 -167
- package/bin/cli.js +70 -70
- package/lib/init.js +92 -92
- package/lib/update.js +132 -132
- package/package.json +1 -1
- package/templates/.ai/memory/napkin.md +68 -68
- package/templates/.github/CHANGELOG.md +121 -0
- package/templates/.github/adapters/SETUP.md +314 -314
- package/templates/.github/adapters/confluence.md +295 -295
- package/templates/.github/adapters/errors.md +234 -234
- package/templates/.github/adapters/filesystem.md +353 -353
- package/templates/.github/adapters/interface.md +301 -301
- package/templates/.github/adapters/naming.md +241 -241
- package/templates/.github/adapters/registry.md +244 -244
- package/templates/.github/agents/backend-coder.md +14 -14
- package/templates/.github/agents/db-coder.md +165 -165
- package/templates/.github/agents/doc-writer.md +66 -53
- package/templates/.github/agents/frontend-coder.md +5 -5
- package/templates/.github/agents/infra-coder.md +341 -341
- package/templates/.github/agents/reviewer.md +6 -6
- package/templates/.github/agents/security-reviewer.md +153 -153
- package/templates/.github/copilot-instructions.md +272 -262
- package/templates/.github/instructions/docs.instructions.md +147 -145
- package/templates/.github/instructions/sensitive-files.instructions.md +32 -32
- package/templates/.github/rules.md +229 -229
- package/templates/.github/scripts/bootstrap-confluence.js +289 -223
- package/templates/.github/skills/sf-design/SKILL.md +161 -216
- package/templates/.github/skills/sf-dev/SKILL.md +204 -351
- package/templates/.github/skills/sf-discovery/SKILL.md +415 -414
- package/templates/.github/skills/sf-extract/SKILL.md +225 -249
- package/templates/.github/skills/sf-load/SKILL.md +296 -295
- package/templates/.github/skills/sf-mcp/SKILL.md +386 -385
- package/templates/.github/skills/sf-merge-docs/SKILL.md +152 -100
- package/templates/.github/skills/sf-plan/SKILL.md +152 -128
- package/templates/.github/skills/sf-publish/SKILL.md +144 -143
- package/templates/.github/skills/sf-session-finish/SKILL.md +93 -120
- package/templates/.github/skills/sf-start/SKILL.md +192 -145
- package/templates/.github/templates/estrutura/apiContracts.template.md +160 -159
- package/templates/.github/templates/estrutura/architecture.template.md +169 -168
- package/templates/.github/templates/estrutura/conventions.template.md +214 -212
- package/templates/.github/templates/estrutura/decisions.template.md +107 -107
- package/templates/.github/templates/estrutura/domain.template.md +161 -160
- package/templates/.github/templates/feature/PRD.template.md +279 -286
- package/templates/.github/templates/feature/Progresso.template.md +141 -141
- package/templates/.github/templates/feature/TRD.template.md +358 -0
- package/templates/.github/templates/feature/context.template.md +89 -48
- package/templates/.github/templates/feature/extract-log.template.md +49 -39
- package/templates/.github/templates/feature/projetos.template.yaml +79 -79
- package/templates/.github/templates/global/progresso_global.template.md +59 -57
- package/templates/.github/templates/specs/brief.template.md +66 -59
- package/templates/.github/templates/specs/contracts.template.md +147 -141
- package/templates/.github/templates/specs/scenarios.template.md +125 -117
- package/templates/.github/templates/specs/tasks.template.md +65 -63
- package/templates/_gitignore +35 -35
- package/templates/sfw.config.yml.example +147 -147
- package/templates/.github/templates/feature/backlog-extraido.template.md +0 -156
- package/templates/.github/templates/feature/sdd.template.md +0 -559
|
@@ -1,168 +1,169 @@
|
|
|
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
|
-
PAPEL: Síntese cross-feature estável sobre arquitetura do sistema.
|
|
14
|
-
Onboarding rápido + visão C4 Níveis 2-3 + stack + ambientes + deploy.
|
|
15
|
-
Quando detalhe for necessário, referenciar
|
|
16
|
-
(ex: "fluxo completo em workspace/Output/feat_X/
|
|
17
|
-
|
|
18
|
-
ORIGEM (first-run, via /sf-design):
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
ATUALIZAÇÃO (feature): /sf-merge-docs
|
|
25
|
-
quando feature adiciona containers,
|
|
26
|
-
ou muda ambientes/deploy.
|
|
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
|
-
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
|
150
|
-
|
|
|
151
|
-
|
|
|
152
|
-
| Deploy
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
|
160
|
-
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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
|
+
PAPEL: Síntese cross-feature estável sobre arquitetura do sistema.
|
|
14
|
+
Onboarding rápido + visão C4 Níveis 2-3 + stack + ambientes + deploy.
|
|
15
|
+
Quando detalhe for necessário, referenciar TRDs de scopes específicos
|
|
16
|
+
(ex: "fluxo completo em workspace/Output/feat_X/TRD.md §2").
|
|
17
|
+
|
|
18
|
+
ORIGEM (first-run, via /sf-design):
|
|
19
|
+
- TRD §1.1 Stack → seção "Stack Principal"
|
|
20
|
+
- TRD §1.2 Arquitetura → "Diagrama de Containers" + "Containers" + "Padrões"
|
|
21
|
+
- TRD §1.3 Ambientes → seção "Ambientes"
|
|
22
|
+
- TRD §1.4 Deploy baseline + §5 §Área-Infra → seção "Deploy" (estratégia, CI/CD, rollback)
|
|
23
|
+
|
|
24
|
+
ATUALIZAÇÃO (feature): /sf-merge-docs faz diff semântico PRD+TRD ↔ docs/
|
|
25
|
+
e aplica ADDED/MODIFIED/REMOVED quando feature adiciona containers,
|
|
26
|
+
componentes, dependências de stack, ou muda ambientes/deploy.
|
|
27
|
+
Não regenerar inteiro — apenas aplicar delta.
|
|
28
|
+
|
|
29
|
+
COMO GERAR (first-run):
|
|
30
|
+
1. Ler TRD §1.2 Arquitetura — containers, padrões de comunicação, padrões de design
|
|
31
|
+
2. Ler TRD §1.1 Stack — tecnologias por camada, versões exatas
|
|
32
|
+
3. Ler TRD §1.3 Ambientes + §1.4 Deploy baseline + §5 §Área-Infra — ambientes, deploy, CI/CD, rollback
|
|
33
|
+
4. Montar diagrama C4 Nível 2 mostrando TODOS os containers e conexões
|
|
34
|
+
5. Para cada container relevante, listar componentes internos (C4 Nível 3)
|
|
35
|
+
6. Documentar stack principal com versões EXATAS (não "latest")
|
|
36
|
+
7. Documentar ambientes (URLs, bancos, branches) e pipeline CI/CD concreto
|
|
37
|
+
|
|
38
|
+
O QUE NÃO VAI AQUI:
|
|
39
|
+
- Variáveis de ambiente → conventions.md
|
|
40
|
+
- Monitoramento e observabilidade → conventions.md
|
|
41
|
+
- Segurança (auth, CORS, rate limiting) → conventions.md
|
|
42
|
+
- Alternativas descartadas de stack → conventions.md
|
|
43
|
+
- Entidades e modelo de dados → domain.md
|
|
44
|
+
|
|
45
|
+
REGRAS:
|
|
46
|
+
- Versões fixadas (18.3.1, não ^18.0.0)
|
|
47
|
+
- Cada container tem: tecnologia, responsabilidade, porta, tipo de comunicação
|
|
48
|
+
- Padrões de design precisam de justificativa (não apenas nome)
|
|
49
|
+
- Pipeline CI/CD deve ser concreto — passos reais e ferramentas
|
|
50
|
+
- Rollback strategy obrigatória — "como voltar se der errado?"
|
|
51
|
+
|
|
52
|
+
=============================================================================
|
|
53
|
+
-->
|
|
54
|
+
|
|
55
|
+
## Diagrama de Containers (C4 Nível 2)
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
<!-- Representação textual dos containers e suas conexões -->
|
|
59
|
+
<!-- Usar formato: [Container] --protocolo--> [Container] -->
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Containers
|
|
63
|
+
|
|
64
|
+
| Container | Tecnologia | Responsabilidade | Porta | Comunicação |
|
|
65
|
+
|-----------|-----------|-----------------|-------|-------------|
|
|
66
|
+
| | | | | |
|
|
67
|
+
|
|
68
|
+
## Componentes Principais (C4 Nível 3)
|
|
69
|
+
|
|
70
|
+
<!-- Repetir esta seção para cada container que tenha componentes internos relevantes -->
|
|
71
|
+
|
|
72
|
+
### {{Container}}
|
|
73
|
+
|
|
74
|
+
| Componente | Responsabilidade | Dependências internas | Dependências externas |
|
|
75
|
+
|------------|-----------------|----------------------|----------------------|
|
|
76
|
+
| | | | |
|
|
77
|
+
|
|
78
|
+
## Padrões de Comunicação
|
|
79
|
+
|
|
80
|
+
### Síncrona (request/response)
|
|
81
|
+
|
|
82
|
+
| De | Para | Protocolo | Formato | Observações |
|
|
83
|
+
|----|------|-----------|---------|-------------|
|
|
84
|
+
| | | | | |
|
|
85
|
+
|
|
86
|
+
### Assíncrona (eventos/filas)
|
|
87
|
+
|
|
88
|
+
| Produtor | Tópico/Fila | Consumer | Formato | Garantia |
|
|
89
|
+
|----------|-------------|----------|---------|----------|
|
|
90
|
+
| | | | | at-least-once / exactly-once |
|
|
91
|
+
|
|
92
|
+
## Padrões de Design Adotados
|
|
93
|
+
|
|
94
|
+
| Padrão | Onde é usado | Justificativa | Ref decisão |
|
|
95
|
+
|--------|-------------|---------------|-------------|
|
|
96
|
+
| | | | |
|
|
97
|
+
|
|
98
|
+
## Stack Principal
|
|
99
|
+
|
|
100
|
+
| Camada | Tecnologia | Versão | Justificativa |
|
|
101
|
+
|--------|-----------|--------|---------------|
|
|
102
|
+
| Frontend | | | |
|
|
103
|
+
| Backend | | | |
|
|
104
|
+
| Banco de Dados | | | |
|
|
105
|
+
| ORM/Query Builder | | | |
|
|
106
|
+
| Autenticação | | | |
|
|
107
|
+
| Testes | | | |
|
|
108
|
+
| CI/CD | | | |
|
|
109
|
+
|
|
110
|
+
<!-- Adicionar camadas conforme necessidade: Mobile, Cache, Fila, Monitoramento, etc. -->
|
|
111
|
+
|
|
112
|
+
## Bibliotecas e Dependências por Camada
|
|
113
|
+
|
|
114
|
+
<!-- Repetir bloco para cada camada com dependências relevantes -->
|
|
115
|
+
|
|
116
|
+
### {{Camada}}
|
|
117
|
+
|
|
118
|
+
| Pacote | Versão | Para quê |
|
|
119
|
+
|--------|--------|----------|
|
|
120
|
+
| | | |
|
|
121
|
+
|
|
122
|
+
## Ambientes
|
|
123
|
+
|
|
124
|
+
| Ambiente | URL | Banco | Propósito | Branch |
|
|
125
|
+
|----------|-----|-------|-----------|--------|
|
|
126
|
+
| Local | `localhost:{{PORT}}` | local | Desenvolvimento | qualquer |
|
|
127
|
+
| Staging | | | Testes e homologação | develop |
|
|
128
|
+
| Produção | | | Usuários finais | main |
|
|
129
|
+
|
|
130
|
+
## Deploy
|
|
131
|
+
|
|
132
|
+
### Estratégia
|
|
133
|
+
|
|
134
|
+
| Aspecto | Decisão |
|
|
135
|
+
|---------|---------|
|
|
136
|
+
| Plataforma | <!-- Docker? Serverless? VPS? Cloud provider? --> |
|
|
137
|
+
| Orquestração | <!-- Kubernetes? ECS? PM2? --> |
|
|
138
|
+
| Build | <!-- Docker multi-stage? Build nativo? --> |
|
|
139
|
+
| Estratégia de deploy | <!-- Rolling? Blue-green? Canary? --> |
|
|
140
|
+
|
|
141
|
+
### Pipeline CI/CD
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
push → lint → test → build → deploy(staging) → aprovação → deploy(prod)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
| Etapa | Ferramenta | Trigger | Timeout |
|
|
148
|
+
|-------|-----------|---------|---------|
|
|
149
|
+
| Lint | <!-- eslint, ruff --> | push | |
|
|
150
|
+
| Testes | <!-- jest, pytest --> | push | |
|
|
151
|
+
| Build | <!-- docker build --> | push em main/develop | |
|
|
152
|
+
| Deploy staging | <!-- CD tool --> | push em develop | |
|
|
153
|
+
| Deploy produção | <!-- CD tool --> | aprovação manual | |
|
|
154
|
+
|
|
155
|
+
### Rollback
|
|
156
|
+
|
|
157
|
+
| Cenário | Procedimento | Responsável |
|
|
158
|
+
|---------|-------------|-------------|
|
|
159
|
+
| Bug em produção | <!-- Reverter deploy? Hotfix? --> | |
|
|
160
|
+
| Migration com erro | <!-- Rollback da migration? --> | |
|
|
161
|
+
| Serviço externo fora | <!-- Fallback? Circuit breaker? --> | |
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Changelog
|
|
166
|
+
|
|
167
|
+
| Data | Feature | Tipo | Descrição |
|
|
168
|
+
|------|---------|------|-----------|
|
|
169
|
+
| | | | |
|