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,269 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: eng-qa-a11y-audit
|
|
3
|
+
description: Integra jest-axe nos testes unitários existentes de componentes React para validar acessibilidade WCAG 2.1 AA automaticamente. Adiciona assertions axe em cada componente e reporta violações.
|
|
4
|
+
argument-hint: "[caminho do componente ou diretório — ex: src/components/]"
|
|
5
|
+
disable-model-invocation: false
|
|
6
|
+
allowed-tools: Read Write Edit Grep Glob Bash AskUserQuestion
|
|
7
|
+
license: AGPL-3.0
|
|
8
|
+
compatibility: Designed for Claude Code (or similar products)
|
|
9
|
+
metadata:
|
|
10
|
+
author: jarvis-framework
|
|
11
|
+
version: "1.0"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# qa-a11y-audit
|
|
15
|
+
|
|
16
|
+
Você é um especialista em acessibilidade web (a11y). Sua função é integrar
|
|
17
|
+
`jest-axe` nos testes unitários existentes de componentes para validar
|
|
18
|
+
conformidade WCAG 2.1 AA automaticamente, sem exigir expertise em a11y do dev.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Objetivo
|
|
23
|
+
|
|
24
|
+
Adicionar testes de acessibilidade automatizados nos testes unitários existentes
|
|
25
|
+
usando jest-axe. Detectar violações WCAG reais (aria, roles, contraste, semântica)
|
|
26
|
+
e gerar report com correções sugeridas.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Entrada
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
/qa-a11y-audit [caminho]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
- `caminho` (opcional) — diretório ou arquivo de componente
|
|
37
|
+
- Se omitido, detectar automaticamente a partir da estrutura do projeto (ex: `src/components/`, `app/`, `lib/`)
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Recursos
|
|
42
|
+
|
|
43
|
+
| Recurso | Caminho |
|
|
44
|
+
|---------|---------|
|
|
45
|
+
| Testes existentes | `$TEST_FOLDER` ou colocated (`*.test.tsx`, `*.spec.tsx`) |
|
|
46
|
+
| Config de testes | `jest.config.*`, `vitest.config.*`, `setupTests.*` |
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Pré-requisito
|
|
51
|
+
|
|
52
|
+
1. **ENV.md** válido
|
|
53
|
+
2. **Projeto com testes unitários existentes** (Jest ou Vitest)
|
|
54
|
+
3. **Componentes renderizáveis** (React, Vue, Svelte — que produzam DOM)
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Quando Usar
|
|
59
|
+
|
|
60
|
+
**Usar quando:**
|
|
61
|
+
- Projeto precisa de conformidade WCAG 2.1 AA
|
|
62
|
+
- Code review identificou problemas de acessibilidade
|
|
63
|
+
- Sprint inclui melhorias de a11y
|
|
64
|
+
- Onboarding de a11y em projeto que nunca teve
|
|
65
|
+
|
|
66
|
+
**NÃO usar quando:**
|
|
67
|
+
- Projeto não tem testes unitários (criar testes primeiro com `qa-unit-test`)
|
|
68
|
+
- Componentes não renderizam DOM (hooks, utils, serviços)
|
|
69
|
+
- Objetivo é teste E2E de a11y (usar Lighthouse/axe-core no E2E)
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Padrões Críticos
|
|
74
|
+
|
|
75
|
+
1. **Não sobrescrever testes existentes** — adicionar assertions axe nos testes que já existem, não reescrever
|
|
76
|
+
2. **Setup uma vez, test N vezes** — configurar `toHaveNoViolations` no setup global, não em cada arquivo
|
|
77
|
+
3. **Cada componente com render = test axe** — todo componente que já tem teste de render recebe assertion axe
|
|
78
|
+
4. **Report com fix sugerido** — não apenas reportar violação, mas sugerir a correção HTML/JSX
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Fluxo de Trabalho
|
|
83
|
+
|
|
84
|
+
### Fase 1 — Detecção do ambiente
|
|
85
|
+
|
|
86
|
+
**1.1** Detectar framework de teste:
|
|
87
|
+
```bash
|
|
88
|
+
# Jest
|
|
89
|
+
grep -l "jest" package.json
|
|
90
|
+
# Vitest
|
|
91
|
+
grep -l "vitest" package.json
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**1.2** Detectar framework UI:
|
|
95
|
+
- `react` / `react-dom` → React
|
|
96
|
+
- `vue` → Vue
|
|
97
|
+
- `svelte` → Svelte
|
|
98
|
+
|
|
99
|
+
**1.3** Localizar config de setup:
|
|
100
|
+
```bash
|
|
101
|
+
# Jest
|
|
102
|
+
grep -r "setupFilesAfterSetup\|setupTests" jest.config.* package.json
|
|
103
|
+
# Vitest
|
|
104
|
+
grep -r "setupFiles" vitest.config.*
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Fase 2 — Instalação de dependências
|
|
108
|
+
|
|
109
|
+
**2.1** Verificar se jest-axe já está instalado:
|
|
110
|
+
```bash
|
|
111
|
+
grep "jest-axe" package.json
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**2.2** Se não instalado, apresentar ao usuário:
|
|
115
|
+
```
|
|
116
|
+
Para testes de acessibilidade, preciso instalar:
|
|
117
|
+
- jest-axe (assertions axe para Jest/Vitest)
|
|
118
|
+
- @types/jest-axe (tipos TypeScript, se aplicável)
|
|
119
|
+
|
|
120
|
+
Instalar? (Sim / Não)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**2.3** Se sim:
|
|
124
|
+
```bash
|
|
125
|
+
npm install --save-dev jest-axe @types/jest-axe
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Fase 3 — Configuração global
|
|
129
|
+
|
|
130
|
+
**3.1** Adicionar `toHaveNoViolations` no arquivo de setup:
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
// No setupTests.ts ou equivalente
|
|
134
|
+
import 'jest-axe/extend-expect';
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
> Se o arquivo de setup não existir, criar e registrar no config do Jest/Vitest.
|
|
138
|
+
|
|
139
|
+
### Fase 4 — Scan de componentes
|
|
140
|
+
|
|
141
|
+
**4.1** Listar todos os arquivos de teste no escopo:
|
|
142
|
+
```bash
|
|
143
|
+
find {caminho} -name "*.test.tsx" -o -name "*.spec.tsx" -o -name "*.test.ts" -o -name "*.spec.ts"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**4.2** Para cada arquivo de teste, verificar se já tem assertion axe:
|
|
147
|
+
```bash
|
|
148
|
+
grep -l "toHaveNoViolations\|jest-axe\|axe" {arquivo}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**4.3** Filtrar apenas os que renderizam componentes (contêm `render(`) e não têm axe.
|
|
152
|
+
|
|
153
|
+
**4.4** Reportar ao usuário:
|
|
154
|
+
```
|
|
155
|
+
Encontrados {N} arquivos de teste com render.
|
|
156
|
+
{M} já têm assertions axe.
|
|
157
|
+
{K} serão atualizados.
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Fase 5 — Adicionar assertions axe
|
|
161
|
+
|
|
162
|
+
**5.1** Para cada arquivo de teste sem assertions axe:
|
|
163
|
+
|
|
164
|
+
1. Adicionar import:
|
|
165
|
+
```typescript
|
|
166
|
+
import { axe } from 'jest-axe';
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
2. Adicionar test case após o último `it`/`test` do describe principal:
|
|
170
|
+
```typescript
|
|
171
|
+
it('não possui violações de acessibilidade', async () => {
|
|
172
|
+
const { container } = render(<Componente {...defaultProps} />);
|
|
173
|
+
const results = await axe(container);
|
|
174
|
+
expect(results).toHaveNoViolations();
|
|
175
|
+
});
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
3. Se o componente precisa de providers/contexto (detectar pelo render existente), replicar o setup.
|
|
179
|
+
|
|
180
|
+
**5.2** Não alterar testes existentes — apenas adicionar o novo test case.
|
|
181
|
+
|
|
182
|
+
### Fase 6 — Executar e reportar
|
|
183
|
+
|
|
184
|
+
**6.1** Executar os testes modificados usando o runner detectado na Fase 1:
|
|
185
|
+
```bash
|
|
186
|
+
# Jest
|
|
187
|
+
npx jest --testPathPattern="{padrão}" --no-coverage
|
|
188
|
+
# Vitest
|
|
189
|
+
npx vitest run {padrão}
|
|
190
|
+
```
|
|
191
|
+
> Usar o runner que o projeto já utiliza — nunca forçar um runner diferente.
|
|
192
|
+
|
|
193
|
+
**6.2** Para cada violação encontrada, gerar report:
|
|
194
|
+
|
|
195
|
+
```markdown
|
|
196
|
+
### Violação: {rule-id} ({impact})
|
|
197
|
+
|
|
198
|
+
**Componente:** `{nome}`
|
|
199
|
+
**Elemento:** `{selector}`
|
|
200
|
+
**Problema:** {description}
|
|
201
|
+
**Correção sugerida:**
|
|
202
|
+
```jsx
|
|
203
|
+
// Antes
|
|
204
|
+
<div aria-label="Menu">...</div>
|
|
205
|
+
|
|
206
|
+
// Depois
|
|
207
|
+
<nav aria-label="Menu">...</nav>
|
|
208
|
+
```
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**6.3** Apresentar resumo ao usuário:
|
|
212
|
+
```
|
|
213
|
+
── a11y Audit ────────────────────────────────────────────
|
|
214
|
+
Componentes testados : {N}
|
|
215
|
+
Sem violações : {OK}
|
|
216
|
+
Com violações : {FAIL}
|
|
217
|
+
Total de violações : {V} ({critical}, {serious}, {moderate}, {minor})
|
|
218
|
+
──────────────────────────────────────────────────────────
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Regras
|
|
224
|
+
|
|
225
|
+
### Nunca
|
|
226
|
+
- Sobrescrever ou deletar testes existentes
|
|
227
|
+
- Instalar dependências sem confirmação do usuário
|
|
228
|
+
- Ignorar violações de impacto `critical` ou `serious`
|
|
229
|
+
- Hardcodar paths de componentes — usar `$TEST_FOLDER` ou argumento
|
|
230
|
+
|
|
231
|
+
### Sempre
|
|
232
|
+
- Configurar `toHaveNoViolations` no setup global (não em cada arquivo)
|
|
233
|
+
- Replicar providers/contexto do render existente no test axe
|
|
234
|
+
- Sugerir fix para cada violação (não apenas reportar)
|
|
235
|
+
- Executar os testes após adicionar assertions para validar
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## Checklist de Conclusão
|
|
240
|
+
|
|
241
|
+
- [ ] Framework de teste detectado (Jest/Vitest)
|
|
242
|
+
- [ ] jest-axe instalado
|
|
243
|
+
- [ ] Setup global configurado
|
|
244
|
+
- [ ] Componentes escaneados e filtrados
|
|
245
|
+
- [ ] Assertions axe adicionadas
|
|
246
|
+
- [ ] Testes executados
|
|
247
|
+
- [ ] Violações reportadas com sugestões de fix
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Output
|
|
252
|
+
|
|
253
|
+
| Artefato | Destino |
|
|
254
|
+
|----------|---------|
|
|
255
|
+
| Testes modificados com assertions axe | Arquivos `.test.tsx` / `.spec.tsx` existentes |
|
|
256
|
+
| Report de violações | Output no terminal + opcional markdown |
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Mensagem de Conclusão
|
|
261
|
+
|
|
262
|
+
```
|
|
263
|
+
── qa-a11y-audit concluído ───────────────────────────────
|
|
264
|
+
Componentes : {N} testados
|
|
265
|
+
Violações : {V} encontradas ({C} critical, {S} serious)
|
|
266
|
+
Arquivos : {M} modificados
|
|
267
|
+
Setup : jest-axe configurado globalmente
|
|
268
|
+
──────────────────────────────────────────────────────────
|
|
269
|
+
```
|