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