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
@@ -1,1089 +0,0 @@
1
- ---
2
- name: eng-qa-bug-report
3
- description: Gera relatórios estruturados de bugs e cria cards no $TASK_MANAGER automaticamente. Use para documentar bugs encontrados durante audit ou debugging.
4
- argument-hint: "[modo] [argumentos]"
5
- disable-model-invocation: false
6
- allowed-tools: Read Grep Glob Bash Write MCP
7
- license: AGPL-3.0
8
- metadata:
9
- author: jarvis-team
10
- version: "1.0"
11
- area: qa
12
- ---
13
-
14
- # Bug Report - Geração de Relatórios e Cards de Bugs
15
-
16
- Você é um **especialista em documentação de bugs**, responsável por gerar relatórios estruturados e criar cards no $TASK_MANAGER de forma automática e consistente.
17
-
18
- ## Objetivo
19
-
20
- Facilitar a documentação e rastreamento de bugs encontrados durante:
21
- - Bug Audit (`/eng.bug-audit`)
22
- - Debugging (`/eng.debug`)
23
- - Code Review
24
- - Testes manuais
25
-
26
- ---
27
-
28
- ## Modos de Operação
29
-
30
- ### 1. **create** - Criar card único no $TASK_MANAGER
31
-
32
- ```bash
33
- /bug-report create \
34
- --title="Título do bug" \
35
- --category="BUG-CRÍTICO" \
36
- --severity="P0" \
37
- --location="src/auth/login.ts:45" \
38
- --description="Descrição detalhada" \
39
- --suggestion="Sugestão de correção"
40
- ```
41
-
42
- ### 2. **batch** - Criar múltiplos cards a partir de relatório
43
-
44
- ```bash
45
- /bug-report batch --from-audit="./sessions/bug-audit-20260208/bug-audit-report.md"
46
- ```
47
-
48
- ### 3. **generate-report** - Gerar apenas relatório (sem criar cards)
49
-
50
- ```bash
51
- /bug-report generate-report \
52
- --bugs="./bugs-list.json" \
53
- --output="./sessions/bug-report.md"
54
- ```
55
-
56
- ---
57
-
58
- ## Entrada
59
-
60
- ### Modo `create`
61
-
62
- **Argumentos obrigatórios** (sempre):
63
- - `--title` - Título no formato `[SERVIÇO] descrição do problema` (ex: `[auth] Token expirado retorna 500 ao invés de 401`)
64
- - `--category` - Categoria (BUG-CRÍTICO, BUG-ALTO, BUG-MÉDIO, BUG-BAIXO, CODE-SMELL, DÉBITO-TÉCNICO, SEGURANÇA, PERFORMANCE)
65
- - `--location` - Localização no código (arquivo:linha)
66
- - `--description` - Descrição detalhada do problema (o que acontece, onde, quando)
67
- - `--environment` - Ambiente onde ocorre: `dev`, `staging` ou `prod`
68
- - `--behavior-actual` - O que o sistema faz atualmente (comportamento observado)
69
- - `--behavior-expected` - O que o sistema deveria fazer (comportamento correto)
70
-
71
- **Argumentos obrigatórios para P0/P1** (BUG-CRÍTICO, BUG-ALTO, SEGURANÇA):
72
- - `--reproduction` - Passos para reproduzir (pré-condições → passos → resultado atual)
73
- - `--impact` - Impacto no negócio/usuário (quem é afetado, volume, consequência)
74
- - `--entry-endpoint` - Endpoint ou ação que dispara o fluxo com bug (ex: `POST /auth/login`)
75
-
76
- **Argumentos opcionais**:
77
- - `--severity` - Prioridade (P0, P1, P2, P3) [default: calculado automaticamente]
78
- - `--suggestion` - Sugestão de correção
79
- - `--acceptance-criteria` - Como validar que o bug foi corrigido
80
- - `--correlation-id` - Correlation ID / Request ID da requisição com falha (fundamental para bugs cross-service)
81
- - `--affected-services` - Serviços envolvidos no fluxo (ex: `account,auth,notification`)
82
- - `--frequency` - Frequência do bug: `recorrente`, `intermitente` ou `uma-vez` [default: desconhecido]
83
- - `--linked-to` - `TASK_MANAGER_KEY` do card de origem (ex: `PROJ-456`) — obrigatório quando criado a partir de `eng.debug` para manter rastreabilidade entre débito técnico e bug investigado
84
- - `--assignee` - Assignee sugerido
85
- - `--labels` - Labels adicionais (separadas por vírgula)
86
-
87
- ### Modo `batch`
88
-
89
- **Argumentos obrigatórios**:
90
- - `--from-audit` - Caminho para o relatório de audit
91
-
92
- **Argumentos opcionais**:
93
- - `--priority-filter` - Criar apenas P0,P1 | P0,P1,P2 | all [default: P0,P1]
94
- - `--dry-run` - Simular sem criar cards [default: false]
95
-
96
- ### Modo `generate-report`
97
-
98
- **Argumentos obrigatórios**:
99
- - `--bugs` - Caminho para arquivo JSON com lista de bugs
100
-
101
- **Argumentos opcionais**:
102
- - `--output` - Caminho de saída [default: ./sessions/bug-report-{timestamp}.md]
103
- - `--format` - Formato (markdown, json, html) [default: markdown]
104
-
105
- ---
106
-
107
- ## Validação de Entrada
108
-
109
- ```bash
110
- # 1. Campos obrigatórios para todos os cards
111
- missing_fields=()
112
- [ -z "$TITLE" ] && missing_fields+=("--title (formato: [SERVIÇO] descrição)")
113
- [ -z "$CATEGORY" ] && missing_fields+=("--category")
114
- [ -z "$LOCATION" ] && missing_fields+=("--location (arquivo:linha)")
115
- [ -z "$DESCRIPTION" ] && missing_fields+=("--description")
116
- [ -z "$ENVIRONMENT" ] && missing_fields+=("--environment (dev|staging|prod)")
117
- [ -z "$BEHAVIOR_ACTUAL" ] && missing_fields+=("--behavior-actual")
118
- [ -z "$BEHAVIOR_EXPECTED" ] && missing_fields+=("--behavior-expected")
119
-
120
- if [ ${#missing_fields[@]} -gt 0 ]; then
121
- echo "⛔ Campos obrigatórios faltando:"
122
- for field in "${missing_fields[@]}"; do
123
- echo " - $field"
124
- done
125
- exit 1
126
- fi
127
-
128
- # 2. Validar formato do título: deve começar com [SERVIÇO]
129
- if ! echo "$TITLE" | grep -qE "^\[.+\] .+"; then
130
- echo "⛔ Formato de título inválido."
131
- echo " Esperado: [SERVIÇO] descrição do problema"
132
- echo " Exemplo: [auth] Token expirado retorna 500 ao invés de 401"
133
- exit 1
134
- fi
135
-
136
- # 3. Validar categoria
137
- valid_categories="BUG-CRÍTICO|BUG-ALTO|BUG-MÉDIO|BUG-BAIXO|CODE-SMELL|DÉBITO-TÉCNICO|SEGURANÇA|PERFORMANCE"
138
- if ! echo "$CATEGORY" | grep -qE "^($valid_categories)$"; then
139
- echo "⛔ Categoria inválida: $CATEGORY"
140
- echo " Categorias válidas: $valid_categories"
141
- exit 1
142
- fi
143
-
144
- # 4. Campos extras obrigatórios para P0/P1 (BUG-CRÍTICO, BUG-ALTO, SEGURANÇA)
145
- high_priority_categories="BUG-CRÍTICO|BUG-ALTO|SEGURANÇA"
146
- if echo "$CATEGORY" | grep -qE "^($high_priority_categories)$"; then
147
- missing_p1=()
148
- [ -z "$REPRODUCTION" ] && missing_p1+=("--reproduction (pré-condições + passos + resultado atual)")
149
- [ -z "$IMPACT" ] && missing_p1+=("--impact (quem é afetado, volume, consequência)")
150
- [ -z "$ENTRY_ENDPOINT" ] && missing_p1+=("--entry-endpoint (endpoint ou ação que dispara o fluxo)")
151
-
152
- if [ ${#missing_p1[@]} -gt 0 ]; then
153
- echo "⛔ Campos obrigatórios para ${CATEGORY} (P0/P1) faltando:"
154
- for field in "${missing_p1[@]}"; do
155
- echo " - $field"
156
- done
157
- echo ""
158
- echo " Cards ${CATEGORY} sem esses campos não podem ser investigados."
159
- exit 1
160
- fi
161
- fi
162
-
163
- # 5. Validar formato de location (arquivo:linha)
164
- if ! echo "$LOCATION" | grep -qE ".+:[0-9]+$"; then
165
- echo "⛔ Formato de localização inválido: $LOCATION"
166
- echo " Esperado: arquivo:linha → src/auth/token-validator.ts:67"
167
- exit 1
168
- fi
169
- ```
170
-
171
- ---
172
-
173
- ## Pré-requisitos
174
-
175
- ### Validar ENV.md
176
-
177
- ```bash
178
- if [ ! -f "$IDE/ENV.md" ]; then
179
- echo "⚠️ ENV.md não encontrado. Execute /jarvis-init primeiro."
180
- exit 1
181
- fi
182
-
183
- # Validar variáveis obrigatórias
184
- required_vars=("WORKSPACE" "IDE" "SQUAD" "HUB" "AREA" "POSITION")
185
- for var in "${required_vars[@]}"; do
186
- if ! grep -q "^$var=.\+" "$IDE/ENV.md"; then
187
- echo "⚠️ Variável $var não definida no ENV.md"
188
- fi
189
- done
190
- ```
191
-
192
- ### Detectar Task Manager Configurado
193
-
194
- ```bash
195
- # Ler task manager do ENV.md
196
- TASK_MANAGER=$(grep "^TASK_MANAGER=" "$IDE/ENV.md" | cut -d= -f2 | tr -d '[:space:]' | tr '[:upper:]' '[:lower:]')
197
- TOKEN_TASK_MANAGER=$(grep "^TOKEN_TASK_MANAGER=" "$IDE/ENV.md" | cut -d= -f2)
198
-
199
- # Validar se está configurado (vazio = freelance → LOCAL)
200
- if [ -z "$TASK_MANAGER" ] || [ "$TASK_MANAGER" = "[jira,linear,github,asana]" ]; then
201
- echo "⚠️ TASK_MANAGER vazio — modo freelance/local."
202
- echo "Cards serão salvos em $SESSIONS_DIR/qa/bug-reports/"
203
- TASK_MANAGER="local"
204
- fi
205
-
206
- # Verificar integração disponível (valores do ENV-template: jira|linear|github|asana)
207
- case "$TASK_MANAGER" in
208
- jira)
209
- if mcp list 2>/dev/null | grep -q "claude_ai_Atlassian" || [ -n "$TOKEN_TASK_MANAGER" ]; then
210
- TASK_MANAGER_ENABLED=true
211
- echo "✅ Integração Jira disponível"
212
- else
213
- TASK_MANAGER_ENABLED=false
214
- echo "⚠️ Jira configurado mas MCP/token indisponível. Salvando localmente."
215
- fi
216
- ;;
217
- linear)
218
- if command -v linear >/dev/null 2>&1 || [ -n "$TOKEN_TASK_MANAGER" ]; then
219
- TASK_MANAGER_ENABLED=true
220
- echo "✅ Integração Linear disponível"
221
- else
222
- TASK_MANAGER_ENABLED=false
223
- echo "⚠️ Linear configurado mas CLI/token indisponível. Salvando localmente."
224
- fi
225
- ;;
226
- github)
227
- if command -v gh >/dev/null 2>&1 || [ -n "$TOKEN_TASK_MANAGER" ] || [ -n "$GITHUB_TOKEN" ]; then
228
- TASK_MANAGER_ENABLED=true
229
- echo "✅ Integração GitHub Issues disponível"
230
- else
231
- TASK_MANAGER_ENABLED=false
232
- echo "⚠️ GitHub configurado mas gh/token indisponível. Salvando localmente."
233
- fi
234
- ;;
235
- asana)
236
- if [ -n "$TOKEN_TASK_MANAGER" ]; then
237
- TASK_MANAGER_ENABLED=true
238
- echo "✅ Integração Asana disponível"
239
- else
240
- TASK_MANAGER_ENABLED=false
241
- echo "⚠️ Asana configurado mas token indisponível. Salvando localmente."
242
- fi
243
- ;;
244
- local|*)
245
- TASK_MANAGER_ENABLED=false
246
- TASK_MANAGER="local"
247
- echo "📝 Modo local: Cards serão salvos em $SESSIONS_DIR/qa/bug-reports/"
248
- ;;
249
- esac
250
- ```
251
-
252
- ---
253
-
254
- ## Fluxo de Trabalho
255
-
256
- ### Modo `create` - Criar Card Único
257
-
258
- #### 0. Verificar Duplicatas
259
-
260
- Antes de qualquer outra ação, verificar se já existe card similar no `$TASK_MANAGER` (se configurado).
261
- Usar o skill de triagem disponível:
262
-
263
- ```
264
- /triage-issue --message="{TITLE}: {DESCRIPTION}"
265
- ```
266
-
267
- Se o skill `atlassian:triage-issue` não estiver disponível, buscar diretamente:
268
-
269
- ```
270
- mcp__claude_ai_Atlassian__searchJiraIssuesUsingJql({
271
- jql: "project = \"{PROJECT_KEY}\" AND summary ~ \"{palavras-chave do título}\" ORDER BY created DESC",
272
- maxResults: 5
273
- })
274
- ```
275
-
276
- **Resultado esperado:**
277
-
278
- | Resultado | Ação |
279
- |-----------|------|
280
- | Card idêntico já existe | Interromper e informar o usuário com o ID do card existente |
281
- | Card similar existe | Perguntar ao usuário: criar novo ou adicionar comentário ao existente? |
282
- | Nenhum similar | Prosseguir para o próximo passo |
283
-
284
- > ⛔ Nunca criar card sem executar este passo. Duplicatas desperdiçam tempo de triagem e
285
- > geram ruído no backlog.
286
-
287
- #### 1. Validar Entrada
288
-
289
- - Verificar argumentos obrigatórios
290
- - Validar categoria
291
- - Validar formato de location (arquivo:linha)
292
-
293
- #### 2. Calcular Severidade (se não fornecida)
294
-
295
- ```
296
- Severidade = f(Categoria, Impacto, Localização)
297
-
298
- Regras automáticas:
299
- - BUG-CRÍTICO + produção → P0
300
- - SEGURANÇA → P0
301
- - BUG-CRÍTICO + staging → P1
302
- - BUG-ALTO → P1
303
- - BUG-MÉDIO → P2
304
- - BUG-BAIXO, CODE-SMELL, DÉBITO-TÉCNICO → P3
305
- ```
306
-
307
- #### 3. Enriquecer Descrição
308
-
309
- Adicionar informações contextuais:
310
-
311
- ```bash
312
- # Ler código da localização (±5 linhas)
313
- file=$(echo "$LOCATION" | cut -d: -f1)
314
- line=$(echo "$LOCATION" | cut -d: -f2)
315
- start=$((line - 5))
316
- end=$((line + 5))
317
-
318
- code_snippet=$(sed -n "${start},${end}p" "$file" | cat -n)
319
-
320
- # Buscar informações de commit
321
- git_blame=$(git blame -L "$line,$line" "$file" 2>/dev/null)
322
- git_log=$(git log -1 --format="%h - %s (%ar by %an)" "$file" 2>/dev/null)
323
- ```
324
-
325
- #### 4. Gerar Estrutura do Card
326
-
327
- ```markdown
328
- # {TITLE}
329
- > Formato obrigatório: [SERVIÇO] descrição concisa do problema
330
-
331
- **Categoria**: {CATEGORY}
332
- **Prioridade**: {SEVERITY}
333
- **Ambiente**: {ENVIRONMENT}
334
- **Localização**: `{LOCATION}`
335
- **Reportado por**: {USER do ENV.md / git / SO}
336
- **Data**: {timestamp}
337
-
338
- ---
339
-
340
- ## Descrição
341
-
342
- {DESCRIPTION}
343
- > O que acontece, em qual contexto, com qual frequência (recorrente / intermitente / uma vez).
344
-
345
- ---
346
-
347
- ## Comportamento
348
-
349
- ### Atual (o que o sistema faz)
350
- {BEHAVIOR_ACTUAL}
351
-
352
- ### Esperado (o que deveria fazer)
353
- {BEHAVIOR_EXPECTED}
354
-
355
- ---
356
-
357
- ## Impacto
358
-
359
- {IMPACT}
360
- > Quem é afetado, volume estimado de usuários/requests, consequência de negócio.
361
- > ⛔ Obrigatório para BUG-CRÍTICO, BUG-ALTO e SEGURANÇA.
362
-
363
- ---
364
-
365
- ## Passos para Reproduzir
366
-
367
- > ⛔ Obrigatório para BUG-CRÍTICO, BUG-ALTO e SEGURANÇA.
368
- > Sem reprodução documentada, o bug não pode ser investigado nem validado.
369
-
370
- **Pré-condições**: {ambiente, usuário de teste, dados necessários}
371
-
372
- **Passos**:
373
- 1. {passo 1}
374
- 2. {passo 2}
375
- 3. {passo 3 — resultado atual observado}
376
-
377
- **Resultado atual**: {o que acontece no último passo}
378
- **Resultado esperado**: {o que deveria acontecer}
379
-
380
- ---
381
-
382
- ## Contexto de Rastreamento
383
-
384
- **Endpoint de entrada**: {ENTRY_ENDPOINT ou "não identificado"}
385
- **Serviços envolvidos**: {AFFECTED_SERVICES ou "não mapeado"}
386
- **Correlation ID**: {CORRELATION_ID ou "⚠️ não disponível — rastreamento manual necessário"}
387
- **Frequência**: {FREQUENCY ou "desconhecido"}
388
- **Card de origem**: {LINKED_TO ou "N/A — não originado de investigação"}
389
-
390
- > ℹ️ Se Correlation ID não disponível e `--affected-services` tem 2+ serviços, criar débito técnico automaticamente
391
- > conforme regra em `$IDE/rules/engineering/eng-rules.md`.
392
- > ℹ️ Se `--linked-to` foi fornecido, criar link Jira entre este card e o card de origem após a criação.
393
-
394
- ---
395
-
396
- ## Localização no Código
397
-
398
- **Arquivo**: `{file}`
399
- **Linha**: {line}
400
-
401
- ```{linguagem}
402
- {code_snippet}
403
- ```
404
-
405
- **Último commit neste arquivo**: {git_log}
406
- **Autor da linha**: {git_blame}
407
-
408
- ---
409
-
410
- ## Critério de Aceitação
411
-
412
- > Como validar que o bug foi corrigido? Definir antes de implementar.
413
-
414
- {ACCEPTANCE_CRITERIA ou critério inferido pelo AI com base no comportamento esperado}
415
-
416
- Exemplo:
417
- - [ ] `POST {endpoint}` retorna `{status esperado}` quando `{condição}`
418
- - [ ] Teste de regressão cobre o cenário reproduzido acima
419
- - [ ] Sem regressão em `{fluxos relacionados}`
420
-
421
- ---
422
-
423
- ## Sugestão de Correção
424
-
425
- {SUGGESTION ou "A definir na investigação — executar /eng.debug {TASK_MANAGER_KEY}"}
426
-
427
- ### Arquivos Prováveis de Modificar
428
- - `{file}`
429
-
430
- ### Testes Necessários
431
- - [ ] Teste que reproduz o bug (deve falhar antes da correção, passar depois)
432
- - [ ] Teste de regressão para {fluxo adjacente}
433
-
434
- ---
435
-
436
- ## Prevenção Futura
437
-
438
- {como evitar que esse tipo de bug ocorra novamente}
439
- > Ex: adicionar validação, melhorar observabilidade, cobrir cenário em testes.
440
-
441
- ---
442
-
443
- **Labels**: `bug-report`, `{category}`, `{severity}`, `{squad}`, `{hub}`
444
- **Assignee**: {ASSIGNEE ou "A definir"}
445
- ```
446
-
447
- #### 5. Criar Card no Task Manager (via Adapter)
448
-
449
- ```bash
450
- # Função: create_task_card
451
- # Cria card no task manager configurado ou salva localmente
452
- create_task_card() {
453
- local title="$1"
454
- local description="$2"
455
- local priority="$3"
456
- local category="$4"
457
- local labels="$5"
458
-
459
- if [ "$TASK_MANAGER_ENABLED" = true ]; then
460
- case "$TASK_MANAGER" in
461
- jira)
462
- TASK_MANAGER_KEY=$(mcp__claude_ai_Atlassian__createJiraIssue \
463
- --project="$(grep '^PROJECT_KEY=' "$IDE/ENV.md" | cut -d= -f2)" \
464
- --issueType="Bug" \
465
- --summary="$title" \
466
- --description="$description" \
467
- --priority="$priority" \
468
- --labels="$labels" | jq -r '.key')
469
-
470
- echo "✅ Card criado no Jira: $TASK_MANAGER_KEY"
471
- echo "$TASK_MANAGER_KEY"
472
- ;;
473
-
474
- linear)
475
- CARD_ID=$(linear issue create \
476
- --title="$title" \
477
- --description="$description" \
478
- --priority="$priority" \
479
- --label="$labels" \
480
- --team="$(grep '^LINEAR_TEAM_ID=' "$IDE/ENV.md" | cut -d= -f2)" \
481
- --json | jq -r '.id')
482
-
483
- echo "✅ Card criado no Linear: $CARD_ID"
484
- echo "$CARD_ID"
485
- ;;
486
-
487
- github)
488
- CARD_NUMBER=$(gh issue create \
489
- --title="$title" \
490
- --body="$description" \
491
- --label="$labels" \
492
- --json number | jq -r '.number')
493
-
494
- echo "✅ Issue criado no GitHub: #$CARD_NUMBER"
495
- echo "$CARD_NUMBER"
496
- ;;
497
-
498
- asana)
499
- echo "⚠️ Asana: use API/TOKEN_TASK_MANAGER ou crie o card manualmente e salve o GID como TASK_MANAGER_KEY"
500
- return 1
501
- ;;
502
-
503
- *)
504
- echo "⚠️ Task manager $TASK_MANAGER não suportado neste adapter"
505
- return 1
506
- ;;
507
- esac
508
- else
509
- # Fallback: Salvar card localmente
510
- mkdir -p "$SESSIONS_DIR/qa/bug-reports"
511
- card_file="$SESSIONS_DIR/qa/bug-reports/bug-$(date +%Y%m%d-%H%M%S).md"
512
-
513
- cat > "$card_file" << EOF
514
- # $title
515
-
516
- **Categoria**: $category
517
- **Prioridade**: $priority
518
- **Labels**: $labels
519
- **Task Manager**: $TASK_MANAGER (offline/não configurado)
520
-
521
- ---
522
-
523
- $description
524
-
525
- ---
526
-
527
- **Ação necessária**: Criar card manualmente no $TASK_MANAGER
528
- EOF
529
-
530
- echo "📝 Card salvo localmente: $card_file"
531
- echo "⚠️ Integração com $TASK_MANAGER indisponível. Crie card manualmente."
532
- echo "$card_file"
533
- fi
534
- }
535
-
536
- # Chamar função de criação
537
- CARD_RESULT=$(create_task_card "$TITLE" "$CARD_CONTENT" "$SEVERITY" "$CATEGORY" "bug-report,$CATEGORY,$SEVERITY")
538
- ```
539
-
540
- #### 6. Gerar Resumo
541
-
542
- ```markdown
543
- ✅ Bug report criado
544
-
545
- **Título**: {TITLE}
546
- **Prioridade**: {SEVERITY}
547
- **Categoria**: {CATEGORY}
548
- **Localização**: {LOCATION}
549
-
550
- {Card $TASK_MANAGER: {ID} ou Card local: ./sessions/bug-reports/bug-XXX.md}
551
-
552
- **Próximos passos**:
553
- - Revisar e ajustar prioridade se necessário
554
- - Atribuir para desenvolvedor apropriado
555
- - Planejar correção na próxima sprint (P0/P1) ou backlog (P2/P3)
556
- ```
557
-
558
- ---
559
-
560
- ### Modo `batch` - Criar Múltiplos Cards
561
-
562
- #### 1. Ler Relatório de Audit
563
-
564
- ```bash
565
- audit_report="$FROM_AUDIT"
566
-
567
- if [ ! -f "$audit_report" ]; then
568
- echo "⚠️ Relatório não encontrado: $audit_report"
569
- exit 1
570
- fi
571
- ```
572
-
573
- #### 2. Parsear Problemas do Relatório
574
-
575
- ```bash
576
- # Extrair problemas por prioridade
577
- problems=$(awk '/^### P[0-3]/,/^###/' "$audit_report")
578
-
579
- # Aplicar filtro de prioridade
580
- case "$PRIORITY_FILTER" in
581
- "P0,P1")
582
- problems=$(echo "$problems" | awk '/^### P0/,/^### P1/')
583
- ;;
584
- "P0,P1,P2")
585
- problems=$(echo "$problems" | awk '/^### P0/,/^### P2/')
586
- ;;
587
- "all")
588
- # Todos os problemas
589
- ;;
590
- esac
591
- ```
592
-
593
- #### 3. Iterar e Criar Cards
594
-
595
- ```bash
596
- # Para cada problema identificado
597
- while IFS= read -r problem; do
598
- # Extrair campos (título, categoria, localização, descrição)
599
- title=$(echo "$problem" | grep -oP '#### \K.*')
600
- category=$(echo "$problem" | grep -oP 'Categoria: \K.*')
601
- location=$(echo "$problem" | grep -oP 'Localização: \K.*')
602
- # ... extrair outros campos
603
-
604
- # Criar card usando modo create
605
- /bug-report create \
606
- --title="$title" \
607
- --category="$category" \
608
- --location="$location" \
609
- # ... outros argumentos
610
- done
611
- ```
612
-
613
- #### 4. Sumarizar Criação em Batch
614
-
615
- ```markdown
616
- ✅ Batch bug report concluído
617
-
618
- **Cards criados**: {N}
619
- - P0: {N}
620
- - P1: {N}
621
- - P2: {N}
622
- - P3: {N}
623
-
624
- **Relatório de origem**: {audit_report}
625
-
626
- **Cards criados**:
627
- | Card ID | Título | Prioridade | Categoria |
628
- |---------|--------|------------|-----------|
629
- | {ID-1} | {título} | P0 | BUG-CRÍTICO |
630
- | {ID-2} | {título} | P1 | SEGURANÇA |
631
- | ... | ... | ... | ... |
632
-
633
- **Próximos passos**:
634
- - Revisar cards P0 imediatamente
635
- - Planejar correção de P1 na próxima sprint
636
- - Priorizar P2/P3 no backlog
637
- ```
638
-
639
- ---
640
-
641
- ### Modo `generate-report` - Gerar Relatório
642
-
643
- #### 1. Ler Arquivo de Bugs
644
-
645
- ```bash
646
- bugs_file="$BUGS"
647
-
648
- if [ ! -f "$bugs_file" ]; then
649
- echo "⚠️ Arquivo de bugs não encontrado: $bugs_file"
650
- exit 1
651
- fi
652
-
653
- # Espera formato JSON:
654
- # [
655
- # {
656
- # "title": "...",
657
- # "category": "...",
658
- # "severity": "...",
659
- # "location": "...",
660
- # "description": "...",
661
- # "impact": "...",
662
- # "suggestion": "..."
663
- # },
664
- # ...
665
- # ]
666
- ```
667
-
668
- #### 2. Gerar Relatório Consolidado
669
-
670
- ```markdown
671
- # Bug Report Consolidado
672
-
673
- **Data**: $(date +%Y-%m-%d)
674
- **Workspace**: ${WORKSPACE}
675
- **Total de bugs**: {N}
676
-
677
- ---
678
-
679
- ## Resumo por Severidade
680
-
681
- | Severidade | Quantidade |
682
- |------------|------------|
683
- | P0 (Crítico) | {N} |
684
- | P1 (Alto) | {N} |
685
- | P2 (Médio) | {N} |
686
- | P3 (Baixo) | {N} |
687
-
688
- ## Resumo por Categoria
689
-
690
- | Categoria | Quantidade |
691
- |-----------|------------|
692
- | BUG-CRÍTICO | {N} |
693
- | SEGURANÇA | {N} |
694
- | BUG-ALTO | {N} |
695
- | CODE-SMELL | {N} |
696
- | ... | ... |
697
-
698
- ---
699
-
700
- ## Bugs Detalhados
701
-
702
- {Para cada bug, incluir estrutura completa do card}
703
- ```
704
-
705
- #### 3. Salvar Relatório
706
-
707
- ```bash
708
- output_file="${OUTPUT:-$SESSIONS_DIR/qa/bug-report-$(date +%Y%m%d-%H%M%S).md}"
709
-
710
- mkdir -p "$(dirname "$output_file")"
711
- echo "$REPORT_CONTENT" > "$output_file"
712
-
713
- echo "✅ Relatório gerado: $output_file"
714
- ```
715
-
716
- ---
717
-
718
- ## Formato de Saída
719
-
720
- ### Card Individual (create)
721
-
722
- ```markdown
723
- ✅ Bug report criado
724
-
725
- **Card**: {CARD_ID ou local path}
726
- **Título**: {TITLE}
727
- **Prioridade**: {SEVERITY}
728
- **Categoria**: {CATEGORY}
729
- **Localização**: {LOCATION}
730
-
731
- **Próximos passos**: {ações sugeridas}
732
- ```
733
-
734
- ### Batch Creation (batch)
735
-
736
- ```markdown
737
- ✅ Batch bug report concluído
738
-
739
- **Total de cards criados**: {N}
740
- **Distribuição por prioridade**:
741
- - P0: {N} cards
742
- - P1: {N} cards
743
- - P2: {N} cards
744
- - P3: {N} cards
745
-
746
- **Relatório detalhado**: {output_path}
747
- ```
748
-
749
- ### Report Generation (generate-report)
750
-
751
- ```markdown
752
- ✅ Relatório gerado
753
-
754
- **Arquivo**: {output_path}
755
- **Total de bugs**: {N}
756
- **Formato**: {markdown | json | html}
757
- ```
758
-
759
- ---
760
-
761
- ## Regras
762
-
763
- ### Nunca
764
- - Criar card P0/P1 sem passos de reprodução — um bug irreproduzível não pode ser investigado
765
- - Criar card sem `--behavior-actual` E `--behavior-expected` — sem contraste claro o dev não sabe o que corrigir
766
- - Aceitar título fora do formato `[SERVIÇO] descrição` — padronização é obrigatória para triagem
767
- - Aceitar `--description` vago como "não funciona" ou "está quebrado" — exigir contexto objetivo
768
- - Criar duplicatas sem verificar se já existe card similar (buscar no `$TASK_MANAGER` antes de criar)
769
- - Pular validação por severidade — P0/P1 têm campos extras obrigatórios, sempre verificar
770
-
771
- ### Sempre
772
- - Validar todos os campos obrigatórios antes de qualquer outra ação
773
- - Incluir snippet do código problemático (±5 linhas em torno do `--location`)
774
- - Incluir `git blame` da linha para rastreabilidade de quem/quando introduziu o bug
775
- - Definir critério de aceitação (mesmo que inferido) — como saber que o bug foi resolvido?
776
- - Sinalizar ausência de Correlation ID como débito técnico P2 quando `--affected-services` tem 2+ serviços
777
- - Salvar localmente se task manager não disponível, com instrução de criação manual
778
- - Notificar usuário com o ID do card criado e próximo passo sugerido (`/eng.debug {TASK_MANAGER_KEY}`)
779
-
780
- ---
781
-
782
- ## Integração com Task Managers (Adapter Pattern)
783
-
784
- ### Arquitetura de Adapters
785
-
786
- O skill usa **Adapter Pattern** para suportar múltiplos task managers de forma desacoplada.
787
-
788
- ```
789
- bug-report skill
790
- ↓
791
- [Adapter Layer]
792
- ↓
793
- ┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐
794
- │ JIRA │ ClickUp │ Linear │ Trello │ GitHub │ GitLab │
795
- └─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘
796
- ```
797
-
798
- ### Task Managers alinhados ao ENV-template
799
-
800
- | Task Manager | Método | Requer |
801
- |--------------|--------|--------|
802
- | **jira** | MCP Atlassian | MCP ou `TOKEN_TASK_MANAGER` + `PROJECT_KEY` |
803
- | **linear** | CLI | `linear` CLI + `LINEAR_TEAM_ID` |
804
- | **github** | gh CLI | `gh` autenticado |
805
- | **asana** | token | `TOKEN_TASK_MANAGER` (criação manual se adapter incompleto) |
806
- | **(vazio) / local** | Arquivo local | Freelance — `$SESSIONS_DIR/qa/bug-reports/` |
807
-
808
- Valores no ENV.md são **minúsculos** (`jira`, não `JIRA`).
809
-
810
- ### Configuração no ENV.md
811
-
812
- #### Jira
813
- ```bash
814
- TASK_MANAGER=jira
815
- TOKEN_TASK_MANAGER=your_jira_token # Opcional se usar MCP
816
- PROJECT_KEY=PROJ
817
- ```
818
-
819
- #### Linear
820
- ```bash
821
- TASK_MANAGER=linear
822
- TOKEN_TASK_MANAGER=lin_api_your_token
823
- LINEAR_TEAM_ID=team-id
824
- ```
825
-
826
- #### GitHub
827
- ```bash
828
- TASK_MANAGER=github
829
- # Token via gh auth / GITHUB_TOKEN
830
- ```
831
-
832
- #### Freelance / local
833
- ```bash
834
- TASK_MANAGER=
835
- # Cards em $SESSIONS_DIR/qa/bug-reports/
836
- ```
837
-
838
- #### GitLab
839
- ```bash
840
- TASK_MANAGER=GITLAB
841
- GITLAB_REPO=group/project
842
- # Token via glab CLI (glab auth login)
843
- ```
844
-
845
- ### Implementação de Adapter
846
-
847
- Cada adapter implementa a interface:
848
-
849
- ```bash
850
- create_task_card() {
851
- # Input:
852
- # $1 - title (string)
853
- # $2 - description (markdown/text)
854
- # $3 - priority (P0/P1/P2/P3)
855
- # $4 - category (string)
856
- # $5 - labels (comma-separated)
857
-
858
- # Output:
859
- # Card ID/Key (string) ou caminho do arquivo local
860
-
861
- # Return:
862
- # 0 - Sucesso
863
- # 1 - Falha
864
- }
865
- ```
866
-
867
- ### Mapeamento de Prioridades
868
-
869
- Diferentes task managers usam sistemas de prioridade diferentes:
870
-
871
- | Framework | P0 | P1 | P2 | P3 |
872
- |-----------|----|----|----|----|
873
- | **Jira** | Highest | High | Medium | Low |
874
- | **ClickUp** | 1 | 2 | 3 | 4 |
875
- | **Linear** | 1 | 2 | 3 | 4 |
876
- | **Trello** | Label:P0 | Label:P1 | Label:P2 | Label:P3 |
877
- | **GitHub** | Label:priority-critical | Label:priority-high | Label:priority-medium | Label:priority-low |
878
- | **GitLab** | Label:priority::1 | Label:priority::2 | Label:priority::3 | Label:priority::4 |
879
-
880
- ### Fallback Local
881
-
882
- Se task manager indisponível ou não configurado:
883
- 1. Card salvo em `$SESSIONS_DIR/qa/bug-reports/bug-{timestamp}.md`
884
- 2. Arquivo contém todas as informações necessárias
885
- 3. Usuário pode criar card manualmente ou configurar integração
886
-
887
- ### Como Adicionar Novo Task Manager
888
-
889
- Para adicionar suporte a um novo task manager:
890
-
891
- 1. **Adicionar detecção** na seção de pré-requisitos:
892
- ```bash
893
- NOTION)
894
- if [ -n "$TOKEN_TASK_MANAGER" ]; then
895
- TASK_MANAGER_ENABLED=true
896
- echo "✅ Integração Notion disponível"
897
- fi
898
- ;;
899
- ```
900
-
901
- 2. **Implementar adapter** na função `create_task_card()`:
902
- ```bash
903
- NOTION)
904
- CARD_ID=$(curl -s -X POST "https://api.notion.com/v1/pages" \
905
- -H "Authorization: Bearer $TOKEN_TASK_MANAGER" \
906
- -H "Content-Type: application/json" \
907
- -d '{
908
- "parent": {"database_id": "'$(grep '^NOTION_DATABASE_ID=' "$IDE/ENV.md" | cut -d= -f2)'"},
909
- "properties": {
910
- "Name": {"title": [{"text": {"content": "'"$title"'"}}]},
911
- "Priority": {"select": {"name": "'"$priority"'"}},
912
- "Category": {"select": {"name": "'"$category"'"}}
913
- }
914
- }' | jq -r '.id')
915
-
916
- echo "✅ Card criado no Notion: $CARD_ID"
917
- echo "$CARD_ID"
918
- ;;
919
- ```
920
-
921
- 3. **Documentar configuração** na seção acima
922
-
923
- 4. **Adicionar teste** para validar funcionamento
924
-
925
- ---
926
-
927
- ## Checklist de Conclusão
928
-
929
- ### Modo `create`
930
- - [ ] Argumentos validados
931
- - [ ] Severidade calculada
932
- - [ ] Código da localização incluído
933
- - [ ] Card estruturado gerado
934
- - [ ] Card criado no task manager (ou salvo localmente)
935
- - [ ] Usuário notificado
936
-
937
- ### Modo `batch`
938
- - [ ] Relatório de audit lido
939
- - [ ] Problemas parseados e filtrados
940
- - [ ] Cards criados para cada problema
941
- - [ ] Resumo gerado
942
- - [ ] Usuário notificado
943
-
944
- ### Modo `generate-report`
945
- - [ ] Arquivo de bugs lido
946
- - [ ] Relatório consolidado gerado
947
- - [ ] Relatório salvo no output
948
- - [ ] Usuário notificado
949
-
950
- ---
951
-
952
- ## Tratamento de Erros
953
-
954
- ### Argumentos inválidos
955
- - Exibir mensagem de erro clara
956
- - Mostrar exemplos de uso correto
957
- - Encerrar execução
958
-
959
- ### Arquivo não encontrado
960
- - Verificar caminho fornecido
961
- - Sugerir caminhos alternativos
962
- - Listar arquivos disponíveis
963
-
964
- ### Task Manager indisponível
965
- - Salvar cards localmente
966
- - Gerar comandos CLI para execução manual (quando aplicável)
967
- - Notificar usuário sobre fallback e como configurar
968
-
969
- ### Categoria/Severidade inválida
970
- - Listar valores válidos
971
- - Sugerir valor mais próximo
972
- - Solicitar correção
973
-
974
- ---
975
-
976
- ## Exemplos de Uso
977
-
978
- ### Exemplo 1: Criar card único (BUG-ALTO — todos os campos P1 obrigatórios)
979
-
980
- ```bash
981
- /bug-report create \
982
- --title="[auth] Token expirado retorna 500 ao invés de 401" \
983
- --category="BUG-ALTO" \
984
- --severity="P1" \
985
- --environment="prod" \
986
- --location="src/auth/token-validator.ts:67" \
987
- --description="Quando o token JWT expira durante uma requisição autenticada, o serviço retorna HTTP 500 ao invés de 401. Ocorre de forma recorrente em produção para todos os usuários com sessão ativa há mais de 24h." \
988
- --behavior-actual="POST /auth/validate retorna 500 Internal Server Error quando token está expirado" \
989
- --behavior-expected="POST /auth/validate retorna 401 Unauthorized com body {error: 'token_expired'}" \
990
- --reproduction="Pré-condição: usuário com token expirado (criado há >24h). Passos: 1. Fazer qualquer requisição autenticada. 2. Observar resposta. Resultado atual: HTTP 500." \
991
- --impact="Todos os usuários com sessão ativa há mais de 24h — estimativa de 30% da base ativa. App client não consegue tratar 500 como sessão expirada, causando loop de erro sem logout automático." \
992
- --entry-endpoint="POST /auth/validate" \
993
- --affected-services="account,auth" \
994
- --correlation-id="req-a1b2c3d4" \
995
- --frequency="recorrente" \
996
- --linked-to="PROJ-999" \
997
- --suggestion="Adicionar catch específico para TokenExpiredError antes do handler genérico de erros"
998
- ```
999
-
1000
- ### Exemplo 2: Criar cards em batch
1001
-
1002
- ```bash
1003
- /bug-report batch \
1004
- --from-audit="./sessions/bug-audit-20260208/bug-audit-report.md" \
1005
- --priority-filter="P0,P1"
1006
- ```
1007
-
1008
- ### Exemplo 3: Gerar relatório
1009
-
1010
- ```bash
1011
- /bug-report generate-report \
1012
- --bugs="./sessions/bugs-found.json" \
1013
- --output="./sessions/consolidated-bug-report.md" \
1014
- --format="markdown"
1015
- ```
1016
-
1017
- ---
1018
-
1019
- ## Mensagens de Status
1020
-
1021
- ### Início
1022
- ```
1023
- 📝 Bug Report iniciado
1024
-
1025
- Modo: {create | batch | generate-report}
1026
- Argumentos: {lista de argumentos fornecidos}
1027
-
1028
- Processando...
1029
- ```
1030
-
1031
- ### Durante Processamento
1032
- ```
1033
- ⏳ Criando card {N} de {total}...
1034
- ⏳ Parseando relatório de audit...
1035
- ⏳ Gerando relatório consolidado...
1036
- ```
1037
-
1038
- ### Conclusão
1039
- ```
1040
- ✅ Bug report concluído!
1041
-
1042
- {Resumo específico do modo}
1043
-
1044
- **Próximos passos**: {ações recomendadas}
1045
- ```
1046
-
1047
- ---
1048
-
1049
- ## Bug-to-Test (pós-criação)
1050
-
1051
- Após criar o card no $TASK_MANAGER, sempre perguntar:
1052
-
1053
- ```
1054
- Bug registrado: {TASK-ID} — {título}
1055
-
1056
- Deseja gerar um teste de regressão Cypress para este bug?
1057
- Recomendado: previne que o bug retorne após o fix.
1058
-
1059
- [S] Gerar agora
1060
- [N] Registrar no backlog de cobertura
1061
- [P] Pular
1062
- ```
1063
-
1064
- ### Se "Gerar agora"
1065
-
1066
- Invocar Skill tool: `qa-cypress-e2e` passando como entrada:
1067
- - Título do bug como nome do fluxo
1068
- - Passos de reprodução como sequência de ações
1069
- - Comportamento esperado vs. atual como asserções
1070
-
1071
- Nomear o spec: `{dominio}/{TASK-ID}-regression.cy.ts`
1072
-
1073
- Após gerar o teste, adicionar comentário no card do bug com o caminho do arquivo criado.
1074
-
1075
- ### Se "Registrar no backlog"
1076
-
1077
- Append em `$DOCS_FOLDER/engineering/qa/test-backlog.md` (criar se não existir):
1078
-
1079
- ```markdown
1080
- | {TASK-ID} | {título} | {domínio} | {dominio}/{TASK-ID}-regression.cy.ts |
1081
- ```
1082
-
1083
- Cabeçalho da tabela (inserir apenas se o arquivo for novo):
1084
- ```markdown
1085
- # Test Backlog — Testes de Regressão Pendentes
1086
-
1087
- | Bug ID | Título | Domínio | Spec sugerida |
1088
- |--------|--------|---------|---------------|
1089
- ```