jarvis-ai-framework 2.1.0 → 3.0.0

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 (303) hide show
  1. package/AGENTS.md +22 -122
  2. package/agents/AGENTS.md +20 -24
  3. package/agents/README.md +25 -129
  4. package/agents/engineering/data/eng.data-engineer.agent.md +12 -35
  5. package/agents/engineering/eng.agent.md +18 -30
  6. package/agents/engineering/eng.bug-hunter.md +9 -12
  7. package/agents/engineering/eng.dev-code-reviewer.md +5 -1
  8. package/agents/engineering/eng.docs-writer.md +3 -3
  9. package/agents/engineering/eng.frontend.agent.md +13 -8
  10. package/agents/engineering/eng.rpa.agent.md +5 -13
  11. package/agents/engineering/eng.ux-designer.agent.md +4 -0
  12. package/agents/engineering/qa/eng.qa.quality-champion-task-agent.md +4 -0
  13. package/agents/engineering/qa/eng.qa.quality-strategist.md +13 -8
  14. package/agents/engineering/qa/eng.qa.test-architect.md +16 -15
  15. package/agents/engineering/qa/eng.qa.test-planner.md +22 -17
  16. package/agents/engineering/qa/eng.qa.testing-engineer.md +99 -15
  17. package/agents/product/prod.discovery-interviewer.md +22 -3
  18. package/agents/product/prod.pm-checker.md +4 -0
  19. package/bin/README.md +142 -0
  20. package/bin/commands/docs-publish.js +105 -141
  21. package/bin/commands/docs-sync.js +66 -104
  22. package/bin/commands/info.js +7 -27
  23. package/bin/commands/init.js +23 -51
  24. package/bin/commands/install-rtk.js +9 -3
  25. package/bin/commands/list.js +5 -18
  26. package/bin/commands/map.js +58 -0
  27. package/bin/commands/qa-signoff.js +58 -55
  28. package/bin/commands/tokens.js +90 -0
  29. package/bin/commands/whoami.js +30 -26
  30. package/bin/jarvis.js +9 -153
  31. package/bin/lib/auth/session.js +20 -20
  32. package/bin/lib/cli/program.js +219 -0
  33. package/bin/lib/cli/shared-options.js +29 -0
  34. package/bin/lib/config/constants.js +70 -2
  35. package/bin/lib/config/ide-config.js +4 -8
  36. package/bin/lib/core/profile-filter.js +116 -0
  37. package/bin/lib/core/scanner.js +5 -31
  38. package/bin/lib/core/sync-engine.js +21 -14
  39. package/bin/lib/core/token-report.js +100 -0
  40. package/bin/lib/docs/fetch-file.js +39 -0
  41. package/bin/lib/docs/publish-file.js +194 -0
  42. package/bin/lib/docs/redis-cache.js +49 -0
  43. package/bin/lib/docs/validate-frontmatter.js +9 -39
  44. package/bin/lib/env-loader.js +11 -34
  45. package/bin/lib/flow-map/index.js +65 -0
  46. package/bin/lib/flow-map/parse.js +223 -0
  47. package/bin/lib/flow-map/render.js +89 -0
  48. package/bin/lib/flow-map/tree.js +248 -0
  49. package/bin/lib/tasks/comment.js +40 -35
  50. package/bin/lib/utils/frontmatter.js +57 -0
  51. package/bin/lib/utils/git-parser.js +4 -6
  52. package/bin/lib/utils/npmrc-parser.js +6 -13
  53. package/bin/lib/utils/paths.js +2 -4
  54. package/bin/lib/utils/ui.js +3 -9
  55. package/bin/lib/vcs/api.js +25 -41
  56. package/bin/lib/vcs/create-issue.js +49 -33
  57. package/bin/lib/vcs/create-merge.js +47 -31
  58. package/bin/lib/vcs/fetch-raw.js +35 -23
  59. package/members.md +1 -1
  60. package/package.json +15 -4
  61. package/rules/AGENTS.md +18 -7
  62. package/rules/engineering/eng-rules.md +3 -13
  63. package/rules/engineering/eng-security-rules.md +19 -18
  64. package/rules/engineering/eng.bump-rules.md +3 -2
  65. package/rules/engineering/eng.docs-scraping-rules.md +4 -4
  66. package/rules/engineering/eng.integrations-rules.md +3 -7
  67. package/rules/engineering/eng.skills-rules.md +1 -5
  68. package/rules/engineering/eng.specializations-rules.md +18 -8
  69. package/rules/engineering/frontend/eng.frontend-rules.md +1 -4
  70. package/rules/engineering/qa/eng.qa.cypress-standards-rules.md +1 -1
  71. package/rules/engineering/rpa/eng.rpa-rules.md +4 -9
  72. package/rules/product/README.md +1 -0
  73. package/rules/product/prod-rules.md +1 -4
  74. package/rules/product/prod.spec-rules.md +0 -4
  75. package/rules/rtk-rules.md +0 -1
  76. package/{rules → rules-on-demand}/engineering/eng.breakdown-subtasks-rules.md +0 -4
  77. package/{rules → rules-on-demand}/engineering/eng.plan-rules.md +0 -4
  78. package/{rules → rules-on-demand}/engineering/eng.pr-rules.md +0 -4
  79. package/{rules → rules-on-demand}/engineering/eng.pre-pr-rules.md +0 -4
  80. package/{rules → rules-on-demand}/engineering/eng.start-rules.md +0 -4
  81. package/{rules → rules-on-demand}/engineering/eng.tech-spec-rules.md +1 -2
  82. package/{rules → rules-on-demand}/engineering/eng.work-rules.md +0 -4
  83. package/skills/AGENTS.md +69 -106
  84. package/skills/SKILLS-ROADMAP.md +47 -132
  85. package/skills/eng-ai/SKILL.md +270 -0
  86. package/skills/eng-ai/references/1-fundamentos-ml.md +24 -0
  87. package/skills/eng-ai/references/10-arquitetura-solucoes-ia.md +24 -0
  88. package/skills/eng-ai/references/11-governanca-ia.md +24 -0
  89. package/skills/eng-ai/references/12-seguranca-ia-responsavel.md +25 -0
  90. package/skills/eng-ai/references/2-matematica-estatistica.md +24 -0
  91. package/skills/eng-ai/references/3-dados-para-ia.md +24 -0
  92. package/skills/eng-ai/references/4-deep-learning-fundacionais.md +24 -0
  93. package/skills/eng-ai/references/5-llms-chatbots-agentes-rag.md +25 -0
  94. package/skills/eng-ai/references/6-avaliacao-experimentacao.md +24 -0
  95. package/skills/eng-ai/references/7-engenharia-sistemas-ia.md +24 -0
  96. package/skills/eng-ai/references/8-mlops-plataforma.md +24 -0
  97. package/skills/eng-ai/references/9-produto-ia.md +24 -0
  98. package/skills/eng-ai/references/especializacoes.md +17 -0
  99. package/skills/eng-automation/SKILL.md +290 -0
  100. package/skills/eng-automation/references/1-fundamentos-automacao.md +25 -0
  101. package/skills/eng-automation/references/10-ingestao-dados.md +25 -0
  102. package/skills/eng-automation/references/11-captcha-antibot.md +25 -0
  103. package/skills/eng-automation/references/12-limites-taxa-sessoes.md +25 -0
  104. package/skills/eng-automation/references/13-agendamento-orquestracao.md +24 -0
  105. package/skills/eng-automation/references/14-retentativa-erros.md +25 -0
  106. package/skills/eng-automation/references/15-autenticacao-credenciais.md +24 -0
  107. package/skills/eng-automation/references/16-observabilidade-confiabilidade.md +24 -0
  108. package/skills/eng-automation/references/2-aquisicao-dados.md +25 -0
  109. package/skills/eng-automation/references/3-automacao-navegador.md +24 -0
  110. package/skills/eng-automation/references/4-scraping-crawling.md +25 -0
  111. package/skills/eng-automation/references/5-apis-rest-graphql-soap.md +26 -0
  112. package/skills/eng-automation/references/6-webhooks-integracao.md +25 -0
  113. package/skills/eng-automation/references/7-rpa.md +25 -0
  114. package/skills/eng-automation/references/8-extracao-estruturada.md +25 -0
  115. package/skills/eng-automation/references/9-extracao-documentos.md +25 -0
  116. package/skills/eng-automation/references/especializacoes.md +18 -0
  117. package/skills/eng-backend/SKILL.md +6 -0
  118. package/skills/eng-backend-arch-c4/SKILL.md +10 -4
  119. package/skills/eng-backend-microservices-trace/SKILL.md +6 -0
  120. package/skills/eng-backend-nestjs/SKILL.md +17 -462
  121. package/skills/eng-backend-nestjs/references/1-arquitetura-modulos.md +54 -0
  122. package/skills/eng-backend-nestjs/references/2-guards-autenticacao.md +118 -0
  123. package/skills/eng-backend-nestjs/references/3-interceptors-pipes-filters.md +113 -0
  124. package/skills/eng-backend-nestjs/references/4-config-logging.md +61 -0
  125. package/skills/eng-backend-nestjs/references/5-testes.md +83 -0
  126. package/skills/eng-backend-nestjs/references/6-problemas-comuns.md +53 -0
  127. package/skills/eng-backend-rabbitmq/SKILL.md +15 -298
  128. package/skills/eng-backend-rabbitmq/references/1-referencia-endpoints.md +28 -0
  129. package/skills/eng-backend-rabbitmq/references/2-codigo-consumer-producer.md +90 -0
  130. package/skills/eng-backend-rabbitmq/references/3-arquiteturas-comuns.md +101 -0
  131. package/skills/eng-backend-rabbitmq/references/4-troubleshooting.md +93 -0
  132. package/skills/eng-data/SKILL.md +271 -0
  133. package/skills/eng-data/references/1-fundamentos-dados.md +24 -0
  134. package/skills/eng-data/references/10-ciencia-dados.md +24 -0
  135. package/skills/eng-data/references/11-dataops-plataforma.md +24 -0
  136. package/skills/eng-data/references/12-seguranca-privacidade.md +24 -0
  137. package/skills/eng-data/references/2-modelagem-dados.md +24 -0
  138. package/skills/eng-data/references/3-bancos-dados.md +24 -0
  139. package/skills/eng-data/references/4-arquitetura-dados.md +24 -0
  140. package/skills/eng-data/references/5-pipelines-integracao.md +24 -0
  141. package/skills/eng-data/references/6-qualidade-dados.md +24 -0
  142. package/skills/eng-data/references/7-governanca-metadados.md +24 -0
  143. package/skills/eng-data/references/8-estatistica-analise.md +24 -0
  144. package/skills/eng-data/references/9-analytics-bi.md +24 -0
  145. package/skills/eng-data/references/especializacoes.md +20 -0
  146. package/skills/eng-frontend/SKILL.md +18 -5
  147. package/skills/eng-frontend/references/13-design-system.md +48 -0
  148. package/skills/eng-frontend/references/14-microfrontend.md +46 -0
  149. package/skills/eng-global-docs-write/SKILL.md +10 -5
  150. package/skills/eng-global-pr/SKILL.md +7 -1
  151. package/skills/eng-global-task-comment/SKILL.md +8 -2
  152. package/skills/eng-platform/SKILL.md +331 -0
  153. package/skills/eng-platform/references/1-fundamentos-sistemas.md +23 -0
  154. package/skills/eng-platform/references/10-resiliencia-arquitetura.md +24 -0
  155. package/skills/eng-platform/references/11-plataforma-devex.md +24 -0
  156. package/skills/eng-platform/references/12-finops-custos.md +24 -0
  157. package/skills/eng-platform/references/13-seguranca-fundamentos.md +26 -0
  158. package/skills/eng-platform/references/14-profiling-performance.md +23 -0
  159. package/skills/eng-platform/references/15-testes-carga-chaos.md +23 -0
  160. package/skills/eng-platform/references/16-cache-multicamada.md +22 -0
  161. package/skills/eng-platform/references/2-redes.md +23 -0
  162. package/skills/eng-platform/references/3-cloud.md +24 -0
  163. package/skills/eng-platform/references/4-iac-automacao.md +24 -0
  164. package/skills/eng-platform/references/5-containers-orquestracao.md +25 -0
  165. package/skills/eng-platform/references/6-cicd-entrega.md +24 -0
  166. package/skills/eng-platform/references/7-observabilidade.md +24 -0
  167. package/skills/eng-platform/references/8-confiabilidade-sre.md +24 -0
  168. package/skills/eng-platform/references/9-seguranca-infra.md +26 -0
  169. package/skills/eng-platform/references/especializacoes.md +34 -0
  170. package/skills/eng-qa/SKILL.md +283 -0
  171. package/skills/eng-qa/references/1-fundamentos-qualidade.md +25 -0
  172. package/skills/eng-qa/references/10-confiabilidade.md +25 -0
  173. package/skills/eng-qa/references/11-seguranca.md +24 -0
  174. package/skills/eng-qa/references/12-acessibilidade.md +24 -0
  175. package/skills/eng-qa/references/13-dados-testes.md +24 -0
  176. package/skills/eng-qa/references/14-gestao-testes-defeitos.md +25 -0
  177. package/skills/eng-qa/references/15-arquitetura-qa.md +25 -0
  178. package/skills/eng-qa/references/2-estrategia-planejamento.md +25 -0
  179. package/skills/eng-qa/references/3-design-testes.md +25 -0
  180. package/skills/eng-qa/references/4-manual-exploratorio.md +24 -0
  181. package/skills/eng-qa/references/5-automacao-testes.md +25 -0
  182. package/skills/eng-qa/references/6-api-integracao.md +25 -0
  183. package/skills/eng-qa/references/7-contrato.md +24 -0
  184. package/skills/eng-qa/references/8-interface-compat-mobile.md +24 -0
  185. package/skills/eng-qa/references/9-performance.md +24 -0
  186. package/skills/eng-qa/references/especializacoes.md +29 -0
  187. package/skills/eng-qa-planner/SKILL.md +264 -0
  188. package/skills/jarvis-context-detect/SKILL.md +7 -1
  189. package/skills/jarvis-context-detect/assets/context-profile-template.md +1 -1
  190. package/skills/jarvis-create-specialization/SKILL.md +14 -0
  191. package/skills/jarvis-docs-central/README.md +31 -28
  192. package/skills/jarvis-docs-central/SKILL.md +11 -5
  193. package/skills/jarvis-docs-index/SKILL.md +10 -2
  194. package/skills/jarvis-evolution-architect/SKILL.md +6 -0
  195. package/skills/jarvis-init/SKILL.md +22 -15
  196. package/skills/jarvis-init/assets/passo-adicionar-stacks.md +47 -18
  197. package/skills/jarvis-list-specializations/SKILL.md +36 -17
  198. package/skills/jarvis-report-issue/SKILL.md +7 -1
  199. package/skills/product-roadmap-report/SKILL.md +8 -0
  200. package/skills/product-specs/SKILL.md +9 -0
  201. package/skills/product-specs-update/SKILL.md +6 -0
  202. package/taxonomy.md +16 -28
  203. package/templates/AGENTS.md +2 -0
  204. package/templates/ENV-template.md +10 -2
  205. package/templates/engineering/qa/qa.sprint-plan-template.md +1 -1
  206. package/templates/engineering/tech-spec-delivery-template.md +179 -0
  207. package/workflows/AGENTS.md +14 -2
  208. package/workflows/README.md +8 -16
  209. package/workflows/all-tools.md +7 -1
  210. package/workflows/engineering/data/data.contract.md +8 -0
  211. package/workflows/engineering/data/data.new-pipeline.md +15 -4
  212. package/workflows/engineering/eng.breakdown-subtasks.md +9 -0
  213. package/workflows/engineering/eng.bug-audit.md +10 -13
  214. package/workflows/engineering/eng.build-tech-spec.md +17 -146
  215. package/workflows/engineering/eng.create-ard-from-code.md +8 -0
  216. package/workflows/engineering/eng.create-ard.md +8 -0
  217. package/workflows/engineering/eng.create-rfc.md +7 -0
  218. package/workflows/engineering/eng.debug.md +5 -21
  219. package/workflows/engineering/eng.docs.md +9 -0
  220. package/workflows/engineering/eng.light-arch.md +7 -0
  221. package/workflows/engineering/eng.plan.md +15 -2
  222. package/workflows/engineering/eng.pr.md +24 -30
  223. package/workflows/engineering/eng.pre-pr.md +33 -15
  224. package/workflows/engineering/eng.review.md +18 -11
  225. package/workflows/engineering/eng.rpa.robot.md +17 -7
  226. package/workflows/engineering/eng.start.md +33 -12
  227. package/workflows/engineering/eng.work.md +25 -17
  228. package/workflows/engineering/frontend/eng.frontend-component.md +7 -0
  229. package/workflows/engineering/frontend/eng.frontend-perf-audit.md +8 -0
  230. package/workflows/engineering/frontend/eng.frontend-review.md +8 -0
  231. package/workflows/engineering/qa/eng.qa-refinement-entry.md +7 -0
  232. package/workflows/engineering/qa/eng.qa-release-signoff.md +6 -0
  233. package/workflows/engineering/qa/eng.qa-sprint-planning.md +7 -1
  234. package/workflows/product/prod.roadmap.preview.md +9 -0
  235. package/workflows/product/prod.spec.ard.md +97 -0
  236. package/workflows/product/prod.spec.breakdown.md +10 -0
  237. package/workflows/product/prod.spec.clarify.md +8 -2
  238. package/workflows/product/prod.spec.discovery.md +11 -1
  239. package/workflows/product/prod.spec.epic.md +8 -0
  240. package/workflows/product/prod.spec.frd.md +7 -0
  241. package/workflows/product/prod.spec.issue.md +6 -0
  242. package/workflows/product/prod.spec.md +15 -1
  243. package/workflows/product/prod.spec.prd.md +7 -0
  244. package/workflows/taxonomy.md +58 -6
  245. package/workflows/warm-up.md +47 -60
  246. package/agents/engineering/eng.cybersecurity.agent.md +0 -488
  247. package/agents/engineering/qa/eng.qa.cypress-specialist.md +0 -109
  248. package/bin/lib/docs/fetch-file.sh +0 -41
  249. package/bin/lib/docs/publish-file.sh +0 -284
  250. package/rules/engineering/eng.downstream-flow-rules.md +0 -297
  251. package/rules/engineering/qa/eng.qa.exploratory-session-rules.md +0 -137
  252. package/rules/engineering/qa/eng.qa.quality-gate-scoring-rules.md +0 -181
  253. package/rules/engineering/qa/eng.qa.tech-spec-validation-criteria-rules.md +0 -120
  254. package/skills/eng-ai-engineer/SKILL.md +0 -297
  255. package/skills/eng-data-bi/SKILL.md +0 -200
  256. package/skills/eng-data-debug/SKILL.md +0 -308
  257. package/skills/eng-data-engineer/SKILL.md +0 -257
  258. package/skills/eng-data-onboard/SKILL.md +0 -311
  259. package/skills/eng-data-orchestrator/SKILL.md +0 -427
  260. package/skills/eng-devops-performance-engineer/SKILL.md +0 -313
  261. package/skills/eng-frontend-design-system/SKILL.md +0 -621
  262. package/skills/eng-frontend-microfrontend/SKILL.md +0 -604
  263. package/skills/eng-global-browser-extension-builder/SKILL.md +0 -386
  264. package/skills/eng-global-jira-comment/SKILL.md +0 -21
  265. package/skills/eng-qa-a11y-audit/SKILL.md +0 -270
  266. package/skills/eng-qa-bug-report/SKILL.md +0 -1089
  267. package/skills/eng-qa-bug-report/TASK_MANAGERS.md +0 -138
  268. package/skills/eng-qa-cypress-e2e/SKILL.md +0 -178
  269. package/skills/eng-qa-dev-guide/SKILL.md +0 -165
  270. package/skills/eng-qa-e2e/SKILL.md +0 -401
  271. package/skills/eng-qa-e2e-spec-writer/SKILL.md +0 -323
  272. package/skills/eng-qa-exploratory/SKILL.md +0 -189
  273. package/skills/eng-qa-gate/SKILL.md +0 -371
  274. package/skills/eng-qa-gate/assets/checklist-validacao.md +0 -291
  275. package/skills/eng-qa-graphql-contract/SKILL.md +0 -257
  276. package/skills/eng-qa-quality-report/SKILL.md +0 -413
  277. package/skills/eng-qa-test-plan/SKILL.md +0 -467
  278. package/skills/eng-qa-testsprite/SKILL.md +0 -326
  279. package/skills/eng-qa-testsprite/references/testsprite-mcp.md +0 -224
  280. package/skills/eng-qa-unit-test/SKILL.md +0 -472
  281. package/skills/eng-scraper/SKILL.md +0 -684
  282. package/skills/eng-scraper-robot-builder/SKILL.md +0 -371
  283. package/skills/eng-security-cybersecurity/SKILL.md +0 -646
  284. package/skills/eng-security-patch/SKILL.md +0 -382
  285. package/skills/eng-security-threat-model/SKILL.md +0 -165
  286. package/skills/eng-security-triage/SKILL.md +0 -270
  287. package/templates/engineering/qa/eng.qa.quality-gate-examples-template.md +0 -311
  288. package/templates/engineering/qa/eng.qa.quality-gate-report-template.md +0 -249
  289. package/templates/engineering/qa/qa.cypress-test-template.md +0 -172
  290. package/templates/engineering/qa/qa.exploratory-session-template.md +0 -148
  291. package/templates/engineering/qa/qa.quality-report-template.md +0 -130
  292. package/workflows/engineering/eng.security-audit.md +0 -312
  293. package/workflows/engineering/eng.security-incident.md +0 -275
  294. package/workflows/engineering/eng.security-pipeline.md +0 -210
  295. package/workflows/engineering/eng.security-review.md +0 -235
  296. package/workflows/engineering/qa/eng.qa-dev-quality-guide.md +0 -51
  297. package/workflows/engineering/qa/eng.qa-e2e-test-generation.md +0 -51
  298. package/workflows/engineering/qa/eng.qa-exploratory-session.md +0 -60
  299. package/workflows/engineering/qa/eng.qa-quality-gate-validation.md +0 -202
  300. package/workflows/engineering/qa/eng.qa-quality-report.md +0 -78
  301. /package/skills/{eng-qa-test-plan → eng-qa-planner}/assets/test-coverage-template.md +0 -0
  302. /package/skills/{eng-qa-test-plan → eng-qa-planner}/assets/test-patterns.md +0 -0
  303. /package/templates/{CDD aplicado a Prompts.md → cdd-aplicado-a-prompts.md} +0 -0
