@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,780 @@
1
+ # 🔗 Integração ClickUp MCP - Sistema Onion
2
+
3
+ ## 📋 Índice
4
+
5
+ - [Visão Geral](#-visão-geral)
6
+ - [Estratégia Dual de Formatação](#-estratégia-dual-de-formatação)
7
+ - [Formatação de Descriptions](#-formatação-de-descriptions-markdown)
8
+ - [Formatação de Comments](#-formatação-de-comments-unicode)
9
+ - [Bulk Operations](#-bulk-operations)
10
+ - [Hierarquia de Tasks](#-hierarquia-de-tasks)
11
+ - [Checklists Nativos](#-checklists-nativos)
12
+ - [Auto-Update Patterns](#-auto-update-patterns)
13
+ - [Troubleshooting](#-troubleshooting)
14
+ - [Best Practices](#-best-practices)
15
+
16
+ ---
17
+
18
+ ## 🎯 Visão Geral
19
+
20
+ O Sistema Onion integra-se profundamente com o **ClickUp MCP** (Model Context Protocol) para sincronização automática de tasks, subtasks, comments e progresso durante todo o ciclo de desenvolvimento.
21
+
22
+ ### Capacidades Principais
23
+
24
+ - ✅ **Criação de Tasks** com decomposição hierárquica
25
+ - ✅ **Auto-Update** de status e progresso
26
+ - ✅ **Comentários Estruturados** com formatação visual
27
+ - ✅ **Bulk Operations** otimizadas para performance
28
+ - ✅ **Checklists Nativos** para tracking interativo
29
+ - ✅ **Phase-Subtask Mapping** automático
30
+
31
+ ---
32
+
33
+ ## 🎨 Estratégia Dual de Formatação
34
+
35
+ O Sistema Onion usa **duas estratégias distintas** de formatação dependendo do contexto:
36
+
37
+ ### 📋 Task Descriptions (markdown_description)
38
+
39
+ **Quando:** Criar ou atualizar descrições de tasks/subtasks
40
+ **Formato:** Markdown nativo do ClickUp
41
+ **Comandos:** `create_task`, `update_task`
42
+
43
+ ### 💬 Task Comments (commentText)
44
+
45
+ **Quando:** Adicionar comentários de progresso ou status
46
+ **Formato:** Formatação visual Unicode
47
+ **Comandos:** `create_task_comment`
48
+
49
+ ---
50
+
51
+ ## 📋 Formatação de Descriptions (Markdown)
52
+
53
+ ### Quando Usar
54
+
55
+ - Descrições de tasks principais
56
+ - Descrições de subtasks
57
+ - Action items em descrição markdown
58
+ - Documentação técnica na task
59
+
60
+ ### Sintaxe Suportada
61
+
62
+ #### Headers
63
+
64
+ ```markdown
65
+ # Header 1
66
+
67
+ ## Header 2
68
+
69
+ ### Header 3
70
+ ```
71
+
72
+ #### Listas
73
+
74
+ ```markdown
75
+ - Item não ordenado
76
+ - Outro item
77
+ - Sub-item
78
+
79
+ 1. Item ordenado
80
+ 2. Segundo item
81
+ ```
82
+
83
+ #### Tabelas
84
+
85
+ ```markdown
86
+ | Coluna 1 | Coluna 2 | Coluna 3 |
87
+ | -------- | -------- | -------- |
88
+ | Valor 1 | Valor 2 | Valor 3 |
89
+ | Valor 4 | Valor 5 | Valor 6 |
90
+ ```
91
+
92
+ #### Formatação de Texto
93
+
94
+ ```markdown
95
+ **Negrito**
96
+ _Itálico_
97
+ `Código inline`
98
+ [Link](https://example.com)
99
+ ```
100
+
101
+ #### Code Blocks
102
+
103
+ ````markdown
104
+ ```python
105
+ def hello_world():
106
+ print("Hello, World!")
107
+ ```
108
+ ````
109
+
110
+ #### Checkboxes (Action Items)
111
+
112
+ ```markdown
113
+ - [ ] Action item não completado
114
+ - [x] Action item completado
115
+ ```
116
+
117
+ ### Exemplo Completo de Description
118
+
119
+ ```markdown
120
+ ## 🎯 Objetivo
121
+
122
+ Implementar autenticação JWT com refresh tokens para melhorar segurança.
123
+
124
+ ## 📚 Contexto Técnico
125
+
126
+ Sistema atual usa sessões server-side. Migração para JWT permite:
127
+
128
+ - Stateless authentication
129
+ - Melhor escalabilidade
130
+ - Suporte a mobile apps
131
+
132
+ ## 🏗️ Arquitetura
133
+
134
+ ### Componentes Afetados
135
+
136
+ | Componente | Mudança | Impacto |
137
+ | ------------ | ------------------------ | ------- |
138
+ | Auth Service | Adicionar JWT | Alto |
139
+ | API Gateway | Validar tokens | Médio |
140
+ | Database | Armazenar refresh tokens | Baixo |
141
+
142
+ ### Stack Tecnológico
143
+
144
+ - **JWT**: jsonwebtoken v9.0.0
145
+ - **Crypto**: bcrypt v5.1.0
146
+ - **Storage**: Redis para refresh tokens
147
+
148
+ ## ✅ Critérios de Aceitação
149
+
150
+ - [ ] Usuário pode fazer login e receber JWT
151
+ - [ ] Token expira após 15 minutos
152
+ - [ ] Refresh token permite renovação
153
+ - [ ] Logout invalida refresh token
154
+ - [ ] Testes de segurança passam
155
+
156
+ ## 🧪 Estratégia de Testes
157
+
158
+ - Unit tests para geração de tokens
159
+ - Integration tests para fluxo completo
160
+ - Security tests para vulnerabilidades
161
+ ```
162
+
163
+ ---
164
+
165
+ ## 💬 Formatação de Comments (Unicode)
166
+
167
+ ### Quando Usar
168
+
169
+ - Comentários de progresso
170
+ - Updates de status
171
+ - Início/fim de desenvolvimento
172
+ - Conclusão de fases
173
+ - Notificações de PR
174
+
175
+ ### Caracteres Unicode Permitidos
176
+
177
+ #### Separadores
178
+
179
+ ```
180
+ ━━━━━━━━━━━━━━━━━━━━━━━━ (linha horizontal)
181
+ ```
182
+
183
+ #### Bullets e Marcadores
184
+
185
+ ```
186
+ ▶ (seta para direita - itens principais)
187
+ ∟ (canto - sub-itens)
188
+ ◆ (diamante - destaque)
189
+ ✅ (check verde - concluído)
190
+ ⏰ (relógio - timestamp)
191
+ 🎯 (alvo - próxima ação)
192
+ ```
193
+
194
+ #### Emojis de Status
195
+
196
+ ```
197
+ 🚀 (foguete - início/lançamento)
198
+ 🔧 (ferramenta - trabalho em progresso)
199
+ 📋 (clipboard - lista/plano)
200
+ 🏗️ (construção - arquitetura)
201
+ ✅ (check - concluído)
202
+ ⚠️ (aviso - atenção)
203
+ ```
204
+
205
+ ### Template de Comentário de Início
206
+
207
+ ```
208
+ 🚀 DESENVOLVIMENTO INICIADO
209
+
210
+ ━━━━━━━━━━━━━━━━━━━━━━━━
211
+
212
+ 🏗️ SESSÃO ATIVADA:
213
+ ▶ Branch: feature/jwt-authentication
214
+ ▶ Sessão: .claude/sessions/jwt-authentication/
215
+ ▶ Arquitetura: Definida e validada ✅
216
+
217
+ 📋 PLANO DE IMPLEMENTAÇÃO:
218
+ ∟ Fase 1: Backend JWT Service (4-6h)
219
+ ∟ Fase 2: API Integration (3-4h)
220
+ ∟ Fase 3: Frontend Integration (2-3h)
221
+ ∟ Fase 4: Testing & Security (2-3h)
222
+
223
+ 🎯 STACK TECNOLÓGICO:
224
+ ∟ jsonwebtoken v9.0.0
225
+ ∟ bcrypt v5.1.0
226
+ ∟ Redis para refresh tokens
227
+
228
+ 🔧 DECISÕES ARQUITETURAIS:
229
+ ∟ JWT em Authorization header (Bearer)
230
+ ∟ Refresh tokens em httpOnly cookies
231
+ ∟ Redis para blacklist de tokens
232
+ ∟ Rotação automática de refresh tokens
233
+
234
+ ━━━━━━━━━━━━━━━━━━━━━━━━
235
+
236
+ ⏰ Iniciado: 2025-01-27 10:30 | 🎯 Próximo: Implementar Fase 1
237
+ ```
238
+
239
+ ### Template de Comentário de Progresso
240
+
241
+ ```
242
+ 🔧 PROGRESSO DE DESENVOLVIMENTO
243
+
244
+ ━━━━━━━━━━━━━━━━━━━━━━━━
245
+
246
+ 📋 FASE COMPLETADA:
247
+ ▶ Fase 1: Backend JWT Service
248
+ ▶ Arquivos modificados: 8 arquivos
249
+ ▶ Funcionalidades: Token generation, validation, refresh
250
+ ▶ Testes: 15 unit tests, 5 integration tests ✅
251
+
252
+ ✅ DECISÕES TÉCNICAS:
253
+ ∟ Usamos RS256 (assimétrico) para melhor segurança
254
+ ∟ Tokens armazenados em Redis com TTL automático
255
+ ∟ Implementado rate limiting em refresh endpoint
256
+ ∟ Adicionado logging de eventos de autenticação
257
+
258
+ 🚀 PRÓXIMA FASE:
259
+ ▶ Fase 2: API Integration
260
+ ▶ Estimativa: 3-4 horas
261
+ ▶ Bloqueadores: Nenhum
262
+
263
+ 📊 PROGRESSO GERAL: 25% completo (1/4 fases)
264
+
265
+ ━━━━━━━━━━━━━━━━━━━━━━━━
266
+
267
+ ⏰ Atualização: 2025-01-27 15:45 | 🎯 Próximo: Integrar com API Gateway
268
+ ```
269
+
270
+ ### Template de Comentário de PR
271
+
272
+ ```
273
+ 🚀 PULL REQUEST CREATED
274
+
275
+ ━━━━━━━━━━━━━━━━━━━━━━━━
276
+
277
+ 📋 CHANGES IMPLEMENTED:
278
+ ∟ JWT authentication service completo
279
+ ∟ Refresh token mechanism
280
+ ∟ Redis integration para token storage
281
+ ∟ Security middleware para API routes
282
+ ∟ Comprehensive test suite ✅
283
+
284
+ 🔗 REVIEW DETAILS:
285
+ ▶ PR: https://github.com/org/repo/pull/123
286
+ ▶ Branch: feature/jwt-authentication
287
+ ▶ Status: Ready for review
288
+ ▶ Tests: All passing (45/45) ✅
289
+
290
+ ✅ CHECKLIST:
291
+ ◆ Code committed and pushed ✅
292
+ ◆ Tests passing ✅
293
+ ◆ Documentation updated ✅
294
+ ◆ Task moved to "in progress" ✅
295
+ ◆ Tag "under-review" added ✅
296
+
297
+ 🤖 GITFLOW INTEGRATION:
298
+ ∟ Auto-sync scheduled pós-merge
299
+ ∟ GitFlow analysis will optimize cleanup
300
+ ∟ Session archiving automático
301
+ ∟ Performance-optimized operations
302
+
303
+ ━━━━━━━━━━━━━━━━━━━━━━━━
304
+
305
+ ⏰ Created: 2025-01-27 18:30 | 🎯 Next: Code review, merge, auto-sync
306
+ ```
307
+
308
+ ---
309
+
310
+ ## ⚡ Bulk Operations
311
+
312
+ ### Quando Usar
313
+
314
+ - Criar múltiplas subtasks de uma vez
315
+ - Atualizar status de várias tasks
316
+ - Operações em lote para performance
317
+
318
+ ### Limitações Importantes
319
+
320
+ #### ❌ NÃO usar `create_bulk_tasks` para hierarquia
321
+
322
+ ```javascript
323
+ // ERRADO - não suporta parent parameter
324
+ const subtasks = await create_bulk_tasks({
325
+ tasks: [
326
+ { name: 'Subtask 1', parent: mainTaskId }, // ❌ parent ignorado!
327
+ { name: 'Subtask 2', parent: mainTaskId },
328
+ ],
329
+ });
330
+ ```
331
+
332
+ #### ✅ Usar `create_task` sequencial para hierarquia
333
+
334
+ ```javascript
335
+ // CORRETO - cria hierarquia apropriada
336
+ // 1. Criar task principal
337
+ const mainTask = await create_task({
338
+ name: '🎯 Feature Principal',
339
+ listId: '901314121395',
340
+ description: 'Descrição completa...',
341
+ });
342
+
343
+ // 2. Criar subtasks com parent
344
+ const subtask1 = await create_task({
345
+ name: '🔧 Subtask 1',
346
+ listId: '901314121395',
347
+ parent: mainTask.id, // ✅ Hierarquia correta
348
+ description: '...',
349
+ });
350
+
351
+ const subtask2 = await create_task({
352
+ name: '🔧 Subtask 2',
353
+ listId: '901314121395',
354
+ parent: mainTask.id, // ✅ Hierarquia correta
355
+ description: '...',
356
+ });
357
+ ```
358
+
359
+ ### Quando usar `create_bulk_tasks`
360
+
361
+ ✅ **Bom para:** Criar múltiplas tasks independentes no mesmo nível
362
+ ❌ **Ruim para:** Criar hierarquia (task → subtasks)
363
+
364
+ ---
365
+
366
+ ## 🏗️ Hierarquia de Tasks
367
+
368
+ ### Estrutura de 3 Níveis
369
+
370
+ ```
371
+ 📋 TASK (Objetivo de Alto Nível)
372
+ ├── 🔧 Subtask 1 (Componente Funcional)
373
+ │ ├── ✅ Checklist Item 1.1 (Ação Específica)
374
+ │ ├── ✅ Checklist Item 1.2
375
+ │ └── ✅ Checklist Item 1.3
376
+ └── 🔧 Subtask 2 (Componente Funcional)
377
+ ├── ✅ Checklist Item 2.1
378
+ └── ✅ Checklist Item 2.2
379
+ ```
380
+
381
+ ### Implementação Correta
382
+
383
+ ```javascript
384
+ // PASSO 1: Criar Task Principal
385
+ const mainTask = await mcp_clickup_create_task({
386
+ name: '🎯 Implementar Autenticação JWT',
387
+ listId: '901314121395',
388
+ markdown_description: `
389
+ ## 🎯 Objetivo
390
+ Implementar autenticação JWT completa...
391
+
392
+ ## ✅ Critérios de Aceitação
393
+ - [ ] Login retorna JWT válido
394
+ - [ ] Refresh token funciona
395
+ - [ ] Logout invalida tokens
396
+ `,
397
+ tags: ['feature', 'security'],
398
+ priority: 'high',
399
+ });
400
+
401
+ // PASSO 2: Criar Subtasks com Parent
402
+ const subtask1 = await mcp_clickup_create_task({
403
+ name: '🔧 Backend JWT Service',
404
+ listId: '901314121395',
405
+ parent: mainTask.id, // ← CRITICAL
406
+ markdown_description: `
407
+ ## Objetivos
408
+ - Implementar geração de JWT
409
+ - Implementar validação de tokens
410
+ - Implementar refresh mechanism
411
+ `,
412
+ tags: ['subtask', 'backend'],
413
+ });
414
+
415
+ const subtask2 = await mcp_clickup_create_task({
416
+ name: '🔧 Frontend Integration',
417
+ listId: '901314121395',
418
+ parent: mainTask.id, // ← CRITICAL
419
+ markdown_description: `
420
+ ## Objetivos
421
+ - Integrar login com JWT
422
+ - Implementar token storage
423
+ - Implementar auto-refresh
424
+ `,
425
+ tags: ['subtask', 'frontend'],
426
+ });
427
+
428
+ // PASSO 3: Adicionar Comentário de Setup
429
+ await mcp_clickup_create_task_comment({
430
+ task_id: mainTask.id,
431
+ comment_text: `
432
+ 🚀 TASK SETUP COMPLETO
433
+
434
+ ━━━━━━━━━━━━━━━━━━━━━━━━
435
+
436
+ 📊 ESTRUTURA CRIADA:
437
+ ▶ Task Principal: ${mainTask.id}
438
+ ▶ Subtasks: 2 componentes funcionais
439
+ ▶ Total Estimate: 13-17 horas
440
+
441
+ 🏗️ AMBIENTE PREPARADO:
442
+ ▶ Branch: feature/jwt-authentication ✅
443
+ ▶ Session: .claude/sessions/jwt-authentication/ ✅
444
+ ▶ Docs: Architecture + Implementation ✅
445
+
446
+ ━━━━━━━━━━━━━━━━━━━━━━━━
447
+
448
+ ⏰ Created: ${new Date().toISOString()} | 🎯 Next: /engineer/start
449
+ `,
450
+ });
451
+ ```
452
+
453
+ ---
454
+
455
+ ## ✅ Checklists Nativos
456
+
457
+ ### Visão Geral
458
+
459
+ O ClickUp suporta **checklists nativos** que são diferentes de checkboxes em markdown. Checklists nativos oferecem:
460
+
461
+ - ✅ Tracking interativo (resolved/unresolved)
462
+ - ✅ Progresso visual automático
463
+ - ✅ Notificações de conclusão
464
+ - ✅ API para leitura de status
465
+
466
+ ### Estrutura Híbrida
467
+
468
+ O Sistema Onion suporta **estrutura híbrida**:
469
+
470
+ 1. **Markdown checkboxes** na descrição (documentação)
471
+ 2. **Checklists nativos** para tracking interativo
472
+
473
+ ### Leitura de Checklists
474
+
475
+ ```javascript
476
+ // Ler task com checklists
477
+ const task = await mcp_clickup_get_task({
478
+ task_id: '86acu8pdk',
479
+ subtasks: true, // Incluir subtasks e seus checklists
480
+ });
481
+
482
+ // Analisar checklists
483
+ task.checklists.forEach((checklist) => {
484
+ console.log(`Checklist: ${checklist.name}`);
485
+ console.log(
486
+ `Progress: ${checklist.resolved}/${checklist.unresolved + checklist.resolved}`,
487
+ );
488
+
489
+ checklist.items.forEach((item) => {
490
+ console.log(` ${item.resolved ? '✅' : '⬜'} ${item.name}`);
491
+ });
492
+ });
493
+ ```
494
+
495
+ ### Monitoramento de Progresso
496
+
497
+ ```javascript
498
+ // Calcular progresso baseado em checklists
499
+ function calculateProgress(task) {
500
+ let totalItems = 0;
501
+ let resolvedItems = 0;
502
+
503
+ task.checklists.forEach((checklist) => {
504
+ totalItems += checklist.unresolved + checklist.resolved;
505
+ resolvedItems += checklist.resolved;
506
+ });
507
+
508
+ return totalItems > 0 ? ((resolvedItems / totalItems) * 100).toFixed(1) : 0;
509
+ }
510
+
511
+ const progress = calculateProgress(task);
512
+ console.log(`Progresso: ${progress}%`);
513
+ ```
514
+
515
+ ---
516
+
517
+ ## 🔄 Auto-Update Patterns
518
+
519
+ ### Pattern 1: Início de Desenvolvimento (`/engineer/start`)
520
+
521
+ ```javascript
522
+ // 1. Ler task do ClickUp
523
+ const task = await mcp_clickup_get_task({
524
+ task_id: taskId,
525
+ subtasks: true,
526
+ });
527
+
528
+ // 2. Atualizar status
529
+ await mcp_clickup_update_task({
530
+ task_id: taskId,
531
+ status: 'in progress',
532
+ });
533
+
534
+ // 3. Adicionar comentário de início
535
+ await mcp_clickup_create_task_comment({
536
+ task_id: taskId,
537
+ comment_text: `🚀 DESENVOLVIMENTO INICIADO...`,
538
+ });
539
+
540
+ // 4. Criar mapeamento fase→subtask no context.md
541
+ const mapping = {
542
+ 'Phase 1': task.subtasks[0].id,
543
+ 'Phase 2': task.subtasks[1].id,
544
+ 'Phase 3': task.subtasks[2].id,
545
+ };
546
+ ```
547
+
548
+ ### Pattern 2: Progresso de Fase (`/engineer/work`)
549
+
550
+ ```javascript
551
+ // 1. Ler mapeamento do context.md
552
+ const phaseMapping = readPhaseMapping();
553
+
554
+ // 2. Identificar subtask correspondente
555
+ const subtaskId = phaseMapping[currentPhase];
556
+
557
+ // 3. Atualizar status da subtask
558
+ await mcp_clickup_update_task({
559
+ task_id: subtaskId,
560
+ status: 'done',
561
+ });
562
+
563
+ // 4. Adicionar comentário de progresso
564
+ await mcp_clickup_create_task_comment({
565
+ task_id: mainTaskId,
566
+ comment_text: `🔧 PROGRESSO DE DESENVOLVIMENTO...`,
567
+ });
568
+
569
+ // 5. Atualizar plan.md
570
+ updatePlanMd(currentPhase, 'completed');
571
+ ```
572
+
573
+ ### Pattern 3: Pull Request (`/engineer/pr`)
574
+
575
+ ```javascript
576
+ // 1. Atualizar status
577
+ await mcp_clickup_update_task({
578
+ task_id: taskId,
579
+ status: 'in progress',
580
+ tags: [...existingTags, 'under-review'],
581
+ });
582
+
583
+ // 2. Adicionar comentário de PR
584
+ await mcp_clickup_create_task_comment({
585
+ task_id: taskId,
586
+ comment_text: `🚀 PULL REQUEST CREATED...`,
587
+ });
588
+ ```
589
+
590
+ ### Pattern 4: Conclusão (`/git/sync`)
591
+
592
+ ```javascript
593
+ // 1. Atualizar status final
594
+ await mcp_clickup_update_task({
595
+ task_id: taskId,
596
+ status: 'done',
597
+ });
598
+
599
+ // 2. Adicionar comentário de conclusão
600
+ await mcp_clickup_create_task_comment({
601
+ task_id: taskId,
602
+ comment_text: `✅ FEATURE CONCLUÍDA E MERGED...`,
603
+ });
604
+ ```
605
+
606
+ ---
607
+
608
+ ## 🔧 Troubleshooting
609
+
610
+ ### Problema: Hierarquia não criada corretamente
611
+
612
+ **Sintoma:** Subtasks aparecem como tasks independentes
613
+
614
+ **Causa:** Uso de `create_bulk_tasks` com `parent` parameter
615
+
616
+ **Solução:**
617
+
618
+ ```javascript
619
+ // ❌ ERRADO
620
+ await create_bulk_tasks({
621
+ tasks: [
622
+ { name: 'Sub 1', parent: mainId },
623
+ { name: 'Sub 2', parent: mainId },
624
+ ],
625
+ });
626
+
627
+ // ✅ CORRETO
628
+ const sub1 = await create_task({
629
+ name: 'Sub 1',
630
+ parent: mainId,
631
+ });
632
+ const sub2 = await create_task({
633
+ name: 'Sub 2',
634
+ parent: mainId,
635
+ });
636
+ ```
637
+
638
+ ---
639
+
640
+ ### Problema: Formatação quebrada em comments
641
+
642
+ **Sintoma:** Comentários aparecem com formatação estranha
643
+
644
+ **Causa:** Uso de markdown em vez de Unicode
645
+
646
+ **Solução:**
647
+
648
+ ```javascript
649
+ // ❌ ERRADO - markdown em comments
650
+ comment_text: `
651
+ ## Header
652
+ **Bold text**
653
+ - List item
654
+ `;
655
+
656
+ // ✅ CORRETO - Unicode visual
657
+ comment_text: `
658
+ 🚀 TÍTULO
659
+
660
+ ━━━━━━━━━━━━━━━━━━
661
+
662
+ 📋 SEÇÃO:
663
+ ▶ Item principal
664
+ ∟ Sub-item
665
+ `;
666
+ ```
667
+
668
+ ---
669
+
670
+ ### Problema: Auto-update não funciona
671
+
672
+ **Sintoma:** Status não atualiza automaticamente
673
+
674
+ **Diagnóstico:**
675
+
676
+ 1. Verificar se `context.md` tem task-id correto
677
+ 2. Verificar se mapeamento fase→subtask existe
678
+ 3. Verificar permissões da API key
679
+
680
+ **Solução:**
681
+
682
+ ```bash
683
+ # 1. Verificar context.md
684
+ cat .claude/sessions/<feature-slug>/context.md | grep "Task ID"
685
+
686
+ # 2. Validar mapeamento
687
+ /engineer/validate-phase-sync
688
+
689
+ # 3. Testar conexão ClickUp
690
+ # (usar comando de teste do MCP)
691
+ ```
692
+
693
+ ---
694
+
695
+ ### Problema: Checklists não aparecem
696
+
697
+ **Sintoma:** Checklists nativos não são lidos
698
+
699
+ **Causa:** Não usar `subtasks: true` no `get_task`
700
+
701
+ **Solução:**
702
+
703
+ ```javascript
704
+ // ❌ ERRADO
705
+ const task = await get_task({ task_id: id });
706
+
707
+ // ✅ CORRETO
708
+ const task = await get_task({
709
+ task_id: id,
710
+ subtasks: true, // ← Inclui checklists
711
+ });
712
+ ```
713
+
714
+ ---
715
+
716
+ ## 💡 Best Practices
717
+
718
+ ### 1. Sempre use hierarquia correta
719
+
720
+ ```javascript
721
+ // Sequência obrigatória:
722
+ // 1. Task principal
723
+ // 2. Subtasks com parent
724
+ // 3. Comentário de setup
725
+ ```
726
+
727
+ ### 2. Formatação apropriada por contexto
728
+
729
+ ```javascript
730
+ // Descriptions: Markdown nativo
731
+ markdown_description: '## Header\n- List';
732
+
733
+ // Comments: Unicode visual
734
+ comment_text: '🚀 TÍTULO\n━━━━━━━━';
735
+ ```
736
+
737
+ ### 3. Sempre incluir timestamps
738
+
739
+ ```javascript
740
+ comment_text: `
741
+ ...
742
+ ⏰ ${new Date().toISOString()} | 🎯 Next: ...
743
+ `;
744
+ ```
745
+
746
+ ### 4. Mapeamento fase→subtask obrigatório
747
+
748
+ ```markdown
749
+ ## 📋 Phase-Subtask Mapping
750
+
751
+ - **Phase 1**: Backend → Subtask ID: 86acu8peq
752
+ - **Phase 2**: Frontend → Subtask ID: 86acu8pew
753
+ ```
754
+
755
+ ### 5. Validar estrutura após criação
756
+
757
+ ```javascript
758
+ const task = await get_task({
759
+ task_id: mainTaskId,
760
+ subtasks: true,
761
+ });
762
+
763
+ console.log(`Subtasks: ${task.subtasks.length}`);
764
+ // Esperado: >= 2
765
+ ```
766
+
767
+ ---
768
+
769
+ ## 🔗 Documentos Relacionados
770
+
771
+ - [Guia de Comandos](./commands-guide.md) - Comandos que usam ClickUp
772
+ - [Fluxos de Engenharia](./engineering-flows.md) - Workflows com ClickUp
773
+ - [Exemplos Práticos](./practical-examples.md) - Casos de uso reais
774
+ - [Configuração Inicial](./getting-started.md) - Setup do ClickUp MCP
775
+
776
+ ---
777
+
778
+ **Última atualização:** 2025-01-27
779
+ **Versão:** 2.0
780
+ **ClickUp MCP:** Integração completa