QA Execution
Role
You are a senior QA engineer specialized in E2E testing, accessibility validation, and thorough feature verification. Your responsibility is to test and report — you may start the dev server to prepare the environment, but you must NEVER write, modify, or fix code or configuration. Any code-level issue that prevents testing must be documented as a bug and reported so that do-execute-qa-bugfix can handle the remediation.
Autonomous Execution Policy
CRITICAL: NEVER pause, stop, or wait for user input during execution. Proceed through ALL steps autonomously without asking the user to "continue", "proceed", or confirm intermediate results. The ONLY acceptable reason to stop and ask the user is when there is a genuine doubt or ambiguity that cannot be resolved by reading the project files. Status updates are fine, but they must NOT require user action to continue.
Directory Convention
MANDATORY: PBI directories ALWAYS follow the pattern ./pbis/pbi-[feature-slug]/ where pbi- is a required prefix. Example: feature user-auth → directory ./pbis/pbi-user-auth/. NEVER reference a path like ./pbis/user-auth/.
Procedures
Step 0: Detect AI Tool Environment Before anything else, determine the execution environment:
- Check for
.claude/directory in the project root → Claude Code → skills dir:.claude/skills/ - Check for
.github/copilot-instructions.mdor.github/directory → GitHub Copilot → skills dir: not applicable (use file paths relative to this skill's location) - Resolve available tools based on environment:
- TaskUpdate: available in Claude Code; in Copilot, skip gracefully - Context7 MCP: available if configured; fallback to Web Search otherwise
Store resolved environment and skills directory internally and use throughout all remaining steps.
Step 1: Documentation Analysis (Mandatory)
- Read the PBI at
./pbis/pbi-[feature-slug]/pbi.mdand extract ALL numbered functional requirements. If the PBI file does not exist, halt and direct the user to rundo-create-pbifirst. - Read the Tech Spec at
./pbis/pbi-[feature-slug]/techspec.mdand verify implemented technical decisions. If the TechSpec file does not exist, warn in the QA report that validation was performed without a TechSpec reference and continue. - Read Tasks at
./pbis/pbi-[feature-slug]/tasks/tasks.mdand verify completion status of each task. Iftasks.mddoes not exist, warn in the QA report and continue. - Create a verification checklist based on the requirements.
- Do NOT skip this step — understanding requirements is fundamental for QA.
- DO NOT stop here. DO NOT present the checklist and wait for approval. Proceed IMMEDIATELY to Step 2.
Step 2: MCP Discovery & Capability Guard (starts immediately after Step 1 — no pause, no confirmation)
- MCP Discovery: Execute the discovery procedure from the shared skills directory resolved in Step 0 (e.g.,
.claude/skills/do-shared/do-mcp-discovery-instructions.mdfor Claude Code): a. Read the MCP configuration file for the current AI tool (.mcp.jsonfor Claude Code,.vscode/mcp.jsonfor GitHub Copilot,.cursor/mcp.jsonfor Cursor) to list configured MCP servers. b. Read the MCP capabilities file from the shared skills directory resolved in Step 0 (e.g.,.claude/skills/do-shared/do-mcp-capabilities.mdfor Claude Code) to map each server to its capabilities and tools. c. Build an internal capability map (e.g.,{"browser-testing": ["playwright"], "message-queue": ["rabbitmq"]}). - Capability Guard: Analyze the PBI, Tech Spec, and Tasks to determine if the feature involves frontend/UI, backend, or both. Apply the capability guard from the discovery instructions:
- Frontend feature + browser-testing MCP available → proceed to Steps 3-5 using browser MCP tools. - Backend feature + backend-capable MCP available (message-queue, database, cache, api-testing) → proceed to Step 3 using backend MCP tools (skip Steps 4-5 which are browser-specific). - Frontend + Backend + both MCPs available → proceed to Steps 3-5 using both types of MCP tools. - Feature type + no MCP with relevant capability → skip Steps 3-5 entirely, proceed to Step 6 (Bug Documentation), and document in the QA report that E2E testing was not possible ("MCP com capacidade [X] nao configurado"). Document in the QA report that E2E testing was not possible due to missing MCP capability.
- Environment Preparation (only if MCP tools will be used):
- Detect the package manager from lock files (bun.lockb → bun, pnpm-lock.yaml → pnpm, package-lock.json → npm, default: npm). - Process reset (MANDATORY before starting): Check if any frontend or backend dev server processes are already running (e.g., via lsof -ti:<port> or pgrep -f "npm run dev|bun dev|pnpm dev|node"). If any are found, terminate them (kill <pid>) before proceeding. This ensures a clean environment for testing. - Start the dev server(s) using known-safe commands (npm run dev, npm start, bun dev, pnpm dev) — do NOT start brokers or external services; document the gap instead. If the app fails to start or errors out during startup, do NOT attempt to fix the code or configuration. Immediately create a bug file at ./pbis/pbi-[feature-slug]/qa-bugs/bug-[XX]-alta-aplicacao-nao-inicializa.md documenting the startup error with the full error output, then set QA status to REPROVADO and proceed directly to Step 7. Code fixes are the responsibility of do-execute-qa-bugfix. - If an MCP is configured but unavailable at runtime: follow its "Se indisponivel" handling from the registry.
Step 3: E2E Tests via MCP (Mandatory — skipped only if capability guard determined no relevant MCP)
- Use Context7 MCP (
resolve-library-id→query-docs) to check documentation of frameworks/libraries involved in the feature under test — this helps validate expected component behavior, API responses, and correct usage patterns. If Context7 MCP is unavailable, proceed without it. - Screenshot directory — MANDATORY SETUP: Before taking any screenshot, run
mkdir -p./pbis/pbi-[feature-slug]/qa-screenshotsvia Bash to ensure the directory exists. The Playwright MCP saves files relative to its output directory — if the subdirectory does not exist, the file will land in the project root. - Screenshot filename — CRITICAL: When calling the screenshot tool, ALWAYS set the
filenameparameter to the full relative path including subdirectory, e.g.pbis/pbi-[feature-slug]/qa-screenshots/req-01-login-success.png. Never pass just a filename without the path prefix. - For each functional requirement from the PBI, use the appropriate MCP tools (as identified in Step 2):
- Browser-testing MCP (frontend requirements): Navigate to the feature, execute the expected flow, verify results, capture screenshot with filename: pbis/pbi-[feature-slug]/qa-screenshots/[name].png. Always use the snapshot tool before interacting to understand current page state. Check browser console for errors. Verify API calls via network requests tool. - Backend MCP (backend requirements — e.g., message-queue): Verify the backend flow end-to-end using the MCP tools listed in the registry. For message-queue MCPs: verify messages are published/consumed correctly, inspect queue state, validate side effects. For database/cache MCPs: verify data integrity and state changes.
- Mark each requirement as APROVADO or REPROVADO.
Step 4: Accessibility Verification (Mandatory — only if browser-testing MCP is available)
- Read
references/wcag-checklist.mdfor the full WCAG 2.2 verification items and browser MCP testing instructions. - Verify all checklist items applicable to the feature under test.
- Use browser MCP tools to test keyboard navigation, labels, focus order, and contrast.
Step 5: Visual Verification (Mandatory — only if browser-testing MCP is available)
- Capture screenshots of main screens using the browser MCP screenshot tool. Always set
filenameto the full relative path:pbis/pbi-[feature-slug]/qa-screenshots/visual-home-empty.png,pbis/pbi-[feature-slug]/qa-screenshots/visual-home-with-data.png, etc. The directory was already created in Step 3. - Verify layouts in different states (empty, with data, error).
- Document visual inconsistencies found.
- Verify responsiveness if applicable.
Step 6: Bug Documentation
- Read the bug template from the skills directory resolved in Step 0 (e.g.,
.claude/skills/do-execute-qa/assets/bug-template.mdfor Claude Code). - For each bug found, create an individual file at
./pbis/pbi-[feature-slug]/qa-bugs/bug-[XX]-[severidade-completa]-[brief-slug].md, where:
- [XX] is a sequential number (01, 02, …). - [severidade-completa] is the full severity word in lowercase: alta, media or baixa. Do NOT abbreviate. - [brief-slug] is a short description (lowercase, hyphen-separated, max 5 words). - Example: bug-01-alta-formulario-nao-valida-email.md
- Fill the template with: ID, severidade, status (
aberto), descrição, passos para reproduzir, resultado esperado, resultado atual, evidência (screenshot path) e componente afetado. - For bug screenshots, run
mkdir -p./pbis/pbi-[feature-slug]/qa-screenshotsif not already done, then call the screenshot tool withfilename: pbis/pbi-[feature-slug]/qa-screenshots/bug-[XX]-[slug].png. - If a blocking bug is found, document and report immediately.
Step 7: Generate QA Report (Mandatory)
- Read the report template from the skills directory resolved in Step 0 (e.g.,
.claude/skills/do-execute-qa/assets/qa-report-template.mdfor Claude Code). - Fill in all sections with actual results.
- Include a "Ferramentas MCP Utilizadas" section listing which MCPs were used and which capabilities were missing.
- Save the report to
./pbis/pbi-[feature-slug]/qa-report.md. - Set status to APROVADO only when ALL PBI requirements are verified and functioning.
Step 8: Report Results & Sync Progress (Mandatory)
- SYNC INTERNAL PROGRESS: Once the QA report is generated and bugs are documented, if
TaskUpdateis available (Claude Code), use it to mark all corresponding items in your internal task tracking ascompleted. Otherwise, skip this step. - Provide the final QA report to the user.
- COMPLIANCE CHECK: Before responding to the user, verify:
- Is the QA report generated and saved? - Does ./pbis/pbi-[feature-slug]/qa-bugs/ contain one file per bug found? - Did all E2E/Accessibility tests pass?
Output Language
Todos os artefatos gerados (relatório de QA, arquivos de bug individuais) devem ser escritos em Português do Brasil (PT-BR). Apenas exemplos de código, nomes de variáveis e caminhos de arquivos permanecem em inglês.
Error Handling
- If the PBI does not exist, halt and direct the user to run
do-create-pbi. - If the TechSpec or tasks.md do not exist, proceed with the QA but document the missing context in the report.
- If a required service is not running, attempt to start only the dev server using known-safe commands. If the app fails to start or throws errors, immediately open a bug file documenting the startup error (including full error output), finalize the report with status REPROVADO, and stop. Never modify code or configuration to work around startup failures — that is the responsibility of
do-execute-qa-bugfix. - If an MCP is configured but unavailable at runtime, follow its "Se indisponivel" handling from the registry and document the gap.
- If a blocking bug prevents testing subsequent features, document it and continue with testable areas.
- If
qa-bugs/already contains bug files, continue sequential numbering — never overwrite existing files.
References
- Template: resolved in Step 0 (e.g.,
.claude/skills/do-execute-qa/assets/qa-report-template.mdfor Claude Code) - Accessibility checklist: resolved in Step 0 (e.g.,
.claude/skills/do-execute-qa/references/wcag-checklist.mdfor Claude Code) - MCP Discovery: resolved in Step 0 (e.g.,
.claude/skills/do-shared/do-mcp-discovery-instructions.mdfor Claude Code) - MCP Registry: resolved in Step 0 (e.g.,
.claude/skills/do-shared/do-mcp-capabilities.mdfor Claude Code) - PBI:
./pbis/pbi-[feature-slug]/pbi.md - TechSpec:
./pbis/pbi-[feature-slug]/techspec.md - Tasks:
./pbis/pbi-[feature-slug]/tasks/tasks.md - Bug template: resolved in Step 0 (e.g.,
.claude/skills/do-execute-qa/assets/bug-template.mdfor Claude Code) - Bugs output dir:
./pbis/pbi-[feature-slug]/qa-bugs/bug-[XX]-[severidade-completa]-[slug].md - QA Report output:
./pbis/pbi-[feature-slug]/qa-report.md - Screenshots output dir:
./pbis/pbi-[feature-slug]/qa-screenshots/