@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,539 @@
1
+ # 🛠️ Ferramentas Core do Cursor
2
+
3
+ ## 📑 Índice
4
+
5
+ - [Codebase Operations](#codebase-operations)
6
+ - [File Operations](#file-operations)
7
+ - [Terminal Operations](#terminal-operations)
8
+ - [Search Operations](#search-operations)
9
+ - [Linting & Validation](#linting--validation)
10
+ - [Notebook Operations](#notebook-operations)
11
+ - [Task Management](#task-management)
12
+ - [Memory Management](#memory-management)
13
+
14
+ ---
15
+
16
+ ## Codebase Operations
17
+
18
+ ### `codebase_search`
19
+
20
+ ```typescript
21
+ function codebase_search(params: {
22
+ query: string; // Pergunta completa sobre o que buscar
23
+ target_directories: string[]; // [] para buscar em todo repo, ou path específico
24
+ explanation: string;
25
+ search_only_prs?: boolean;
26
+ }): SearchResults;
27
+ // Propósito: Busca semântica no codebase por significado, não texto exato
28
+ ```
29
+
30
+ **Quando Usar:**
31
+
32
+ - ✅ Explorar codebase desconhecido
33
+ - ✅ Perguntas "como/onde/o que" sobre comportamento
34
+ - ✅ Buscar código por significado
35
+ - ❌ NÃO para texto exato (use `grep`)
36
+ - ❌ NÃO para ler arquivos conhecidos (use `read_file`)
37
+ - ❌ NÃO para símbolos simples (use `grep`)
38
+
39
+ **Exemplos:**
40
+
41
+ ```typescript
42
+ // ✅ Bom
43
+ codebase_search({
44
+ query: 'Where is interface MyInterface implemented in the frontend?',
45
+ target_directories: ['frontend/'],
46
+ explanation: 'Finding implementation locations',
47
+ });
48
+
49
+ // ✅ Bom
50
+ codebase_search({
51
+ query: 'Where do we encrypt user passwords before saving?',
52
+ target_directories: [],
53
+ explanation: 'Understanding password encryption flow',
54
+ });
55
+
56
+ // ❌ Ruim - muito vago
57
+ codebase_search({
58
+ query: 'MyInterface frontend',
59
+ target_directories: [],
60
+ explanation: '...',
61
+ });
62
+
63
+ // ❌ Ruim - use grep
64
+ codebase_search({
65
+ query: 'AuthService',
66
+ target_directories: [],
67
+ explanation: '...',
68
+ });
69
+ ```
70
+
71
+ **Estratégia de Busca:**
72
+
73
+ 1. Comece com queries exploratórias amplas
74
+ 2. Revise resultados
75
+ 3. Refine com target_directory específico se necessário
76
+ 4. Quebre perguntas grandes em menores
77
+ 5. Para arquivos >1K linhas, use `codebase_search` ou `grep`
78
+
79
+ ---
80
+
81
+ ## File Operations
82
+
83
+ ### `read_file`
84
+
85
+ ```typescript
86
+ function read_file(params: {
87
+ target_file: string; // Path relativo ou absoluto
88
+ offset?: number; // Linha inicial (opcional)
89
+ limit?: number; // Número de linhas (opcional)
90
+ }): FileContents;
91
+ // Propósito: Lê arquivo do filesystem (texto ou imagem)
92
+ ```
93
+
94
+ **Suporte:**
95
+
96
+ - 📄 Arquivos de texto
97
+ - 🖼️ Imagens (jpeg, png, gif, webp)
98
+ - 📊 Notebooks (via read_file, edite via edit_notebook)
99
+
100
+ **Formato de Output:**
101
+
102
+ ```
103
+ LINE_NUMBER|LINE_CONTENT
104
+ ```
105
+
106
+ **Dica:** Para múltiplos arquivos, use chamadas paralelas!
107
+
108
+ ### `write`
109
+
110
+ ```typescript
111
+ function write(params: { file_path: string; contents: string }): void;
112
+ // Propósito: Cria ou sobrescreve arquivo completamente
113
+ ```
114
+
115
+ **⚠️ Avisos:**
116
+
117
+ - Sobrescreve arquivo existente
118
+ - Se existir, DEVE ler com `read_file` primeiro
119
+ - SEMPRE prefira editar arquivos existentes
120
+ - NUNCA crie docs (\*.md) proativamente
121
+
122
+ ### `search_replace`
123
+
124
+ ```typescript
125
+ function search_replace(params: {
126
+ file_path: string;
127
+ old_string: string; // Deve ser único no arquivo
128
+ new_string: string;
129
+ replace_all?: boolean; // Para renomear/substituir todas ocorrências
130
+ }): void;
131
+ // Propósito: Substituições exatas de string em arquivos
132
+ ```
133
+
134
+ **Regras Críticas:**
135
+
136
+ - ✅ Preservar indentação exata (tabs/spaces)
137
+ - ✅ SEMPRE prefira editar arquivos existentes
138
+ - ✅ Use emojis APENAS se usuário pedir
139
+ - ❌ Falha se `old_string` não for único
140
+ - ✅ Use `replace_all` para renomear variáveis
141
+
142
+ ### `delete_file`
143
+
144
+ ```typescript
145
+ function delete_file(params: {
146
+ target_file: string;
147
+ explanation: string;
148
+ }): void;
149
+ // Propósito: Deleta arquivo do filesystem
150
+ ```
151
+
152
+ **Uso:** Cleanup de arquivos temporários, scripts helper, etc.
153
+
154
+ ### `list_dir`
155
+
156
+ ```typescript
157
+ function list_dir(params: {
158
+ target_directory: string;
159
+ ignore_globs?: string[]; // Padrões glob para ignorar
160
+ }): DirectoryListing;
161
+ // Propósito: Lista arquivos e diretórios
162
+ ```
163
+
164
+ **Nota:** Não mostra dot-files e dot-directories por padrão
165
+
166
+ ### `glob_file_search`
167
+
168
+ ```typescript
169
+ function glob_file_search(params: {
170
+ glob_pattern: string; // Auto-prepend com **/ se necessário
171
+ target_directory?: string;
172
+ }): FilePaths[];
173
+ // Propósito: Busca arquivos por padrão de nome
174
+ ```
175
+
176
+ **Exemplos:**
177
+
178
+ ```typescript
179
+ // Encontrar todos .js
180
+ glob_file_search({ glob_pattern: '*.js' });
181
+
182
+ // Encontrar node_modules
183
+ glob_file_search({ glob_pattern: '**/node_modules/**' });
184
+
185
+ // Encontrar test files
186
+ glob_file_search({ glob_pattern: '**/test/**/test_*.ts' });
187
+ ```
188
+
189
+ ---
190
+
191
+ ## Terminal Operations
192
+
193
+ ### `run_terminal_cmd`
194
+
195
+ ```typescript
196
+ function run_terminal_cmd(params: {
197
+ command: string;
198
+ is_background: boolean;
199
+ explanation?: string;
200
+ }): CommandOutput;
201
+ // Propósito: Executa comando no terminal
202
+ ```
203
+
204
+ **Diretrizes:**
205
+
206
+ 1. ✅ Se shell novo: `cd` para diretório apropriado + setup
207
+ 2. ✅ Se mesmo shell: Verifique working directory no histórico
208
+ 3. ✅ Comandos interativos: Use flags não-interativos (--yes)
209
+ 4. ✅ Long-running: Use `is_background: true`
210
+ 5. ❌ NUNCA atualize git config
211
+ 6. ❌ NUNCA force push/hard reset (a menos que explícito)
212
+ 7. ❌ NUNCA skip hooks (--no-verify) sem pedido explícito
213
+ 8. ❌ NUNCA force push para main/master
214
+ 9. ❌ NUNCA commit sem pedido explícito do usuário
215
+
216
+ **Preferir Ferramentas Especializadas:**
217
+
218
+ - ❌ NÃO use cat/head/tail para ler arquivos → `read_file`
219
+ - ❌ NÃO use sed/awk para editar → `search_replace`
220
+ - ❌ NÃO use cat/echo para criar arquivos → `write`
221
+ - ✅ Reserve terminal para comandos de sistema reais
222
+
223
+ **⚠️ NUNCA use echo para comunicar ao usuário!**
224
+
225
+ ---
226
+
227
+ ## Search Operations
228
+
229
+ ### `grep`
230
+
231
+ ```typescript
232
+ function grep(params: {
233
+ pattern: string; // Regex pattern (ripgrep syntax)
234
+ path?: string; // Arquivo ou diretório
235
+ output_mode?: 'content' | 'files_with_matches' | 'count';
236
+ type?: string; // js, py, rust, go, java, etc
237
+ glob?: string; // "*.js", "*.{ts,tsx}"
238
+ multiline?: boolean; // Para patterns multi-linha
239
+ '-i'?: boolean; // Case insensitive
240
+ '-A'?: number; // Linhas após match
241
+ '-B'?: number; // Linhas antes match
242
+ '-C'?: number; // Linhas antes e depois
243
+ '-n'?: boolean; // Números de linha
244
+ head_limit?: number; // Limitar output
245
+ }): GrepResults;
246
+ // Propósito: Busca poderosa por texto exato/regex (ripgrep)
247
+ ```
248
+
249
+ **Quando Usar:**
250
+
251
+ - ✅ Busca exata de símbolos/strings
252
+ - ✅ Regex patterns
253
+ - ✅ Mais rápido que terminal grep
254
+
255
+ **Notas:**
256
+
257
+ - Respeita .gitignore/.cursorignore
258
+ - Suporta regex completo
259
+ - Pattern syntax: ripgrep (não grep)
260
+ - Braces literais precisam escape: `interface\{\}`
261
+ - Multiline: false por padrão
262
+ - Output pode ser truncado
263
+
264
+ **Formato de Output:**
265
+
266
+ ```
267
+ '-' para linhas de contexto
268
+ ':' para linhas de match
269
+ Agrupado por arquivo
270
+ ```
271
+
272
+ ---
273
+
274
+ ## Linting & Validation
275
+
276
+ ### `read_lints`
277
+
278
+ ```typescript
279
+ function read_lints(params: {
280
+ paths?: string[]; // Arquivos/diretórios, ou [] para tudo
281
+ }): LinterErrors[];
282
+ // Propósito: Lê erros de linter do workspace
283
+ ```
284
+
285
+ **⚠️ Avisos:**
286
+
287
+ - Pode retornar erros pré-existentes
288
+ - Evite escopo muito amplo
289
+ - NUNCA chame em arquivo que não editou
290
+ - Pode incluir arquivos unsaved/out-of-workspace
291
+
292
+ ---
293
+
294
+ ## Notebook Operations
295
+
296
+ ### `edit_notebook`
297
+
298
+ ```typescript
299
+ function edit_notebook(params: {
300
+ target_notebook: string;
301
+ cell_idx: number; // 0-based
302
+ is_new_cell: boolean; // CRÍTICO: true para criar, false para editar
303
+ cell_language: string; // python, markdown, javascript, etc
304
+ old_string: string; // Vazio se is_new_cell=true
305
+ new_string: string; // SEMPRE obrigatório
306
+ }): void;
307
+ // Propósito: Edita ou cria células em Jupyter notebooks
308
+ ```
309
+
310
+ **Linguagens Suportadas:**
311
+
312
+ - `python`, `markdown`, `javascript`, `typescript`
313
+ - `r`, `sql`, `shell`, `raw`, `other`
314
+
315
+ **Regras Críticas:**
316
+
317
+ 1. ✅ Índices são 0-based
318
+ 2. ✅ Conteúdo SEM sintaxe JSON do notebook
319
+ 3. ✅ `old_string` DEVE ser único (3-5 linhas contexto)
320
+ 4. ✅ Uma mudança por vez
321
+ 5. ✅ Markdown pode ser salvo como "raw" (OK)
322
+ 6. ❌ NÃO suporta deletar células (use new_string vazio)
323
+ 7. ✅ Para novo notebook: is_new_cell=true, cell_idx=0
324
+ 8. ✅ SEMPRE gere argumentos na ordem: target_notebook, cell_idx, is_new_cell, cell_language, old_string, new_string
325
+
326
+ ---
327
+
328
+ ## Task Management
329
+
330
+ ### `todo_write`
331
+
332
+ ```typescript
333
+ function todo_write(params: {
334
+ merge: boolean;
335
+ todos: Array<{
336
+ id: string;
337
+ content: string;
338
+ status: 'pending' | 'in_progress' | 'completed' | 'cancelled';
339
+ }>;
340
+ }): void;
341
+ // Propósito: Cria e gerencia lista de TODOs estruturada
342
+ ```
343
+
344
+ **Quando Usar:**
345
+
346
+ - ✅ Tarefas complexas (3+ passos)
347
+ - ✅ Tarefas não-triviais
348
+ - ✅ Usuário pede lista de TODO
349
+ - ✅ Múltiplas tarefas do usuário
350
+ - ✅ Após novas instruções (merge=false)
351
+ - ✅ Após completar tasks (merge=true)
352
+ - ✅ Ao iniciar nova task (mark in_progress)
353
+
354
+ **Quando NÃO Usar:**
355
+
356
+ - ❌ Tarefas únicas e diretas
357
+ - ❌ Tarefas triviais (<3 passos)
358
+ - ❌ Requests conversacionais
359
+ - ❌ Ações operacionais (linting, testing, searching)
360
+
361
+ **Estados:**
362
+
363
+ - `pending` - Não iniciado
364
+ - `in_progress` - Trabalhando (APENAS UM por vez)
365
+ - `completed` - Finalizado (marcar IMEDIATAMENTE)
366
+ - `cancelled` - Não mais necessário
367
+
368
+ **Gestão:**
369
+
370
+ - ✅ Atualizar status em tempo real
371
+ - ✅ Marcar complete IMEDIATAMENTE após finalizar
372
+ - ✅ Apenas UMA task in_progress por vez
373
+ - ✅ Completar tasks antes de iniciar novas
374
+ - ✅ Criar itens específicos e acionáveis
375
+ - ✅ Usar nomes descritivos
376
+
377
+ **Paralelismo:**
378
+
379
+ - ✅ Preferir criar primeiro todo como in_progress
380
+ - ✅ Iniciar trabalho com tool calls no mesmo batch
381
+ - ✅ Agrupar todo updates com outras tool calls
382
+
383
+ ---
384
+
385
+ ## Memory Management
386
+
387
+ ### `update_memory`
388
+
389
+ ```typescript
390
+ function update_memory(params: {
391
+ action: 'create' | 'update' | 'delete';
392
+ title?: string; // Para create/update
393
+ knowledge_to_store?: string; // Para create/update
394
+ existing_knowledge_id?: string; // Para update/delete
395
+ }): void;
396
+ // Propósito: Cria/atualiza/deleta memórias persistentes para IA
397
+ ```
398
+
399
+ **Quando Usar:**
400
+
401
+ - ✅ Usuário pede para lembrar algo
402
+ - ✅ Usuário augmenta memória existente (action=update)
403
+ - ✅ Usuário contradiz memória (action=delete)
404
+ - ❌ NÃO criar memórias de planos de implementação
405
+ - ❌ NÃO criar memórias de migrações completadas
406
+ - ❌ NÃO criar memórias de tarefas específicas
407
+
408
+ **Regras:**
409
+
410
+ - ✅ update_memory COM action se usuário augmenta
411
+ - ✅ update_memory COM delete se usuário contradiz
412
+ - ❌ Sem ação = default 'create'
413
+ - ✅ Se dúvida entre update/delete, prefira delete
414
+
415
+ **Citação de Memórias:**
416
+
417
+ ```markdown
418
+ Formato: [[memory:MEMORY_ID]]
419
+ Exemplo: "Vou usar -la flag [[memory:3004810]] para mostrar detalhes"
420
+ ```
421
+
422
+ ---
423
+
424
+ ## Web & MCP Operations
425
+
426
+ ### `web_search`
427
+
428
+ ```typescript
429
+ function web_search(params: {
430
+ search_term: string;
431
+ explanation: string;
432
+ }): SearchResults;
433
+ // Propósito: Busca web para informações em tempo real
434
+ ```
435
+
436
+ **Quando Usar:**
437
+
438
+ - Informações atualizadas não no training data
439
+ - Verificar fatos atuais
440
+ - Perguntas sobre eventos atuais
441
+ - Updates de tecnologia
442
+ - Tópicos que requerem informação recente
443
+
444
+ ### `list_mcp_resources` / `fetch_mcp_resource`
445
+
446
+ ```typescript
447
+ function list_mcp_resources(params: {
448
+ server?: string; // Filtrar por servidor
449
+ }): MCPResources[];
450
+
451
+ function fetch_mcp_resource(params: {
452
+ server: string;
453
+ uri: string;
454
+ downloadPath?: string; // Salvar em disco
455
+ }): ResourceContent;
456
+ // Propósito: Acessa recursos de servidores MCP configurados
457
+ ```
458
+
459
+ ---
460
+
461
+ ## 🎯 Melhores Práticas
462
+
463
+ ### Paralelização
464
+
465
+ ```typescript
466
+ // ✅ Bom - lê 3 arquivos em paralelo
467
+ Promise.all([
468
+ read_file({ target_file: 'file1.ts' }),
469
+ read_file({ target_file: 'file2.ts' }),
470
+ read_file({ target_file: 'file3.ts' }),
471
+ ]);
472
+
473
+ // ❌ Ruim - sequencial desnecessário
474
+ read_file({ target_file: 'file1.ts' });
475
+ // espera...
476
+ read_file({ target_file: 'file2.ts' });
477
+ // espera...
478
+ read_file({ target_file: 'file3.ts' });
479
+ ```
480
+
481
+ ### Quando NÃO Paralelizar
482
+
483
+ ```typescript
484
+ // ❌ NÃO paralelizar se dependente
485
+ const userId = getUserId(); // Precisa completar primeiro
486
+ const userData = getUser(userId); // Depende do userId
487
+ ```
488
+
489
+ ### Fluxo de Trabalho Típico
490
+
491
+ ```typescript
492
+ // 1. Buscar contexto
493
+ codebase_search({ query: 'How does auth work?' });
494
+
495
+ // 2. Ler arquivos relevantes
496
+ read_file({ target_file: 'auth/service.ts' });
497
+
498
+ // 3. Editar
499
+ search_replace({
500
+ file_path: 'auth/service.ts',
501
+ old_string: 'old implementation',
502
+ new_string: 'new implementation',
503
+ });
504
+
505
+ // 4. Validar
506
+ read_lints({ paths: ['auth/service.ts'] });
507
+
508
+ // 5. Testar
509
+ run_terminal_cmd({
510
+ command: 'npm test auth/service.test.ts',
511
+ is_background: false,
512
+ });
513
+ ```
514
+
515
+ ---
516
+
517
+ ## 📊 Resumo de Uso
518
+
519
+ | Categoria | Ferramenta Principal | Uso |
520
+ | ------------------- | -------------------- | ------------------------- |
521
+ | **Busca Semântica** | `codebase_search` | Explorar/entender código |
522
+ | **Busca Exata** | `grep` | Símbolos, regex patterns |
523
+ | **Ler Arquivo** | `read_file` | Texto, imagens, notebooks |
524
+ | **Editar Arquivo** | `search_replace` | Modificações precisas |
525
+ | **Criar Arquivo** | `write` | Novos arquivos |
526
+ | **Terminal** | `run_terminal_cmd` | Comandos sistema |
527
+ | **Validação** | `read_lints` | Erros de linter |
528
+ | **Notebooks** | `edit_notebook` | Células Jupyter |
529
+ | **Tasks** | `todo_write` | Gestão de tarefas |
530
+ | **Memória** | `update_memory` | Aprendizados persistentes |
531
+
532
+ ---
533
+
534
+ ## 🔗 Recursos Relacionados
535
+
536
+ - [Ferramentas MCP](./mcps.md)
537
+ - [Agentes Especializados](./agents.md)
538
+ - [Comandos .claude/](./commands.md)
539
+ - [Regras do Workspace](./rules.md)