@onion-ai/cli 1.0.0-beta.1

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.
Files changed (220) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +529 -0
  3. package/bin/onion.js +6 -0
  4. package/framework/CLAUDE.md +45 -0
  5. package/framework/VERSION +1 -0
  6. package/framework/agents/compliance/iso-22301-specialist.md +985 -0
  7. package/framework/agents/compliance/iso-27001-specialist.md +713 -0
  8. package/framework/agents/compliance/pmbok-specialist.md +739 -0
  9. package/framework/agents/compliance/security-information-master.md +907 -0
  10. package/framework/agents/compliance/soc2-specialist.md +889 -0
  11. package/framework/agents/deployment/docker-specialist.md +1192 -0
  12. package/framework/agents/development/c4-architecture-specialist.md +745 -0
  13. package/framework/agents/development/c4-documentation-specialist.md +695 -0
  14. package/framework/agents/development/clickup-specialist.md +396 -0
  15. package/framework/agents/development/cursor-specialist.md +277 -0
  16. package/framework/agents/development/docs-reverse-engineer.md +417 -0
  17. package/framework/agents/development/gamma-api-specialist.md +1168 -0
  18. package/framework/agents/development/gitflow-specialist.md +1206 -0
  19. package/framework/agents/development/linux-security-specialist.md +675 -0
  20. package/framework/agents/development/mermaid-specialist.md +515 -0
  21. package/framework/agents/development/nodejs-specialist.md +672 -0
  22. package/framework/agents/development/nx-migration-specialist.md +866 -0
  23. package/framework/agents/development/nx-monorepo-specialist.md +618 -0
  24. package/framework/agents/development/postgres-specialist.md +1123 -0
  25. package/framework/agents/development/react-developer.md +131 -0
  26. package/framework/agents/development/runflow-specialist.md +277 -0
  27. package/framework/agents/development/system-documentation-orchestrator.md +1387 -0
  28. package/framework/agents/development/task-specialist.md +677 -0
  29. package/framework/agents/git/branch-code-reviewer.md +225 -0
  30. package/framework/agents/git/branch-documentation-writer.md +161 -0
  31. package/framework/agents/git/branch-metaspec-checker.md +67 -0
  32. package/framework/agents/git/branch-test-planner.md +176 -0
  33. package/framework/agents/meta/agent-creator-specialist.md +1266 -0
  34. package/framework/agents/meta/command-creator-specialist.md +1676 -0
  35. package/framework/agents/meta/metaspec-gate-keeper.md +240 -0
  36. package/framework/agents/meta/onion.md +824 -0
  37. package/framework/agents/product/branding-positioning-specialist.md +1029 -0
  38. package/framework/agents/product/extract-meeting-specialist.md +394 -0
  39. package/framework/agents/product/meeting-consolidator.md +482 -0
  40. package/framework/agents/product/pain-price-specialist.md +508 -0
  41. package/framework/agents/product/presentation-orchestrator.md +1190 -0
  42. package/framework/agents/product/product-agent.md +201 -0
  43. package/framework/agents/product/story-points-framework-specialist.md +538 -0
  44. package/framework/agents/product/storytelling-business-specialist.md +890 -0
  45. package/framework/agents/research/research-agent.md +292 -0
  46. package/framework/agents/review/code-reviewer.md +154 -0
  47. package/framework/agents/review/corporate-compliance-specialist.md +370 -0
  48. package/framework/agents/testing/test-agent.md +424 -0
  49. package/framework/agents/testing/test-engineer.md +294 -0
  50. package/framework/agents/testing/test-planner.md +117 -0
  51. package/framework/commands/common/prompts/README.md +208 -0
  52. package/framework/commands/common/prompts/clickup-patterns.md +144 -0
  53. package/framework/commands/common/prompts/code-review-checklist.md +168 -0
  54. package/framework/commands/common/prompts/git-workflow-patterns.md +235 -0
  55. package/framework/commands/common/prompts/output-formats.md +240 -0
  56. package/framework/commands/common/prompts/technical.md +194 -0
  57. package/framework/commands/common/templates/abstraction-template.md +399 -0
  58. package/framework/commands/common/templates/agent-template.md +353 -0
  59. package/framework/commands/common/templates/business_context_template.md +748 -0
  60. package/framework/commands/common/templates/command-template.md +273 -0
  61. package/framework/commands/common/templates/technical_context_template.md +526 -0
  62. package/framework/commands/design/screen-spec.md +505 -0
  63. package/framework/commands/development/runflow-dev.md +465 -0
  64. package/framework/commands/docs/build-business-docs.md +299 -0
  65. package/framework/commands/docs/build-compliance-docs.md +143 -0
  66. package/framework/commands/docs/build-index.md +119 -0
  67. package/framework/commands/docs/build-tech-docs.md +221 -0
  68. package/framework/commands/docs/docs-health.md +141 -0
  69. package/framework/commands/docs/help.md +278 -0
  70. package/framework/commands/docs/refine-vision.md +25 -0
  71. package/framework/commands/docs/reverse-consolidate.md +158 -0
  72. package/framework/commands/docs/sync-sessions.md +354 -0
  73. package/framework/commands/docs/validate-docs.md +157 -0
  74. package/framework/commands/engineer/bump.md +29 -0
  75. package/framework/commands/engineer/docs.md +11 -0
  76. package/framework/commands/engineer/hotfix.md +183 -0
  77. package/framework/commands/engineer/plan.md +85 -0
  78. package/framework/commands/engineer/pr-update.md +219 -0
  79. package/framework/commands/engineer/pr.md +117 -0
  80. package/framework/commands/engineer/pre-pr.md +81 -0
  81. package/framework/commands/engineer/start.md +254 -0
  82. package/framework/commands/engineer/validate-phase-sync.md +134 -0
  83. package/framework/commands/engineer/warm-up.md +20 -0
  84. package/framework/commands/engineer/work.md +155 -0
  85. package/framework/commands/f/company-context-extractor.md +93 -0
  86. package/framework/commands/f/process-meetings.md +103 -0
  87. package/framework/commands/git/README.md +682 -0
  88. package/framework/commands/git/code-review.md +213 -0
  89. package/framework/commands/git/fast-commit.md +43 -0
  90. package/framework/commands/git/feature/finish.md +88 -0
  91. package/framework/commands/git/feature/publish.md +89 -0
  92. package/framework/commands/git/feature/start.md +172 -0
  93. package/framework/commands/git/help.md +100 -0
  94. package/framework/commands/git/hotfix/finish.md +96 -0
  95. package/framework/commands/git/hotfix/start.md +92 -0
  96. package/framework/commands/git/init.md +111 -0
  97. package/framework/commands/git/release/finish.md +96 -0
  98. package/framework/commands/git/release/start.md +93 -0
  99. package/framework/commands/git/sync.md +199 -0
  100. package/framework/commands/meta/all-tools.md +58 -0
  101. package/framework/commands/meta/analyze-complex-problem.md +186 -0
  102. package/framework/commands/meta/create-abstraction.md +882 -0
  103. package/framework/commands/meta/create-agent-express.md +98 -0
  104. package/framework/commands/meta/create-agent.md +210 -0
  105. package/framework/commands/meta/create-command.md +203 -0
  106. package/framework/commands/meta/create-knowledge-base.md +143 -0
  107. package/framework/commands/meta/create-task-structure.md +150 -0
  108. package/framework/commands/meta/setup-integration.md +274 -0
  109. package/framework/commands/onion.md +169 -0
  110. package/framework/commands/product/README.md +249 -0
  111. package/framework/commands/product/analyze-pain-price.md +694 -0
  112. package/framework/commands/product/branding.md +458 -0
  113. package/framework/commands/product/check.md +46 -0
  114. package/framework/commands/product/checklist-sync.md +239 -0
  115. package/framework/commands/product/collect.md +95 -0
  116. package/framework/commands/product/consolidate-meetings.md +291 -0
  117. package/framework/commands/product/estimate.md +511 -0
  118. package/framework/commands/product/extract-meeting.md +226 -0
  119. package/framework/commands/product/feature.md +416 -0
  120. package/framework/commands/product/light-arch.md +82 -0
  121. package/framework/commands/product/presentation.md +174 -0
  122. package/framework/commands/product/refine.md +161 -0
  123. package/framework/commands/product/spec.md +79 -0
  124. package/framework/commands/product/task-check.md +378 -0
  125. package/framework/commands/product/task.md +603 -0
  126. package/framework/commands/product/validate-task.md +325 -0
  127. package/framework/commands/product/warm-up.md +24 -0
  128. package/framework/commands/quick/analisys.md +17 -0
  129. package/framework/commands/test/e2e.md +377 -0
  130. package/framework/commands/test/integration.md +508 -0
  131. package/framework/commands/test/unit.md +381 -0
  132. package/framework/commands/validate/collab/pair-testing.md +657 -0
  133. package/framework/commands/validate/collab/three-amigos.md +534 -0
  134. package/framework/commands/validate/qa-points/estimate.md +660 -0
  135. package/framework/commands/validate/test-strategy/analyze.md +1201 -0
  136. package/framework/commands/validate/test-strategy/create.md +411 -0
  137. package/framework/commands/validate/workflow.md +370 -0
  138. package/framework/commands/warm-up.md +20 -0
  139. package/framework/docs/architecture/acoplamento-clickup-problema-analise.md +468 -0
  140. package/framework/docs/architecture/desacoplamento-roadmap.md +364 -0
  141. package/framework/docs/architecture/validacao-fase-1.md +235 -0
  142. package/framework/docs/c4/c4-detection-rules.md +395 -0
  143. package/framework/docs/c4/c4-documentation-templates.md +579 -0
  144. package/framework/docs/c4/c4-mermaid-patterns.md +331 -0
  145. package/framework/docs/c4/c4-templates.md +256 -0
  146. package/framework/docs/clickup/clickup-acceptance-criteria-strategy.md +329 -0
  147. package/framework/docs/clickup/clickup-auto-update-strategy.md +340 -0
  148. package/framework/docs/clickup/clickup-comment-formatter.md +239 -0
  149. package/framework/docs/clickup/clickup-description-fix.md +384 -0
  150. package/framework/docs/clickup/clickup-dual-comment-strategy.md +528 -0
  151. package/framework/docs/clickup/clickup-formatting.md +302 -0
  152. package/framework/docs/clickup/separador-tamanho-otimizado.md +258 -0
  153. package/framework/docs/engineer/pre-pr-acceptance-validation.md +256 -0
  154. package/framework/docs/onion/ESPERANTO.md +293 -0
  155. package/framework/docs/onion/agents-reference.md +832 -0
  156. package/framework/docs/onion/clickup-integration.md +780 -0
  157. package/framework/docs/onion/commands-guide.md +924 -0
  158. package/framework/docs/onion/engineering-flows.md +900 -0
  159. package/framework/docs/onion/getting-started.md +803 -0
  160. package/framework/docs/onion/maintenance-checklist.md +421 -0
  161. package/framework/docs/onion/naming-conventions.md +286 -0
  162. package/framework/docs/onion/practical-examples.md +854 -0
  163. package/framework/docs/product/story-points-integration.md +269 -0
  164. package/framework/docs/product/story-points-validation.md +237 -0
  165. package/framework/docs/reviews/task-manager-docs-review-2025-11-24.md +184 -0
  166. package/framework/docs/strategies/clickup-comment-patterns.md +766 -0
  167. package/framework/docs/strategies/clickup-integration-tests.md +602 -0
  168. package/framework/docs/strategies/clickup-mcp-wrappers-tests.md +888 -0
  169. package/framework/docs/strategies/clickup-regression-tests.md +587 -0
  170. package/framework/docs/strategies/visual-patterns.md +315 -0
  171. package/framework/docs/templates/README.md +649 -0
  172. package/framework/docs/templates/adr-template.md +226 -0
  173. package/framework/docs/templates/analysis-template.md +280 -0
  174. package/framework/docs/templates/execution-plan-template.md +430 -0
  175. package/framework/docs/templates/guide-template.md +367 -0
  176. package/framework/docs/templates/phase-execution-prompt-template.md +504 -0
  177. package/framework/docs/templates/reference-template.md +522 -0
  178. package/framework/docs/templates/solution-template.md +390 -0
  179. package/framework/docs/tools/README.md +356 -0
  180. package/framework/docs/tools/agents.md +365 -0
  181. package/framework/docs/tools/commands.md +669 -0
  182. package/framework/docs/tools/cursor.md +539 -0
  183. package/framework/docs/tools/mcps.md +937 -0
  184. package/framework/docs/tools/rules.md +461 -0
  185. package/framework/rules/language-and-documentation.mdc +371 -0
  186. package/framework/rules/nestjs-controllers.md +83 -0
  187. package/framework/rules/nestjs-dtos.md +255 -0
  188. package/framework/rules/nestjs-modules.md +141 -0
  189. package/framework/rules/nestjs-services.md +230 -0
  190. package/framework/rules/nx-rules.mdc +41 -0
  191. package/framework/rules/onion-patterns.mdc +197 -0
  192. package/framework/skills/codebase-visualizer/SKILL.md +26 -0
  193. package/framework/skills/codebase-visualizer/scripts/visualize.py +131 -0
  194. package/framework/skills/collect/SKILL.md +84 -0
  195. package/framework/skills/create-rule/SKILL.md +152 -0
  196. package/framework/skills/db-schema-visualizer/SKILL.md +49 -0
  197. package/framework/skills/db-schema-visualizer/scripts/visualize.py +1191 -0
  198. package/framework/skills/sync-meetings/SKILL.md +239 -0
  199. package/framework/utils/clickup-mcp-wrappers.md +744 -0
  200. package/framework/utils/date-time-standards.md +200 -0
  201. package/framework/utils/task-manager/README.md +94 -0
  202. package/framework/utils/task-manager/adapters/asana.md +377 -0
  203. package/framework/utils/task-manager/adapters/clickup.md +467 -0
  204. package/framework/utils/task-manager/adapters/linear.md +421 -0
  205. package/framework/utils/task-manager/detector.md +299 -0
  206. package/framework/utils/task-manager/factory.md +363 -0
  207. package/framework/utils/task-manager/interface.md +248 -0
  208. package/framework/utils/task-manager/types.md +409 -0
  209. package/package.json +41 -0
  210. package/src/cli.js +73 -0
  211. package/src/commands/doctor.js +191 -0
  212. package/src/commands/init.js +287 -0
  213. package/src/commands/install.js +261 -0
  214. package/src/commands/list.js +152 -0
  215. package/src/commands/uninstall.js +90 -0
  216. package/src/commands/update.js +26 -0
  217. package/src/utils/fs.js +89 -0
  218. package/src/utils/log.js +35 -0
  219. package/src/utils/paths.js +32 -0
  220. package/src/utils/prompt.js +76 -0
