@onion-architect-ai/cli 4.1.0-beta.1 → 4.1.0-beta.2
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/dist/cli.js +8 -7
- package/dist/cli.js.map +1 -1
- package/package.json +4 -3
- package/templates/.cursor/agents/compliance/iso-22301-specialist.md +917 -0
- package/templates/.cursor/agents/compliance/iso-27001-specialist.md +641 -0
- package/templates/.cursor/agents/compliance/pmbok-specialist.md +669 -0
- package/templates/.cursor/agents/compliance/security-information-master.md +824 -0
- package/templates/.cursor/agents/compliance/soc2-specialist.md +818 -0
- package/templates/.cursor/agents/deployment/docker-specialist.md +1192 -0
- package/templates/.cursor/agents/meta/agent-creator-specialist.md +1135 -0
- package/templates/.cursor/agents/meta/command-creator-specialist.md +1519 -0
- package/templates/.cursor/agents/meta/metaspec-gate-keeper.md +240 -0
- package/templates/.cursor/agents/meta/onion.md +753 -0
- package/templates/.cursor/agents/research/research-agent.md +292 -0
- package/templates/.cursor/agents/review/corporate-compliance-specialist.md +370 -0
- package/templates/.cursor/commands/common/prompts/README.md +187 -0
- package/templates/.cursor/commands/common/prompts/clickup-patterns.md +144 -0
- package/templates/.cursor/commands/common/prompts/code-review-checklist.md +168 -0
- package/templates/.cursor/commands/common/prompts/git-workflow-patterns.md +235 -0
- package/templates/.cursor/commands/common/prompts/output-formats.md +240 -0
- package/templates/.cursor/commands/common/prompts/technical.md +172 -0
- package/templates/.cursor/commands/common/prompts/validation-rules.md +173 -0
- package/templates/.cursor/commands/common/templates/abstraction-template.md +400 -0
- package/templates/.cursor/commands/common/templates/agent-template.md +353 -0
- package/templates/.cursor/commands/common/templates/business_context_template.md +748 -0
- package/templates/.cursor/commands/common/templates/command-template.md +273 -0
- package/templates/.cursor/commands/common/templates/technical_context_template.md +526 -0
- package/templates/.cursor/commands/development/runflow-dev.md +465 -0
- package/templates/.cursor/commands/docs/build-compliance-docs.md +143 -0
- package/templates/.cursor/commands/git/README.md +606 -0
- package/templates/.cursor/commands/meta/all-tools.md +50 -0
- package/templates/.cursor/commands/meta/analyze-complex-problem.md +186 -0
- package/templates/.cursor/commands/meta/create-abstraction.md +859 -0
- package/templates/.cursor/commands/meta/create-agent-express.md +83 -0
- package/templates/.cursor/commands/meta/create-agent.md +210 -0
- package/templates/.cursor/commands/meta/create-command.md +203 -0
- package/templates/.cursor/commands/meta/create-knowledge-base.md +143 -0
- package/templates/.cursor/commands/meta/create-task-structure.md +150 -0
- package/templates/.cursor/commands/meta/setup-integration.md +257 -0
- package/templates/.cursor/commands/onion/setup.md +843 -0
- package/templates/.cursor/commands/onion.md +168 -0
- package/templates/.cursor/commands/product/README.md +230 -0
- package/templates/.cursor/commands/quick/analisys.md +17 -0
- package/templates/.cursor/commands/validate/collab/pair-testing.md +633 -0
- package/templates/.cursor/commands/validate/collab/three-amigos.md +505 -0
- package/templates/.cursor/commands/validate/qa-points/estimate.md +660 -0
- package/templates/.cursor/commands/validate/test-strategy/analyze.md +1134 -0
- package/templates/.cursor/commands/validate/test-strategy/create.md +392 -0
- package/templates/.cursor/commands/validate/workflow.md +360 -0
- package/templates/.cursor/commands/warm-up.md +91 -0
- package/templates/.cursor/docs/architecture/acoplamento-clickup-problema-analise.md +446 -0
- package/templates/.cursor/docs/architecture/desacoplamento-roadmap.md +360 -0
- package/templates/.cursor/docs/architecture/validacao-fase-1.md +219 -0
- package/templates/.cursor/docs/c4/c4-detection-rules.md +395 -0
- package/templates/.cursor/docs/c4/c4-documentation-templates.md +579 -0
- package/templates/.cursor/docs/c4/c4-mermaid-patterns.md +331 -0
- package/templates/.cursor/docs/c4/c4-templates.md +256 -0
- package/templates/.cursor/docs/clickup/clickup-acceptance-criteria-strategy.md +329 -0
- package/templates/.cursor/docs/clickup/clickup-auto-update-strategy.md +318 -0
- package/templates/.cursor/docs/clickup/clickup-comment-formatter.md +239 -0
- package/templates/.cursor/docs/clickup/clickup-description-fix.md +355 -0
- package/templates/.cursor/docs/clickup/clickup-dual-comment-strategy.md +505 -0
- package/templates/.cursor/docs/clickup/clickup-formatting.md +302 -0
- package/templates/.cursor/docs/clickup/separador-tamanho-otimizado.md +256 -0
- package/templates/.cursor/docs/engineer/pre-pr-acceptance-validation.md +256 -0
- package/templates/.cursor/docs/onion/ESPERANTO.md +278 -0
- package/templates/.cursor/docs/onion/agents-reference.md +832 -0
- package/templates/.cursor/docs/onion/clickup-integration.md +738 -0
- package/templates/.cursor/docs/onion/commands-guide.md +807 -0
- package/templates/.cursor/docs/onion/engineering-flows.md +865 -0
- package/templates/.cursor/docs/onion/getting-started.md +741 -0
- package/templates/.cursor/docs/onion/maintenance-checklist.md +388 -0
- package/templates/.cursor/docs/onion/naming-conventions.md +268 -0
- package/templates/.cursor/docs/onion/practical-examples.md +782 -0
- package/templates/.cursor/docs/product/story-points-integration.md +254 -0
- package/templates/.cursor/docs/product/story-points-validation.md +224 -0
- package/templates/.cursor/docs/reviews/task-manager-docs-review-2025-11-24.md +167 -0
- package/templates/.cursor/docs/strategies/clickup-comment-patterns.md +766 -0
- package/templates/.cursor/docs/strategies/clickup-integration-tests.md +599 -0
- package/templates/.cursor/docs/strategies/clickup-mcp-wrappers-tests.md +854 -0
- package/templates/.cursor/docs/strategies/clickup-regression-tests.md +589 -0
- package/templates/.cursor/docs/strategies/visual-patterns.md +308 -0
- package/templates/.cursor/docs/templates/README.md +624 -0
- package/templates/.cursor/docs/templates/adr-template.md +226 -0
- package/templates/.cursor/docs/templates/analysis-template.md +280 -0
- package/templates/.cursor/docs/templates/execution-plan-template.md +430 -0
- package/templates/.cursor/docs/templates/guide-template.md +367 -0
- package/templates/.cursor/docs/templates/phase-execution-prompt-template.md +504 -0
- package/templates/.cursor/docs/templates/reference-template.md +522 -0
- package/templates/.cursor/docs/templates/solution-template.md +390 -0
- package/templates/.cursor/docs/tools/README.md +325 -0
- package/templates/.cursor/docs/tools/agents.md +330 -0
- package/templates/.cursor/docs/tools/commands.md +606 -0
- package/templates/.cursor/docs/tools/cursor.md +498 -0
- package/templates/.cursor/docs/tools/mcps.md +858 -0
- package/templates/.cursor/docs/tools/rules.md +423 -0
- package/templates/.cursor/rules/language-and-documentation.mdc +371 -0
- package/templates/.cursor/rules/onion-patterns.mdc +197 -0
- package/templates/.cursor/rules/validation-rules.mdc +194 -0
- package/templates/.cursor/utils/clickup-mcp-wrappers.md +671 -0
- package/templates/.cursor/utils/date-time-standards.md +182 -0
- package/templates/.cursor/utils/task-manager/README.md +94 -0
- package/templates/.cursor/utils/task-manager/adapters/asana.md +377 -0
- package/templates/.cursor/utils/task-manager/adapters/clickup.md +467 -0
- package/templates/.cursor/utils/task-manager/adapters/linear.md +421 -0
- package/templates/.cursor/utils/task-manager/detector.md +290 -0
- package/templates/.cursor/utils/task-manager/factory.md +363 -0
- package/templates/.cursor/utils/task-manager/interface.md +248 -0
- package/templates/.cursor/utils/task-manager/types.md +409 -0
- package/templates/.cursor/validation/product-task-validation.md +344 -0
- package/templates/.onion/contexts/business/.context-config.yml +52 -0
- package/templates/.onion/contexts/business/README.md +222 -0
- package/templates/.onion/contexts/business/agents/branding-specialist.md +1030 -0
- package/templates/.onion/contexts/business/agents/clickup-specialist.md +397 -0
- package/templates/.onion/contexts/business/agents/extract-meeting-specialist.md +395 -0
- package/templates/.onion/contexts/business/agents/gamma-specialist.md +1169 -0
- package/templates/.onion/contexts/business/agents/meeting-consolidator.md +483 -0
- package/templates/.onion/contexts/business/agents/pain-price-specialist.md +509 -0
- package/templates/.onion/contexts/business/agents/presentation-orchestrator.md +1191 -0
- package/templates/.onion/contexts/business/agents/product-agent.md +202 -0
- package/templates/.onion/contexts/business/agents/story-points-specialist.md +539 -0
- package/templates/.onion/contexts/business/agents/storytelling-specialist.md +891 -0
- package/templates/.onion/contexts/business/agents/task-specialist.md +618 -0
- package/templates/.onion/contexts/business/agents/whisper-specialist.md +373 -0
- package/templates/.onion/contexts/business/commands/advanced/analyze-pain-price.md +709 -0
- package/templates/.onion/contexts/business/commands/advanced/branding.md +460 -0
- package/templates/.onion/contexts/business/commands/advanced/checklist-sync.md +241 -0
- package/templates/.onion/contexts/business/commands/advanced/presentation.md +189 -0
- package/templates/.onion/contexts/business/commands/advanced/transform-consolidated.md +592 -0
- package/templates/.onion/contexts/business/commands/help.md +212 -0
- package/templates/.onion/contexts/business/commands/intermediate/check.md +48 -0
- package/templates/.onion/contexts/business/commands/intermediate/collect.md +96 -0
- package/templates/.onion/contexts/business/commands/intermediate/consolidate-meetings.md +306 -0
- package/templates/.onion/contexts/business/commands/intermediate/convert-to-tasks.md +220 -0
- package/templates/.onion/contexts/business/commands/intermediate/extract-meeting.md +241 -0
- package/templates/.onion/contexts/business/commands/intermediate/feature.md +431 -0
- package/templates/.onion/contexts/business/commands/intermediate/light-arch.md +97 -0
- package/templates/.onion/contexts/business/commands/intermediate/task-check.md +340 -0
- package/templates/.onion/contexts/business/commands/intermediate/validate-task.md +294 -0
- package/templates/.onion/contexts/business/commands/intermediate/whisper.md +325 -0
- package/templates/.onion/contexts/business/commands/starter/estimate.md +519 -0
- package/templates/.onion/contexts/business/commands/starter/refine.md +186 -0
- package/templates/.onion/contexts/business/commands/starter/spec.md +107 -0
- package/templates/.onion/contexts/business/commands/starter/task.md +585 -0
- package/templates/.onion/contexts/business/commands/starter/warm-up.md +187 -0
- package/templates/.onion/contexts/technical/.context-config.yml +64 -0
- package/templates/.onion/contexts/technical/README.md +238 -0
- package/templates/.onion/contexts/technical/agents/branch-code-reviewer.md +200 -0
- package/templates/.onion/contexts/technical/agents/branch-doc-writer.md +162 -0
- package/templates/.onion/contexts/technical/agents/branch-metaspec-checker.md +68 -0
- package/templates/.onion/contexts/technical/agents/branch-test-planner.md +177 -0
- package/templates/.onion/contexts/technical/agents/c4-architecture-specialist.md +712 -0
- package/templates/.onion/contexts/technical/agents/c4-documentation-specialist.md +658 -0
- package/templates/.onion/contexts/technical/agents/code-reviewer.md +155 -0
- package/templates/.onion/contexts/technical/agents/cursor-specialist.md +249 -0
- package/templates/.onion/contexts/technical/agents/docs-reverse-engineer.md +418 -0
- package/templates/.onion/contexts/technical/agents/gitflow-specialist.md +1207 -0
- package/templates/.onion/contexts/technical/agents/linux-security-specialist.md +676 -0
- package/templates/.onion/contexts/technical/agents/mermaid-specialist.md +516 -0
- package/templates/.onion/contexts/technical/agents/nodejs-specialist.md +673 -0
- package/templates/.onion/contexts/technical/agents/nx-migration-specialist.md +867 -0
- package/templates/.onion/contexts/technical/agents/nx-monorepo-specialist.md +619 -0
- package/templates/.onion/contexts/technical/agents/postgres-specialist.md +1124 -0
- package/templates/.onion/contexts/technical/agents/react-developer.md +132 -0
- package/templates/.onion/contexts/technical/agents/runflow-specialist.md +278 -0
- package/templates/.onion/contexts/technical/agents/system-doc-orchestrator.md +1388 -0
- package/templates/.onion/contexts/technical/agents/test-agent.md +425 -0
- package/templates/.onion/contexts/technical/agents/test-engineer.md +295 -0
- package/templates/.onion/contexts/technical/agents/test-planner.md +118 -0
- package/templates/.onion/contexts/technical/agents/zen-engine-specialist.md +421 -0
- package/templates/.onion/contexts/technical/commands/advanced/bump.md +43 -0
- package/templates/.onion/contexts/technical/commands/advanced/consolidate-documents.md +424 -0
- package/templates/.onion/contexts/technical/commands/advanced/e2e.md +392 -0
- package/templates/.onion/contexts/technical/commands/advanced/feature-finish.md +90 -0
- package/templates/.onion/contexts/technical/commands/advanced/feature-publish.md +91 -0
- package/templates/.onion/contexts/technical/commands/advanced/feature-start.md +158 -0
- package/templates/.onion/contexts/technical/commands/advanced/hotfix-finish.md +98 -0
- package/templates/.onion/contexts/technical/commands/advanced/hotfix-start.md +94 -0
- package/templates/.onion/contexts/technical/commands/advanced/hotfix.md +186 -0
- package/templates/.onion/contexts/technical/commands/advanced/refine-vision.md +27 -0
- package/templates/.onion/contexts/technical/commands/advanced/release-finish.md +98 -0
- package/templates/.onion/contexts/technical/commands/advanced/release-start.md +95 -0
- package/templates/.onion/contexts/technical/commands/advanced/reverse-consolidate.md +160 -0
- package/templates/.onion/contexts/technical/commands/advanced/validate-phase-sync.md +118 -0
- package/templates/.onion/contexts/technical/commands/help.md +329 -0
- package/templates/.onion/contexts/technical/commands/intermediate/build-business-docs.md +276 -0
- package/templates/.onion/contexts/technical/commands/intermediate/build-index.md +128 -0
- package/templates/.onion/contexts/technical/commands/intermediate/build-tech-docs.md +204 -0
- package/templates/.onion/contexts/technical/commands/intermediate/code-review.md +215 -0
- package/templates/.onion/contexts/technical/commands/intermediate/docs-health.md +142 -0
- package/templates/.onion/contexts/technical/commands/intermediate/fast-commit.md +45 -0
- package/templates/.onion/contexts/technical/commands/intermediate/integration.md +523 -0
- package/templates/.onion/contexts/technical/commands/intermediate/pr-update.md +198 -0
- package/templates/.onion/contexts/technical/commands/intermediate/pre-pr.md +91 -0
- package/templates/.onion/contexts/technical/commands/intermediate/start.md +266 -0
- package/templates/.onion/contexts/technical/commands/intermediate/sync-sessions.md +320 -0
- package/templates/.onion/contexts/technical/commands/intermediate/unit.md +378 -0
- package/templates/.onion/contexts/technical/commands/intermediate/validate-docs.md +159 -0
- package/templates/.onion/contexts/technical/commands/starter/docs.md +39 -0
- package/templates/.onion/contexts/technical/commands/starter/help.md +306 -0
- package/templates/.onion/contexts/technical/commands/starter/init.md +139 -0
- package/templates/.onion/contexts/technical/commands/starter/plan.md +111 -0
- package/templates/.onion/contexts/technical/commands/starter/pr.md +136 -0
- package/templates/.onion/contexts/technical/commands/starter/sync.md +228 -0
- package/templates/.onion/contexts/technical/commands/starter/warm-up.md +173 -0
- package/templates/.onion/contexts/technical/commands/starter/work.md +169 -0
- package/templates/.onion/core/commands/help.md +388 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Regras de Validação
|
|
2
|
+
|
|
3
|
+
## ✅ Validação de Inputs
|
|
4
|
+
|
|
5
|
+
### Parâmetros Obrigatórios
|
|
6
|
+
|
|
7
|
+
```markdown
|
|
8
|
+
SE parâmetro NÃO fornecido:
|
|
9
|
+
→ Perguntar ao usuário
|
|
10
|
+
→ NÃO assumir valores
|
|
11
|
+
→ NÃO prosseguir sem confirmação
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### Formato de Parâmetros
|
|
15
|
+
|
|
16
|
+
| Tipo | Formato | Exemplo |
|
|
17
|
+
|------|---------|---------|
|
|
18
|
+
| feature-slug | kebab-case | `user-authentication` |
|
|
19
|
+
| task-id | alfanumérico | `86adf8jj6` |
|
|
20
|
+
| branch-name | kebab-case | `feature/user-auth` |
|
|
21
|
+
| version | semver | `1.2.3` |
|
|
22
|
+
| date | ISO | `2025-11-24` |
|
|
23
|
+
|
|
24
|
+
### Validação de Paths
|
|
25
|
+
|
|
26
|
+
```markdown
|
|
27
|
+
✅ Válido: /home/user/project/file.md
|
|
28
|
+
✅ Válido: ./relative/path/file.md
|
|
29
|
+
❌ Inválido: file.md (sem contexto)
|
|
30
|
+
❌ Inválido: ~/path (expandir primeiro)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 🔍 Validação de Estado
|
|
36
|
+
|
|
37
|
+
### Pré-condições Comuns
|
|
38
|
+
|
|
39
|
+
```markdown
|
|
40
|
+
### Verificar Antes de Executar
|
|
41
|
+
|
|
42
|
+
1. **Workspace válido**
|
|
43
|
+
- [ ] .cursor/ existe
|
|
44
|
+
- [ ] É projeto Onion
|
|
45
|
+
|
|
46
|
+
2. **Git limpo** (se necessário)
|
|
47
|
+
- [ ] Sem alterações não commitadas
|
|
48
|
+
- [ ] Branch correta
|
|
49
|
+
|
|
50
|
+
3. **Dependências** (se necessário)
|
|
51
|
+
- [ ] Node modules instalados
|
|
52
|
+
- [ ] Ambiente configurado
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Verificação de Arquivos
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Arquivo existe
|
|
59
|
+
test -f "$FILE" && echo "✅ Existe" || echo "❌ Não existe"
|
|
60
|
+
|
|
61
|
+
# Diretório existe
|
|
62
|
+
test -d "$DIR" && echo "✅ Existe" || echo "❌ Não existe"
|
|
63
|
+
|
|
64
|
+
# Arquivo não vazio
|
|
65
|
+
test -s "$FILE" && echo "✅ Tem conteúdo" || echo "⚠️ Vazio"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 🚫 Tratamento de Erros
|
|
71
|
+
|
|
72
|
+
### Níveis de Erro
|
|
73
|
+
|
|
74
|
+
| Nível | Ação | Exemplo |
|
|
75
|
+
|-------|------|---------|
|
|
76
|
+
| **Fatal** | Abortar | Arquivo crítico ausente |
|
|
77
|
+
| **Erro** | Perguntar | Parâmetro inválido |
|
|
78
|
+
| **Aviso** | Informar | Valor não otimal |
|
|
79
|
+
| **Info** | Logar | Status informativo |
|
|
80
|
+
|
|
81
|
+
### Formato de Erro
|
|
82
|
+
|
|
83
|
+
```markdown
|
|
84
|
+
❌ **Erro**: [Descrição clara]
|
|
85
|
+
|
|
86
|
+
**Causa**: [O que causou]
|
|
87
|
+
**Solução**: [Como resolver]
|
|
88
|
+
|
|
89
|
+
Exemplo:
|
|
90
|
+
❌ **Erro**: Arquivo de sessão não encontrado
|
|
91
|
+
|
|
92
|
+
**Causa**: Sessão 'my-feature' não existe em .cursor/sessions/
|
|
93
|
+
**Solução**: Execute `/engineer/start my-feature` primeiro
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Fallback Strategy
|
|
97
|
+
|
|
98
|
+
```markdown
|
|
99
|
+
SE erro recuperável:
|
|
100
|
+
1. Tentar recuperação automática
|
|
101
|
+
2. SE falhar → Perguntar ao usuário
|
|
102
|
+
3. SE usuário não disponível → Abortar com instruções
|
|
103
|
+
|
|
104
|
+
SE erro fatal:
|
|
105
|
+
1. Logar erro detalhado
|
|
106
|
+
2. Abortar imediatamente
|
|
107
|
+
3. Sugerir correção
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## 📋 Validação de Outputs
|
|
113
|
+
|
|
114
|
+
### Checklist de Output
|
|
115
|
+
|
|
116
|
+
```markdown
|
|
117
|
+
- [ ] Output corresponde ao esperado
|
|
118
|
+
- [ ] Formato consistente
|
|
119
|
+
- [ ] Sem dados sensíveis expostos
|
|
120
|
+
- [ ] Acionável pelo usuário
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Formato de Sucesso
|
|
124
|
+
|
|
125
|
+
```markdown
|
|
126
|
+
✅ **Sucesso**: [Descrição]
|
|
127
|
+
|
|
128
|
+
📁 Arquivos criados/modificados:
|
|
129
|
+
∟ path/to/file1.md
|
|
130
|
+
∟ path/to/file2.md
|
|
131
|
+
|
|
132
|
+
🚀 Próximos passos:
|
|
133
|
+
∟ Ação 1
|
|
134
|
+
∟ Ação 2
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 🔐 Validação de Segurança
|
|
140
|
+
|
|
141
|
+
### Nunca Expor
|
|
142
|
+
|
|
143
|
+
- [ ] API keys/tokens
|
|
144
|
+
- [ ] Senhas
|
|
145
|
+
- [ ] Dados pessoais
|
|
146
|
+
- [ ] Paths absolutos sensíveis
|
|
147
|
+
|
|
148
|
+
### Sanitização
|
|
149
|
+
|
|
150
|
+
```markdown
|
|
151
|
+
# Antes de logar/exibir:
|
|
152
|
+
- Mascarar tokens: pk_xxx...xxx
|
|
153
|
+
- Remover credenciais de URLs
|
|
154
|
+
- Anonimizar dados pessoais
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## ⚡ Validação Rápida
|
|
160
|
+
|
|
161
|
+
### One-liners
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Validar YAML
|
|
165
|
+
head -1 file.md | grep -q "^---$" && echo "✅ YAML"
|
|
166
|
+
|
|
167
|
+
# Validar kebab-case
|
|
168
|
+
echo "$VAR" | grep -qE "^[a-z0-9]+(-[a-z0-9]+)*$" && echo "✅"
|
|
169
|
+
|
|
170
|
+
# Validar semver
|
|
171
|
+
echo "$VERSION" | grep -qE "^[0-9]+\.[0-9]+\.[0-9]+$" && echo "✅"
|
|
172
|
+
```
|
|
173
|
+
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
# 🏗️ Template: Abstraction Layer (SDAAL)
|
|
2
|
+
|
|
3
|
+
Este template define a estrutura padrão para camadas de abstração seguindo o padrão **Specification-Driven AI Abstraction Layer**.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 📁 Estrutura de Arquivos
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
.cursor/utils/{{abstraction_name}}/
|
|
11
|
+
├── README.md # Visão geral + uso rápido
|
|
12
|
+
├── interface.md # Contrato principal
|
|
13
|
+
├── types.md # Tipos de entrada/saída
|
|
14
|
+
├── factory.md # Criação de instâncias
|
|
15
|
+
├── detector.md # Detecção de provedor
|
|
16
|
+
└── adapters/
|
|
17
|
+
├── {{provider}}.md # Um por provedor
|
|
18
|
+
└── none.md # Fallback obrigatório
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 📝 README.md Template
|
|
24
|
+
|
|
25
|
+
```markdown
|
|
26
|
+
# 🔌 {{InterfaceName}} - Abstraction Layer
|
|
27
|
+
|
|
28
|
+
## 🎯 Propósito
|
|
29
|
+
|
|
30
|
+
[Descrição do que a abstração faz]
|
|
31
|
+
|
|
32
|
+
## 📁 Estrutura
|
|
33
|
+
|
|
34
|
+
\`\`\`
|
|
35
|
+
{{abstraction_name}}/
|
|
36
|
+
├── README.md
|
|
37
|
+
├── interface.md
|
|
38
|
+
├── types.md
|
|
39
|
+
├── detector.md
|
|
40
|
+
├── factory.md
|
|
41
|
+
└── adapters/
|
|
42
|
+
├── [providers].md
|
|
43
|
+
└── none.md
|
|
44
|
+
\`\`\`
|
|
45
|
+
|
|
46
|
+
## ⚡ Uso Rápido
|
|
47
|
+
|
|
48
|
+
### 1. Configurar Provedor
|
|
49
|
+
|
|
50
|
+
\`\`\`bash
|
|
51
|
+
{{ENV_PREFIX}}_PROVIDER=[provider]
|
|
52
|
+
\`\`\`
|
|
53
|
+
|
|
54
|
+
### 2. Usar nos Comandos
|
|
55
|
+
|
|
56
|
+
\`\`\`typescript
|
|
57
|
+
const manager = get{{ManagerName}}();
|
|
58
|
+
await manager.operation({ ... });
|
|
59
|
+
\`\`\`
|
|
60
|
+
|
|
61
|
+
## 🔧 Provedores Suportados
|
|
62
|
+
|
|
63
|
+
| Provedor | Status | Notas |
|
|
64
|
+
|----------|--------|-------|
|
|
65
|
+
| [provider] | ✅/📝 | [notas] |
|
|
66
|
+
| None | ✅ | Modo offline |
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
**Versão**: 1.0.0
|
|
71
|
+
**Criado em**: YYYY-MM-DD
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 📝 interface.md Template
|
|
77
|
+
|
|
78
|
+
```markdown
|
|
79
|
+
# 📐 Interface {{InterfaceName}}
|
|
80
|
+
|
|
81
|
+
## 🎯 Propósito
|
|
82
|
+
|
|
83
|
+
[O que esta interface define]
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 📋 Interface Completa
|
|
88
|
+
|
|
89
|
+
\`\`\`typescript
|
|
90
|
+
interface {{InterfaceName}} {
|
|
91
|
+
// ═══════════════════════════════════════════════════
|
|
92
|
+
// IDENTIFICAÇÃO
|
|
93
|
+
// ═══════════════════════════════════════════════════
|
|
94
|
+
|
|
95
|
+
readonly provider: {{ManagerName}}Provider;
|
|
96
|
+
readonly isConfigured: boolean;
|
|
97
|
+
|
|
98
|
+
// ═══════════════════════════════════════════════════
|
|
99
|
+
// OPERAÇÕES PRINCIPAIS
|
|
100
|
+
// ═══════════════════════════════════════════════════
|
|
101
|
+
|
|
102
|
+
operation(input: OperationInput): Promise<OperationOutput>;
|
|
103
|
+
|
|
104
|
+
// ═══════════════════════════════════════════════════
|
|
105
|
+
// VALIDAÇÃO
|
|
106
|
+
// ═══════════════════════════════════════════════════
|
|
107
|
+
|
|
108
|
+
validateConfiguration(): boolean;
|
|
109
|
+
}
|
|
110
|
+
\`\`\`
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 📊 Métodos por Categoria
|
|
115
|
+
|
|
116
|
+
| Categoria | Métodos | Descrição |
|
|
117
|
+
|-----------|---------|-----------|
|
|
118
|
+
| Identificação | provider, isConfigured | Info do adapter |
|
|
119
|
+
| Principais | [lista] | Operações core |
|
|
120
|
+
| Validação | validateConfiguration | Verificação |
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
**Versão**: 1.0.0
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## 📝 types.md Template
|
|
130
|
+
|
|
131
|
+
```markdown
|
|
132
|
+
# 📦 Tipos Compartilhados
|
|
133
|
+
|
|
134
|
+
## 🔧 Enums e Constantes
|
|
135
|
+
|
|
136
|
+
\`\`\`typescript
|
|
137
|
+
type {{ManagerName}}Provider = '[providers]' | 'none';
|
|
138
|
+
\`\`\`
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## 📥 Tipos de Entrada
|
|
143
|
+
|
|
144
|
+
\`\`\`typescript
|
|
145
|
+
interface OperationInput {
|
|
146
|
+
field: Type;
|
|
147
|
+
}
|
|
148
|
+
\`\`\`
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 📤 Tipos de Saída
|
|
153
|
+
|
|
154
|
+
\`\`\`typescript
|
|
155
|
+
interface OperationOutput {
|
|
156
|
+
id: string;
|
|
157
|
+
provider: {{ManagerName}}Provider;
|
|
158
|
+
createdAt: string;
|
|
159
|
+
}
|
|
160
|
+
\`\`\`
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## ⚙️ Configuração
|
|
165
|
+
|
|
166
|
+
\`\`\`typescript
|
|
167
|
+
interface ProviderConfig {
|
|
168
|
+
provider: {{ManagerName}}Provider;
|
|
169
|
+
isConfigured: boolean;
|
|
170
|
+
requiredEnvVars: string[];
|
|
171
|
+
optionalEnvVars: string[];
|
|
172
|
+
errorMessage?: string;
|
|
173
|
+
}
|
|
174
|
+
\`\`\`
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
**Versão**: 1.0.0
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## 📝 detector.md Template
|
|
184
|
+
|
|
185
|
+
```markdown
|
|
186
|
+
# 🔍 Detector de Provedor
|
|
187
|
+
|
|
188
|
+
## 📋 detectProvider()
|
|
189
|
+
|
|
190
|
+
\`\`\`typescript
|
|
191
|
+
function detectProvider(): ProviderConfig {
|
|
192
|
+
const provider = process.env.{{ENV_PREFIX}}_PROVIDER || 'none';
|
|
193
|
+
|
|
194
|
+
const configs = {
|
|
195
|
+
'[provider]': {
|
|
196
|
+
provider: '[provider]',
|
|
197
|
+
isConfigured: !!process.env.{{ENV_PREFIX}}_[PROVIDER]_TOKEN,
|
|
198
|
+
requiredEnvVars: ['{{ENV_PREFIX}}_[PROVIDER]_TOKEN'],
|
|
199
|
+
optionalEnvVars: ['{{ENV_PREFIX}}_[PROVIDER]_WORKSPACE'],
|
|
200
|
+
},
|
|
201
|
+
'none': {
|
|
202
|
+
provider: 'none',
|
|
203
|
+
isConfigured: true,
|
|
204
|
+
requiredEnvVars: [],
|
|
205
|
+
optionalEnvVars: [],
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
return configs[provider] || configs.none;
|
|
210
|
+
}
|
|
211
|
+
\`\`\`
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## 📊 Variáveis de Ambiente
|
|
216
|
+
|
|
217
|
+
| Provedor | Obrigatória | Opcionais |
|
|
218
|
+
|----------|-------------|-----------|
|
|
219
|
+
| [provider] | TOKEN | WORKSPACE |
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
**Versão**: 1.0.0
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## 📝 factory.md Template
|
|
229
|
+
|
|
230
|
+
```markdown
|
|
231
|
+
# 🏭 Factory
|
|
232
|
+
|
|
233
|
+
## 📋 get{{ManagerName}}()
|
|
234
|
+
|
|
235
|
+
\`\`\`typescript
|
|
236
|
+
function get{{ManagerName}}(options?: FactoryOptions): {{InterfaceName}} {
|
|
237
|
+
const config = detectProvider();
|
|
238
|
+
|
|
239
|
+
if (!config.isConfigured && options?.throwOnMisconfigured) {
|
|
240
|
+
throw new Error(config.errorMessage);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
switch (config.provider) {
|
|
244
|
+
case '[provider]':
|
|
245
|
+
return new [Provider]Adapter({ ... });
|
|
246
|
+
default:
|
|
247
|
+
return new NoProviderAdapter();
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
\`\`\`
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## ⚙️ FactoryOptions
|
|
255
|
+
|
|
256
|
+
\`\`\`typescript
|
|
257
|
+
interface FactoryOptions {
|
|
258
|
+
debug?: boolean;
|
|
259
|
+
throwOnMisconfigured?: boolean;
|
|
260
|
+
forceProvider?: {{ManagerName}}Provider;
|
|
261
|
+
}
|
|
262
|
+
\`\`\`
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## 📊 NoProviderAdapter
|
|
267
|
+
|
|
268
|
+
\`\`\`typescript
|
|
269
|
+
class NoProviderAdapter implements {{InterfaceName}} {
|
|
270
|
+
readonly provider = 'none';
|
|
271
|
+
readonly isConfigured = false;
|
|
272
|
+
|
|
273
|
+
// Implementar com warnings + fallbacks
|
|
274
|
+
}
|
|
275
|
+
\`\`\`
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
**Versão**: 1.0.0
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## 📝 adapters/[provider].md Template
|
|
285
|
+
|
|
286
|
+
```markdown
|
|
287
|
+
# 🔵 [Provider] Adapter
|
|
288
|
+
|
|
289
|
+
## 📋 Configuração
|
|
290
|
+
|
|
291
|
+
\`\`\`bash
|
|
292
|
+
{{ENV_PREFIX}}_[PROVIDER]_TOKEN=xxx
|
|
293
|
+
{{ENV_PREFIX}}_[PROVIDER]_WORKSPACE=xxx
|
|
294
|
+
\`\`\`
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## 🔧 Implementação
|
|
299
|
+
|
|
300
|
+
\`\`\`typescript
|
|
301
|
+
class [Provider]Adapter implements {{InterfaceName}} {
|
|
302
|
+
readonly provider = '[provider]';
|
|
303
|
+
readonly isConfigured: boolean;
|
|
304
|
+
|
|
305
|
+
constructor(config) {
|
|
306
|
+
this.isConfigured = !!config.token;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
async operation(input): Promise<Output> {
|
|
310
|
+
// Chamar API/MCP específico
|
|
311
|
+
// Normalizar resposta
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
\`\`\`
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## 📊 Mapeamento
|
|
319
|
+
|
|
320
|
+
| Interface | [Provider] API | Notas |
|
|
321
|
+
|-----------|---------------|-------|
|
|
322
|
+
| field | api_field | [mapeamento] |
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
**Versão**: 1.0.0
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## 📝 adapters/none.md Template
|
|
332
|
+
|
|
333
|
+
```markdown
|
|
334
|
+
# ⚪ NoProvider Adapter
|
|
335
|
+
|
|
336
|
+
## 🎯 Propósito
|
|
337
|
+
|
|
338
|
+
Fallback para modo offline.
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
## 🔧 Implementação
|
|
343
|
+
|
|
344
|
+
\`\`\`typescript
|
|
345
|
+
class NoProviderAdapter implements {{InterfaceName}} {
|
|
346
|
+
readonly provider = 'none';
|
|
347
|
+
readonly isConfigured = false;
|
|
348
|
+
|
|
349
|
+
async operation(input) {
|
|
350
|
+
console.warn('⚠️ Modo offline');
|
|
351
|
+
return {
|
|
352
|
+
id: \`local-\${Date.now()}\`,
|
|
353
|
+
provider: 'none',
|
|
354
|
+
...input
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
\`\`\`
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
## 📊 Comportamento
|
|
363
|
+
|
|
364
|
+
| Operação | Offline |
|
|
365
|
+
|----------|---------|
|
|
366
|
+
| Leitura | [] ou null |
|
|
367
|
+
| Escrita | Warning + ID local |
|
|
368
|
+
| Update | Warning + throw |
|
|
369
|
+
| Delete | Warning + false |
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
**Versão**: 1.0.0
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
## 🔄 Variáveis de Substituição
|
|
379
|
+
|
|
380
|
+
| Variável | Exemplo | Descrição |
|
|
381
|
+
|----------|---------|-----------|
|
|
382
|
+
| `{{abstraction_name}}` | `notification-manager` | Nome em kebab-case |
|
|
383
|
+
| `{{InterfaceName}}` | `INotificationManager` | Interface (I + PascalCase) |
|
|
384
|
+
| `{{ManagerName}}` | `NotificationManager` | Sem I (PascalCase) |
|
|
385
|
+
| `{{ENV_PREFIX}}` | `NOTIFICATION_MANAGER` | Prefixo de env (UPPER_SNAKE) |
|
|
386
|
+
| `{{providers}}` | `slack,discord` | Lista de provedores |
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## 📚 Referências
|
|
391
|
+
|
|
392
|
+
- [SDAAL Pattern](../../../docs/knowbase/concepts/specification-driven-ai-abstraction-layer.md)
|
|
393
|
+
- [Task Manager (Exemplo)](../../../.cursor/utils/task-manager/)
|
|
394
|
+
- [Comando create-abstraction](../meta/create-abstraction.md)
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
**Versão**: 1.0.0
|
|
399
|
+
**Criado em**: 2025-11-25
|
|
400
|
+
|