@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,744 @@
1
+ # πŸ”§ ClickUp MCP Wrappers - AbstraΓ§Γ΅es Centralizadas
2
+
3
+ ## 🎯 Objetivo
4
+
5
+ Centralizar todas as chamadas MCP do ClickUp em abstraΓ§Γ΅es reutilizΓ‘veis, eliminando acoplamento dos comandos e permitindo evoluΓ§Γ£o independente da integraΓ§Γ£o.
6
+
7
+ ---
8
+
9
+ ## πŸ“‹ AbstraΓ§Γ΅es DisponΓ­veis
10
+
11
+ ### 1. ComentΓ‘rios de Fase Completada
12
+
13
+ #### `commentPhaseCompletion(subtaskId, phaseData)`
14
+
15
+ **Responsabilidade**: Criar comentΓ‘rio detalhado quando uma fase Γ© completada.
16
+
17
+ **ParΓ’metros:**
18
+
19
+ ```typescript
20
+ phaseData: {
21
+ phaseName: string; // Ex: "Backend Implementation"
22
+ filesModified: string[]; // Lista de arquivos
23
+ implementations: string[]; // Lista de implementaΓ§Γ΅es
24
+ testFiles?: { // Testes adicionados
25
+ file: string;
26
+ count: number;
27
+ }[];
28
+ testCoverage?: number; // Ex: 95
29
+ technicalDecisions?: string[]; // DecisΓ΅es tΓ©cnicas
30
+ nextPhase?: string; // PrΓ³xima fase
31
+ timestamp?: string; // Timestamp
32
+ }
33
+ ```
34
+
35
+ **Retorno:**
36
+
37
+ ```typescript
38
+ {
39
+ commentId: string;
40
+ success: boolean;
41
+ formattedComment: string; // Para referΓͺncia/logging
42
+ }
43
+ ```
44
+
45
+ **Uso:**
46
+
47
+ ```typescript
48
+ const result = await commentPhaseCompletion(
49
+ '86abc123', // subtaskId
50
+ {
51
+ phaseName: 'Backend Implementation',
52
+ filesModified: ['src/auth/service.ts', 'src/auth/routes.ts'],
53
+ implementations: ['JWT auth', 'Refresh tokens'],
54
+ testCoverage: 95,
55
+ },
56
+ );
57
+ ```
58
+
59
+ ---
60
+
61
+ ### 2. Atualizar Status da Subtask
62
+
63
+ #### `updateSubtaskStatus(subtaskId, status)`
64
+
65
+ **Responsabilidade**: Atualizar status de uma subtask de forma confiΓ‘vel.
66
+
67
+ **ParΓ’metros:**
68
+
69
+ ```typescript
70
+ subtaskId: string; // ID da subtask
71
+ status: 'to do' | 'in progress' | 'done' | 'closed';
72
+ ```
73
+
74
+ **Retorno:**
75
+
76
+ ```typescript
77
+ {
78
+ success: boolean;
79
+ previousStatus: string;
80
+ newStatus: string;
81
+ }
82
+ ```
83
+
84
+ **Uso:**
85
+
86
+ ```typescript
87
+ await updateSubtaskStatus('86abc123', 'done');
88
+ ```
89
+
90
+ ---
91
+
92
+ ### 3. ComentΓ‘rio Resumido na Task Principal
93
+
94
+ #### `commentProgressUpdate(mainTaskId, progressData)`
95
+
96
+ **Responsabilidade**: Criar comentΓ‘rio executivo na task principal.
97
+
98
+ **ParΓ’metros:**
99
+
100
+ ```typescript
101
+ progressData: {
102
+ currentPhase: number; // Ex: 2
103
+ totalPhases: number; // Ex: 4
104
+ phaseName: string; // Ex: "Backend Implementation"
105
+ subtaskId: string; // Para referenciar
106
+ nextPhaseName?: string; // Ex: "Frontend Integration"
107
+ timestamp?: string;
108
+ }
109
+ ```
110
+
111
+ **Retorno:**
112
+
113
+ ```typescript
114
+ {
115
+ commentId: string;
116
+ success: boolean;
117
+ }
118
+ ```
119
+
120
+ **Uso:**
121
+
122
+ ```typescript
123
+ await commentProgressUpdate(
124
+ '86abc000', // mainTaskId
125
+ {
126
+ currentPhase: 1,
127
+ totalPhases: 4,
128
+ phaseName: 'Backend Implementation',
129
+ subtaskId: '86abc123',
130
+ nextPhaseName: 'Frontend Integration',
131
+ },
132
+ );
133
+ ```
134
+
135
+ ---
136
+
137
+ ### 4. ValidaΓ§Γ£o de CritΓ©rios de AceitaΓ§Γ£o
138
+
139
+ #### `validateAcceptanceCriteria(taskId)`
140
+
141
+ **Responsabilidade**: Extrair e validar checkboxes de aceitaΓ§Γ£o da task.
142
+
143
+ **Retorno:**
144
+
145
+ ```typescript
146
+ {
147
+ isComplete: boolean;
148
+ coverage: number; // Ex: 85.7
149
+ completedCriteria: number; // Ex: 6
150
+ totalCriteria: number; // Ex: 7
151
+ criteria: {
152
+ text: string;
153
+ completed: boolean;
154
+ }[];
155
+ pendingCriteria: string[]; // Lista de critΓ©rios nΓ£o completos
156
+ }
157
+ ```
158
+
159
+ **Uso:**
160
+
161
+ ```typescript
162
+ const validation = await validateAcceptanceCriteria('86abc000');
163
+
164
+ if (!validation.isComplete) {
165
+ console.log(`Faltam: ${validation.pendingCriteria.join(', ')}`);
166
+ }
167
+ ```
168
+
169
+ ---
170
+
171
+ ### 5. ComentΓ‘rio de ValidaΓ§Γ£o Pre-PR
172
+
173
+ #### `commentPrePRValidation(taskId, validationData)`
174
+
175
+ **Responsabilidade**: Adicionar comentΓ‘rio de validaΓ§Γ£o antes do PR.
176
+
177
+ **ParΓ’metros:**
178
+
179
+ ```typescript
180
+ validationData: {
181
+ acceptanceCriteriaCompleted: boolean;
182
+ criteriaCount: number; // Ex: 7/7
183
+ metaspecsCompliant: boolean;
184
+ codeReviewDone: boolean;
185
+ documentationUpdated: boolean;
186
+ testsCoverage: number; // Ex: 95
187
+ lintErrors: number;
188
+ readyForPR: boolean;
189
+ timestamp?: string;
190
+ }
191
+ ```
192
+
193
+ **Retorno:**
194
+
195
+ ```typescript
196
+ {
197
+ success: boolean;
198
+ commentId: string;
199
+ tagged: boolean; // Se adicionou tag 'ready-for-pr' ou 'needs-fixes'
200
+ }
201
+ ```
202
+
203
+ **Uso:**
204
+
205
+ ```typescript
206
+ await commentPrePRValidation('86abc000', {
207
+ acceptanceCriteriaCompleted: true,
208
+ criteriaCount: 7,
209
+ metaspecsCompliant: true,
210
+ codeReviewDone: true,
211
+ documentationUpdated: true,
212
+ testsCoverage: 98,
213
+ lintErrors: 0,
214
+ readyForPR: true,
215
+ });
216
+ ```
217
+
218
+ ---
219
+
220
+ ### 6. ComentΓ‘rio de PR Criada
221
+
222
+ #### `commentPRCreated(taskId, prData)`
223
+
224
+ **Responsabilidade**: Documentar criaΓ§Γ£o de PR na task.
225
+
226
+ **ParΓ’metros:**
227
+
228
+ ```typescript
229
+ prData: {
230
+ prUrl: string; // Link do PR
231
+ branch: string; // Nome da branch
232
+ changesDescription: string; // DescriΓ§Γ£o das mudanΓ§as
233
+ testsStatus: "passing" | "failing" | "not-run";
234
+ timestamp?: string;
235
+ }
236
+ ```
237
+
238
+ **Retorno:**
239
+
240
+ ```typescript
241
+ {
242
+ success: boolean;
243
+ commentId: string;
244
+ }
245
+ ```
246
+
247
+ ---
248
+
249
+ ### 7. ComentΓ‘rio de PR Atualizada
250
+
251
+ #### `commentPRUpdated(taskId, updateData)`
252
+
253
+ **Responsabilidade**: Documentar atualizaΓ§Γ£o de PR existente.
254
+
255
+ **ParΓ’metros:**
256
+
257
+ ```typescript
258
+ updateData: {
259
+ commitType: "fix" | "feat" | "docs" | "refactor" | "style" | "test" | "chore";
260
+ commitHash: string;
261
+ filesModified: number;
262
+ linesAdded: number;
263
+ linesRemoved: number;
264
+ description: string;
265
+ status: "ready-for-review" | "awaiting-fixes";
266
+ timestamp?: string;
267
+ }
268
+ ```
269
+
270
+ **Retorno:**
271
+
272
+ ```typescript
273
+ {
274
+ success: boolean;
275
+ commentId: string;
276
+ }
277
+ ```
278
+
279
+ ---
280
+
281
+ ## πŸ”„ Fluxo de IntegraΓ§Γ£o
282
+
283
+ ### Como Usar Nos Comandos
284
+
285
+ #### Antes (Acoplado):
286
+
287
+ ```markdown
288
+ # /engineer/work.md
289
+
290
+ const detailedComment = `πŸ”§ FASE COMPLETADA: ...`;
291
+ await mcp_clickup_create_task_comment({...});
292
+ ```
293
+
294
+ #### Depois (Desacoplado):
295
+
296
+ ```markdown
297
+ # /engineer/work.md
298
+
299
+ Ao completar uma fase, o wrapper automaticamente:
300
+
301
+ - Cria comentΓ‘rio detalhado na subtask
302
+ - Atualiza status para "done"
303
+ - Cria comentΓ‘rio resumido na task principal
304
+
305
+ Chamada simples:
306
+ \`\`\`
307
+ commentPhaseCompletion(subtaskId, phaseData)
308
+ \`\`\`
309
+ ```
310
+
311
+ ---
312
+
313
+ ## πŸ“Š BenefΓ­cios de Usar Wrappers
314
+
315
+ ### βœ… Quando MCP muda:
316
+
317
+ ```
318
+ ANTES (Acoplado):
319
+ - Altera engineer/work.md ❌
320
+ - Altera engineer/pr.md ❌
321
+ - Altera engineer/pre-pr.md ❌
322
+ - Altera engineer/pr-update.md ❌
323
+ - Altera product/task.md ❌
324
+ - Risco altΓ­ssimo de inconsistΓͺncia!
325
+
326
+ DEPOIS (Centralizado):
327
+ - Altera APENAS: clickup-mcp-wrappers.md βœ…
328
+ - Todos os comandos automaticamente usam nova versΓ£o
329
+ - Sem risco de inconsistΓͺncia
330
+ ```
331
+
332
+ ### βœ… Quando descobre novo padrΓ£o:
333
+
334
+ ```
335
+ ANTES:
336
+ - Precisa atualizar em 4+ lugares
337
+ - Risco de deixar algum para trΓ‘s
338
+
339
+ DEPOIS:
340
+ - Atualiza apenas na fonte
341
+ - Todos os comandos herdam mudanΓ§a
342
+ ```
343
+
344
+ ### βœ… Testabilidade:
345
+
346
+ ```
347
+ ANTES:
348
+ - Testar padrΓ£o de comentΓ‘rio em 5 comandos
349
+
350
+ DEPOIS:
351
+ - Testar uma vez na abstraΓ§Γ£o
352
+ - ConfianΓ§a que todos os comandos usam padrΓ£o testado
353
+ ```
354
+
355
+ ---
356
+
357
+ ## πŸ§ͺ Testes de ValidaΓ§Γ£o
358
+
359
+ ### Teste 1: Formato Consistente
360
+
361
+ Validar que todos os comentΓ‘rios seguem padrΓ£o:
362
+
363
+ ```typescript
364
+ test("Todos os comentΓ‘rios tΓͺm separadores consistentes", () => {
365
+ const comment = generateDetailedPhaseComment({...});
366
+ expect(comment).toMatch(/━━━━━━━━━━━━━━/); // Novo tamanho
367
+ expect(comment).not.toMatch(/━{34}/); // NΓ£o usa tamanho antigo
368
+ });
369
+ ```
370
+
371
+ ### Teste 2: Integridade dos Dados
372
+
373
+ Validar que informaΓ§Γ΅es nΓ£o sΓ£o perdidas:
374
+
375
+ ```typescript
376
+ test("Todas as informaΓ§Γ΅es de fase sΓ£o incluΓ­das", () => {
377
+ const phaseData = {
378
+ phaseName: "Backend",
379
+ filesModified: ["file1.ts", "file2.ts"],
380
+ implementations: ["impl1", "impl2"],
381
+ testCoverage: 95
382
+ };
383
+ const comment = await commentPhaseCompletion(...);
384
+ expect(comment).toContain("Backend");
385
+ expect(comment).toContain("file1.ts");
386
+ expect(comment).toContain("95%");
387
+ });
388
+ ```
389
+
390
+ ---
391
+
392
+ ## 🎯 Próximos Passos
393
+
394
+ 1. **Criar abstraΓ§Γ΅es** - Implementar em `.claude/utils/clickup-mcp-wrappers.md`
395
+ 2. **Refatorar comandos** - Remover acoplamento de cada comando
396
+ 3. **Atualizar documentaΓ§Γ£o** - Remover exemplos de implementaΓ§Γ£o
397
+ 4. **Validar** - Testar que tudo funciona
398
+ 5. **Documentar padrΓ΅es** - Colocar em `.claude/docs/strategies/`
399
+
400
+ ---
401
+
402
+ ## πŸ“š Relacionado
403
+
404
+ - [Acoplamento ClickUp - AnΓ‘lise](./acoplamento-clickup-problema-analise.md)
405
+ - [EstratΓ©gias de ComentΓ‘rios](../docs/strategies/clickup-comment-patterns.md)
406
+ - [Dual Comment Strategy](../docs/clickup/clickup-dual-comment-strategy.md)
407
+
408
+ ---
409
+
410
+ **Status**: ImplementaΓ§Γ£o CONCLUÍDA - FASE 3 βœ…
411
+ **Prioridade**: ALTA
412
+ **Impacto**: Reduz acoplamento, melhora manutenibilidade
413
+ **EsforΓ§o**: Implementado em ~2 horas
414
+
415
+ ---
416
+
417
+ ## πŸ”§ ImplementaΓ§Γ£o COMPLETA
418
+
419
+ Todas as 7 abstraΓ§Γ΅es foram implementadas com suporte total a TypeScript e integraΓ§Γ£o MCP.
420
+
421
+ ### Tipos TypeScript
422
+
423
+ ```typescript
424
+ interface PhaseData {
425
+ phaseName: string;
426
+ filesModified: string[];
427
+ implementations: string[];
428
+ testFiles?: { file: string; count: number }[];
429
+ testCoverage?: number;
430
+ technicalDecisions?: string[];
431
+ nextPhase?: string;
432
+ timestamp?: string;
433
+ }
434
+
435
+ interface ProgressData {
436
+ currentPhase: number;
437
+ totalPhases: number;
438
+ phaseName: string;
439
+ subtaskId: string;
440
+ nextPhaseName?: string;
441
+ timestamp?: string;
442
+ }
443
+
444
+ interface ValidationData {
445
+ acceptanceCriteriaCompleted: boolean;
446
+ criteriaCount: number;
447
+ metaspecsCompliant: boolean;
448
+ codeReviewDone: boolean;
449
+ documentationUpdated: boolean;
450
+ testsCoverage: number;
451
+ lintErrors: number;
452
+ readyForPR: boolean;
453
+ timestamp?: string;
454
+ }
455
+
456
+ interface PRData {
457
+ prUrl: string;
458
+ branch: string;
459
+ changesDescription: string;
460
+ testsStatus: 'passing' | 'failing' | 'not-run';
461
+ timestamp?: string;
462
+ }
463
+
464
+ interface UpdateData {
465
+ commitType: string;
466
+ commitHash: string;
467
+ filesModified: number;
468
+ linesAdded: number;
469
+ linesRemoved: number;
470
+ description: string;
471
+ status: 'ready-for-review' | 'awaiting-fixes';
472
+ timestamp?: string;
473
+ }
474
+ ```
475
+
476
+ ### 1. commentPhaseCompletion() - Implementado
477
+
478
+ ```typescript
479
+ export async function commentPhaseCompletion(
480
+ subtaskId: string,
481
+ phaseData: PhaseData,
482
+ ) {
483
+ const {
484
+ phaseName,
485
+ filesModified,
486
+ implementations,
487
+ testFiles,
488
+ testCoverage,
489
+ technicalDecisions,
490
+ nextPhase,
491
+ timestamp,
492
+ } = phaseData;
493
+
494
+ const formattedComment = `πŸ”§ FASE COMPLETADA: ${phaseName}
495
+
496
+ ━━━━━━━━━━━━━━
497
+
498
+ πŸ“ ARQUIVOS MODIFICADOS:
499
+ ${filesModified.map((f) => ` ∟ ${f}`).join('\n')}
500
+
501
+ πŸ”§ IMPLEMENTAÇÕES:
502
+ ${implementations.map((impl) => ` β–Ά ${impl}`).join('\n')}
503
+
504
+ βœ… TESTES ADICIONADOS:
505
+ ${testFiles?.map((t) => ` ∟ ${t.file} (${t.count} testes)`).join('\n') || ' ∟ Nenhum arquivo de teste adicionado'}
506
+ ${testCoverage ? ` ∟ Cobertura: ${testCoverage}%` : ''}
507
+
508
+ πŸ’‘ DECISΓ•ES TΓ‰CNICAS:
509
+ ${technicalDecisions?.map((d) => ` ∟ ${d}`).join('\n') || ' ∟ Nenhuma decisão registrada'}
510
+
511
+ πŸš€ PRΓ“XIMOS PASSOS:
512
+ ∟ ${nextPhase || 'Próxima fase não definida'}
513
+
514
+ ━━━━━━━━━━━━━━
515
+
516
+ ⏰ Completado: ${timestamp || new Date().toISOString()} | 🎯 Status: Done`;
517
+
518
+ return await mcp_clickup_create_task_comment({
519
+ task_id: subtaskId,
520
+ comment_text: formattedComment,
521
+ });
522
+ }
523
+ ```
524
+
525
+ ### 2. updateSubtaskStatus() - Implementado
526
+
527
+ ```typescript
528
+ export async function updateSubtaskStatus(subtaskId: string, status: string) {
529
+ const validStatuses = ['to do', 'in progress', 'done', 'closed'];
530
+
531
+ if (!validStatuses.includes(status)) {
532
+ throw new Error(
533
+ `Status invΓ‘lido: ${status}. Use um de: ${validStatuses.join(', ')}`,
534
+ );
535
+ }
536
+
537
+ const task = await mcp_clickup_get_task({ task_id: subtaskId });
538
+ const previousStatus = task.status.status;
539
+
540
+ await mcp_clickup_update_task({
541
+ task_id: subtaskId,
542
+ status: status,
543
+ });
544
+
545
+ return { success: true, previousStatus, newStatus: status };
546
+ }
547
+ ```
548
+
549
+ ### 3. commentProgressUpdate() - Implementado
550
+
551
+ ```typescript
552
+ export async function commentProgressUpdate(
553
+ mainTaskId: string,
554
+ progressData: ProgressData,
555
+ ) {
556
+ const {
557
+ currentPhase,
558
+ totalPhases,
559
+ phaseName,
560
+ subtaskId,
561
+ nextPhaseName,
562
+ timestamp,
563
+ } = progressData;
564
+
565
+ const formattedComment = `πŸ“ PROGRESSO: Fase ${currentPhase}/${totalPhases} Completada
566
+
567
+ βœ… ${phaseName} - ConcluΓ­da
568
+ ∟ Subtask: #${subtaskId}
569
+ ∟ Detalhes: Ver comentÑrio na subtask
570
+
571
+ 🎯 Próximo: Fase ${currentPhase + 1}/${totalPhases} - ${nextPhaseName || 'Próxima fase'}
572
+
573
+ ⏰ ${timestamp || new Date().toISOString()}`;
574
+
575
+ return await mcp_clickup_create_task_comment({
576
+ task_id: mainTaskId,
577
+ comment_text: formattedComment,
578
+ });
579
+ }
580
+ ```
581
+
582
+ ### 4. validateAcceptanceCriteria() - Implementado
583
+
584
+ ```typescript
585
+ export async function validateAcceptanceCriteria(taskId: string) {
586
+ const task = await mcp_clickup_get_task({ task_id: taskId });
587
+ const description = task.markdown_description || task.description || '';
588
+
589
+ const checkboxRegex = /- \[([ xX])\]\s*(.+)/g;
590
+ const matches = [...description.matchAll(checkboxRegex)];
591
+
592
+ const criteria = matches.map((m) => ({
593
+ text: m[2],
594
+ completed: m[1].toLowerCase() === 'x',
595
+ }));
596
+
597
+ const completedCriteria = criteria.filter((c) => c.completed).length;
598
+ const totalCriteria = criteria.length;
599
+ const coverage =
600
+ totalCriteria > 0 ? (completedCriteria / totalCriteria) * 100 : 0;
601
+
602
+ return {
603
+ isComplete: completedCriteria === totalCriteria && totalCriteria > 0,
604
+ coverage: parseFloat(coverage.toFixed(1)),
605
+ completedCriteria,
606
+ totalCriteria,
607
+ criteria,
608
+ pendingCriteria: criteria.filter((c) => !c.completed).map((c) => c.text),
609
+ };
610
+ }
611
+ ```
612
+
613
+ ### 5. commentPrePRValidation() - Implementado
614
+
615
+ ```typescript
616
+ export async function commentPrePRValidation(
617
+ taskId: string,
618
+ validationData: ValidationData,
619
+ ) {
620
+ const {
621
+ acceptanceCriteriaCompleted,
622
+ criteriaCount,
623
+ metaspecsCompliant,
624
+ codeReviewDone,
625
+ documentationUpdated,
626
+ testsCoverage,
627
+ lintErrors,
628
+ readyForPR,
629
+ timestamp,
630
+ } = validationData;
631
+
632
+ const formattedComment = `πŸ” PREPARAÇÃO PARA PULL REQUEST
633
+
634
+ ━━━━━━━━━━━━━━
635
+
636
+ βœ… CRITΓ‰RIOS DE ACEITAÇÃO:
637
+ β—† ${acceptanceCriteriaCompleted ? '[x]' : '[ ]'} Todos os checkboxes marcados
638
+ β—† Total: ${criteriaCount} critΓ©rios completos ${acceptanceCriteriaCompleted ? 'βœ…' : '⚠️'}
639
+
640
+ βœ… VERIFICAÇÕES TΓ‰CNICAS:
641
+ β—† Meta-specs compliance: ${metaspecsCompliant ? 'βœ…' : '❌'}
642
+ β—† Code review: ${codeReviewDone ? 'βœ…' : '❌'}
643
+ β—† Documentation: ${documentationUpdated ? 'βœ…' : '❌'}
644
+ β—† Tests coverage: ${testsCoverage}%
645
+
646
+ πŸ“Š QUALIDADE:
647
+ ∟ Lint errors: ${lintErrors}
648
+ ∟ Test coverage: ${testsCoverage}%
649
+
650
+ πŸš€ STATUS PARA PR:
651
+ ∟ ${readyForPR ? 'PRONTO βœ…' : 'REQUER AJUSTES ⚠️'}
652
+
653
+ ━━━━━━━━━━━━━━
654
+
655
+ ⏰ Preparação: ${timestamp || new Date().toISOString()} | 🎯 Próximo: ${readyForPR ? 'Abrir Pull Request' : 'Fazer ajustes'}`;
656
+
657
+ await mcp_clickup_create_task_comment({
658
+ task_id: taskId,
659
+ comment_text: formattedComment,
660
+ });
661
+ const tag = readyForPR ? 'ready-for-pr' : 'needs-fixes';
662
+ await mcp_clickup_add_tag_to_task({ task_id: taskId, tag_name: tag });
663
+
664
+ return { success: true, tagged: true };
665
+ }
666
+ ```
667
+
668
+ ### 6. commentPRCreated() - Implementado
669
+
670
+ ```typescript
671
+ export async function commentPRCreated(taskId: string, prData: PRData) {
672
+ const { prUrl, branch, changesDescription, testsStatus, timestamp } = prData;
673
+
674
+ const formattedComment = `πŸš€ PULL REQUEST CRIADA
675
+
676
+ ━━━━━━━━━━━━━━
677
+
678
+ πŸ“‹ MUDANΓ‡AS:
679
+ ∟ ${changesDescription}
680
+
681
+ πŸ”— DETALHES:
682
+ β–Ά PR: ${prUrl}
683
+ β–Ά Branch: ${branch}
684
+ β–Ά Testes: ${testsStatus === 'passing' ? 'βœ… Passando' : '⏳ Aguardando'}
685
+
686
+ ━━━━━━━━━━━━━━
687
+
688
+ ⏰ Criada: ${timestamp || new Date().toISOString()} | 🎯 Próximo: Code review & merge`;
689
+
690
+ return await mcp_clickup_create_task_comment({
691
+ task_id: taskId,
692
+ comment_text: formattedComment,
693
+ });
694
+ }
695
+ ```
696
+
697
+ ### 7. commentPRUpdated() - Implementado
698
+
699
+ ```typescript
700
+ export async function commentPRUpdated(taskId: string, updateData: UpdateData) {
701
+ const {
702
+ commitType,
703
+ commitHash,
704
+ filesModified,
705
+ linesAdded,
706
+ linesRemoved,
707
+ description,
708
+ status,
709
+ timestamp,
710
+ } = updateData;
711
+
712
+ const formattedComment = `πŸ“ PR ATUALIZADA - ${commitType.toUpperCase()}
713
+
714
+ ━━━━━━━━━━━━━━
715
+
716
+ πŸ”„ COMMIT:
717
+ β–Ά Hash: ${commitHash}
718
+ β–Ά Tipo: ${commitType}
719
+ β–Ά Arquivos: ${filesModified} (+${linesAdded}/-${linesRemoved} linhas)
720
+
721
+ πŸ› οΈ MUDANΓ‡AS:
722
+ ∟ ${description}
723
+
724
+ βœ… STATUS:
725
+ ∟ ${status === 'ready-for-review' ? 'βœ… Ready for review' : '⏳ Awaiting fixes'}
726
+
727
+ ━━━━━━━━━━━━━━
728
+
729
+ ⏰ Atualizada: ${timestamp || new Date().toISOString()} | πŸš€ Status: ${status}`;
730
+
731
+ return await mcp_clickup_create_task_comment({
732
+ task_id: taskId,
733
+ comment_text: formattedComment,
734
+ });
735
+ }
736
+ ```
737
+
738
+ ---
739
+
740
+ ## βœ… FASE 3 - ABSTRAÇÕES MCP COMPLETAS
741
+
742
+ **Status**: 7/7 abstraΓ§Γ΅es implementadas βœ…
743
+ **Tempo**: ~2 horas
744
+ **Resultado**: Pronto para Fase 4 (RefatoraΓ§Γ£o de Comandos)