@@ -0,0 +1,900 @@
1
+ # 🔄 Fluxos de Engenharia - Sistema Onion
2
+
3
+ ## 📋 Índice
4
+
5
+ - [Visão Geral](#-visão-geral)
6
+ - [Fluxo Completo de Feature](#-fluxo-completo-de-feature)
7
+ - [Fluxo de Hotfix](#-fluxo-de-hotfix)
8
+ - [Fluxo de Release](#-fluxo-de-release)
9
+ - [Fluxo de Documentação](#-fluxo-de-documentação)
10
+ - [Fluxo de Validação](#-fluxo-de-validação)
11
+ - [Integração entre Comandos](#-integração-entre-comandos)
12
+ - [Decision Trees](#-decision-trees)
13
+ - [Troubleshooting](#-troubleshooting)
14
+ - [Fluxos Git (Avançado)](#-fluxos-git-avançado)
15
+ - [Documentos Relacionados](#-documentos-relacionados)
16
+
17
+ ---
18
+
19
+ ## 🎯 Visão Geral
20
+
21
+ O Sistema Onion oferece workflows automatizados centrados em **comandos de engenharia** (`/engineer/*`) e **produto** (`/product/*`), com integração automática ao ClickUp e Git. Todos os fluxos seguem o padrão de nomenclatura `<feature-slug>` (kebab-case).
22
+
23
+ ### Princípios dos Fluxos
24
+
25
+ 1. **Engineering-First**: Comandos `/engineer/*` são o core do desenvolvimento
26
+ 2. **Product-Driven**: `/product/*` gerencia tasks e planejamento estratégico
27
+ 3. **Automação Inteligente**: Git e ClickUp são gerenciados automaticamente
28
+ 4. **Session Management**: Contexto preservado em `.claude/sessions/`
29
+ 5. **Documentação Automática**: Geração de docs durante desenvolvimento
30
+
31
+ ### Hierarquia de Comandos
32
+
33
+ ```
34
+ 🎯 CORE (Prioridade Máxima)
35
+ ├── /product/* # Gestão de produto e tasks
36
+ └── /engineer/* # Desenvolvimento e implementação
37
+
38
+ ⚙️ SUPORTE (Automáticos)
39
+ ├── /docs/* # Documentação e sessões
40
+ └── /git/* # Git (usado internamente pelos comandos core)
41
+ ```
42
+
43
+ ---
44
+
45
+ ## 🚀 Fluxo Completo de Feature
46
+
47
+ ### Visão Geral
48
+
49
+ Fluxo end-to-end para desenvolvimento de uma nova funcionalidade, desde a criação da task até o merge final.
50
+
51
+ ### Diagrama do Fluxo
52
+
53
+ ```mermaid
54
+ flowchart TD
55
+ A[Inicio] --> B["/product/task"]
56
+ B --> C{Task Criada?}
57
+ C -->|Sim| D["/engineer/start"]
58
+ C -->|Nao| B
59
+
60
+ D --> E{Analise OK?}
61
+ E -->|Nao| F[Clarificacoes]
62
+ F --> D
63
+ E -->|Sim| G[Arquitetura]
64
+
65
+ G --> H{Arquitetura OK?}
66
+ H -->|Nao| I[Ajustes]
67
+ I --> G
68
+ H -->|Sim| J["/engineer/work"]
69
+
70
+ J --> K[Implementar Fase]
71
+ K --> L{Fase Completa?}
72
+ L -->|Nao| K
73
+ L -->|Sim| M[Auto-Update ClickUp]
74
+
75
+ M --> N{Mais Fases?}
76
+ N -->|Sim| J
77
+ N -->|Nao| O["/engineer/pr"]
78
+
79
+ O --> P["/engineer/pre-pr"]
80
+ P --> Q[Code Review]
81
+ Q --> R{Aprovado?}
82
+ R -->|Nao| S[Correcoes]
83
+ S --> O
84
+ R -->|Sim| T[Merge]
85
+
86
+ T --> U["/docs/sync-sessions"]
87
+ U --> V[Concluido]
88
+
89
+ style A fill:#e1f5e1
90
+ style V fill:#e1f5e1
91
+ style B fill:#fff3cd
92
+ style D fill:#fff3cd
93
+ style J fill:#fff3cd
94
+ style O fill:#fff3cd
95
+ style P fill:#fff3cd
96
+ style U fill:#fff3cd
97
+ ```
98
+
99
+ ### Passo a Passo Detalhado
100
+
101
+ #### 1. Criação da Task (`/product/task`)
102
+
103
+ ```bash
104
+ /product/task "Implementar autenticação JWT com refresh tokens"
105
+ ```
106
+
107
+ **O que acontece:**
108
+
109
+ 1. ✅ Análise de documentação (README.md, docs/)
110
+ 2. ✅ Identificação de complexidade e pattern
111
+ 3. ✅ Apresentação do plano para confirmação
112
+ 4. ✅ Criação no ClickUp (Task + Subtasks + Action Items)
113
+ 5. ✅ Integração Git automática (`/git/feature/start` ou branch direta)
114
+ 6. ✅ Setup de sessão (`.claude/sessions/<feature-slug>/`)
115
+ 7. ✅ Criação de context files
116
+
117
+ **Saída:**
118
+
119
+ ```
120
+ 📋 Task: 86acu8pdk
121
+ 🌿 Branch: feature/jwt-authentication
122
+ 📁 Sessão: .claude/sessions/jwt-authentication/
123
+ ```
124
+
125
+ ---
126
+
127
+ #### 2. Início do Desenvolvimento (`/engineer/start`)
128
+
129
+ ```bash
130
+ /engineer/start jwt-authentication
131
+ ```
132
+
133
+ **O que acontece:**
134
+
135
+ 1. ✅ Valida/cria feature branch
136
+ 2. ✅ Lê task do ClickUp (com subtasks e checklists)
137
+ 3. ✅ Análise profunda (5-7 questões de clarificação)
138
+ 4. ✅ Cria `context.md` com entendimento
139
+ 5. ✅ Desenvolve `architecture.md` detalhada
140
+ 6. ✅ Gera `plan.md` com fases de implementação
141
+ 7. ✅ Atualiza ClickUp (status → "In Progress")
142
+ 8. ✅ Cria mapeamento fase→subtask
143
+
144
+ **Arquivos Criados:**
145
+
146
+ ```
147
+ .claude/sessions/jwt-authentication/
148
+ ├── context.md # Contexto completo
149
+ ├── architecture.md # Arquitetura técnica
150
+ └── plan.md # Plano de implementação
151
+ ```
152
+
153
+ ---
154
+
155
+ #### 3. Implementação (`/engineer/work`)
156
+
157
+ ```bash
158
+ /engineer/work jwt-authentication
159
+ ```
160
+
161
+ **O que acontece:**
162
+
163
+ 1. ✅ Lê arquivos da sessão
164
+ 2. ✅ Identifica fase atual no `plan.md`
165
+ 3. ✅ Implementa código da fase
166
+ 4. ✅ Ao completar fase:
167
+ - Adiciona comentário no ClickUp
168
+ - Atualiza status da subtask para "done"
169
+ - Atualiza `plan.md` com decisões
170
+ 5. ✅ Repete para próximas fases
171
+
172
+ **Ciclo de Implementação:**
173
+
174
+ ```mermaid
175
+ flowchart LR
176
+ A[Ler plan.md] --> B[Identificar Fase]
177
+ B --> C[Implementar]
178
+ C --> D[Validar com Usuario]
179
+ D --> E{Aprovado?}
180
+ E -->|Nao| C
181
+ E -->|Sim| F[Auto-Update ClickUp]
182
+ F --> G[Atualizar plan.md]
183
+ G --> H{Mais Fases?}
184
+ H -->|Sim| A
185
+ H -->|Nao| I[Concluido]
186
+ ```
187
+
188
+ ---
189
+
190
+ #### 4. Preparação para PR (`/engineer/pre-pr`)
191
+
192
+ ```bash
193
+ /engineer/pre-pr
194
+ ```
195
+
196
+ **O que acontece:**
197
+
198
+ 1. ✅ Valida testes
199
+ 2. ✅ Verifica linting
200
+ 3. ✅ Valida cobertura de testes
201
+ 4. ✅ Revisa mudanças
202
+ 5. ✅ Prepara descrição do PR
203
+ 6. ✅ Valida commits
204
+ 7. ✅ Checklist de qualidade
205
+
206
+ ---
207
+
208
+ #### 5. Pull Request (`/engineer/pr`)
209
+
210
+ ```bash
211
+ /engineer/pr
212
+ ```
213
+
214
+ **O que acontece:**
215
+
216
+ 1. ✅ Cria feature branch (se necessário)
217
+ 2. ✅ Commit e push das mudanças
218
+ 3. ✅ Atualiza ClickUp:
219
+ - Status → "in progress"
220
+ - Tag → "under-review"
221
+ - Comentário com link do PR
222
+ 4. ✅ Abre Pull Request
223
+ 5. ✅ Aguarda code review
224
+ 6. ✅ Aplica correções (se necessário)
225
+
226
+ ---
227
+
228
+ #### 6. Sincronização de Sessão (`/docs/sync-sessions`)
229
+
230
+ ```bash
231
+ /docs/sync-sessions
232
+ ```
233
+
234
+ **O que acontece (após merge):**
235
+
236
+ 1. ✅ Analisa trabalho realizado na sessão
237
+ 2. ✅ Organiza documentação gerada
238
+ 3. ✅ Preserva contexto e decisões
239
+ 4. ✅ Gera estrutura de sessão:
240
+ - README.md (resumo)
241
+ - context.md (contexto inicial)
242
+ - decisions.md (decisões tomadas)
243
+ - changes.md (mudanças realizadas)
244
+ 5. ✅ Atualiza índice de sessões
245
+ 6. ✅ Atualiza ClickUp para "Done"
246
+
247
+ ---
248
+
249
+ ### Responsabilidades dos Comandos
250
+
251
+ #### 🎯 **Comandos CORE (Prioridade Máxima)**
252
+
253
+ | Comando | Responsabilidade | Cria Branch? | Cria Sessão? | Atualiza ClickUp? |
254
+ | ------------------ | ---------------------- | ------------------ | ------------ | ----------------- |
255
+ | `/product/task` | Criar task estruturada | ✅ Opcional\* | ✅ Sim | ✅ Sim |
256
+ | `/engineer/start` | Análise + Arquitetura | ✅ Valida/Cria\* | ✅ Valida | ✅ Sim |
257
+ | `/engineer/work` | Implementação | ❌ Não | ❌ Não | ✅ Sim (por fase) |
258
+ | `/engineer/pre-pr` | Validação pré-PR | ❌ Não | ❌ Não | ❌ Não |
259
+ | `/engineer/pr` | Pull Request | ✅ Se necessário\* | ❌ Não | ✅ Sim |
260
+ | `/engineer/hotfix` | Correção emergencial | ❌ Não | ✅ Sim | ✅ Sim |
261
+
262
+ **\* Nota sobre Branches:** Os comandos `/product/task` e `/engineer/start` **gerenciam Git internamente**. Eles chamam comandos `/git/*` automaticamente quando necessário. O usuário **não precisa** executar comandos Git manualmente.
263
+
264
+ #### ⚙️ **Comandos de Suporte (Automáticos)**
265
+
266
+ | Comando | Responsabilidade | Quando Usar |
267
+ | --------------------- | ----------------------- | ----------------------------------------------- |
268
+ | `/docs/sync-sessions` | Sincronização de Sessão | Após merge (manual ou automático) |
269
+ | `/git/feature/start` | Criar feature branch | **Chamado internamente** por `/product/task` |
270
+ | `/git/hotfix/start` | Criar hotfix branch | **Chamado internamente** por `/engineer/hotfix` |
271
+ | `/git/hotfix/finish` | Finalizar hotfix | Após merge do PR de hotfix |
272
+
273
+ ---
274
+
275
+ ## 🔥 Fluxo de Hotfix
276
+
277
+ ### Visão Geral
278
+
279
+ Fluxo rápido para correções urgentes em produção usando comandos de engenharia.
280
+
281
+ ### Diagrama do Fluxo
282
+
283
+ ```mermaid
284
+ flowchart TD
285
+ A[Bug Critico] --> B["/engineer/hotfix"]
286
+ B --> C["Branch hotfix/fix-name"]
287
+
288
+ C --> D[Analise Rapida]
289
+ D --> E[Implementar Fix]
290
+
291
+ E --> F[Testes]
292
+ F --> G{Testes OK?}
293
+ G -->|Nao| E
294
+ G -->|Sim| H["/engineer/pr"]
295
+
296
+ H --> I[Code Review Urgente]
297
+ I --> J{Aprovado?}
298
+ J -->|Nao| E
299
+ J -->|Sim| K[Merge]
300
+
301
+ K --> L["/git/hotfix/finish"]
302
+ L --> M[Deploy Producao]
303
+
304
+ style A fill:#ffebee
305
+ style M fill:#e1f5e1
306
+ style B fill:#fff3cd
307
+ style H fill:#fff3cd
308
+ ```
309
+
310
+ ### Passo a Passo
311
+
312
+ ```bash
313
+ # 1. Iniciar hotfix (cria branch + análise)
314
+ /engineer/hotfix "fix-payment-timeout"
315
+
316
+ # 2. Criar PR após implementação
317
+ /engineer/pr
318
+
319
+ # 3. Finalizar hotfix após merge (merge + deploy)
320
+ /git/hotfix/finish
321
+ ```
322
+
323
+ **💡 Nota:** `/engineer/hotfix` **cria automaticamente** a branch `hotfix/fix-name` a partir de `main`. Não é necessário executar `/git/hotfix/start` manualmente.
324
+
325
+ **O que `/git/hotfix/finish` faz:**
326
+
327
+ - ✅ Merge emergencial para main/master
328
+ - ✅ Back-merge automático para develop
329
+ - ✅ Criação de tag de patch
330
+ - ✅ Preparação para deploy de produção
331
+ - ✅ Cleanup de branches
332
+ - ✅ Atualização do ClickUp
333
+
334
+ **Diferenças do Fluxo de Feature:**
335
+
336
+ - ⚡ **Análise mais rápida** (foco no problema)
337
+ - ⚡ **Menos fases** no plan.md
338
+ - ⚡ **Branch de main** (não develop)
339
+ - ⚡ **Merge duplo automático** (main + develop)
340
+ - ⚡ **Deploy imediato** após merge
341
+
342
+ ---
343
+
344
+ ## 📦 Fluxo de Release
345
+
346
+ ### Visão Geral
347
+
348
+ Fluxo para preparação e publicação de versões.
349
+
350
+ ### Diagrama do Fluxo
351
+
352
+ ```mermaid
353
+ flowchart TD
354
+ A[Preparar Release] --> B["/git/release/start"]
355
+ B --> C["Branch release/v1.2.0"]
356
+
357
+ C --> D[Ajustes Finais]
358
+ D --> E[Atualizar CHANGELOG]
359
+ E --> F["/engineer/bump"]
360
+
361
+ F --> G[Testes Finais]
362
+ G --> H{Testes OK?}
363
+ H -->|Nao| D
364
+ H -->|Sim| I["/engineer/pr"]
365
+
366
+ I --> J[Code Review]
367
+ J --> K{Aprovado?}
368
+ K -->|Nao| D
369
+ K -->|Sim| L[Merge]
370
+
371
+ L --> M["/git/release/finish"]
372
+ M --> N["Merge main + develop"]
373
+ N --> O[Tag v1.2.0]
374
+ O --> P[Deploy Producao]
375
+
376
+ style A fill:#e3f2fd
377
+ style P fill:#e1f5e1
378
+ ```
379
+
380
+ ### Passo a Passo
381
+
382
+ ```bash
383
+ # 1. Criar release branch
384
+ /git/release/start "v1.2.0"
385
+
386
+ # 2. Fazer ajustes finais
387
+ # (correções de bugs, atualização de docs)
388
+
389
+ # 3. Atualizar versão
390
+ /engineer/bump minor
391
+
392
+ # 4. Criar PR
393
+ /engineer/pr
394
+
395
+ # 5. Após merge, finalizar release
396
+ /git/release/finish
397
+ ```
398
+
399
+ ---
400
+
401
+ ## 📚 Fluxo de Documentação
402
+
403
+ ### Visão Geral
404
+
405
+ Fluxo para geração e manutenção de documentação.
406
+
407
+ ### Diagrama do Fluxo
408
+
409
+ ```mermaid
410
+ flowchart TD
411
+ A[Documentar Projeto] --> B{Tipo de Docs?}
412
+
413
+ B -->|Negocio| C["/docs/build-business-docs"]
414
+ B -->|Tecnico| D["/docs/build-tech-docs"]
415
+ B -->|Compliance| E["/docs/build-compliance-docs"]
416
+
417
+ C --> F["docs/business-context/"]
418
+ D --> G["docs/technical-context/"]
419
+ E --> H["docs/compliance/"]
420
+
421
+ F --> I["/docs/build-index"]
422
+ G --> I
423
+ H --> I
424
+
425
+ I --> J[docs/index.md]
426
+ J --> K["/docs/validate-docs"]
427
+
428
+ K --> L{Docs OK?}
429
+ L -->|Nao| M["/docs/docs-health"]
430
+ M --> N[Corrigir Problemas]
431
+ N --> K
432
+ L -->|Sim| O[Docs Completos]
433
+
434
+ style A fill:#fff3cd
435
+ style O fill:#e1f5e1
436
+ ```
437
+
438
+ ### Passo a Passo
439
+
440
+ ```bash
441
+ # 1. Gerar docs de negócio
442
+ /docs/build-business-docs
443
+
444
+ # 2. Gerar docs técnicos
445
+ /docs/build-tech-docs
446
+
447
+ # 3. Gerar docs de compliance (se necessário)
448
+ /docs/build-compliance-docs
449
+
450
+ # 4. Gerar índice navegável
451
+ /docs/build-index
452
+
453
+ # 5. Validar documentação
454
+ /docs/validate-docs
455
+
456
+ # 6. Verificar saúde (links quebrados, etc)
457
+ /docs/docs-health
458
+ ```
459
+
460
+ ---
461
+
462
+ ## ✅ Fluxo de Validação
463
+
464
+ ### Visão Geral
465
+
466
+ Fluxo para validação completa do projeto.
467
+
468
+ ### Diagrama do Fluxo
469
+
470
+ ```mermaid
471
+ flowchart TD
472
+ A[Validar Projeto] --> B["/validate/workflow"]
473
+
474
+ B --> C[Validar Estrutura]
475
+ C --> D[Validar Documentacao]
476
+ D --> E[Validar Git]
477
+ E --> F[Validar ClickUp]
478
+
479
+ F --> G{Tudo OK?}
480
+ G -->|Nao| H[Listar Problemas]
481
+ H --> I[Corrigir]
482
+ I --> B
483
+ G -->|Sim| J[Projeto Valido]
484
+
485
+ style A fill:#e3f2fd
486
+ style J fill:#e1f5e1
487
+ ```
488
+
489
+ ---
490
+
491
+ ## 🔗 Integração entre Comandos
492
+
493
+ ### Fluxo de Integração ClickUp
494
+
495
+ ```mermaid
496
+ sequenceDiagram
497
+ participant U as Usuário
498
+ participant PT as /product/task
499
+ participant CU as ClickUp
500
+ participant ES as /engineer/start
501
+ participant EW as /engineer/work
502
+ participant EP as /engineer/pr
503
+ participant GS as /git/sync
504
+
505
+ U->>PT: Criar task
506
+ PT->>CU: Create task + subtasks
507
+ CU-->>PT: Task ID
508
+ PT->>U: Task criada
509
+
510
+ U->>ES: Iniciar dev
511
+ ES->>CU: Get task details
512
+ ES->>CU: Update status → In Progress
513
+ ES->>U: Análise + Arquitetura
514
+
515
+ U->>EW: Implementar fase
516
+ EW->>EW: Código
517
+ EW->>CU: Update subtask → Done
518
+ EW->>CU: Add progress comment
519
+ EW->>U: Fase completa
520
+
521
+ U->>EP: Criar PR
522
+ EP->>CU: Update status → In Progress
523
+ EP->>CU: Add tag "under-review"
524
+ EP->>U: PR criado
525
+
526
+ U->>GS: Pós-merge
527
+ GS->>CU: Update status → Done
528
+ GS->>U: Sincronizado
529
+ ```
530
+
531
+ ---
532
+
533
+ ## 🤔 Decision Trees
534
+
535
+ ### Qual comando usar para iniciar?
536
+
537
+ ```mermaid
538
+ flowchart TD
539
+ A[Preciso iniciar algo] --> B{O que?}
540
+
541
+ B -->|Nova Feature| C{Task existe?}
542
+ C -->|Nao| D["/product/task"]
543
+ C -->|Sim| E["/engineer/start"]
544
+
545
+ B -->|Bug Critico| F["/engineer/hotfix"]
546
+
547
+ B -->|Release| G["/git/release/start"]
548
+
549
+ B -->|Documentacao| H{Tipo?}
550
+ H -->|Negocio| I["/docs/build-business-docs"]
551
+ H -->|Tecnico| J["/docs/build-tech-docs"]
552
+
553
+ B -->|Validacao| K["/validate/workflow"]
554
+
555
+ style D fill:#fff3cd
556
+ style E fill:#fff3cd
557
+ style F fill:#ffebee
558
+ style G fill:#e3f2fd
559
+ style I fill:#f3e5f5
560
+ style J fill:#f3e5f5
561
+ style K fill:#e8f5e9
562
+ ```
563
+
564
+ ### Quando usar cada comando?
565
+
566
+ #### 🎯 **Comandos de Produto**
567
+
568
+ | Cenário | Comando | Razão |
569
+ | ---------------------- | ------------------ | -------------------------------------------------- |
570
+ | **Criar nova feature** | `/product/task` | Cria task estruturada no ClickUp + branch + sessão |
571
+ | **Planejar épico** | `/product/epic` | Decompõe épico em tasks menores |
572
+ | **Revisar backlog** | `/product/backlog` | Organiza e prioriza tasks pendentes |
573
+
574
+ #### 🔧 **Comandos de Engenharia**
575
+
576
+ | Cenário | Comando | Razão |
577
+ | --------------------------- | ------------------------------- | ---------------------------------------- |
578
+ | **Iniciar desenvolvimento** | `/engineer/start` | Análise + arquitetura + setup de sessão |
579
+ | **Implementar fase** | `/engineer/work` | Implementa código seguindo plan.md |
580
+ | **Validar antes de PR** | `/engineer/pre-pr` | Checklist de qualidade completo |
581
+ | **Criar Pull Request** | `/engineer/pr` | Abre PR e atualiza ClickUp |
582
+ | **Atualizar PR** | `/engineer/pr-update` | Atualiza PR existente com novas mudanças |
583
+ | **Bug crítico em produção** | `/engineer/hotfix` | Análise rápida + implementação urgente |
584
+ | **Validar fase** | `/engineer/validate-phase-sync` | Valida sincronização fase ↔ subtask |
585
+
586
+ #### 📚 **Comandos de Documentação**
587
+
588
+ | Cenário | Comando | Razão |
589
+ | ------------------------- | --------------------------- | ------------------------------------- |
590
+ | **Após merge concluído** | `/docs/sync-sessions` | Arquiva sessão e atualiza ClickUp |
591
+ | **Gerar docs de negócio** | `/docs/build-business-docs` | Documentação de contexto de negócio |
592
+ | **Gerar docs técnicos** | `/docs/build-tech-docs` | Documentação de arquitetura e stack |
593
+ | **Criar índice** | `/docs/build-index` | Índice navegável de toda documentação |
594
+ | **Validar documentação** | `/docs/validate-docs` | Verifica completude e consistência |
595
+
596
+ **💡 Regra de Ouro:** Use sempre comandos `/product/*` e `/engineer/*` para desenvolvimento. Comandos Git são gerenciados automaticamente.
597
+
598
+ ---
599
+
600
+ ## 🔧 Troubleshooting
601
+
602
+ ### Problema: Branch já existe
603
+
604
+ **Sintoma:** Erro ao criar branch com `/git/feature/start`
605
+
606
+ **Solução:**
607
+
608
+ ```bash
609
+ # Opção 1: Usar branch existente
610
+ git checkout feature/nome-existente
611
+
612
+ # Opção 2: Deletar e recriar
613
+ git branch -D feature/nome-existente
614
+ /git/feature/start "nome-existente"
615
+ ```
616
+
617
+ ---
618
+
619
+ ### Problema: Sessão não encontrada
620
+
621
+ **Sintoma:** `/engineer/work` não encontra arquivos da sessão
622
+
623
+ **Solução:**
624
+
625
+ ```bash
626
+ # Verificar se sessão existe
627
+ ls .claude/sessions/
628
+
629
+ # Se não existe, criar com /engineer/start
630
+ /engineer/start <feature-slug>
631
+ ```
632
+
633
+ ---
634
+
635
+ ### Problema: ClickUp não atualiza
636
+
637
+ **Sintoma:** Comandos não atualizam status no ClickUp
638
+
639
+ **Solução:**
640
+
641
+ 1. Verificar se `context.md` tem task-id correto
642
+ 2. Verificar conexão com ClickUp MCP
643
+ 3. Verificar permissões da API key
644
+
645
+ ```bash
646
+ # Verificar task-id no context.md
647
+ cat .claude/sessions/<feature-slug>/context.md | grep "Task ID"
648
+
649
+ # Testar conexão ClickUp
650
+ # (usar ferramenta de teste do MCP)
651
+ ```
652
+
653
+ ---
654
+
655
+ ### Problema: Mapeamento fase→subtask incorreto
656
+
657
+ **Sintoma:** Subtask errada é atualizada ao completar fase
658
+
659
+ **Solução:**
660
+
661
+ ```bash
662
+ # Validar mapeamento
663
+ /engineer/validate-phase-sync
664
+
665
+ # Corrigir manualmente no context.md se necessário
666
+ ```
667
+
668
+ ---
669
+
670
+ ### Problema: Sessão não sincroniza
671
+
672
+ **Sintoma:** `/docs/sync-sessions` não detecta arquivos
673
+
674
+ **Solução:**
675
+
676
+ 1. Verificar se está no diretório correto
677
+ 2. Verificar se há arquivos modificados
678
+ 3. Verificar `.gitignore` para exclusões
679
+
680
+ ```bash
681
+ # Verificar arquivos modificados
682
+ git status
683
+
684
+ # Forçar sincronização
685
+ /docs/sync-sessions --force
686
+
687
+ # Validar estrutura
688
+ /docs/sync-sessions --validate-only
689
+ ```
690
+
691
+ ---
692
+
693
+ ## 🌿 Fluxos Git (Avançado)
694
+
695
+ > **⚠️ IMPORTANTE:** Esta seção é para **uso avançado** ou **troubleshooting**. Os comandos Git são **chamados automaticamente** pelos comandos de engenharia e produto. Na maioria dos casos, você **não precisa** executá-los manualmente.
696
+
697
+ ### Quando Usar Comandos Git Diretamente
698
+
699
+ Use comandos Git **apenas** nestas situações:
700
+
701
+ 1. **Troubleshooting**: Corrigir problemas de branch ou merge
702
+ 2. **Operações Manuais**: Quando comandos de engenharia não cobrem o caso
703
+ 3. **Releases**: Gerenciar releases e tags
704
+ 4. **Hotfix Finalização**: Após merge do PR de hotfix
705
+
706
+ ---
707
+
708
+ ### 🔀 Comandos Git Disponíveis
709
+
710
+ #### **Feature Branches**
711
+
712
+ | Comando | Uso | Quando Usar |
713
+ | --------------------- | -------------------- | ---------------------------------- |
714
+ | `/git/feature/start` | Criar feature branch | **Automático** via `/product/task` |
715
+ | `/git/feature/finish` | Finalizar feature | Após merge do PR |
716
+
717
+ **💡 Nota:** `/product/task` e `/engineer/start` gerenciam feature branches automaticamente.
718
+
719
+ ---
720
+
721
+ #### **Hotfix Branches**
722
+
723
+ | Comando | Uso | Quando Usar |
724
+ | -------------------- | ------------------- | ------------------------------------- |
725
+ | `/git/hotfix/start` | Criar hotfix branch | **Automático** via `/engineer/hotfix` |
726
+ | `/git/hotfix/finish` | Finalizar hotfix | Após merge do PR de hotfix |
727
+
728
+ **Fluxo Completo de Hotfix:**
729
+
730
+ ```bash
731
+ # 1. Iniciar (cria branch automaticamente)
732
+ /engineer/hotfix "fix-critical-bug"
733
+
734
+ # 2. Criar PR
735
+ /engineer/pr
736
+
737
+ # 3. Após merge, finalizar
738
+ /git/hotfix/finish
739
+ ```
740
+
741
+ **O que `/git/hotfix/finish` faz:**
742
+
743
+ - ✅ Merge para main/master
744
+ - ✅ Back-merge para develop
745
+ - ✅ Criação de tag de patch
746
+ - ✅ Preparação para deploy
747
+ - ✅ Cleanup de branches
748
+ - ✅ Atualização do ClickUp
749
+
750
+ ---
751
+
752
+ #### **Release Management**
753
+
754
+ | Comando | Uso | Quando Usar |
755
+ | --------------------- | ----------------- | -------------------- |
756
+ | `/git/release/start` | Criar release | Preparar nova versão |
757
+ | `/git/release/finish` | Finalizar release | Deploy para produção |
758
+
759
+ **Fluxo de Release:**
760
+
761
+ ```bash
762
+ # 1. Criar release com versionamento
763
+ /git/release/start "v2.1.0"
764
+ # ou auto-bump:
765
+ /git/release/start "patch" # 2.0.1 → 2.0.2
766
+ /git/release/start "minor" # 2.0.1 → 2.1.0
767
+ /git/release/start "major" # 2.0.1 → 3.0.0
768
+
769
+ # 2. Testar release
770
+
771
+ # 3. Finalizar (merge + tag + deploy)
772
+ /git/release/finish
773
+ ```
774
+
775
+ **O que `/git/release/finish` faz:**
776
+
777
+ - ✅ Merge para main
778
+ - ✅ Back-merge para develop
779
+ - ✅ Tag anotada com metadata
780
+ - ✅ Preparação para deploy
781
+ - ✅ Cleanup de branches
782
+ - ✅ Atualização do ClickUp
783
+
784
+ ---
785
+
786
+ #### **Operações Gerais**
787
+
788
+ | Comando | Uso | Quando Usar |
789
+ | ------------- | --------------------- | ------------------ |
790
+ | `/git/init` | Inicializar Git | Novo projeto |
791
+ | `/git/status` | Status do repositório | Verificar estado |
792
+ | `/git/help` | Ajuda Git | Consultar comandos |
793
+
794
+ ---
795
+
796
+ ### 🔄 Integração Git ↔ Engenharia
797
+
798
+ ```mermaid
799
+ flowchart LR
800
+ A["/product/task"] -->|chama| B["/git/feature/start"]
801
+ B -->|cria| C["Branch feature/name"]
802
+
803
+ D["/engineer/hotfix"] -->|chama| E["/git/hotfix/start"]
804
+ E -->|cria| F["Branch hotfix/name"]
805
+
806
+ G["/engineer/pr"] -->|usa| C
807
+ G -->|usa| F
808
+
809
+ H["Merge PR"] --> I{Tipo?}
810
+ I -->|Feature| J["/git/feature/finish"]
811
+ I -->|Hotfix| K["/git/hotfix/finish"]
812
+
813
+ style A fill:#fff3cd
814
+ style D fill:#fff3cd
815
+ style G fill:#fff3cd
816
+ style B fill:#e3f2fd
817
+ style E fill:#e3f2fd
818
+ style J fill:#e3f2fd
819
+ style K fill:#e3f2fd
820
+ ```
821
+
822
+ ---
823
+
824
+ ### ⚠️ Troubleshooting Git
825
+
826
+ #### **Problema: Branch já existe**
827
+
828
+ ```bash
829
+ # Verificar branches
830
+ git branch -a
831
+
832
+ # Deletar branch local
833
+ git branch -D feature/nome
834
+
835
+ # Deletar branch remota
836
+ git push origin --delete feature/nome
837
+
838
+ # Recriar
839
+ /git/feature/start "nome"
840
+ ```
841
+
842
+ #### **Problema: Conflitos de merge**
843
+
844
+ ```bash
845
+ # Verificar conflitos
846
+ git status
847
+
848
+ # Resolver manualmente
849
+ # (editar arquivos com conflitos)
850
+
851
+ # Marcar como resolvido
852
+ git add .
853
+ git commit -m "Resolve merge conflicts"
854
+ ```
855
+
856
+ #### **Problema: Tag já existe**
857
+
858
+ ```bash
859
+ # Listar tags
860
+ git tag
861
+
862
+ # Deletar tag local
863
+ git tag -d v1.0.0
864
+
865
+ # Deletar tag remota
866
+ git push origin --delete v1.0.0
867
+
868
+ # Recriar release
869
+ /git/release/start "v1.0.0"
870
+ ```
871
+
872
+ ---
873
+
874
+ ### 📋 Checklist de Operações Git Manuais
875
+
876
+ Antes de usar comandos Git diretamente, verifique:
877
+
878
+ - [ ] O comando de engenharia equivalente não resolve?
879
+ - [ ] É realmente necessário fazer manualmente?
880
+ - [ ] Entendo o impacto da operação?
881
+ - [ ] Fiz backup/commit das mudanças?
882
+ - [ ] Estou na branch correta?
883
+
884
+ **💡 Dica:** Na dúvida, use comandos de engenharia. Eles são mais seguros e integrados.
885
+
886
+ ---
887
+
888
+ ## 🔗 Documentos Relacionados
889
+
890
+ - [Guia de Comandos](./commands-guide.md) - Referência completa de comandos
891
+ - [Integração ClickUp](./clickup-integration.md) - Detalhes do ClickUp MCP
892
+ - [Referência de Agentes](./agents-reference.md) - Agentes especializados
893
+ - [Exemplos Práticos](./practical-examples.md) - Casos de uso reais
894
+ - [Configuração Inicial](./getting-started.md) - Setup do sistema
895
+
896
+ ---
897
+
898
+ **Última atualização:** 2025-01-27
899
+ **Versão:** 2.0
900
+ **Padrão de Nomenclatura:** `<feature-slug>` (kebab-case)