@onion-architect-ai/cli 4.1.0-beta.1 → 4.1.0-beta.3

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 (207) hide show
  1. package/dist/cli.js +8 -19
  2. package/dist/cli.js.map +1 -1
  3. package/package.json +4 -3
  4. package/templates/.cursor/agents/compliance/iso-22301-specialist.md +917 -0
  5. package/templates/.cursor/agents/compliance/iso-27001-specialist.md +641 -0
  6. package/templates/.cursor/agents/compliance/pmbok-specialist.md +669 -0
  7. package/templates/.cursor/agents/compliance/security-information-master.md +824 -0
  8. package/templates/.cursor/agents/compliance/soc2-specialist.md +818 -0
  9. package/templates/.cursor/agents/deployment/docker-specialist.md +1192 -0
  10. package/templates/.cursor/agents/meta/agent-creator-specialist.md +1135 -0
  11. package/templates/.cursor/agents/meta/command-creator-specialist.md +1519 -0
  12. package/templates/.cursor/agents/meta/metaspec-gate-keeper.md +240 -0
  13. package/templates/.cursor/agents/meta/onion.md +753 -0
  14. package/templates/.cursor/agents/research/research-agent.md +292 -0
  15. package/templates/.cursor/agents/review/corporate-compliance-specialist.md +370 -0
  16. package/templates/.cursor/commands/common/prompts/README.md +187 -0
  17. package/templates/.cursor/commands/common/prompts/clickup-patterns.md +144 -0
  18. package/templates/.cursor/commands/common/prompts/code-review-checklist.md +168 -0
  19. package/templates/.cursor/commands/common/prompts/git-workflow-patterns.md +235 -0
  20. package/templates/.cursor/commands/common/prompts/output-formats.md +240 -0
  21. package/templates/.cursor/commands/common/prompts/technical.md +172 -0
  22. package/templates/.cursor/commands/common/prompts/validation-rules.md +173 -0
  23. package/templates/.cursor/commands/common/templates/abstraction-template.md +400 -0
  24. package/templates/.cursor/commands/common/templates/agent-template.md +353 -0
  25. package/templates/.cursor/commands/common/templates/business_context_template.md +748 -0
  26. package/templates/.cursor/commands/common/templates/command-template.md +273 -0
  27. package/templates/.cursor/commands/common/templates/technical_context_template.md +526 -0
  28. package/templates/.cursor/commands/development/runflow-dev.md +465 -0
  29. package/templates/.cursor/commands/docs/build-compliance-docs.md +143 -0
  30. package/templates/.cursor/commands/git/README.md +606 -0
  31. package/templates/.cursor/commands/meta/all-tools.md +50 -0
  32. package/templates/.cursor/commands/meta/analyze-complex-problem.md +186 -0
  33. package/templates/.cursor/commands/meta/create-abstraction.md +859 -0
  34. package/templates/.cursor/commands/meta/create-agent-express.md +83 -0
  35. package/templates/.cursor/commands/meta/create-agent.md +210 -0
  36. package/templates/.cursor/commands/meta/create-command.md +203 -0
  37. package/templates/.cursor/commands/meta/create-knowledge-base.md +143 -0
  38. package/templates/.cursor/commands/meta/create-task-structure.md +150 -0
  39. package/templates/.cursor/commands/meta/setup-integration.md +257 -0
  40. package/templates/.cursor/commands/onion/setup.md +843 -0
  41. package/templates/.cursor/commands/onion.md +168 -0
  42. package/templates/.cursor/commands/product/README.md +230 -0
  43. package/templates/.cursor/commands/quick/analisys.md +17 -0
  44. package/templates/.cursor/commands/validate/collab/pair-testing.md +633 -0
  45. package/templates/.cursor/commands/validate/collab/three-amigos.md +505 -0
  46. package/templates/.cursor/commands/validate/qa-points/estimate.md +660 -0
  47. package/templates/.cursor/commands/validate/test-strategy/analyze.md +1134 -0
  48. package/templates/.cursor/commands/validate/test-strategy/create.md +392 -0
  49. package/templates/.cursor/commands/validate/workflow.md +360 -0
  50. package/templates/.cursor/commands/warm-up.md +91 -0
  51. package/templates/.cursor/docs/architecture/acoplamento-clickup-problema-analise.md +446 -0
  52. package/templates/.cursor/docs/architecture/desacoplamento-roadmap.md +360 -0
  53. package/templates/.cursor/docs/architecture/validacao-fase-1.md +219 -0
  54. package/templates/.cursor/docs/c4/c4-detection-rules.md +395 -0
  55. package/templates/.cursor/docs/c4/c4-documentation-templates.md +579 -0
  56. package/templates/.cursor/docs/c4/c4-mermaid-patterns.md +331 -0
  57. package/templates/.cursor/docs/c4/c4-templates.md +256 -0
  58. package/templates/.cursor/docs/clickup/clickup-acceptance-criteria-strategy.md +329 -0
  59. package/templates/.cursor/docs/clickup/clickup-auto-update-strategy.md +318 -0
  60. package/templates/.cursor/docs/clickup/clickup-comment-formatter.md +239 -0
  61. package/templates/.cursor/docs/clickup/clickup-description-fix.md +355 -0
  62. package/templates/.cursor/docs/clickup/clickup-dual-comment-strategy.md +505 -0
  63. package/templates/.cursor/docs/clickup/clickup-formatting.md +302 -0
  64. package/templates/.cursor/docs/clickup/separador-tamanho-otimizado.md +256 -0
  65. package/templates/.cursor/docs/engineer/pre-pr-acceptance-validation.md +256 -0
  66. package/templates/.cursor/docs/onion/ESPERANTO.md +278 -0
  67. package/templates/.cursor/docs/onion/agents-reference.md +832 -0
  68. package/templates/.cursor/docs/onion/clickup-integration.md +738 -0
  69. package/templates/.cursor/docs/onion/commands-guide.md +807 -0
  70. package/templates/.cursor/docs/onion/engineering-flows.md +865 -0
  71. package/templates/.cursor/docs/onion/getting-started.md +741 -0
  72. package/templates/.cursor/docs/onion/maintenance-checklist.md +388 -0
  73. package/templates/.cursor/docs/onion/naming-conventions.md +268 -0
  74. package/templates/.cursor/docs/onion/practical-examples.md +782 -0
  75. package/templates/.cursor/docs/product/story-points-integration.md +254 -0
  76. package/templates/.cursor/docs/product/story-points-validation.md +224 -0
  77. package/templates/.cursor/docs/reviews/task-manager-docs-review-2025-11-24.md +167 -0
  78. package/templates/.cursor/docs/strategies/clickup-comment-patterns.md +766 -0
  79. package/templates/.cursor/docs/strategies/clickup-integration-tests.md +599 -0
  80. package/templates/.cursor/docs/strategies/clickup-mcp-wrappers-tests.md +854 -0
  81. package/templates/.cursor/docs/strategies/clickup-regression-tests.md +589 -0
  82. package/templates/.cursor/docs/strategies/visual-patterns.md +308 -0
  83. package/templates/.cursor/docs/templates/README.md +624 -0
  84. package/templates/.cursor/docs/templates/adr-template.md +226 -0
  85. package/templates/.cursor/docs/templates/analysis-template.md +280 -0
  86. package/templates/.cursor/docs/templates/execution-plan-template.md +430 -0
  87. package/templates/.cursor/docs/templates/guide-template.md +367 -0
  88. package/templates/.cursor/docs/templates/phase-execution-prompt-template.md +504 -0
  89. package/templates/.cursor/docs/templates/reference-template.md +522 -0
  90. package/templates/.cursor/docs/templates/solution-template.md +390 -0
  91. package/templates/.cursor/docs/tools/README.md +325 -0
  92. package/templates/.cursor/docs/tools/agents.md +330 -0
  93. package/templates/.cursor/docs/tools/commands.md +606 -0
  94. package/templates/.cursor/docs/tools/cursor.md +498 -0
  95. package/templates/.cursor/docs/tools/mcps.md +858 -0
  96. package/templates/.cursor/docs/tools/rules.md +423 -0
  97. package/templates/.cursor/rules/language-and-documentation.mdc +371 -0
  98. package/templates/.cursor/rules/onion-patterns.mdc +197 -0
  99. package/templates/.cursor/rules/validation-rules.mdc +194 -0
  100. package/templates/.cursor/utils/clickup-mcp-wrappers.md +671 -0
  101. package/templates/.cursor/utils/date-time-standards.md +182 -0
  102. package/templates/.cursor/utils/task-manager/README.md +94 -0
  103. package/templates/.cursor/utils/task-manager/adapters/asana.md +377 -0
  104. package/templates/.cursor/utils/task-manager/adapters/clickup.md +467 -0
  105. package/templates/.cursor/utils/task-manager/adapters/linear.md +421 -0
  106. package/templates/.cursor/utils/task-manager/detector.md +290 -0
  107. package/templates/.cursor/utils/task-manager/factory.md +363 -0
  108. package/templates/.cursor/utils/task-manager/interface.md +248 -0
  109. package/templates/.cursor/utils/task-manager/types.md +409 -0
  110. package/templates/.cursor/validation/product-task-validation.md +344 -0
  111. package/templates/.onion/contexts/business/.context-config.yml +52 -0
  112. package/templates/.onion/contexts/business/README.md +222 -0
  113. package/templates/.onion/contexts/business/agents/branding-specialist.md +1030 -0
  114. package/templates/.onion/contexts/business/agents/clickup-specialist.md +397 -0
  115. package/templates/.onion/contexts/business/agents/extract-meeting-specialist.md +395 -0
  116. package/templates/.onion/contexts/business/agents/gamma-specialist.md +1169 -0
  117. package/templates/.onion/contexts/business/agents/meeting-consolidator.md +483 -0
  118. package/templates/.onion/contexts/business/agents/pain-price-specialist.md +509 -0
  119. package/templates/.onion/contexts/business/agents/presentation-orchestrator.md +1191 -0
  120. package/templates/.onion/contexts/business/agents/product-agent.md +202 -0
  121. package/templates/.onion/contexts/business/agents/story-points-specialist.md +539 -0
  122. package/templates/.onion/contexts/business/agents/storytelling-specialist.md +891 -0
  123. package/templates/.onion/contexts/business/agents/task-specialist.md +618 -0
  124. package/templates/.onion/contexts/business/agents/whisper-specialist.md +373 -0
  125. package/templates/.onion/contexts/business/commands/advanced/analyze-pain-price.md +709 -0
  126. package/templates/.onion/contexts/business/commands/advanced/branding.md +460 -0
  127. package/templates/.onion/contexts/business/commands/advanced/checklist-sync.md +241 -0
  128. package/templates/.onion/contexts/business/commands/advanced/presentation.md +189 -0
  129. package/templates/.onion/contexts/business/commands/advanced/transform-consolidated.md +592 -0
  130. package/templates/.onion/contexts/business/commands/help.md +212 -0
  131. package/templates/.onion/contexts/business/commands/intermediate/check.md +48 -0
  132. package/templates/.onion/contexts/business/commands/intermediate/collect.md +96 -0
  133. package/templates/.onion/contexts/business/commands/intermediate/consolidate-meetings.md +306 -0
  134. package/templates/.onion/contexts/business/commands/intermediate/convert-to-tasks.md +220 -0
  135. package/templates/.onion/contexts/business/commands/intermediate/extract-meeting.md +241 -0
  136. package/templates/.onion/contexts/business/commands/intermediate/feature.md +431 -0
  137. package/templates/.onion/contexts/business/commands/intermediate/light-arch.md +97 -0
  138. package/templates/.onion/contexts/business/commands/intermediate/task-check.md +340 -0
  139. package/templates/.onion/contexts/business/commands/intermediate/validate-task.md +294 -0
  140. package/templates/.onion/contexts/business/commands/intermediate/whisper.md +325 -0
  141. package/templates/.onion/contexts/business/commands/starter/estimate.md +519 -0
  142. package/templates/.onion/contexts/business/commands/starter/refine.md +186 -0
  143. package/templates/.onion/contexts/business/commands/starter/spec.md +107 -0
  144. package/templates/.onion/contexts/business/commands/starter/task.md +585 -0
  145. package/templates/.onion/contexts/business/commands/starter/warm-up.md +187 -0
  146. package/templates/.onion/contexts/technical/.context-config.yml +64 -0
  147. package/templates/.onion/contexts/technical/README.md +238 -0
  148. package/templates/.onion/contexts/technical/agents/branch-code-reviewer.md +200 -0
  149. package/templates/.onion/contexts/technical/agents/branch-doc-writer.md +162 -0
  150. package/templates/.onion/contexts/technical/agents/branch-metaspec-checker.md +68 -0
  151. package/templates/.onion/contexts/technical/agents/branch-test-planner.md +177 -0
  152. package/templates/.onion/contexts/technical/agents/c4-architecture-specialist.md +712 -0
  153. package/templates/.onion/contexts/technical/agents/c4-documentation-specialist.md +658 -0
  154. package/templates/.onion/contexts/technical/agents/code-reviewer.md +155 -0
  155. package/templates/.onion/contexts/technical/agents/cursor-specialist.md +249 -0
  156. package/templates/.onion/contexts/technical/agents/docs-reverse-engineer.md +418 -0
  157. package/templates/.onion/contexts/technical/agents/gitflow-specialist.md +1207 -0
  158. package/templates/.onion/contexts/technical/agents/linux-security-specialist.md +676 -0
  159. package/templates/.onion/contexts/technical/agents/mermaid-specialist.md +516 -0
  160. package/templates/.onion/contexts/technical/agents/nodejs-specialist.md +673 -0
  161. package/templates/.onion/contexts/technical/agents/nx-migration-specialist.md +867 -0
  162. package/templates/.onion/contexts/technical/agents/nx-monorepo-specialist.md +619 -0
  163. package/templates/.onion/contexts/technical/agents/postgres-specialist.md +1124 -0
  164. package/templates/.onion/contexts/technical/agents/react-developer.md +132 -0
  165. package/templates/.onion/contexts/technical/agents/runflow-specialist.md +278 -0
  166. package/templates/.onion/contexts/technical/agents/system-doc-orchestrator.md +1388 -0
  167. package/templates/.onion/contexts/technical/agents/test-agent.md +425 -0
  168. package/templates/.onion/contexts/technical/agents/test-engineer.md +295 -0
  169. package/templates/.onion/contexts/technical/agents/test-planner.md +118 -0
  170. package/templates/.onion/contexts/technical/agents/zen-engine-specialist.md +421 -0
  171. package/templates/.onion/contexts/technical/commands/advanced/bump.md +43 -0
  172. package/templates/.onion/contexts/technical/commands/advanced/consolidate-documents.md +424 -0
  173. package/templates/.onion/contexts/technical/commands/advanced/e2e.md +392 -0
  174. package/templates/.onion/contexts/technical/commands/advanced/feature-finish.md +90 -0
  175. package/templates/.onion/contexts/technical/commands/advanced/feature-publish.md +91 -0
  176. package/templates/.onion/contexts/technical/commands/advanced/feature-start.md +158 -0
  177. package/templates/.onion/contexts/technical/commands/advanced/hotfix-finish.md +98 -0
  178. package/templates/.onion/contexts/technical/commands/advanced/hotfix-start.md +94 -0
  179. package/templates/.onion/contexts/technical/commands/advanced/hotfix.md +186 -0
  180. package/templates/.onion/contexts/technical/commands/advanced/refine-vision.md +27 -0
  181. package/templates/.onion/contexts/technical/commands/advanced/release-finish.md +98 -0
  182. package/templates/.onion/contexts/technical/commands/advanced/release-start.md +95 -0
  183. package/templates/.onion/contexts/technical/commands/advanced/reverse-consolidate.md +160 -0
  184. package/templates/.onion/contexts/technical/commands/advanced/validate-phase-sync.md +118 -0
  185. package/templates/.onion/contexts/technical/commands/help.md +329 -0
  186. package/templates/.onion/contexts/technical/commands/intermediate/build-business-docs.md +276 -0
  187. package/templates/.onion/contexts/technical/commands/intermediate/build-index.md +128 -0
  188. package/templates/.onion/contexts/technical/commands/intermediate/build-tech-docs.md +204 -0
  189. package/templates/.onion/contexts/technical/commands/intermediate/code-review.md +215 -0
  190. package/templates/.onion/contexts/technical/commands/intermediate/docs-health.md +142 -0
  191. package/templates/.onion/contexts/technical/commands/intermediate/fast-commit.md +45 -0
  192. package/templates/.onion/contexts/technical/commands/intermediate/integration.md +523 -0
  193. package/templates/.onion/contexts/technical/commands/intermediate/pr-update.md +198 -0
  194. package/templates/.onion/contexts/technical/commands/intermediate/pre-pr.md +91 -0
  195. package/templates/.onion/contexts/technical/commands/intermediate/start.md +266 -0
  196. package/templates/.onion/contexts/technical/commands/intermediate/sync-sessions.md +320 -0
  197. package/templates/.onion/contexts/technical/commands/intermediate/unit.md +378 -0
  198. package/templates/.onion/contexts/technical/commands/intermediate/validate-docs.md +159 -0
  199. package/templates/.onion/contexts/technical/commands/starter/docs.md +39 -0
  200. package/templates/.onion/contexts/technical/commands/starter/help.md +306 -0
  201. package/templates/.onion/contexts/technical/commands/starter/init.md +139 -0
  202. package/templates/.onion/contexts/technical/commands/starter/plan.md +111 -0
  203. package/templates/.onion/contexts/technical/commands/starter/pr.md +136 -0
  204. package/templates/.onion/contexts/technical/commands/starter/sync.md +228 -0
  205. package/templates/.onion/contexts/technical/commands/starter/warm-up.md +173 -0
  206. package/templates/.onion/contexts/technical/commands/starter/work.md +169 -0
  207. package/templates/.onion/core/commands/help.md +388 -0
