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