@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,682 @@
1
+ # 🌿 Git Commands - Sistema Onion
2
+
3
+ **Framework completo de comandos Git com workflows Gitflow integrados ao Sistema Onion.**
4
+
5
+ Este módulo oferece automação completa para desenvolvimento com Git, desde planejamento até deploy, com integração nativa ClickUp MCP.
6
+
7
+ ## ⚡ **CRÍTICO: Cursor Commands vs Terminal**
8
+
9
+ ### 🎮 **Como Usar os Comandos Git**
10
+
11
+ Todos os comandos deste módulo são **[Cursor Commands](https://cursor.com/pt-BR/docs/agent/chat/commands)** executados no **chat da Cursor**:
12
+
13
+ ```markdown
14
+ # ✅ CORRETO - No chat da Cursor IDE:
15
+
16
+ /git/init
17
+ /git/feature/start "user-authentication"
18
+ /git/feature/publish
19
+ /git/release/finish
20
+
21
+ # ❌ INCORRETO - NÃO são comandos bash/shell:
22
+
23
+ $ /git/init # Não funciona no terminal
24
+ $ ./git/feature/start # Não é script executável
25
+ ```
26
+
27
+ ### 🧠 **Arquitetura dos Comandos**
28
+
29
+ - **Interface**: Cursor Commands (digitados no chat)
30
+ - **Definição**: Arquivos `.md` nesta pasta definem workflows
31
+ - **Execução**: Cursor AI interpreta e executa bash scripts internos
32
+ - **UX**: Modern CLI via `.claude/utils/modern-cli-ux.sh`
33
+
34
+ ---
35
+
36
+ ## 📋 **Comandos Disponíveis**
37
+
38
+ ### **🆘 Setup e Ajuda**
39
+
40
+ #### **`/git/help`** - Sistema de Ajuda Completo
41
+
42
+ **Finalidade**: Cartão de referência e troubleshooting para todos workflows Gitflow
43
+ **Uso**: `/git/help`
44
+
45
+ - ✅ Quick reference de todos os comandos
46
+ - ✅ Troubleshooting automático com soluções
47
+ - ✅ Examples práticos por workflow
48
+ - ✅ Guidance vs execution (comandos vs @gitflow-specialist)
49
+
50
+ #### **`/git/init`** - Setup Gitflow Automático
51
+
52
+ **Finalidade**: Inicializar repositório com Gitflow e ClickUp integration
53
+ **Uso**: `/git/init`
54
+
55
+ - ✅ Master/main detection automática
56
+ - ✅ Setup develop branch + configurações
57
+ - ✅ ClickUp integration se sessão ativa
58
+ - ✅ Validações de segurança completas
59
+
60
+ ---
61
+
62
+ ### **🌿 Feature Development**
63
+
64
+ #### **`/git/feature/start "nome"`** - Criar Feature Backlog
65
+
66
+ **Finalidade**: Criar task ClickUp para feature (planejamento, sem desenvolvimento)
67
+ **Uso**: `/git/feature/start "implementar-oauth-authentication"`
68
+
69
+ - ✅ Task ClickUp com tag "backlog" criada
70
+ - ✅ Descrição estruturada + próximos passos
71
+ - ✅ Integração com `/engineer/start` para desenvolvimento
72
+ - ✅ Auto-detecção de lista ClickUp atual
73
+
74
+ #### **`/git/feature/finish`** - Finalizar Feature Development
75
+
76
+ **Finalidade**: Merge feature → develop + cleanup automático
77
+ **Uso**: `/git/feature/finish` (na feature branch)
78
+
79
+ - ✅ Merge feature → develop com validações
80
+ - ✅ Cleanup branches locais/remotos com confirmação
81
+ - ✅ Update ClickUp task → "Done" + comentário
82
+ - ✅ Archive automático da sessão de trabalho
83
+
84
+ ---
85
+
86
+ ### **🚀 Release Management**
87
+
88
+ #### **`/git/release/start "version"`** - Iniciar Release
89
+
90
+ **Finalidade**: Preparar release com versionamento semântico automático
91
+ **Uso**:
92
+
93
+ ```bash
94
+ /git/release/start "v2.1.0" # Versão específica
95
+ /git/release/start "patch" # Auto-bump patch (2.0.1 → 2.0.2)
96
+ /git/release/start "minor" # Auto-bump minor (2.0.1 → 2.1.0)
97
+ /git/release/start "major" # Auto-bump major (2.0.1 → 3.0.0)
98
+ ```
99
+
100
+ - ✅ Release branch criada a partir de develop
101
+ - ✅ Auto-versioning (package.json, version.txt, VERSION)
102
+ - ✅ Changelog preparation automática
103
+ - ✅ ClickUp release task com checklist
104
+ - ✅ Validações de conflito (branches e tags)
105
+
106
+ #### **`/git/release/finish`** - Finalizar Release
107
+
108
+ **Finalidade**: Deploy production com duplo merge + tags
109
+ **Uso**: `/git/release/finish` (na release branch)
110
+
111
+ - ✅ Duplo merge: release → main + develop
112
+ - ✅ Tag anotada com metadata completa
113
+ - ✅ Deploy preparation hooks
114
+ - ✅ ClickUp completion + release notes
115
+ - ✅ Branch cleanup com confirmações
116
+
117
+ ---
118
+
119
+ ### **🔥 Emergency Hotfix**
120
+
121
+ #### **`/git/hotfix/start "nome"`** - Emergency Hotfix Setup
122
+
123
+ **Finalidade**: Hotfix emergencial a partir de produção (main/master)
124
+ **Uso**: `/git/hotfix/start "fix-payment-gateway-timeout"`
125
+
126
+ - ✅ Hotfix branch a partir de main/master
127
+ - ✅ Auto-versioning patch emergencial
128
+ - ✅ ClickUp emergency task (prioridade 1)
129
+ - ✅ Emergency auto-save de mudanças
130
+ - ✅ Rollback preparation desde início
131
+
132
+ #### **`/git/hotfix/finish`** - Deploy Crítico Emergency
133
+
134
+ **Finalidade**: Deploy emergencial com duplo merge acelerado
135
+ **Uso**: `/git/hotfix/finish` (na hotfix branch)
136
+
137
+ - ✅ Duplo merge emergencial (main + develop)
138
+ - ✅ Production-first strategy com overrides
139
+ - ✅ Emergency tag + monitoring requirements
140
+ - ✅ SLA < 2 horas + production health verification
141
+ - ✅ ClickUp emergency completion
142
+
143
+ ---
144
+
145
+ ### **💥 Workflow Híbrido**
146
+
147
+ #### **`/engineer/hotfix "desc" [params]`** - Emergency Workflow Completo
148
+
149
+ **Finalidade**: Task ClickUp + Git hotfix + Session management em 1 comando
150
+ **Uso**:
151
+
152
+ ```bash
153
+ /engineer/hotfix "Fix critical payment timeout"
154
+ /engineer/hotfix "Security auth patch" --related-tasks="123,456" --tags="security"
155
+ ```
156
+
157
+ **Parâmetros**:
158
+
159
+ - `--related-tasks="id1,id2"` - Link tasks relacionadas
160
+ - `--tags="urgent,security"` - Tags adicionais
161
+ - `--status="In Progress"` - Status inicial
162
+ - `--priority=1` - Prioridade (1=urgent)
163
+
164
+ - ✅ Executa `/product/task` + `/git/hotfix/start` internamente
165
+ - ✅ Session management completo (context, plan, notes)
166
+ - ✅ Emergency automation: task + session + git
167
+ - ✅ Parameter parsing + ClickUp linking
168
+
169
+ ---
170
+
171
+ ### **🔄 Pós-Merge**
172
+
173
+ #### **`/git/sync [branch]`** - Sincronização Automática
174
+
175
+ **Finalidade**: Sincronização pós-merge com cleanup de branches
176
+ **Uso**:
177
+
178
+ ```bash
179
+ /git/sync # Sincroniza com develop (padrão)
180
+ /git/sync main # Sincroniza com main
181
+ /git/sync staging # Sincroniza com staging
182
+ ```
183
+
184
+ - ✅ Checkout automático + pull das mudanças
185
+ - ✅ Limpeza segura de branch anterior
186
+ - ✅ Atualização automática task ClickUp
187
+ - ✅ Gestão inteligente de sessões (3000+ linhas)
188
+
189
+ ---
190
+
191
+ ## 🎯 **Workflows Completos**
192
+
193
+ ### **🌟 Feature Development (Método 1 - Planejado):**
194
+
195
+ ```mermaid
196
+ flowchart LR
197
+ A["/git/feature/start 'nome'"] --> B["Task Backlog Created"]
198
+ B --> C["/engineer/start"]
199
+ C --> D["/engineer/work"]
200
+ D --> E["/git/feature/finish"]
201
+ E --> F["/git/sync develop"]
202
+ ```
203
+
204
+ ### **⚡ Feature Development (Método 2 - Direto):**
205
+
206
+ ```mermaid
207
+ flowchart LR
208
+ A["/product/task"] --> B["/engineer/start"]
209
+ B --> C["/engineer/work"]
210
+ C --> D["/git/feature/finish"]
211
+ D --> E["/git/sync develop"]
212
+ ```
213
+
214
+ ### **🚀 Release Workflow:**
215
+
216
+ ```mermaid
217
+ flowchart LR
218
+ A["/git/release/start 'v2.1.0'"] --> B["Testing & Validation"]
219
+ B --> C["/git/release/finish"]
220
+ C --> D["Production Deploy"]
221
+ D --> E["/git/sync main"]
222
+ ```
223
+
224
+ ### **🔥 Emergency Hotfix (Método 1 - Separado):**
225
+
226
+ ```mermaid
227
+ flowchart LR
228
+ A["/git/hotfix/start 'critical-bug'"] --> B["Emergency Fix"]
229
+ B --> C["/git/hotfix/finish"]
230
+ C --> D["Production Deploy"]
231
+ ```
232
+
233
+ ### **💥 Emergency Hotfix (Método 2 - Híbrido):**
234
+
235
+ ```mermaid
236
+ flowchart LR
237
+ A["/engineer/hotfix 'desc' --params"] --> B["Auto: Task + Session + Git"]
238
+ B --> C["Emergency Fix"]
239
+ C --> D["/git/hotfix/finish"]
240
+ ```
241
+
242
+ ---
243
+
244
+ ## 🔗 **Integração Sistema Onion**
245
+
246
+ ### **Comandos por Categoria:**
247
+
248
+ | Categoria | Comandos | Finalidade |
249
+ | ----------- | ------------------------------------------- | ----------------------------- |
250
+ | **Setup** | `/git/help`, `/git/init` | Help system + Gitflow setup |
251
+ | **Feature** | `/git/feature/start`, `/git/feature/finish` | Development workflow |
252
+ | **Release** | `/git/release/start`, `/git/release/finish` | Production deployment |
253
+ | **Hotfix** | `/git/hotfix/start`, `/git/hotfix/finish` | Emergency fixes |
254
+ | **Híbrido** | `/engineer/hotfix` | All-in-one emergency workflow |
255
+ | **Sync** | `/git/sync` | Post-merge synchronization |
256
+
257
+ ### **Integração com Outros Comandos:**
258
+
259
+ | Comando Anterior | Comando Git | Resultado Final |
260
+ | -------------------- | ----------------------------------------- | --------------------------- |
261
+ | `/product/task` | `/engineer/start` + `/git/feature/finish` | Feature completa |
262
+ | `/git/feature/start` | `/engineer/start` + `/git/feature/finish` | Backlog → Production |
263
+ | `/engineer/work` | `/git/feature/finish` | Development → Merge |
264
+ | `/engineer/pr` | `/git/sync` | PR merge → Clean state |
265
+ | `/git/release/start` | `/git/release/finish` | Version → Production |
266
+ | Emergency issue | `/engineer/hotfix` | Issue → Fixed in production |
267
+
268
+ ---
269
+
270
+ ## 🛠️ **Características Técnicas**
271
+
272
+ ### **🔍 Auto-Detecção:**
273
+
274
+ - **Master/Main**: Detecta automaticamente convenção do repositório
275
+ - **ClickUp Lists**: Auto-detecção via sessão ativa ou API
276
+ - **Version Files**: package.json, version.txt, VERSION
277
+ - **Current Context**: Task IDs, session state, branch status
278
+
279
+ ### **🔗 ClickUp Integration:**
280
+
281
+ - **20+ API calls** implementadas com graceful degradation
282
+ - **Task creation**: Automática com templates estruturados
283
+ - **Status updates**: Automático baseado em workflow phase
284
+ - **Comments**: Formatados com progresso e metadata técnica
285
+ - **Linking**: Tasks relacionadas e parent-child relationships
286
+
287
+ ### **⚙️ Versionamento Semântico:**
288
+
289
+ ```bash
290
+ # Auto-bump types:
291
+ patch: 2.0.1 → 2.0.2 # Bug fixes
292
+ minor: 2.0.1 → 2.1.0 # New features
293
+ major: 2.0.1 → 3.0.0 # Breaking changes
294
+
295
+ # Specific versions:
296
+ /git/release/start "v2.1.0" # Exact version
297
+ /git/release/start "2.1.0" # Without v prefix
298
+ ```
299
+
300
+ ### **🚨 Emergency Features:**
301
+
302
+ - **SLA < 2 horas**: Workflows acelerados para emergências
303
+ - **Auto-save**: Mudanças não commitadas salvas automaticamente
304
+ - **Production-first**: Merge strategy priorizando produção
305
+ - **Override capabilities**: Emergency confirmations para ações críticas
306
+ - **Rollback ready**: Preparation automática desde início
307
+
308
+ ### **🛡️ Validações de Segurança:**
309
+
310
+ - Estado git limpo antes de operações críticas
311
+ - Confirmações inteligentes apenas para ações irreversíveis
312
+ - Conflict detection antes de merges
313
+ - Tag e branch validation
314
+ - Remote connectivity checks
315
+
316
+ ---
317
+
318
+ ## 📊 **Métricas de Performance**
319
+
320
+ ### **🎯 Objetivos de Eficiência:**
321
+
322
+ - **70% redução** no tempo de gestão de branches
323
+ - **Erro humano reduzido** através de automação
324
+ - **Zero downtime** em deploys quando possível
325
+ - **Tracking completo** de decisões técnicas
326
+
327
+ ### **📈 Benefícios Mensuráveis:**
328
+
329
+ - **Feature workflow**: 5 mins vs 15+ mins manual
330
+ - **Release process**: 10 mins vs 30+ mins manual
331
+ - **Emergency hotfix**: < 2 horas vs 4+ horas manual
332
+ - **ClickUp sync**: Automático vs manual updates
333
+
334
+ ---
335
+
336
+ ## 🎓 **Guias de Uso**
337
+
338
+ ### **🌟 Para Iniciantes:**
339
+
340
+ 1. **Setup inicial**: `/git/init`
341
+ 2. **Criar feature**: `/git/feature/start "nome"`
342
+ 3. **Desenvolver**: `/engineer/start nome-feature`
343
+ 4. **Finalizar**: `/git/feature/finish`
344
+ 5. **Limpar**: `/git/sync develop`
345
+
346
+ ### **⚡ Para Experts:**
347
+
348
+ - **Release rápida**: `/git/release/start "minor"` → testing → `/git/release/finish`
349
+ - **Emergency hotfix**: `/engineer/hotfix "Critical bug" --related-tasks="123"`
350
+ - **Batch operations**: Use parameters para efficiency
351
+
352
+ ### **🆘 Para Emergências:**
353
+
354
+ 1. **Hotfix simples**: `/git/hotfix/start` → fix → `/git/hotfix/finish`
355
+ 2. **Hotfix completo**: `/engineer/hotfix "desc" --tags="urgent"`
356
+ 3. **Rollback**: Guidance automático se deploy falhar
357
+
358
+ ---
359
+
360
+ ## 🔧 **Troubleshooting**
361
+
362
+ ### **❌ Problemas Comuns:**
363
+
364
+ #### **"Branch não encontrada"**
365
+
366
+ ```bash
367
+ # Verificar branches disponíveis
368
+ git branch -a
369
+
370
+ # Inicializar Gitflow se necessário
371
+ /git/init
372
+ ```
373
+
374
+ #### **"Mudanças não commitadas"**
375
+
376
+ ```bash
377
+ # Quick commit
378
+ git add .
379
+ git commit -m "save progress"
380
+
381
+ # Então executar comando desejado
382
+ ```
383
+
384
+ #### **"ClickUp task não atualiza"**
385
+
386
+ ```bash
387
+ # Verificar sessão ativa
388
+ ls .claude/sessions/
389
+
390
+ # Criar sessão se necessário
391
+ /engineer/start [feature-name]
392
+ ```
393
+
394
+ ### **🆘 Help Sempre Disponível:**
395
+
396
+ - **Quick reference**: `/git/help`
397
+ - **Detailed guidance**: `@gitflow-specialist "sua pergunta"`
398
+ - **Troubleshooting**: Automático em cada comando
399
+ - **Examples**: Incluídos em every command
400
+
401
+ ---
402
+
403
+ ## 📚 **Documentação Adicional**
404
+
405
+ ### **🎯 Para Desenvolvimento:**
406
+
407
+ - **Architecture**: `.claude/sessions/gitflow-commands/architecture.md`
408
+ - **Implementation**: Source code em cada comando
409
+ - **ClickUp Integration**: `.claude/docs/clickup/clickup-formatting.md`
410
+
411
+ ### **🔗 Comandos Relacionados:**
412
+
413
+ - **Product Management**: `/product/task`, `/product/task-check`
414
+ - **Engineering**: `/engineer/start`, `/engineer/work`, `/engineer/pr`
415
+ - **Meta Operations**: `/meta/all-tools`
416
+ - **Specialized Agents**: `@gitflow-specialist`, `@clickup-specialist`
417
+
418
+ ### **📊 Sistema Completo:**
419
+
420
+ Este módulo faz parte do **Sistema Onion** com:
421
+
422
+ - **28+ comandos especializados** organizados por categoria
423
+ - **17 agentes de IA especializados**
424
+ - **Integração ClickUp MCP** completa
425
+ - **Workflows automatizados** do planejamento ao deploy
426
+
427
+ ---
428
+
429
+ **🌟 Framework completo de Git workflows com automação inteligente e integração ClickUp nativa!**
430
+
431
+ **Para começar**: `/git/help` ou `/git/init`
432
+ | `/engineer/pr` | `/git/sync` | Workflow completo finalizado |
433
+ | Manual merge | `/git/sync main` | Sincronização com main |
434
+ | Hotfix merge | `/git/sync develop` | Volta para develop |
435
+
436
+ ---
437
+
438
+ ## 🛠️ **Funcionalidades Técnicas**
439
+
440
+ ### **Branch Strategy**
441
+
442
+ - **Padrão**: `develop` (GitFlow)
443
+ - **Auto-criação**: Cria `develop` a partir de `main` se não existir
444
+ - **Flexibilidade**: Aceita qualquer branch válida
445
+ - **Validação**: Verifica existência remota antes de sincronizar
446
+
447
+ ### **Detecção Inteligente**
448
+
449
+ - **Contexto Automático**: Detecta task ativa via sessões
450
+ - **Branch Atual**: Identifica branch para limpeza
451
+ - **Estado Repositório**: Valida git status antes de proceder
452
+ - **Múltiplas Sessões**: Usa sessão mais recente automaticamente
453
+
454
+ ### **Operações Git Seguras**
455
+
456
+ - **Fetch First**: Sempre busca mudanças remotas primeiro
457
+ - **Validação**: Verifica estado antes de cada operação
458
+ - **Rollback**: Possível reverter operações em caso de erro
459
+ - **Logs**: Detalhamento completo para debugging
460
+
461
+ ### **ClickUp Integration**
462
+
463
+ - **Auto-Status**: Move task para "Done" automaticamente
464
+ - **Tag Management**: Remove "in-progress", adiciona "completed"
465
+ - **Comentários**: Formatação Unicode consistente
466
+ - **Fallback**: Continue git ops mesmo se ClickUp falhar
467
+
468
+ ### **Session Management**
469
+
470
+ - **Detecção**: Identifica sessões ativas automaticamente
471
+ - **Arquivamento**: Opcional, controlado pelo usuário
472
+ - **Preservação**: Mantém arquivos importantes (context, plan, notes)
473
+ - **Organização**: Estrutura temporal para histórico
474
+
475
+ ---
476
+
477
+ ## ⚠️ **Segurança e Validações**
478
+
479
+ ### **Verificações Automáticas:**
480
+
481
+ - ✅ **Repositório válido**: Deve ser git repo com remote origin
482
+ - ✅ **Mudanças não commitadas**: Avisa e orienta usuário
483
+ - ✅ **Branch remota**: Verifica existência antes de checkout
484
+ - ✅ **Permissões**: Valida direitos para operações git
485
+
486
+ ### **Proteções Implementadas:**
487
+
488
+ - 🛡️ **Nunca force push**: Operações sempre seguras
489
+ - 🛡️ **Backup implícito**: Git mantém reflog para recovery
490
+ - 🛡️ **Confirmações**: Pede confirmação para operações críticas
491
+ - 🛡️ **Graceful failure**: Falha de forma controlada
492
+
493
+ ### **Edge Cases Tratados:**
494
+
495
+ - **Conflitos de merge**: Orientação para resolução manual
496
+ - **Network issues**: Retry logic e fallback gracioso
497
+ - **Branch inexistente**: Auto-criação ou erro informativo
498
+ - **Múltiplas sessões**: Usa mais recente, avisa usuário
499
+
500
+ ---
501
+
502
+ ## 📊 **Formatos de Saída**
503
+
504
+ ### **Saída de Sucesso:**
505
+
506
+ ```
507
+ 🔄 SINCRONIZAÇÃO COMPLETA
508
+
509
+ ━━━━━━━━━━━━━━━━━━━━━━━━
510
+
511
+ ✅ GIT OPERATIONS:
512
+ ▶ Switched to: develop
513
+ ▶ Pulled latest: 3 new commits
514
+ ▶ Cleaned branch: feature/my-feature
515
+
516
+ 🔗 CLICKUP UPDATED:
517
+ ▶ Task 86abc123: Moved to "Done"
518
+ ▶ Tags updated: +completed, -in-progress
519
+ ▶ Comment added: Sync completed
520
+
521
+ 📁 SESSION STATUS:
522
+ ▶ Session archived: .claude/sessions/archived/[YYYY-MM-DD_HHMM_session-name]/
523
+
524
+ ━━━━━━━━━━━━━━━━━━━━━━━━
525
+
526
+ ⏰ Completed: $(date +'%d/%m/%Y %H:%M') | 🎯 Ready for next task
527
+ ```
528
+
529
+ ### **Tratamento de Erros:**
530
+
531
+ ```
532
+ ⚠️ SYNC ISSUE DETECTED
533
+
534
+ Issue: Uncommitted changes in working directory
535
+ Files: src/app.ts, package.json
536
+
537
+ Solution: Commit or stash changes before sync
538
+ Commands:
539
+ git add .
540
+ git commit -m "WIP: save before sync"
541
+ /git/sync
542
+
543
+ Alternative: Use git stash to temporarily save changes
544
+ ```
545
+
546
+ ### **Orientações Contextuais:**
547
+
548
+ ```
549
+ 💡 SYNC TIPS
550
+
551
+ Current situation: First time using /git/sync
552
+ Recommendation: develop branch will be created from main
553
+
554
+ This follows GitFlow best practices:
555
+ - main: Production-ready code
556
+ - develop: Integration branch for features
557
+ - feature/*: Individual feature branches
558
+
559
+ Next time: /git/sync will use existing develop branch
560
+ ```
561
+
562
+ ---
563
+
564
+ ## 🎨 **Padrões e Convenções**
565
+
566
+ ### **Nomenclatura de Branches:**
567
+
568
+ ```
569
+ feature/<feature-slug> # Features normais
570
+ hotfix/critical-fix # Correções urgentes
571
+ release/v1.2.0 # Preparação de releases
572
+ bugfix/issue-123 # Correções de bugs
573
+ ```
574
+
575
+ ### **Estratégia de Tags ClickUp:**
576
+
577
+ ```
578
+ Adicionadas: completed, synced
579
+ Removidas: in-progress, under-review, needs-fix
580
+ Preservadas: feature, bug, improvement, research
581
+ ```
582
+
583
+ ### **Formato de Comentários:**
584
+
585
+ - **Header**: `✅ TASK CONCLUÍDA - SYNC COMPLETED`
586
+ - **Separador**: `━━━━━━━━━━━━━━━━━━━━━━━━`
587
+ - **Seções**: Git Operations, Development Status, Final Status
588
+ - **Footer**: `⏰ Timestamp | 🤖 Sistema Onion Sync`
589
+
590
+ ### **Estrutura de Arquivamento:**
591
+
592
+ ```
593
+ .claude/sessions/archived/
594
+ ├── [YYYY-MM-DD_HHMM_session-name]/
595
+ │ ├── context.md # Contexto preservado
596
+ │ ├── plan.md # Plano de implementação
597
+ │ ├── notes.md # Notas de desenvolvimento
598
+ │ └── task-86ac06261.md # Link para task ClickUp
599
+ ```
600
+
601
+ ---
602
+
603
+ ## 🚀 **Roadmap Futuro**
604
+
605
+ ### **Versão Atual (1.0)**
606
+
607
+ - ✅ Sync básico com develop/main
608
+ - ✅ ClickUp integration completa
609
+ - ✅ Session management
610
+ - ✅ Error handling robusto
611
+
612
+ ### **Versões Futuras**
613
+
614
+ - **1.1**: Integração com CI/CD pipelines
615
+ - **1.2**: Sync com múltiplas branches simultaneamente
616
+ - **1.3**: Configuração personalizada via `.onion-config`
617
+ - **1.4**: Hooks git para automação adicional
618
+ - **2.0**: Integração com outros sistemas de task (Jira, Linear, etc.)
619
+
620
+ ### **Melhorias Planejadas**
621
+
622
+ - 📈 **Performance**: Cache de operações git para speed up
623
+ - 🔧 **Configurabilidade**: Arquivo de config para branches padrão
624
+ - 🌐 **Multi-repo**: Sync em monorepos com múltiplos projetos
625
+ - 📱 **Notifications**: Integração com Slack/Teams para notificações
626
+
627
+ ---
628
+
629
+ ## 🆘 **Troubleshooting**
630
+
631
+ ### **Problemas Comuns:**
632
+
633
+ #### **"Branch develop não existe"**
634
+
635
+ ```bash
636
+ # Solução automática (comando faz isso)
637
+ git checkout main
638
+ git checkout -b develop
639
+ git push origin develop
640
+ /git/sync
641
+ ```
642
+
643
+ #### **"Mudanças não commitadas"**
644
+
645
+ ```bash
646
+ # Commit temporário
647
+ git add .
648
+ git commit -m "WIP: save before sync"
649
+ /git/sync
650
+
651
+ # Ou usar stash
652
+ git stash push -m "WIP before sync"
653
+ /git/sync
654
+ git stash pop # Para recuperar depois
655
+ ```
656
+
657
+ #### **"ClickUp não atualizou"**
658
+
659
+ - Verifique credenciais ClickUp MCP
660
+ - Operações git continuam normalmente
661
+ - ClickUp pode ser atualizado manualmente depois
662
+
663
+ #### **"Sessão não foi detectada"**
664
+
665
+ - Comando funciona sem sessão
666
+ - ClickUp integration fica limitada
667
+ - Crie sessão com `/product/task` para próximas tasks
668
+
669
+ ### **Logs de Debug:**
670
+
671
+ ```bash
672
+ # Ver logs detalhados
673
+ git reflog --oneline -10 # Últimas 10 operações git
674
+ git log --oneline -5 # Últimos 5 commits
675
+ git status # Estado atual do repo
676
+ ```
677
+
678
+ ---
679
+
680
+ **Sistema Onion Git Commands v1.0**
681
+ **Documentação atualizada**: 22/09/2025 19:18
682
+ **Próxima revisão**: Após implementação completa