@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,363 @@
1
+ # 🏭 Factory - Task Manager
2
+
3
+ ## 🎯 Propósito
4
+
5
+ Fornece uma factory para instanciar o adapter correto baseado na configuração do ambiente, abstraindo a criação e permitindo uso simplificado nos comandos.
6
+
7
+ ---
8
+
9
+ ## 📋 Função Principal
10
+
11
+ ### getTaskManager()
12
+
13
+ ```typescript
14
+ /**
15
+ * Retorna uma instância do TaskManager configurado.
16
+ * Baseado em TASK_MANAGER_PROVIDER no .env
17
+ *
18
+ * @param options - Opções de configuração (opcional)
19
+ * @returns Instância do adapter apropriado
20
+ *
21
+ * @example
22
+ * const tm = getTaskManager();
23
+ * const task = await tm.createTask({ name: 'Nova Task' });
24
+ */
25
+ function getTaskManager(options?: FactoryOptions): ITaskManager {
26
+ const config = detectProvider();
27
+
28
+ // Log de debug (se habilitado)
29
+ if (options?.debug) {
30
+ console.log(`[TaskManager] Provider: ${config.provider}`);
31
+ console.log(`[TaskManager] Configured: ${config.isConfigured}`);
32
+ }
33
+
34
+ // Se não está configurado, decidir comportamento
35
+ if (!config.isConfigured) {
36
+ if (options?.throwOnMisconfigured) {
37
+ throw new Error(config.errorMessage || 'Provider not configured');
38
+ }
39
+
40
+ // Aviso e fallback para NoProviderAdapter
41
+ console.warn(`⚠️ ${config.errorMessage}`);
42
+ console.warn(`💡 Continuando em modo offline...`);
43
+ return new NoProviderAdapter();
44
+ }
45
+
46
+ // Instanciar adapter apropriado
47
+ switch (config.provider) {
48
+ case 'clickup':
49
+ return new ClickUpAdapter({
50
+ apiToken: process.env.CLICKUP_API_TOKEN!,
51
+ workspaceId: process.env.CLICKUP_WORKSPACE_ID,
52
+ defaultListId: process.env.CLICKUP_DEFAULT_LIST_ID
53
+ });
54
+
55
+ case 'asana':
56
+ return new AsanaAdapter({
57
+ accessToken: process.env.ASANA_ACCESS_TOKEN!,
58
+ workspaceId: process.env.ASANA_WORKSPACE_ID,
59
+ defaultProjectId: process.env.ASANA_DEFAULT_PROJECT_ID
60
+ });
61
+
62
+ case 'linear':
63
+ return new LinearAdapter({
64
+ apiKey: process.env.LINEAR_API_KEY!,
65
+ teamId: process.env.LINEAR_TEAM_ID
66
+ });
67
+
68
+ case 'none':
69
+ default:
70
+ return new NoProviderAdapter();
71
+ }
72
+ }
73
+ ```
74
+
75
+ ---
76
+
77
+ ## ⚙️ Tipos da Factory
78
+
79
+ ```typescript
80
+ /**
81
+ * Opções para a factory.
82
+ */
83
+ interface FactoryOptions {
84
+ /** Habilita logs de debug */
85
+ debug?: boolean;
86
+
87
+ /** Lança erro se provedor não configurado (ao invés de fallback) */
88
+ throwOnMisconfigured?: boolean;
89
+
90
+ /** Força um provedor específico (ignora .env) */
91
+ forceProvider?: TaskManagerProvider;
92
+ }
93
+
94
+ /**
95
+ * Configuração para ClickUp Adapter.
96
+ */
97
+ interface ClickUpAdapterConfig {
98
+ apiToken: string;
99
+ workspaceId?: string;
100
+ defaultListId?: string;
101
+ }
102
+
103
+ /**
104
+ * Configuração para Asana Adapter.
105
+ */
106
+ interface AsanaAdapterConfig {
107
+ accessToken: string;
108
+ workspaceId?: string;
109
+ defaultProjectId?: string;
110
+ }
111
+
112
+ /**
113
+ * Configuração para Linear Adapter.
114
+ */
115
+ interface LinearAdapterConfig {
116
+ apiKey: string;
117
+ teamId?: string;
118
+ }
119
+ ```
120
+
121
+ ---
122
+
123
+ ## 🔄 Funções Auxiliares
124
+
125
+ ### getTaskManagerOrFail()
126
+
127
+ ```typescript
128
+ /**
129
+ * Versão da factory que lança erro se não configurado.
130
+ * Útil para comandos que REQUEREM um provedor.
131
+ *
132
+ * @throws Error se provedor não configurado
133
+ */
134
+ function getTaskManagerOrFail(): ITaskManager {
135
+ return getTaskManager({ throwOnMisconfigured: true });
136
+ }
137
+ ```
138
+
139
+ ### getTaskManagerWithWarning()
140
+
141
+ ```typescript
142
+ /**
143
+ * Versão da factory que mostra warning formatado.
144
+ * Útil para comandos que podem funcionar sem provedor.
145
+ *
146
+ * @returns Adapter + flag indicando se está em modo offline
147
+ */
148
+ function getTaskManagerWithWarning(): {
149
+ taskManager: ITaskManager;
150
+ isOffline: boolean;
151
+ warning?: string;
152
+ } {
153
+ const config = detectProvider();
154
+ const taskManager = getTaskManager();
155
+
156
+ if (config.provider === 'none' || !config.isConfigured) {
157
+ return {
158
+ taskManager,
159
+ isOffline: true,
160
+ warning: `⚠️ MODO OFFLINE ATIVADO
161
+ ━━━━━━━━━━━━━━━━━━━━━━━━
162
+ Nenhum gerenciador de tarefas configurado.
163
+
164
+ Funcionalidades disponíveis:
165
+ ✅ Criar documentos locais
166
+ ✅ Gerar estrutura de sessão
167
+ ❌ Sincronizar com ClickUp/Asana/Linear
168
+ ❌ Atualizar status de tasks
169
+
170
+ 💡 Para habilitar sincronização:
171
+ Execute /meta/setup-integration
172
+ ━━━━━━━━━━━━━━━━━━━━━━━━`
173
+ };
174
+ }
175
+
176
+ return {
177
+ taskManager,
178
+ isOffline: false
179
+ };
180
+ }
181
+ ```
182
+
183
+ ---
184
+
185
+ ## 📊 Classe Base NoProviderAdapter
186
+
187
+ ```typescript
188
+ /**
189
+ * Adapter de fallback quando nenhum provedor está configurado.
190
+ * Permite operações locais e gera IDs locais.
191
+ */
192
+ class NoProviderAdapter implements ITaskManager {
193
+ readonly provider: TaskManagerProvider = 'none';
194
+ readonly isConfigured: boolean = false;
195
+
196
+ async createTask(input: CreateTaskInput): Promise<TaskOutput> {
197
+ console.warn('⚠️ Criando task LOCAL (não sincronizada)');
198
+
199
+ const localId = `local-${Date.now()}`;
200
+
201
+ return {
202
+ id: localId,
203
+ provider: 'none',
204
+ name: input.name,
205
+ description: input.description || '',
206
+ status: 'todo',
207
+ url: '', // Sem URL pois é local
208
+ createdAt: new Date().toISOString(),
209
+ updatedAt: new Date().toISOString(),
210
+ assignees: [],
211
+ tags: input.tags || [],
212
+ dueDate: input.dueDate,
213
+ priority: input.priority
214
+ };
215
+ }
216
+
217
+ async getTask(taskId: string): Promise<TaskOutput> {
218
+ console.warn(`⚠️ getTask('${taskId}') - Operando em modo offline`);
219
+ throw new Error('Operação não disponível em modo offline');
220
+ }
221
+
222
+ async updateTask(taskId: string, updates: UpdateTaskInput): Promise<TaskOutput> {
223
+ console.warn(`⚠️ updateTask('${taskId}') - Operando em modo offline`);
224
+ throw new Error('Operação não disponível em modo offline');
225
+ }
226
+
227
+ async deleteTask(taskId: string): Promise<boolean> {
228
+ console.warn(`⚠️ deleteTask('${taskId}') - Operando em modo offline`);
229
+ return false;
230
+ }
231
+
232
+ async createSubtask(parentId: string, input: CreateTaskInput): Promise<TaskOutput> {
233
+ console.warn('⚠️ Criando subtask LOCAL (não sincronizada)');
234
+
235
+ const localId = `local-${Date.now()}-sub`;
236
+
237
+ return {
238
+ id: localId,
239
+ provider: 'none',
240
+ name: input.name,
241
+ description: input.description || '',
242
+ status: 'todo',
243
+ url: '',
244
+ createdAt: new Date().toISOString(),
245
+ updatedAt: new Date().toISOString(),
246
+ assignees: [],
247
+ tags: input.tags || [],
248
+ parent: parentId
249
+ };
250
+ }
251
+
252
+ async getSubtasks(parentId: string): Promise<TaskOutput[]> {
253
+ console.warn(`⚠️ getSubtasks('${parentId}') - Operando em modo offline`);
254
+ return [];
255
+ }
256
+
257
+ async addComment(taskId: string, comment: string): Promise<CommentOutput> {
258
+ console.warn(`⚠️ addComment('${taskId}') - Operando em modo offline`);
259
+
260
+ return {
261
+ id: `local-comment-${Date.now()}`,
262
+ text: comment,
263
+ author: { id: 'local', name: 'Local User' },
264
+ createdAt: new Date().toISOString()
265
+ };
266
+ }
267
+
268
+ async getComments(taskId: string): Promise<CommentOutput[]> {
269
+ return [];
270
+ }
271
+
272
+ async updateStatus(taskId: string, status: TaskStatus): Promise<TaskOutput> {
273
+ console.warn(`⚠️ updateStatus('${taskId}', '${status}') - Operando em modo offline`);
274
+ throw new Error('Operação não disponível em modo offline');
275
+ }
276
+
277
+ async searchTasks(query: SearchQuery): Promise<TaskOutput[]> {
278
+ console.warn('⚠️ searchTasks() - Operando em modo offline');
279
+ return [];
280
+ }
281
+
282
+ async getProjectList(): Promise<ProjectOutput[]> {
283
+ return [];
284
+ }
285
+
286
+ async getProject(projectId: string): Promise<ProjectOutput> {
287
+ throw new Error('Operação não disponível em modo offline');
288
+ }
289
+
290
+ validateTaskId(taskId: string): boolean {
291
+ return /^local-\d+(-sub)?$/.test(taskId);
292
+ }
293
+
294
+ getProviderFromTaskId(taskId: string): TaskManagerProvider | null {
295
+ return detectProviderFromTaskId(taskId);
296
+ }
297
+ }
298
+ ```
299
+
300
+ ---
301
+
302
+ ## 🧪 Exemplos de Uso
303
+
304
+ ### Uso Básico
305
+
306
+ ```typescript
307
+ // Obter adapter configurado
308
+ const taskManager = getTaskManager();
309
+
310
+ // Verificar se está online
311
+ if (taskManager.isConfigured) {
312
+ const task = await taskManager.createTask({
313
+ name: 'Minha Task',
314
+ description: 'Descrição'
315
+ });
316
+ console.log(`✅ Task criada: ${task.url}`);
317
+ } else {
318
+ console.log('⚠️ Modo offline - task não será sincronizada');
319
+ }
320
+ ```
321
+
322
+ ### Uso com Validação
323
+
324
+ ```typescript
325
+ // Requer provedor configurado
326
+ try {
327
+ const taskManager = getTaskManagerOrFail();
328
+ await taskManager.updateStatus(taskId, 'done');
329
+ } catch (error) {
330
+ console.error('❌ Provedor não configurado');
331
+ // Sugerir /meta/setup-integration
332
+ }
333
+ ```
334
+
335
+ ### Uso com Warning
336
+
337
+ ```typescript
338
+ // Mostrar warning se offline
339
+ const { taskManager, isOffline, warning } = getTaskManagerWithWarning();
340
+
341
+ if (isOffline) {
342
+ console.log(warning);
343
+ }
344
+
345
+ // Continuar com funcionalidade limitada
346
+ const task = await taskManager.createTask({
347
+ name: 'Task pode ser local'
348
+ });
349
+ ```
350
+
351
+ ---
352
+
353
+ ## 📚 Referências
354
+
355
+ - [Interface ITaskManager](./interface.md)
356
+ - [Detector](./detector.md)
357
+ - [Adapters](./adapters/)
358
+
359
+ ---
360
+
361
+ **Versão**: 1.0.0
362
+ **Criado em**: 2025-11-24
363
+
@@ -0,0 +1,248 @@
1
+ # 📐 Interface ITaskManager
2
+
3
+ ## 🎯 Propósito
4
+
5
+ Define o contrato que todos os adapters de gerenciadores de tarefas devem implementar, garantindo consistência e permitindo troca transparente de provedores.
6
+
7
+ ---
8
+
9
+ ## 📋 Interface Completa
10
+
11
+ ```typescript
12
+ /**
13
+ * Interface abstrata para gerenciadores de tarefas.
14
+ * Todos os adapters (ClickUp, Asana, Linear) devem implementar esta interface.
15
+ */
16
+ interface ITaskManager {
17
+ // ═══════════════════════════════════════════════════════════════════════════
18
+ // IDENTIFICAÇÃO
19
+ // ═══════════════════════════════════════════════════════════════════════════
20
+
21
+ /**
22
+ * Nome do provedor: 'clickup' | 'asana' | 'linear' | 'none'
23
+ */
24
+ readonly provider: TaskManagerProvider;
25
+
26
+ /**
27
+ * Indica se o provedor está configurado corretamente
28
+ */
29
+ readonly isConfigured: boolean;
30
+
31
+ // ═══════════════════════════════════════════════════════════════════════════
32
+ // CRUD DE TASKS
33
+ // ═══════════════════════════════════════════════════════════════════════════
34
+
35
+ /**
36
+ * Cria uma nova task no gerenciador.
37
+ * @param input - Dados da task a criar
38
+ * @returns Task criada com ID e URL
39
+ */
40
+ createTask(input: CreateTaskInput): Promise<TaskOutput>;
41
+
42
+ /**
43
+ * Obtém detalhes de uma task existente.
44
+ * @param taskId - ID da task no provedor
45
+ * @returns Task completa com todos os detalhes
46
+ */
47
+ getTask(taskId: string): Promise<TaskOutput>;
48
+
49
+ /**
50
+ * Atualiza uma task existente.
51
+ * @param taskId - ID da task
52
+ * @param updates - Campos a atualizar (parcial)
53
+ * @returns Task atualizada
54
+ */
55
+ updateTask(taskId: string, updates: UpdateTaskInput): Promise<TaskOutput>;
56
+
57
+ /**
58
+ * Remove uma task.
59
+ * @param taskId - ID da task
60
+ * @returns true se removida com sucesso
61
+ */
62
+ deleteTask(taskId: string): Promise<boolean>;
63
+
64
+ // ═══════════════════════════════════════════════════════════════════════════
65
+ // SUBTASKS
66
+ // ═══════════════════════════════════════════════════════════════════════════
67
+
68
+ /**
69
+ * Cria uma subtask vinculada a uma task pai.
70
+ * @param parentId - ID da task pai
71
+ * @param input - Dados da subtask
72
+ * @returns Subtask criada
73
+ */
74
+ createSubtask(parentId: string, input: CreateTaskInput): Promise<TaskOutput>;
75
+
76
+ /**
77
+ * Lista todas as subtasks de uma task.
78
+ * @param parentId - ID da task pai
79
+ * @returns Array de subtasks
80
+ */
81
+ getSubtasks(parentId: string): Promise<TaskOutput[]>;
82
+
83
+ // ═══════════════════════════════════════════════════════════════════════════
84
+ // COMENTÁRIOS
85
+ // ═══════════════════════════════════════════════════════════════════════════
86
+
87
+ /**
88
+ * Adiciona um comentário a uma task.
89
+ * @param taskId - ID da task
90
+ * @param comment - Texto do comentário
91
+ * @returns Comentário criado
92
+ */
93
+ addComment(taskId: string, comment: string): Promise<CommentOutput>;
94
+
95
+ /**
96
+ * Lista comentários de uma task.
97
+ * @param taskId - ID da task
98
+ * @returns Array de comentários
99
+ */
100
+ getComments(taskId: string): Promise<CommentOutput[]>;
101
+
102
+ // ═══════════════════════════════════════════════════════════════════════════
103
+ // STATUS
104
+ // ═══════════════════════════════════════════════════════════════════════════
105
+
106
+ /**
107
+ * Atualiza o status de uma task.
108
+ * @param taskId - ID da task
109
+ * @param status - Novo status (mapeado internamente pelo adapter)
110
+ * @returns Task atualizada
111
+ */
112
+ updateStatus(taskId: string, status: TaskStatus): Promise<TaskOutput>;
113
+
114
+ // ═══════════════════════════════════════════════════════════════════════════
115
+ // BUSCA
116
+ // ═══════════════════════════════════════════════════════════════════════════
117
+
118
+ /**
119
+ * Busca tasks com filtros.
120
+ * @param query - Critérios de busca
121
+ * @returns Array de tasks que correspondem aos critérios
122
+ */
123
+ searchTasks(query: SearchQuery): Promise<TaskOutput[]>;
124
+
125
+ // ═══════════════════════════════════════════════════════════════════════════
126
+ // PROJETOS/LISTAS
127
+ // ═══════════════════════════════════════════════════════════════════════════
128
+
129
+ /**
130
+ * Lista projetos/listas disponíveis.
131
+ * @returns Array de projetos
132
+ */
133
+ getProjectList(): Promise<ProjectOutput[]>;
134
+
135
+ /**
136
+ * Obtém detalhes de um projeto.
137
+ * @param projectId - ID do projeto
138
+ * @returns Projeto com detalhes
139
+ */
140
+ getProject(projectId: string): Promise<ProjectOutput>;
141
+
142
+ // ═══════════════════════════════════════════════════════════════════════════
143
+ // VALIDAÇÃO
144
+ // ═══════════════════════════════════════════════════════════════════════════
145
+
146
+ /**
147
+ * Valida se um ID de task é válido para este provedor.
148
+ * @param taskId - ID a validar
149
+ * @returns true se o formato é válido
150
+ */
151
+ validateTaskId(taskId: string): boolean;
152
+
153
+ /**
154
+ * Detecta o provedor de origem de um ID de task.
155
+ * @param taskId - ID da task
156
+ * @returns Nome do provedor ou null se desconhecido
157
+ */
158
+ getProviderFromTaskId(taskId: string): TaskManagerProvider | null;
159
+ }
160
+ ```
161
+
162
+ ---
163
+
164
+ ## 📊 Métodos por Categoria
165
+
166
+ | Categoria | Métodos | Descrição |
167
+ |-----------|---------|-----------|
168
+ | **Identificação** | `provider`, `isConfigured` | Informações do adapter |
169
+ | **CRUD Tasks** | `createTask`, `getTask`, `updateTask`, `deleteTask` | Operações básicas |
170
+ | **Subtasks** | `createSubtask`, `getSubtasks` | Hierarquia de tasks |
171
+ | **Comentários** | `addComment`, `getComments` | Documentação e discussão |
172
+ | **Status** | `updateStatus` | Workflow |
173
+ | **Busca** | `searchTasks` | Localização de tasks |
174
+ | **Projetos** | `getProjectList`, `getProject` | Navegação |
175
+ | **Validação** | `validateTaskId`, `getProviderFromTaskId` | Compatibilidade |
176
+
177
+ ---
178
+
179
+ ## 🔄 Mapeamento por Provedor
180
+
181
+ ### Status
182
+
183
+ | Interface | ClickUp | Asana | Linear |
184
+ |-----------|---------|-------|--------|
185
+ | `backlog` | "backlog" | - | "backlog" |
186
+ | `todo` | "to do" | - | "todo" |
187
+ | `in_progress` | "in progress" | - | "in_progress" |
188
+ | `done` | "done" | completed: true | "done" |
189
+ | `closed` | "closed" | completed: true | "canceled" |
190
+
191
+ ### Prioridade
192
+
193
+ | Interface | ClickUp | Asana | Linear |
194
+ |-----------|---------|-------|--------|
195
+ | `urgent` | 1 | - | 1 |
196
+ | `high` | 2 | - | 2 |
197
+ | `normal` | 3 | - | 3 |
198
+ | `low` | 4 | - | 4 |
199
+
200
+ ---
201
+
202
+ ## 🧪 Exemplo de Uso
203
+
204
+ ```typescript
205
+ // Obter adapter
206
+ const taskManager = getTaskManager();
207
+
208
+ // Verificar configuração
209
+ if (!taskManager.isConfigured) {
210
+ console.warn('⚠️ Provedor não configurado. Execute /meta/setup-integration');
211
+ return;
212
+ }
213
+
214
+ // Criar task
215
+ const task = await taskManager.createTask({
216
+ name: 'Implementar feature X',
217
+ description: 'Descrição detalhada...',
218
+ priority: 'high',
219
+ tags: ['feature', 'v2']
220
+ });
221
+
222
+ console.log(`✅ Task criada: ${task.url}`);
223
+
224
+ // Criar subtask
225
+ const subtask = await taskManager.createSubtask(task.id, {
226
+ name: 'Fase 1: Setup'
227
+ });
228
+
229
+ // Adicionar comentário
230
+ await taskManager.addComment(task.id, '🚀 Desenvolvimento iniciado!');
231
+
232
+ // Atualizar status
233
+ await taskManager.updateStatus(subtask.id, 'in_progress');
234
+ ```
235
+
236
+ ---
237
+
238
+ ## 📚 Referências
239
+
240
+ - [Tipos Compartilhados](./types.md)
241
+ - [Factory](./factory.md)
242
+ - [Adapters](./adapters/)
243
+
244
+ ---
245
+
246
+ **Versão**: 1.0.0
247
+ **Criado em**: 2025-11-24
248
+