@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,528 @@
1
+ # 🔄 Estratégia Dual de Comentários - Task vs Subtask
2
+
3
+ ## 🎯 Objetivo
4
+
5
+ Manter **contexto técnico detalhado nas subtasks** e **resumo executivo na task principal**, garantindo rastreabilidade completa e comunicação eficiente para diferentes audiências.
6
+
7
+ ---
8
+
9
+ ## 📋 Problema Identificado
10
+
11
+ ### Comportamento Anterior (❌ Incorreto):
12
+
13
+ ```
14
+ 📋 Task Principal (ID: 123)
15
+ └── 💬 Comentário detalhado aqui (na task principal)
16
+ - Arquivos modificados
17
+ - Decisões técnicas
18
+ - Testes implementados
19
+
20
+ ├── 🔧 Subtask 1: Backend Implementation (ID: 456)
21
+ │ └── (Sem comentário) ❌
22
+ ```
23
+
24
+ **Problemas:**
25
+
26
+ - ❌ Contexto técnico perdido na task principal
27
+ - ❌ Subtask não tem histórico de implementação
28
+ - ❌ Difícil rastrear decisões específicas por componente
29
+ - ❌ Product Owners veem detalhes técnicos desnecessários
30
+
31
+ ---
32
+
33
+ ## ✅ Solução Implementada
34
+
35
+ ### Comportamento Correto:
36
+
37
+ ```
38
+ 📋 Task Principal (ID: 123)
39
+ └── 💬 Comentário RESUMIDO (nota executiva)
40
+ "✅ Fase 1/4 completada - Backend Implementation
41
+ 🎯 Próximo: Fase 2 - Frontend Integration"
42
+
43
+ ├── 🔧 Subtask 1: Backend Implementation (ID: 456)
44
+ │ └── 💬 Comentário DETALHADO (técnico completo)
45
+ │ - Arquivos modificados: 15 arquivos
46
+ │ - Decisões técnicas: JWT, bcrypt, etc
47
+ │ - Testes: 20 testes, 95% cobertura
48
+ │ - Status: Done ✅
49
+ ```
50
+
51
+ **Benefícios:**
52
+
53
+ - ✅ Contexto técnico preservado na subtask
54
+ - ✅ Visão executiva clara na task principal
55
+ - ✅ Rastreabilidade completa por componente
56
+ - ✅ Comunicação eficiente para diferentes audiências
57
+
58
+ ---
59
+
60
+ ## 📚 Quando Usar Cada Tipo
61
+
62
+ ### 💬 Comentário DETALHADO (Subtask)
63
+
64
+ **Quando:**
65
+
66
+ - Fase/componente específico completado
67
+ - Implementação técnica realizada
68
+ - Decisões de arquitetura tomadas
69
+ - Testes adicionados
70
+ - Refatoração executada
71
+
72
+ **Audiência:**
73
+
74
+ - Desenvolvedores
75
+ - Tech Leads
76
+ - Code Reviewers
77
+
78
+ **Conteúdo:**
79
+
80
+ - Arquivos modificados (lista completa)
81
+ - Implementações realizadas (detalhes técnicos)
82
+ - Testes adicionados (cobertura, arquivos)
83
+ - Decisões técnicas (justificativas)
84
+ - Próximos passos (ações específicas)
85
+
86
+ ---
87
+
88
+ ### 📝 Comentário RESUMIDO (Task Principal)
89
+
90
+ **Quando:**
91
+
92
+ - Progresso geral da feature
93
+ - Milestone alcançado
94
+ - Status update executivo
95
+ - Mudança de fase
96
+
97
+ **Audiência:**
98
+
99
+ - Product Owners
100
+ - Stakeholders
101
+ - Project Managers
102
+
103
+ **Conteúdo:**
104
+
105
+ - Fase completada (número e nome)
106
+ - Link para subtask (onde estão os detalhes)
107
+ - Próxima fase (o que vem a seguir)
108
+ - Timestamp
109
+
110
+ ---
111
+
112
+ ## 🔧 Templates de Implementação
113
+
114
+ ### Template 1: Comentário DETALHADO (Subtask)
115
+
116
+ ```typescript
117
+ const detailedComment = `🔧 FASE COMPLETADA: ${phaseName}
118
+
119
+ ━━━━━━━━━━━━━━━━
120
+
121
+ 📁 ARQUIVOS MODIFICADOS:
122
+ ∟ ${file1}
123
+ ∟ ${file2}
124
+ ∟ ${file3}
125
+ ${moreFiles ? `∟ ... e mais ${moreFiles.length} arquivos` : ''}
126
+
127
+ 🔧 IMPLEMENTAÇÕES:
128
+ ▶ ${implementation1}
129
+ ▶ ${implementation2}
130
+ ▶ ${implementation3}
131
+
132
+ ✅ TESTES ADICIONADOS:
133
+ ∟ ${testFile1} (${testCount1} testes)
134
+ ∟ ${testFile2} (${testCount2} testes)
135
+ ∟ Cobertura: ${coverage}%
136
+
137
+ 💡 DECISÕES TÉCNICAS:
138
+ ∟ ${decision1}
139
+ ∟ ${decision2}
140
+ ∟ ${decision3}
141
+
142
+ 🚀 PRÓXIMOS PASSOS:
143
+ ∟ ${nextPhase}
144
+ ∟ ${nextAction1}
145
+ ∟ ${nextAction2}
146
+
147
+ ━━━━━━━━━━━━━━━━
148
+
149
+ ⏰ Completado: ${timestamp} | 🎯 Status: Done`;
150
+ ```
151
+
152
+ ### Template 2: Comentário RESUMIDO (Task Principal)
153
+
154
+ ```typescript
155
+ const summaryComment = `📝 PROGRESSO: Fase ${phaseNum}/${totalPhases} Completada
156
+
157
+ ✅ ${phaseName} - Concluída
158
+ ∟ Subtask: #${subtaskId}
159
+ ∟ Detalhes: Ver comentário na subtask
160
+
161
+ 🎯 Próximo: Fase ${nextPhaseNum} - ${nextPhaseName}
162
+
163
+ ⏰ ${timestamp}`;
164
+ ```
165
+
166
+ ---
167
+
168
+ ## 📊 Fluxo de Atualização
169
+
170
+ ### Sequência Correta:
171
+
172
+ ```typescript
173
+ // 1. Comentário DETALHADO na SUBTASK
174
+ await mcp_clickup_create_task_comment({
175
+ task_id: subtaskId,
176
+ workspace_id: workspaceId,
177
+ comment_text: generateDetailedComment({
178
+ phaseName,
179
+ filesModified,
180
+ implementations,
181
+ tests,
182
+ decisions,
183
+ nextSteps,
184
+ }),
185
+ });
186
+
187
+ // 2. Atualizar STATUS da SUBTASK
188
+ await mcp_clickup_update_task({
189
+ task_id: subtaskId,
190
+ workspace_id: workspaceId,
191
+ status: 'Done',
192
+ });
193
+
194
+ // 3. Comentário RESUMIDO na TASK PRINCIPAL
195
+ await mcp_clickup_create_task_comment({
196
+ task_id: mainTaskId,
197
+ workspace_id: workspaceId,
198
+ comment_text: generateSummaryComment({
199
+ phaseNum,
200
+ totalPhases,
201
+ phaseName,
202
+ subtaskId,
203
+ nextPhaseNum,
204
+ nextPhaseName,
205
+ }),
206
+ });
207
+ ```
208
+
209
+ ---
210
+
211
+ ## 🗺️ Mapeamento Fase → Subtask
212
+
213
+ ### Estrutura Necessária no `context.md`:
214
+
215
+ ```markdown
216
+ ## 🗺️ Phase → Subtask Mapping
217
+
218
+ **Main Task ID**: 86abc000
219
+
220
+ | Fase | Subtask ID | Subtask Name | Status |
221
+ | ---- | ---------- | ---------------------- | ----------- |
222
+ | 1 | 86abc123 | Backend Implementation | done |
223
+ | 2 | 86abc124 | Frontend Integration | in progress |
224
+ | 3 | 86abc125 | Testing & QA | to do |
225
+ | 4 | 86abc126 | Documentation | to do |
226
+ ```
227
+
228
+ ### Como Usar no Código:
229
+
230
+ ```typescript
231
+ // Ler mapeamento do context.md
232
+ const mapping = parsePhaseSubtaskMapping(contextMd);
233
+
234
+ // Obter subtask da fase atual
235
+ const currentPhase = identifyCurrentPhase(planMd);
236
+ const subtaskInfo = mapping[currentPhase];
237
+
238
+ // Usar IDs corretos
239
+ const subtaskId = subtaskInfo.subtaskId;
240
+ const mainTaskId = mapping.mainTaskId;
241
+ ```
242
+
243
+ ---
244
+
245
+ ## 📝 Comandos Afetados
246
+
247
+ ### 1. `/engineer/work` (CRÍTICO)
248
+
249
+ **Mudança:**
250
+
251
+ - ❌ Antes: Comentário na task principal
252
+ - ✅ Depois: Comentário detalhado na subtask + resumo na task principal
253
+
254
+ **Implementação:**
255
+
256
+ ```typescript
257
+ // Ao completar fase
258
+ await updateSubtaskWithDetails(subtaskId, phaseDetails);
259
+ await updateMainTaskWithSummary(mainTaskId, phaseSummary);
260
+ ```
261
+
262
+ ---
263
+
264
+ ### 2. `/engineer/start` (Opcional)
265
+
266
+ **Mudança:**
267
+
268
+ - Comentário inicial pode ir na task principal (é setup, não implementação)
269
+ - Se houver subtasks pré-criadas, adicionar comentário de início em cada uma
270
+
271
+ **Implementação:**
272
+
273
+ ```typescript
274
+ // Comentário de início na task principal
275
+ await create_task_comment({
276
+ task_id: mainTaskId,
277
+ comment_text: `🚀 DESENVOLVIMENTO INICIADO
278
+
279
+ ━━━━━━━━━━━━━━━━━━━━━━━━
280
+
281
+ 🏗️ SESSÃO ATIVADA:
282
+ ▶ Branch: ${branch}
283
+ ▶ Sessão: ${sessionPath}
284
+ ▶ Arquitetura: Definida
285
+
286
+ 📋 PLANO: ${totalPhases} fases
287
+
288
+ ━━━━━━━━━━━━━━━━━━━━━━━━
289
+
290
+ ⏰ ${timestamp}`,
291
+ });
292
+ ```
293
+
294
+ ---
295
+
296
+ ### 3. `/engineer/pr` (Manter Atual)
297
+
298
+ **Comportamento:**
299
+
300
+ - Comentário vai na task principal (é ação global da feature)
301
+ - Não precisa mudar
302
+
303
+ ---
304
+
305
+ ### 4. `/product/task-check` (Novo Comportamento)
306
+
307
+ **Mudança:**
308
+
309
+ - Verificação de subtask → comentário na subtask
310
+ - Resumo geral → comentário na task principal
311
+
312
+ ---
313
+
314
+ ## 🎨 Exemplos Práticos
315
+
316
+ ### Exemplo 1: Completar Fase de Backend
317
+
318
+ **Subtask (86abc123) - Comentário Detalhado:**
319
+
320
+ ```
321
+ 🔧 FASE COMPLETADA: Backend Implementation
322
+
323
+ ━━━━━━━━━━━━━━━━
324
+
325
+ 📁 ARQUIVOS MODIFICADOS:
326
+ ∟ src/services/auth.service.ts
327
+ ∟ src/controllers/auth.controller.ts
328
+ ∟ src/middleware/jwt.middleware.ts
329
+ ∟ src/models/user.model.ts
330
+ ∟ src/routes/auth.routes.ts
331
+
332
+ 🔧 IMPLEMENTAÇÕES:
333
+ ▶ JWT generation e validation
334
+ ▶ Refresh token mechanism
335
+ ▶ Password hashing com bcrypt
336
+ ▶ Error handling e logging
337
+ ▶ Rate limiting para endpoints
338
+
339
+ ✅ TESTES ADICIONADOS:
340
+ ∟ auth.service.spec.ts (12 testes)
341
+ ∟ auth.controller.spec.ts (8 testes)
342
+ ∟ jwt.middleware.spec.ts (6 testes)
343
+ ∟ Cobertura: 95%
344
+
345
+ 💡 DECISÕES TÉCNICAS:
346
+ ∟ Usamos jsonwebtoken v9.0.0 (mais recente)
347
+ ∟ Access token: 15min, Refresh: 7 dias
348
+ ∟ Bcrypt rounds: 10 (balanceamento perf/segurança)
349
+ ∟ Rate limit: 5 tentativas/15min por IP
350
+
351
+ 🚀 PRÓXIMOS PASSOS:
352
+ ∟ Fase 2: Frontend Integration
353
+ ∟ Criar AuthContext no React
354
+ ∟ Implementar token storage seguro
355
+
356
+ ━━━━━━━━━━━━━━━━
357
+
358
+ ⏰ Completado: 2025-11-05 16:45 | 🎯 Status: Done
359
+ ```
360
+
361
+ **Task Principal (86abc000) - Comentário Resumido:**
362
+
363
+ ```
364
+ 📝 PROGRESSO: Fase 1/4 Completada
365
+
366
+ ✅ Backend Implementation - Concluída
367
+ ∟ Subtask: #86abc123
368
+ ∟ Detalhes: Ver comentário na subtask
369
+
370
+ 🎯 Próximo: Fase 2 - Frontend Integration
371
+
372
+ ⏰ 2025-11-05 16:45
373
+ ```
374
+
375
+ ---
376
+
377
+ ### Exemplo 2: Completar Fase de Frontend
378
+
379
+ **Subtask (86abc124) - Comentário Detalhado:**
380
+
381
+ ```
382
+ 🔧 FASE COMPLETADA: Frontend Integration
383
+
384
+ ━━━━━━━━━━━━━━━━
385
+
386
+ 📁 ARQUIVOS MODIFICADOS:
387
+ ∟ src/contexts/AuthContext.tsx
388
+ ∟ src/hooks/useAuth.ts
389
+ ∟ src/pages/Login.tsx
390
+ ∟ src/components/ProtectedRoute.tsx
391
+ ∟ src/services/api.service.ts
392
+
393
+ 🔧 IMPLEMENTAÇÕES:
394
+ ▶ AuthContext com React Context API
395
+ ▶ useAuth hook customizado
396
+ ▶ Login page com validação
397
+ ▶ ProtectedRoute component
398
+ ▶ Interceptor axios para token refresh
399
+
400
+ ✅ TESTES ADICIONADOS:
401
+ ∟ AuthContext.test.tsx (10 testes)
402
+ ∟ useAuth.test.ts (8 testes)
403
+ ∟ Login.test.tsx (12 testes)
404
+ ∟ Cobertura: 92%
405
+
406
+ 💡 DECISÕES TÉCNICAS:
407
+ ∟ Token storage: localStorage (com encryption)
408
+ ∟ Auto-refresh: 1min antes de expirar
409
+ ∟ Redirect após login: dashboard
410
+ ∟ Error handling: toast notifications
411
+
412
+ 🚀 PRÓXIMOS PASSOS:
413
+ ∟ Fase 3: Testing & QA
414
+ ∟ E2E tests com Cypress
415
+ ∟ Security audit
416
+
417
+ ━━━━━━━━━━━━━━━━
418
+
419
+ ⏰ Completado: 2025-11-06 10:30 | 🎯 Status: Done
420
+ ```
421
+
422
+ **Task Principal (86abc000) - Comentário Resumido:**
423
+
424
+ ```
425
+ 📝 PROGRESSO: Fase 2/4 Completada
426
+
427
+ ✅ Frontend Integration - Concluída
428
+ ∟ Subtask: #86abc124
429
+ ∟ Detalhes: Ver comentário na subtask
430
+
431
+ 🎯 Próximo: Fase 3 - Testing & QA
432
+
433
+ ⏰ 2025-11-06 10:30
434
+ ```
435
+
436
+ ---
437
+
438
+ ## ✅ Benefícios por Audiência
439
+
440
+ ### Para Desenvolvedores:
441
+
442
+ - ✅ Contexto técnico completo na subtask
443
+ - ✅ Histórico de decisões preservado
444
+ - ✅ Fácil code review (tudo documentado)
445
+ - ✅ Rastreabilidade de mudanças
446
+
447
+ ### Para Product Owners:
448
+
449
+ - ✅ Visão executiva clara na task principal
450
+ - ✅ Progresso objetivo e mensurável
451
+ - ✅ Sem sobrecarga de detalhes técnicos
452
+ - ✅ Fácil comunicação com stakeholders
453
+
454
+ ### Para Tech Leads:
455
+
456
+ - ✅ Visão completa em ambos os níveis
457
+ - ✅ Pode revisar detalhes técnicos quando necessário
458
+ - ✅ Pode reportar progresso executivo facilmente
459
+ - ✅ Melhor gestão de conhecimento
460
+
461
+ ---
462
+
463
+ ## 🔍 Troubleshooting
464
+
465
+ ### Problema: Subtask ID não encontrado
466
+
467
+ **Causa:** Mapeamento fase→subtask não existe no context.md
468
+
469
+ **Solução:**
470
+
471
+ ```typescript
472
+ // Verificar se mapeamento existe
473
+ if (!mapping[currentPhase]) {
474
+ console.warn(`Mapeamento não encontrado para fase ${currentPhase}`);
475
+ // Fallback: comentar apenas na task principal
476
+ await create_task_comment({
477
+ task_id: mainTaskId,
478
+ comment_text: detailedComment,
479
+ });
480
+ }
481
+ ```
482
+
483
+ ---
484
+
485
+ ### Problema: Task principal não tem ID
486
+
487
+ **Causa:** Context.md não tem mainTaskId
488
+
489
+ **Solução:**
490
+
491
+ ```typescript
492
+ // Extrair do context.md
493
+ const mainTaskId = extractMainTaskId(contextMd);
494
+ if (!mainTaskId) {
495
+ throw new Error('Main task ID not found in context.md');
496
+ }
497
+ ```
498
+
499
+ ---
500
+
501
+ ## 📊 Métricas de Sucesso
502
+
503
+ ### Indicadores de que está funcionando:
504
+
505
+ - ✅ Subtasks têm comentários detalhados
506
+ - ✅ Task principal tem comentários resumidos
507
+ - ✅ Desenvolvedores encontram contexto técnico facilmente
508
+ - ✅ POs conseguem reportar progresso sem detalhes técnicos
509
+ - ✅ Histórico completo de implementação preservado
510
+
511
+ ---
512
+
513
+ ## 🚀 Implementação
514
+
515
+ ### Checklist de Comandos:
516
+
517
+ - [ ] `/engineer/work` - Implementar estratégia dual
518
+ - [ ] `/engineer/start` - Ajustar comentário inicial
519
+ - [ ] `/product/task-check` - Implementar estratégia dual
520
+ - [ ] Documentar em `.claude/docs/clickup/clickup-auto-update-strategy.md`
521
+ - [ ] Testar com task real
522
+ - [ ] Validar comentários em ambos os níveis
523
+
524
+ ---
525
+
526
+ **Última atualização**: 2025-11-05
527
+ **Status**: Documentado e pronto para implementação
528
+ **Prioridade**: ALTA - Melhora significativa de UX