@@ -0,0 +1,182 @@
1
+ # 📅 Padrões Oficiais de Data/Hora - Sistema Onion
2
+
3
+ ## 🚨 **CRÍTICO - PADRÕES OBRIGATÓRIOS**
4
+
5
+ ### **📁 1. Pastas de Sessão Arquivadas**
6
+
7
+ **✅ FORMATO CORRETO:**
8
+ ```bash
9
+ # Comando para mover sessões
10
+ mv .cursor/sessions/nome-sessao .cursor/sessions/archived/$(date +%Y-%m-%d_%H%M)_nome-sessao
11
+
12
+ # Exemplo de resultado:
13
+ 2025-09-29_0012_implementar-docs-help/
14
+ ```
15
+
16
+ **📋 Padrão**: `YYYY-MM-DD_HHMM_nome-sessao`
17
+
18
+ ---
19
+
20
+ ### **💬 2. Timestamps em Comentários ClickUp**
21
+
22
+ **✅ FORMATO CORRETO:**
23
+ ```bash
24
+ # Em comandos bash
25
+ ⏰ Completed: $(date +'%d/%m/%Y %H:%M:%S')
26
+
27
+ # Em JavaScript (templates)
28
+ new Date().toLocaleString('pt-BR', {
29
+ day: '2-digit',
30
+ month: '2-digit',
31
+ year: 'numeric',
32
+ hour: '2-digit',
33
+ minute: '2-digit'
34
+ })
35
+ ```
36
+
37
+ **📋 Padrão**: `dd/mm/yyyy hh:mm` (formato brasileiro)
38
+
39
+ ---
40
+
41
+ ### **📝 3. Contextos de Sessão e Logs**
42
+
43
+ **✅ FORMATO CORRETO:**
44
+ ```bash
45
+ **Created**: $(date +'%d/%m/%Y %H:%M:%S')
46
+ **Started**: $(date +'%d/%m/%Y %H:%M:%S')
47
+ **Emergency Start**: $(date +'%d/%m/%Y %H:%M:%S')
48
+ ```
49
+
50
+ **📋 Padrão**: `dd/mm/yyyy hh:mm` (formato brasileiro)
51
+
52
+ ---
53
+
54
+ ### **🕒 4. Headers de Log por Data**
55
+
56
+ **✅ FORMATO CORRETO:**
57
+ ```bash
58
+ ### **$(date +'%d/%m/%Y') - Session Initialization**
59
+ ```
60
+
61
+ **📋 Padrão**: `dd/mm/yyyy` (formato brasileiro)
62
+
63
+ ---
64
+
65
+ ## ❌ **FORMATOS PROIBIDOS**
66
+
67
+ ### **🚫 Não Use:**
68
+ ```bash
69
+ # ERRADO - formato americano/ISO em contextos de usuário
70
+ $(date +'%Y-%m-%d %H:%M:%S')
71
+ $(date +'%Y-%m-%d %H:%M')
72
+
73
+ # ERRADO - JavaScript genérico
74
+ new Date().toLocaleString() // Varia por região
75
+
76
+ # ERRADO - formato misto
77
+ $(date +'%d-%m-%Y %H:%M')
78
+ ```
79
+
80
+ ---
81
+
82
+ ## 📋 **Checklist de Validação**
83
+
84
+ ### **✅ Antes de Commitar:**
85
+ - [ ] Pastas arquivadas usam `YYYY-MM-DD_HHMM_nome`
86
+ - [ ] Comentários ClickUp usam `dd/mm/yyyy hh:mm`
87
+ - [ ] Contextos de sessão usam `dd/mm/yyyy hh:mm`
88
+ - [ ] JavaScript usa `toLocaleString('pt-BR', options)`
89
+ - [ ] Headers de log usam `dd/mm/yyyy`
90
+
91
+ ### **🔍 Comandos de Verificação:**
92
+ ```bash
93
+ # Buscar padrões incorretos
94
+ grep -r "Y-%m-%d %H:%M" .cursor/commands/
95
+ grep -r "toLocaleString()" .cursor/utils/
96
+
97
+ # Buscar padrões corretos
98
+ grep -r "%d/%m/%Y %H:%M" .cursor/commands/
99
+ ```
100
+
101
+ ---
102
+
103
+ ## 🛠️ **Ferramentas de Correção**
104
+
105
+ ### **Busca e Substituição Automática:**
106
+ ```bash
107
+ # Corrigir formato de data em contextos
108
+ sed -i 's/\$(date +'\''%Y-%m-%d %H:%M:%S'\'')/\$(date +'\''%d\/%m\/%Y %H:%M'\'')/g' arquivo.md
109
+
110
+ # Corrigir formato de data em timestamps
111
+ sed -i 's/\$(date +'\''%Y-%m-%d %H:%M'\'')/\$(date +'\''%d\/%m\/%Y %H:%M'\'')/g' arquivo.md
112
+ ```
113
+
114
+ ---
115
+
116
+ ## 📚 **Referências**
117
+
118
+ ### **Documentos Corrigidos:**
119
+ - ✅ `.cursor/commands/git/feature/start.md`
120
+ - ✅ `.cursor/commands/engineer/hotfix.md`
121
+ - ✅ `.cursor/commands/git/hotfix/start.md`
122
+ - ✅ `.cursor/utils/clickup-comment-formatter.md`
123
+ - ✅ `.cursor/docs/clickup/clickup-formatting.md`
124
+
125
+ ### **Documentos Já Corretos:**
126
+ - ✅ `.cursor/commands/git/README.md` (linha 464)
127
+
128
+ ---
129
+
130
+ ## 🎯 **Importância**
131
+
132
+ **📊 Consistência de UX:**
133
+ - Usuários brasileiros esperam formato `dd/mm/yyyy`
134
+ - Comentários ClickUp devem ser legíveis para stakeholders
135
+ - Uniformidade em todo o sistema
136
+
137
+ **🔧 Manutenibilidade:**
138
+ - Padrão único facilita manutenção
139
+ - Busca e substituição automática
140
+ - Validação automatizada
141
+
142
+ **🌍 Localização:**
143
+ - Adequado para usuários brasileiros
144
+ - JavaScript configurado para pt-BR
145
+ - Comandos bash com formato brasileiro
146
+
147
+ ---
148
+
149
+ ## ⚠️ **ATENÇÃO ESPECIAL**
150
+
151
+ ### **Contextos que Requerem Cuidado:**
152
+ 1. **Sessions Archiving** - Nome da pasta vs timestamps internos
153
+ 2. **ClickUp Integration** - Comentários vs task descriptions
154
+ 3. **Git Commands** - Logs vs metadados
155
+ 4. **JavaScript Templates** - Locale correto vs fallback
156
+
157
+ ### **🚨 ERRO CRÍTICO IDENTIFICADO:**
158
+ **NEVER use bash commands in ClickUp comments!**
159
+
160
+ ❌ **INCORRETO**:
161
+ ```bash
162
+ # Em comentários ClickUp - NÃO FUNCIONA
163
+ ⏰ Setup Complete: $(date +'%d/%m/%Y %H:%M:%S')
164
+ ```
165
+
166
+ ✅ **CORRETO**:
167
+ ```bash
168
+ # Gerar timestamp ANTES de enviar para ClickUp
169
+ TIMESTAMP=$(date +'%d/%m/%Y %H:%M:%S')
170
+ # Então usar $TIMESTAMP no comentário ClickUp
171
+ ⏰ Setup Complete: 29/09/2025 00:18
172
+ ```
173
+
174
+ **Razão**: ClickUp não executa comandos bash - exibe literalmente `$(date +...)` no comentário.
175
+
176
+ ### **Validação Obrigatória:**
177
+ Todo novo comando ou template que gere data/hora deve ser validado contra este documento antes do merge.
178
+
179
+ ---
180
+
181
+ **🧅 Padrões mantidos pelo Sistema Onion**
182
+ **📅 Última atualização: 29/09/2025 00:15**
@@ -0,0 +1,94 @@
1
+ # 🔌 Task Manager Abstraction Layer
2
+
3
+ ## 🎯 Propósito
4
+
5
+ Camada de abstração que permite trocar o gerenciador de tarefas (ClickUp, Asana, Linear) sem modificar os comandos do Sistema Onion.
6
+
7
+ ## 📁 Estrutura
8
+
9
+ ```
10
+ task-manager/
11
+ ├── README.md # Este arquivo
12
+ ├── interface.md # Interface ITaskManager
13
+ ├── types.md # Tipos compartilhados
14
+ ├── detector.md # Detecção de provedor
15
+ ├── factory.md # Factory para adapters
16
+ └── adapters/
17
+ ├── clickup.md # Adapter ClickUp
18
+ ├── asana.md # Adapter Asana
19
+ └── linear.md # Adapter Linear (stub)
20
+ ```
21
+
22
+ ## ⚡ Uso Rápido
23
+
24
+ ### 1. Configurar Provedor
25
+
26
+ No `.env`:
27
+ ```bash
28
+ TASK_MANAGER_PROVIDER=clickup # clickup | asana | linear | none
29
+ ```
30
+
31
+ ### 2. Usar nos Comandos
32
+
33
+ ```typescript
34
+ // Importar factory
35
+ import { getTaskManager } from '.cursor/utils/task-manager/factory';
36
+
37
+ // Obter adapter configurado
38
+ const taskManager = getTaskManager();
39
+
40
+ // Usar interface comum
41
+ const task = await taskManager.createTask({
42
+ name: 'Minha Task',
43
+ description: 'Descrição da task'
44
+ });
45
+ ```
46
+
47
+ ## 🔧 Provedores Suportados
48
+
49
+ | Provedor | Status | Notas |
50
+ |----------|--------|-------|
51
+ | ClickUp | ✅ Completo | Via MCP |
52
+ | Asana | ✅ Completo | Via MCP |
53
+ | Linear | 📝 Stub | Documentado para implementação |
54
+ | None | ✅ Funcional | Modo offline |
55
+
56
+ ## 📊 Fluxo de Execução
57
+
58
+ ```
59
+ Comando Onion
60
+
61
+
62
+ ┌─────────────┐
63
+ │ Factory │ → detectProvider() → TASK_MANAGER_PROVIDER
64
+ └─────────────┘
65
+
66
+
67
+ ┌─────────────┐
68
+ │ Adapter │ → ClickUp | Asana | Linear | None
69
+ └─────────────┘
70
+
71
+
72
+ ┌─────────────┐
73
+ │ API/MCP │ → Executa operação
74
+ └─────────────┘
75
+ ```
76
+
77
+ ## 🔗 Referências
78
+
79
+ - [Interface ITaskManager](./interface.md)
80
+ - [Tipos Compartilhados](./types.md)
81
+ - [Detector de Provedor](./detector.md)
82
+ - [Factory](./factory.md)
83
+
84
+ ## 📚 Documentação Relacionada
85
+
86
+ - `docs/knowbase/task-manager-abstraction.md` - Knowledge Base completa
87
+ - `docs/onion/getting-started.md` - Setup inicial
88
+ - `.env.example` - Variáveis de ambiente
89
+
90
+ ---
91
+
92
+ **Versão**: 1.0.0
93
+ **Criado em**: 2025-11-24
94
+
@@ -0,0 +1,377 @@
1
+ # 🟠 Asana Adapter
2
+
3
+ ## 🎯 Propósito
4
+
5
+ Implementação do `ITaskManager` para Asana usando o MCP (Model Context Protocol) do Asana.
6
+
7
+ ---
8
+
9
+ ## 📋 Configuração
10
+
11
+ ### Variáveis de Ambiente
12
+
13
+ ```bash
14
+ # Obrigatória
15
+ ASANA_ACCESS_TOKEN=1/xxxxx
16
+
17
+ # Opcionais
18
+ ASANA_WORKSPACE_ID=1234567890123456 # Workspace padrão
19
+ ASANA_DEFAULT_PROJECT_ID=1234567890123456 # Projeto padrão
20
+ ```
21
+
22
+ ### Obter Token
23
+
24
+ 1. Acesse Asana → My Settings → Apps → Developer Apps
25
+ 2. Clique em "Create new app" ou use existente
26
+ 3. Gere um Personal Access Token
27
+ 4. Copie o token e adicione ao `.env`
28
+
29
+ ---
30
+
31
+ ## 🔧 Implementação
32
+
33
+ ```typescript
34
+ /**
35
+ * Adapter Asana implementando ITaskManager.
36
+ * Usa Asana MCP para todas as operações.
37
+ */
38
+ class AsanaAdapter implements ITaskManager {
39
+ readonly provider: TaskManagerProvider = 'asana';
40
+ readonly isConfigured: boolean;
41
+
42
+ private accessToken: string;
43
+ private workspaceId?: string;
44
+ private defaultProjectId?: string;
45
+
46
+ constructor(config: AsanaAdapterConfig) {
47
+ this.accessToken = config.accessToken;
48
+ this.workspaceId = config.workspaceId;
49
+ this.defaultProjectId = config.defaultProjectId;
50
+ this.isConfigured = !!this.accessToken;
51
+ }
52
+
53
+ // ═══════════════════════════════════════════════════════════════════════════
54
+ // CRUD DE TASKS
55
+ // ═══════════════════════════════════════════════════════════════════════════
56
+
57
+ async createTask(input: CreateTaskInput): Promise<TaskOutput> {
58
+ const projectId = input.projectId || this.defaultProjectId;
59
+
60
+ const result = await mcp_asana_asana_create_task({
61
+ name: input.name,
62
+ notes: input.description,
63
+ html_notes: input.markdownDescription,
64
+ project_id: projectId,
65
+ workspace: this.workspaceId,
66
+ due_on: input.dueDate,
67
+ start_on: input.startDate,
68
+ assignee: input.assignees?.[0] // Asana suporta apenas 1 assignee
69
+ });
70
+
71
+ const data = JSON.parse(result.content[0].text);
72
+ return this.normalizeTask(data.data || data);
73
+ }
74
+
75
+ async getTask(taskId: string): Promise<TaskOutput> {
76
+ const result = await mcp_asana_asana_get_task({
77
+ task_id: taskId,
78
+ opt_fields: 'name,notes,completed,due_on,start_on,assignee,tags,parent,projects,subtasks,created_at,modified_at,permalink_url'
79
+ });
80
+
81
+ const data = JSON.parse(result.content[0].text);
82
+ return this.normalizeTask(data.data || data);
83
+ }
84
+
85
+ async updateTask(taskId: string, updates: UpdateTaskInput): Promise<TaskOutput> {
86
+ const updateParams: any = {
87
+ task_id: taskId
88
+ };
89
+
90
+ if (updates.name) updateParams.name = updates.name;
91
+ if (updates.description) updateParams.notes = updates.description;
92
+ if (updates.status === 'done' || updates.status === 'closed') {
93
+ updateParams.completed = true;
94
+ } else if (updates.status) {
95
+ updateParams.completed = false;
96
+ }
97
+ if (updates.dueDate !== undefined) updateParams.due_on = updates.dueDate;
98
+ if (updates.startDate !== undefined) updateParams.start_on = updates.startDate;
99
+ if (updates.assignees?.length) updateParams.assignee = updates.assignees[0];
100
+
101
+ const result = await mcp_asana_asana_update_task(updateParams);
102
+
103
+ const data = JSON.parse(result.content[0].text);
104
+ return this.normalizeTask(data.data || data);
105
+ }
106
+
107
+ async deleteTask(taskId: string): Promise<boolean> {
108
+ try {
109
+ await mcp_asana_asana_delete_task({ task_id: taskId });
110
+ return true;
111
+ } catch {
112
+ return false;
113
+ }
114
+ }
115
+
116
+ // ═══════════════════════════════════════════════════════════════════════════
117
+ // SUBTASKS
118
+ // ═══════════════════════════════════════════════════════════════════════════
119
+
120
+ async createSubtask(parentId: string, input: CreateTaskInput): Promise<TaskOutput> {
121
+ const result = await mcp_asana_asana_create_task({
122
+ name: input.name,
123
+ notes: input.description,
124
+ parent: parentId, // ← Torna subtask
125
+ workspace: this.workspaceId
126
+ });
127
+
128
+ const data = JSON.parse(result.content[0].text);
129
+ return this.normalizeTask(data.data || data);
130
+ }
131
+
132
+ async getSubtasks(parentId: string): Promise<TaskOutput[]> {
133
+ const result = await mcp_asana_asana_get_tasks({
134
+ parent: parentId,
135
+ opt_fields: 'name,notes,completed,due_on,assignee,permalink_url'
136
+ });
137
+
138
+ const data = JSON.parse(result.content[0].text);
139
+ return (data.data || []).map((t: any) => this.normalizeTask(t));
140
+ }
141
+
142
+ // ═══════════════════════════════════════════════════════════════════════════
143
+ // COMENTÁRIOS
144
+ // ═══════════════════════════════════════════════════════════════════════════
145
+
146
+ async addComment(taskId: string, comment: string): Promise<CommentOutput> {
147
+ const result = await mcp_asana_asana_create_task_story({
148
+ task_id: taskId,
149
+ text: comment
150
+ });
151
+
152
+ const data = JSON.parse(result.content[0].text);
153
+ const story = data.data || data;
154
+
155
+ return {
156
+ id: story.gid,
157
+ text: comment,
158
+ author: {
159
+ id: story.created_by?.gid || 'unknown',
160
+ name: story.created_by?.name || 'Unknown'
161
+ },
162
+ createdAt: story.created_at || new Date().toISOString()
163
+ };
164
+ }
165
+
166
+ async getComments(taskId: string): Promise<CommentOutput[]> {
167
+ const result = await mcp_asana_asana_get_stories_for_task({
168
+ task_id: taskId,
169
+ opt_fields: 'text,created_by,created_at,type'
170
+ });
171
+
172
+ const data = JSON.parse(result.content[0].text);
173
+ return (data.data || [])
174
+ .filter((s: any) => s.type === 'comment')
175
+ .map((s: any) => ({
176
+ id: s.gid,
177
+ text: s.text,
178
+ author: {
179
+ id: s.created_by?.gid || 'unknown',
180
+ name: s.created_by?.name || 'Unknown'
181
+ },
182
+ createdAt: s.created_at
183
+ }));
184
+ }
185
+
186
+ // ═══════════════════════════════════════════════════════════════════════════
187
+ // STATUS
188
+ // ═══════════════════════════════════════════════════════════════════════════
189
+
190
+ async updateStatus(taskId: string, status: TaskStatus): Promise<TaskOutput> {
191
+ // Asana usa completed: true/false para status
192
+ const completed = status === 'done' || status === 'closed';
193
+ return this.updateTask(taskId, { status });
194
+ }
195
+
196
+ // ═══════════════════════════════════════════════════════════════════════════
197
+ // BUSCA
198
+ // ═══════════════════════════════════════════════════════════════════════════
199
+
200
+ async searchTasks(query: SearchQuery): Promise<TaskOutput[]> {
201
+ const searchParams: any = {
202
+ workspace: this.workspaceId,
203
+ opt_fields: 'name,notes,completed,due_on,assignee,permalink_url'
204
+ };
205
+
206
+ if (query.text) searchParams.text = query.text;
207
+ if (query.projectId) searchParams.projects_any = query.projectId;
208
+ if (query.assignee) searchParams.assignee_any = query.assignee;
209
+ if (query.status?.includes('done')) searchParams.completed = true;
210
+ if (query.status?.includes('todo')) searchParams.completed = false;
211
+
212
+ const result = await mcp_asana_asana_search_tasks(searchParams);
213
+
214
+ const data = JSON.parse(result.content[0].text);
215
+ return (data.data || [])
216
+ .slice(0, query.limit || 50)
217
+ .map((t: any) => this.normalizeTask(t));
218
+ }
219
+
220
+ // ═══════════════════════════════════════════════════════════════════════════
221
+ // PROJETOS
222
+ // ═══════════════════════════════════════════════════════════════════════════
223
+
224
+ async getProjectList(): Promise<ProjectOutput[]> {
225
+ const result = await mcp_asana_asana_get_projects({
226
+ workspace: this.workspaceId,
227
+ opt_fields: 'name,notes,permalink_url,archived'
228
+ });
229
+
230
+ const data = JSON.parse(result.content[0].text);
231
+ return (data.data || []).map((p: any) => ({
232
+ id: p.gid,
233
+ name: p.name,
234
+ description: p.notes,
235
+ url: p.permalink_url,
236
+ archived: p.archived,
237
+ workspaceId: this.workspaceId
238
+ }));
239
+ }
240
+
241
+ async getProject(projectId: string): Promise<ProjectOutput> {
242
+ const result = await mcp_asana_asana_get_project({
243
+ project_id: projectId,
244
+ opt_fields: 'name,notes,permalink_url,archived'
245
+ });
246
+
247
+ const data = JSON.parse(result.content[0].text);
248
+ const project = data.data || data;
249
+
250
+ return {
251
+ id: project.gid,
252
+ name: project.name,
253
+ description: project.notes,
254
+ url: project.permalink_url,
255
+ archived: project.archived,
256
+ workspaceId: this.workspaceId
257
+ };
258
+ }
259
+
260
+ // ═══════════════════════════════════════════════════════════════════════════
261
+ // VALIDAÇÃO
262
+ // ═══════════════════════════════════════════════════════════════════════════
263
+
264
+ validateTaskId(taskId: string): boolean {
265
+ // Asana IDs: 15+ dígitos numéricos
266
+ return /^\d{15,}$/.test(taskId);
267
+ }
268
+
269
+ getProviderFromTaskId(taskId: string): TaskManagerProvider | null {
270
+ return this.validateTaskId(taskId) ? 'asana' : null;
271
+ }
272
+
273
+ // ═══════════════════════════════════════════════════════════════════════════
274
+ // HELPERS PRIVADOS
275
+ // ═══════════════════════════════════════════════════════════════════════════
276
+
277
+ private normalizeTask(raw: any): TaskOutput {
278
+ return {
279
+ id: raw.gid,
280
+ provider: 'asana',
281
+ name: raw.name,
282
+ description: raw.notes || '',
283
+ status: raw.completed ? 'done' : 'todo',
284
+ statusRaw: raw.completed ? 'Completed' : 'Not Completed',
285
+ url: raw.permalink_url || `https://app.asana.com/0/0/${raw.gid}`,
286
+ createdAt: raw.created_at || new Date().toISOString(),
287
+ updatedAt: raw.modified_at || new Date().toISOString(),
288
+ dueDate: raw.due_on,
289
+ startDate: raw.start_on,
290
+ assignees: raw.assignee ? [{
291
+ id: raw.assignee.gid,
292
+ name: raw.assignee.name,
293
+ email: raw.assignee.email
294
+ }] : [],
295
+ tags: (raw.tags || []).map((t: any) => t.name),
296
+ parent: raw.parent?.gid,
297
+ projectId: raw.projects?.[0]?.gid,
298
+ projectName: raw.projects?.[0]?.name
299
+ };
300
+ }
301
+ }
302
+ ```
303
+
304
+ ---
305
+
306
+ ## 📊 Mapeamento de Campos
307
+
308
+ ### Task Fields
309
+
310
+ | Interface | Asana API | Notas |
311
+ |-----------|-----------|-------|
312
+ | `name` | `name` | Direto |
313
+ | `description` | `notes` | Texto plano |
314
+ | `markdownDescription` | `html_notes` | Com HTML |
315
+ | `status` | `completed` | Boolean |
316
+ | `priority` | - | Não suportado nativamente |
317
+ | `dueDate` | `due_on` | YYYY-MM-DD |
318
+ | `assignees` | `assignee` | Apenas 1 no Asana |
319
+ | `tags` | `tags[].name` | Array |
320
+ | `projectId` | `projects[0].gid` | GID do projeto |
321
+
322
+ ### Status Mapping
323
+
324
+ | Interface | Asana |
325
+ |-----------|-------|
326
+ | `todo`, `backlog`, `in_progress`, `review` | `completed: false` |
327
+ | `done`, `closed` | `completed: true` |
328
+
329
+ ---
330
+
331
+ ## ⚠️ Limitações do Asana
332
+
333
+ 1. **Apenas 1 assignee** por task (vs múltiplos no ClickUp)
334
+ 2. **Sem prioridade nativa** - usar custom fields ou tags
335
+ 3. **Status binário** - completed ou não (usar seções para workflow)
336
+ 4. **IDs numéricos longos** - 16+ dígitos
337
+
338
+ ---
339
+
340
+ ## 🧪 Exemplos de Uso
341
+
342
+ ```typescript
343
+ // Via Factory (com TASK_MANAGER_PROVIDER=asana)
344
+ const tm = getTaskManager();
345
+
346
+ // Criar task
347
+ const task = await tm.createTask({
348
+ name: 'Nova Feature',
349
+ description: 'Implementar funcionalidade X',
350
+ projectId: '1234567890123456'
351
+ });
352
+
353
+ // Criar subtask
354
+ const subtask = await tm.createSubtask(task.id, {
355
+ name: 'Fase 1: Setup'
356
+ });
357
+
358
+ // Marcar como concluída
359
+ await tm.updateStatus(subtask.id, 'done');
360
+
361
+ // Adicionar comentário
362
+ await tm.addComment(task.id, '🚀 Desenvolvimento iniciado!');
363
+ ```
364
+
365
+ ---
366
+
367
+ ## 📚 Referências
368
+
369
+ - [Asana API Docs](https://developers.asana.com/)
370
+ - [Interface ITaskManager](../interface.md)
371
+ - [Types](../types.md)
372
+
373
+ ---
374
+
375
+ **Versão**: 1.0.0
376
+ **Criado em**: 2025-11-24
377
+