@@ -281,33 +281,25 @@ curl -s -X DELETE -u "$AUTH" \
281
281
  "$MB_URL/queues/%2F/{nome-fila}/contents"
282
282
  ```
283
283
 
284
- ---
284
+ ### Skills invocados durante a execução do skill
285
285
 
286
- ## Referência de Endpoints
287
-
288
- | Operação | Método | Endpoint |
289
- |----------|--------|----------|
290
- | Status geral | GET | `/api/overview` |
291
- | Listar filas | GET | `/api/queues` |
292
- | Detalhes de fila | GET | `/api/queues/{vhost}/{name}` |
293
- | Criar fila | PUT | `/api/queues/{vhost}/{name}` |
294
- | Deletar fila | DELETE | `/api/queues/{vhost}/{name}` |
295
- | Purgar fila | DELETE | `/api/queues/{vhost}/{name}/contents` |
296
- | Consumir mensagens | POST | `/api/queues/{vhost}/{name}/get` |
297
- | Listar exchanges | GET | `/api/exchanges/{vhost}` |
298
- | Criar exchange | PUT | `/api/exchanges/{vhost}/{name}` |
299
- | Deletar exchange | DELETE | `/api/exchanges/{vhost}/{name}` |
300
- | Publicar mensagem | POST | `/api/exchanges/{vhost}/{name}/publish` |
301
- | Listar bindings | GET | `/api/bindings/{vhost}` |
302
- | Criar binding (fila) | POST | `/api/bindings/{vhost}/e/{exchange}/q/{queue}` |
303
- | Deletar binding | DELETE | `/api/bindings/{vhost}/e/{exchange}/q/{queue}/{props}` |
304
- | Listar connections | GET | `/api/connections` |
305
- | Fechar connection | DELETE | `/api/connections/{name}` |
306
- | Listar channels | GET | `/api/channels` |
307
- | Listar vhosts | GET | `/api/vhosts` |
286
+ | Passo | Skill | Condição |
287
+ |-------|-------|----------|
288
+ | — | Nenhuma — skill autocontida | — |
308
289
 
309
290
  ---
310
291
 
292
+ ## Referências (leia só o tema que a tarefa pedir)
293
+
294
+ Leia **só** o arquivo do tema que a tarefa pedir; o restante fica fora do contexto.
295
+
296
+ | Tema | Quando ler | Arquivo |
297
+ |------|-----------|---------|
298
+ | Referência de Endpoints | Precisar do endpoint exato, método ou payload da Management API | `references/1-referencia-endpoints.md` |
299
+ | Código de Consumer/Producer | A tarefa pedir código de consumer ou producer (Node.js com amqplib ou Python com pika) | `references/2-codigo-consumer-producer.md` |
300
+ | Arquiteturas Comuns (DLX, retry, fanout, topic) | A tarefa pedir Dead Letter Exchange, retry com delay, fanout ou topic routing | `references/3-arquiteturas-comuns.md` |
301
+ | Troubleshooting do RabbitMQ | Houver fila acumulando, mensagens indo para dead letter, loop de consumer, erro 406 ou mensagens que não chegam | `references/4-troubleshooting.md` |
302
+
311
303
  ## Regras
312
304
 
313
305
  ### Nunca
@@ -326,281 +318,6 @@ curl -s -X DELETE -u "$AUTH" \
326
318
 
327
319
  ---
328
320
 
329
- ## Criar Código de Consumer/Producer
330
-
331
- Quando o usuário pedir para criar código, gerar implementação completa e funcional. Verificar a linguagem/framework do projeto antes de escolher a biblioteca.
332
-
333
- ### Node.js com amqplib
334
-
335
- ```javascript
336
- // consumer.js
337
- const amqp = require('amqplib');
338
-
339
- async function startConsumer() {
340
- const conn = await amqp.connect(process.env.RABBITMQ_URL);
341
- const channel = await conn.createChannel();
342
-
343
- const queue = 'nome-da-fila';
344
- await channel.assertQueue(queue, { durable: true });
345
- channel.prefetch(1); // processa 1 mensagem por vez
346
-
347
- console.log(`Aguardando mensagens em ${queue}`);
348
-
349
- channel.consume(queue, async (msg) => {
350
- if (!msg) return;
351
- try {
352
- const payload = JSON.parse(msg.content.toString());
353
- console.log('Mensagem recebida:', payload);
354
-
355
- // processar aqui...
356
-
357
- channel.ack(msg); // confirmar processamento
358
- } catch (err) {
359
- console.error('Erro ao processar:', err);
360
- channel.nack(msg, false, false); // rejeitar sem requeue → vai para DLX
361
- }
362
- });
363
- }
364
-
365
- startConsumer().catch(console.error);
366
- ```
367
-
368
- ```javascript
369
- // producer.js
370
- const amqp = require('amqplib');
371
-
372
- async function publish(exchange, routingKey, payload) {
373
- const conn = await amqp.connect(process.env.RABBITMQ_URL);
374
- const channel = await conn.createChannel();
375
-
376
- channel.publish(
377
- exchange,
378
- routingKey,
379
- Buffer.from(JSON.stringify(payload)),
380
- { persistent: true, contentType: 'application/json' }
381
- );
382
-
383
- await channel.close();
384
- await conn.close();
385
- }
386
- ```
387
-
388
- ### Python com pika
389
-
390
- ```python
391
- # consumer.py
392
- import pika, json, os
393
-
394
- def on_message(channel, method, properties, body):
395
- try:
396
- payload = json.loads(body)
397
- print(f"Mensagem recebida: {payload}")
398
- # processar aqui...
399
- channel.basic_ack(delivery_tag=method.delivery_tag)
400
- except Exception as e:
401
- print(f"Erro: {e}")
402
- channel.basic_nack(delivery_tag=method.delivery_tag, requeue=False)
403
-
404
- params = pika.URLParameters(os.environ['RABBITMQ_URL'])
405
- conn = pika.BlockingConnection(params)
406
- ch = conn.channel()
407
- ch.basic_qos(prefetch_count=1)
408
- ch.basic_consume('nome-da-fila', on_message)
409
- ch.start_consuming()
410
- ```
411
-
412
- > Sempre ler o projeto para detectar a linguagem e adaptar o código antes de gerar.
413
-
414
- ---
415
-
416
- ## Arquiteturas Comuns
417
-
418
- ### Dead Letter Exchange (DLX) — Fila com rejeição controlada
419
-
420
- ```
421
- Fila principal → (nack/expired) → DLX Exchange → Fila de Dead Letters
422
- ```
423
-
424
- ```bash
425
- # 1. Criar DLX exchange
426
- curl -s -X PUT -u "$AUTH" -H "Content-Type: application/json" \
427
- -d '{"type":"direct","durable":true}' \
428
- "$MB_URL/exchanges/%2F/dlx.minha-fila"
429
-
430
- # 2. Criar fila de dead letters
431
- curl -s -X PUT -u "$AUTH" -H "Content-Type: application/json" \
432
- -d '{"durable":true}' \
433
- "$MB_URL/queues/%2F/minha-fila.dead"
434
-
435
- # 3. Criar binding DLX → fila dead
436
- curl -s -X POST -u "$AUTH" -H "Content-Type: application/json" \
437
- -d '{"routing_key":"minha-fila"}' \
438
- "$MB_URL/bindings/%2F/e/dlx.minha-fila/q/minha-fila.dead"
439
-
440
- # 4. Criar fila principal apontando para DLX
441
- curl -s -X PUT -u "$AUTH" -H "Content-Type: application/json" \
442
- -d '{
443
- "durable": true,
444
- "arguments": {
445
- "x-dead-letter-exchange": "dlx.minha-fila",
446
- "x-dead-letter-routing-key": "minha-fila",
447
- "x-message-ttl": 86400000
448
- }
449
- }' \
450
- "$MB_URL/queues/%2F/minha-fila"
451
- ```
452
-
453
- ### Retry com Delay (usando TTL + DLX como fila de espera)
454
-
455
- ```
456
- Fila principal → (nack) → DLX Exchange → Fila retry (TTL 30s) → republica → Fila principal
457
- ```
458
-
459
- ```bash
460
- # Fila de retry com TTL de 30 segundos e DLX apontando de volta para a fila principal
461
- curl -s -X PUT -u "$AUTH" -H "Content-Type: application/json" \
462
- -d '{
463
- "durable": true,
464
- "arguments": {
465
- "x-message-ttl": 30000,
466
- "x-dead-letter-exchange": "",
467
- "x-dead-letter-routing-key": "minha-fila"
468
- }
469
- }' \
470
- "$MB_URL/queues/%2F/minha-fila.retry"
471
- ```
472
-
473
- ### Fanout — Broadcast para múltiplas filas
474
-
475
- ```
476
- Exchange fanout → Fila A
477
- → Fila B
478
- → Fila C
479
- ```
480
-
481
- ```bash
482
- # Exchange fanout (routing_key é ignorada)
483
- curl -s -X PUT -u "$AUTH" -H "Content-Type: application/json" \
484
- -d '{"type":"fanout","durable":true}' \
485
- "$MB_URL/exchanges/%2F/events.broadcast"
486
-
487
- # Cada fila se liga sem routing_key
488
- curl -s -X POST -u "$AUTH" -H "Content-Type: application/json" \
489
- -d '{"routing_key":""}' \
490
- "$MB_URL/bindings/%2F/e/events.broadcast/q/servico-a"
491
- ```
492
-
493
- ### Topic Routing — Roteamento por padrão
494
-
495
- ```
496
- Exchange topic → "pedido.criado" → fila pedidos
497
- → "pedido.*" → fila auditoria
498
- → "*.erro" → fila alertas
499
- ```
500
-
501
- ```bash
502
- curl -s -X PUT -u "$AUTH" -H "Content-Type: application/json" \
503
- -d '{"type":"topic","durable":true}' \
504
- "$MB_URL/exchanges/%2F/events.topic"
505
-
506
- # Binding com wildcard
507
- curl -s -X POST -u "$AUTH" -H "Content-Type: application/json" \
508
- -d '{"routing_key":"pedido.*"}' \
509
- "$MB_URL/bindings/%2F/e/events.topic/q/fila-auditoria"
510
- ```
511
-
512
- ---
513
-
514
- ## Troubleshooting
515
-
516
- ### Diagnóstico inicial — sempre começar aqui
517
-
518
- ```bash
519
- AUTH=$(grep "MESSAGE_BROKER_API_AUTH" $IDE/ENV.md | cut -d'=' -f2)
520
- MB_URL=$(grep "MESSAGE_BROKER_URL_API" $IDE/ENV.md | cut -d'=' -f2)
521
-
522
- # Visão geral do cluster
523
- curl -s -u "$AUTH" "$MB_URL/overview" | python3 -m json.tool
524
-
525
- # Filas com problemas (messages_ready > 0 e consumers = 0)
526
- curl -s -u "$AUTH" "$MB_URL/queues" | python3 -c "
527
- import json,sys
528
- qs = json.load(sys.stdin)
529
- for q in qs:
530
- ready = q.get('messages_ready', 0)
531
- consumers = q.get('consumers', 0)
532
- if ready > 0 and consumers == 0:
533
- print(f\"ALERTA: {q['name']} | mensagens={ready} | consumers=0\")
534
- "
535
- ```
536
-
537
- ### Problema: Fila acumulando mensagens (consumer parado)
538
-
539
- 1. Verificar se há consumers ativos na fila:
540
- ```bash
541
- curl -s -u "$AUTH" "$MB_URL/queues/%2F/nome-da-fila" | python3 -m json.tool | grep -E "consumers|messages"
542
- ```
543
- 2. Verificar connections abertas:
544
- ```bash
545
- curl -s -u "$AUTH" "$MB_URL/connections" | python3 -m json.tool
546
- ```
547
- 3. Checar se o consumer está com unacked alto (travado no processamento):
548
- ```bash
549
- curl -s -u "$AUTH" "$MB_URL/queues/%2F/nome-da-fila" | python3 -c "
550
- import json,sys; q=json.load(sys.stdin)
551
- print('messages_ready:', q.get('messages_ready'))
552
- print('messages_unacknowledged:', q.get('messages_unacknowledged'))
553
- print('consumers:', q.get('consumers'))
554
- "
555
- ```
556
-
557
- ### Problema: Mensagens indo para Dead Letter inesperadamente
558
-
559
- Causas comuns:
560
- - `x-message-ttl` expirando antes do consumer processar → aumentar TTL ou aumentar prefetch
561
- - Consumer fazendo `nack` com `requeue=false` por erro no código → checar logs do consumer
562
- - Fila com `x-max-length` atingido → verificar se fila está lotada
563
-
564
- ```bash
565
- # Ver argumentos da fila (TTL, DLX, max-length)
566
- curl -s -u "$AUTH" "$MB_URL/queues/%2F/nome-da-fila" | python3 -c "
567
- import json,sys; q=json.load(sys.stdin)
568
- print(json.dumps(q.get('arguments', {}), indent=2))
569
- "
570
- ```
571
-
572
- ### Problema: Consumer recebe mensagem mas não processa (loop infinito)
573
-
574
- Sintoma: `messages_unacknowledged` cresce, `messages_ready` não zera.
575
-
576
- Solução: Verificar prefetch — consumer pode estar segurando todas as mensagens:
577
- ```bash
578
- # Ver detalhes dos channels (prefetch_count)
579
- curl -s -u "$AUTH" "$MB_URL/channels" | python3 -m json.tool
580
- ```
581
-
582
- ### Problema: 406 PRECONDITION_FAILED ao criar fila/exchange
583
-
584
- A fila/exchange já existe com parâmetros diferentes. Verificar parâmetros atuais:
585
- ```bash
586
- curl -s -u "$AUTH" "$MB_URL/queues/%2F/nome-da-fila" | python3 -m json.tool
587
- ```
588
- Se precisar mudar: deletar e recriar (confirmar com o usuário antes).
589
-
590
- ### Problema: Mensagens publicadas mas não chegam na fila
591
-
592
- Verificar se o binding existe com a routing_key correta:
593
- ```bash
594
- curl -s -u "$AUTH" "$MB_URL/bindings/%2F" | python3 -c "
595
- import json,sys
596
- for b in json.load(sys.stdin):
597
- if b.get('source') == 'nome-exchange':
598
- print(b)
599
- "
600
- ```
601
-
602
- ---
603
-
604
321
  ## Tratamento de Erros
605
322
 
606
323
  ### 401 Unauthorized
@@ -0,0 +1,28 @@
1
+ # Referência de Endpoints
2
+
3
+ > Parte do skill `eng-backend-rabbitmq`. Leia este arquivo quando precisar do endpoint exato, método ou payload da Management API.
4
+
5
+ ## Referência de Endpoints
6
+
7
+ | Operação | Método | Endpoint |
8
+ |----------|--------|----------|
9
+ | Status geral | GET | `/api/overview` |
10
+ | Listar filas | GET | `/api/queues` |
11
+ | Detalhes de fila | GET | `/api/queues/{vhost}/{name}` |
12
+ | Criar fila | PUT | `/api/queues/{vhost}/{name}` |
13
+ | Deletar fila | DELETE | `/api/queues/{vhost}/{name}` |
14
+ | Purgar fila | DELETE | `/api/queues/{vhost}/{name}/contents` |
15
+ | Consumir mensagens | POST | `/api/queues/{vhost}/{name}/get` |
16
+ | Listar exchanges | GET | `/api/exchanges/{vhost}` |
17
+ | Criar exchange | PUT | `/api/exchanges/{vhost}/{name}` |
18
+ | Deletar exchange | DELETE | `/api/exchanges/{vhost}/{name}` |
19
+ | Publicar mensagem | POST | `/api/exchanges/{vhost}/{name}/publish` |
20
+ | Listar bindings | GET | `/api/bindings/{vhost}` |
21
+ | Criar binding (fila) | POST | `/api/bindings/{vhost}/e/{exchange}/q/{queue}` |
22
+ | Deletar binding | DELETE | `/api/bindings/{vhost}/e/{exchange}/q/{queue}/{props}` |
23
+ | Listar connections | GET | `/api/connections` |
24
+ | Fechar connection | DELETE | `/api/connections/{name}` |
25
+ | Listar channels | GET | `/api/channels` |
26
+ | Listar vhosts | GET | `/api/vhosts` |
27
+
28
+ ---
@@ -0,0 +1,90 @@
1
+ # Código de Consumer/Producer
2
+
3
+ > Parte do skill `eng-backend-rabbitmq`. Leia este arquivo quando a tarefa pedir código de consumer ou producer (Node.js com amqplib ou Python com pika).
4
+
5
+ ## Criar Código de Consumer/Producer
6
+
7
+ Quando o usuário pedir para criar código, gerar implementação completa e funcional. Verificar a linguagem/framework do projeto antes de escolher a biblioteca.
8
+
9
+ ### Node.js com amqplib
10
+
11
+ ```javascript
12
+ // consumer.js
13
+ const amqp = require('amqplib');
14
+
15
+ async function startConsumer() {
16
+ const conn = await amqp.connect(process.env.RABBITMQ_URL);
17
+ const channel = await conn.createChannel();
18
+
19
+ const queue = 'nome-da-fila';
20
+ await channel.assertQueue(queue, { durable: true });
21
+ channel.prefetch(1); // processa 1 mensagem por vez
22
+
23
+ console.log(`Aguardando mensagens em ${queue}`);
24
+
25
+ channel.consume(queue, async (msg) => {
26
+ if (!msg) return;
27
+ try {
28
+ const payload = JSON.parse(msg.content.toString());
29
+ console.log('Mensagem recebida:', payload);
30
+
31
+ // processar aqui...
32
+
33
+ channel.ack(msg); // confirmar processamento
34
+ } catch (err) {
35
+ console.error('Erro ao processar:', err);
36
+ channel.nack(msg, false, false); // rejeitar sem requeue → vai para DLX
37
+ }
38
+ });
39
+ }
40
+
41
+ startConsumer().catch(console.error);
42
+ ```
43
+
44
+ ```javascript
45
+ // producer.js
46
+ const amqp = require('amqplib');
47
+
48
+ async function publish(exchange, routingKey, payload) {
49
+ const conn = await amqp.connect(process.env.RABBITMQ_URL);
50
+ const channel = await conn.createChannel();
51
+
52
+ channel.publish(
53
+ exchange,
54
+ routingKey,
55
+ Buffer.from(JSON.stringify(payload)),
56
+ { persistent: true, contentType: 'application/json' }
57
+ );
58
+
59
+ await channel.close();
60
+ await conn.close();
61
+ }
62
+ ```
63
+
64
+ ### Python com pika
65
+
66
+ ```python
67
+ # consumer.py
68
+ import pika, json, os
69
+
70
+ def on_message(channel, method, properties, body):
71
+ try:
72
+ payload = json.loads(body)
73
+ print(f"Mensagem recebida: {payload}")
74
+ # processar aqui...
75
+ channel.basic_ack(delivery_tag=method.delivery_tag)
76
+ except Exception as e:
77
+ print(f"Erro: {e}")
78
+ channel.basic_nack(delivery_tag=method.delivery_tag, requeue=False)
79
+
80
+ params = pika.URLParameters(os.environ['RABBITMQ_URL'])
81
+ conn = pika.BlockingConnection(params)
82
+ ch = conn.channel()
83
+ ch.basic_qos(prefetch_count=1)
84
+ ch.basic_consume('nome-da-fila', on_message)
85
+ ch.start_consuming()
86
+ ```
87
+
88
+ > Sempre ler o projeto para detectar a linguagem e adaptar o código antes de gerar.
89
+
90
+ ---
@@ -0,0 +1,101 @@
1
+ # Arquiteturas Comuns (DLX, retry, fanout, topic)
2
+
3
+ > Parte do skill `eng-backend-rabbitmq`. Leia este arquivo quando a tarefa pedir Dead Letter Exchange, retry com delay, fanout ou topic routing.
4
+
5
+ ## Arquiteturas Comuns
6
+
7
+ ### Dead Letter Exchange (DLX) — Fila com rejeição controlada
8
+
9
+ ```
10
+ Fila principal → (nack/expired) → DLX Exchange → Fila de Dead Letters
11
+ ```
12
+
13
+ ```bash
14
+ # 1. Criar DLX exchange
15
+ curl -s -X PUT -u "$AUTH" -H "Content-Type: application/json" \
16
+ -d '{"type":"direct","durable":true}' \
17
+ "$MB_URL/exchanges/%2F/dlx.minha-fila"
18
+
19
+ # 2. Criar fila de dead letters
20
+ curl -s -X PUT -u "$AUTH" -H "Content-Type: application/json" \
21
+ -d '{"durable":true}' \
22
+ "$MB_URL/queues/%2F/minha-fila.dead"
23
+
24
+ # 3. Criar binding DLX → fila dead
25
+ curl -s -X POST -u "$AUTH" -H "Content-Type: application/json" \
26
+ -d '{"routing_key":"minha-fila"}' \
27
+ "$MB_URL/bindings/%2F/e/dlx.minha-fila/q/minha-fila.dead"
28
+
29
+ # 4. Criar fila principal apontando para DLX
30
+ curl -s -X PUT -u "$AUTH" -H "Content-Type: application/json" \
31
+ -d '{
32
+ "durable": true,
33
+ "arguments": {
34
+ "x-dead-letter-exchange": "dlx.minha-fila",
35
+ "x-dead-letter-routing-key": "minha-fila",
36
+ "x-message-ttl": 86400000
37
+ }
38
+ }' \
39
+ "$MB_URL/queues/%2F/minha-fila"
40
+ ```
41
+
42
+ ### Retry com Delay (usando TTL + DLX como fila de espera)
43
+
44
+ ```
45
+ Fila principal → (nack) → DLX Exchange → Fila retry (TTL 30s) → republica → Fila principal
46
+ ```
47
+
48
+ ```bash
49
+ # Fila de retry com TTL de 30 segundos e DLX apontando de volta para a fila principal
50
+ curl -s -X PUT -u "$AUTH" -H "Content-Type: application/json" \
51
+ -d '{
52
+ "durable": true,
53
+ "arguments": {
54
+ "x-message-ttl": 30000,
55
+ "x-dead-letter-exchange": "",
56
+ "x-dead-letter-routing-key": "minha-fila"
57
+ }
58
+ }' \
59
+ "$MB_URL/queues/%2F/minha-fila.retry"
60
+ ```
61
+
62
+ ### Fanout — Broadcast para múltiplas filas
63
+
64
+ ```
65
+ Exchange fanout → Fila A
66
+ → Fila B
67
+ → Fila C
68
+ ```
69
+
70
+ ```bash
71
+ # Exchange fanout (routing_key é ignorada)
72
+ curl -s -X PUT -u "$AUTH" -H "Content-Type: application/json" \
73
+ -d '{"type":"fanout","durable":true}' \
74
+ "$MB_URL/exchanges/%2F/events.broadcast"
75
+
76
+ # Cada fila se liga sem routing_key
77
+ curl -s -X POST -u "$AUTH" -H "Content-Type: application/json" \
78
+ -d '{"routing_key":""}' \
79
+ "$MB_URL/bindings/%2F/e/events.broadcast/q/servico-a"
80
+ ```
81
+
82
+ ### Topic Routing — Roteamento por padrão
83
+
84
+ ```
85
+ Exchange topic → "pedido.criado" → fila pedidos
86
+ → "pedido.*" → fila auditoria
87
+ → "*.erro" → fila alertas
88
+ ```
89
+
90
+ ```bash
91
+ curl -s -X PUT -u "$AUTH" -H "Content-Type: application/json" \
92
+ -d '{"type":"topic","durable":true}' \
93
+ "$MB_URL/exchanges/%2F/events.topic"
94
+
95
+ # Binding com wildcard
96
+ curl -s -X POST -u "$AUTH" -H "Content-Type: application/json" \
97
+ -d '{"routing_key":"pedido.*"}' \
98
+ "$MB_URL/bindings/%2F/e/events.topic/q/fila-auditoria"
99
+ ```
100
+
101
+ ---
@@ -0,0 +1,93 @@
1
+ # Troubleshooting do RabbitMQ
2
+
3
+ > Parte do skill `eng-backend-rabbitmq`. Leia este arquivo quando houver fila acumulando, mensagens indo para dead letter, loop de consumer, erro 406 ou mensagens que não chegam.
4
+
5
+ ## Troubleshooting
6
+
7
+ ### Diagnóstico inicial — sempre começar aqui
8
+
9
+ ```bash
10
+ AUTH=$(grep "MESSAGE_BROKER_API_AUTH" $IDE/ENV.md | cut -d'=' -f2)
11
+ MB_URL=$(grep "MESSAGE_BROKER_URL_API" $IDE/ENV.md | cut -d'=' -f2)
12
+
13
+ # Visão geral do cluster
14
+ curl -s -u "$AUTH" "$MB_URL/overview" | python3 -m json.tool
15
+
16
+ # Filas com problemas (messages_ready > 0 e consumers = 0)
17
+ curl -s -u "$AUTH" "$MB_URL/queues" | python3 -c "
18
+ import json,sys
19
+ qs = json.load(sys.stdin)
20
+ for q in qs:
21
+ ready = q.get('messages_ready', 0)
22
+ consumers = q.get('consumers', 0)
23
+ if ready > 0 and consumers == 0:
24
+ print(f\"ALERTA: {q['name']} | mensagens={ready} | consumers=0\")
25
+ "
26
+ ```
27
+
28
+ ### Problema: Fila acumulando mensagens (consumer parado)
29
+
30
+ 1. Verificar se há consumers ativos na fila:
31
+ ```bash
32
+ curl -s -u "$AUTH" "$MB_URL/queues/%2F/nome-da-fila" | python3 -m json.tool | grep -E "consumers|messages"
33
+ ```
34
+ 2. Verificar connections abertas:
35
+ ```bash
36
+ curl -s -u "$AUTH" "$MB_URL/connections" | python3 -m json.tool
37
+ ```
38
+ 3. Checar se o consumer está com unacked alto (travado no processamento):
39
+ ```bash
40
+ curl -s -u "$AUTH" "$MB_URL/queues/%2F/nome-da-fila" | python3 -c "
41
+ import json,sys; q=json.load(sys.stdin)
42
+ print('messages_ready:', q.get('messages_ready'))
43
+ print('messages_unacknowledged:', q.get('messages_unacknowledged'))
44
+ print('consumers:', q.get('consumers'))
45
+ "
46
+ ```
47
+
48
+ ### Problema: Mensagens indo para Dead Letter inesperadamente
49
+
50
+ Causas comuns:
51
+ - `x-message-ttl` expirando antes do consumer processar → aumentar TTL ou aumentar prefetch
52
+ - Consumer fazendo `nack` com `requeue=false` por erro no código → checar logs do consumer
53
+ - Fila com `x-max-length` atingido → verificar se fila está lotada
54
+
55
+ ```bash
56
+ # Ver argumentos da fila (TTL, DLX, max-length)
57
+ curl -s -u "$AUTH" "$MB_URL/queues/%2F/nome-da-fila" | python3 -c "
58
+ import json,sys; q=json.load(sys.stdin)
59
+ print(json.dumps(q.get('arguments', {}), indent=2))
60
+ "
61
+ ```
62
+
63
+ ### Problema: Consumer recebe mensagem mas não processa (loop infinito)
64
+
65
+ Sintoma: `messages_unacknowledged` cresce, `messages_ready` não zera.
66
+
67
+ Solução: Verificar prefetch — consumer pode estar segurando todas as mensagens:
68
+ ```bash
69
+ # Ver detalhes dos channels (prefetch_count)
70
+ curl -s -u "$AUTH" "$MB_URL/channels" | python3 -m json.tool
71
+ ```
72
+
73
+ ### Problema: 406 PRECONDITION_FAILED ao criar fila/exchange
74
+
75
+ A fila/exchange já existe com parâmetros diferentes. Verificar parâmetros atuais:
76
+ ```bash
77
+ curl -s -u "$AUTH" "$MB_URL/queues/%2F/nome-da-fila" | python3 -m json.tool
78
+ ```
79
+ Se precisar mudar: deletar e recriar (confirmar com o usuário antes).
80
+
81
+ ### Problema: Mensagens publicadas mas não chegam na fila
82
+
83
+ Verificar se o binding existe com a routing_key correta:
84
+ ```bash
85
+ curl -s -u "$AUTH" "$MB_URL/bindings/%2F" | python3 -c "
86
+ import json,sys
87
+ for b in json.load(sys.stdin):
88
+ if b.get('source') == 'nome-exchange':
89
+ print(b)
90
+ "
91
+ ```
92
+
93
+ ---