/qa-flow:setup-qafrom qa-flow
Set up the independent QA workspace — detects the codebase's testing signals and PROPOSES a stack (qa/qa.config.yml) you confirm/override, then scaffolds only the chosen tools, seed personas, and case catalogue. Stack-agnostic, free by default.
Ships in qa-flow. Installing the plugin adds it to Claude Code.
Scaffold qa/ as a self-contained QA workspace, independent of spec/. Never
overwrite existing files.
Safe to re-run on an existing qa/ workspace, as many times as needed:
// qa-flow:begin X / // qa-flow:end X (or the file-type's comment syntax). Content
outside the markers (a user's custom Playwright projects, added scripts) is left
byte-for-byte untouched.git add -A; git status after.Read CLAUDE.md (stack, auth, roles, tenancy), routes, the OpenAPI spec location, and
docs/ for personas/acceptance criteria. Then detect the codebase's testing signals so
you can propose a stack (evidence → proposal), rather than asking cold:
cypress in package.json (esp. with @badeball/cypress-cucumber-preprocessor or any
*.feature) → web_e2e: cypress-cucumber.@playwright/test in deps → web_e2e: playwright.requirements.txt/pyproject.toml) with selenium and/or
pytest-bdd/behave → web_e2e: selenium-pytest-bdd.*.feature / cucumber anywhere → keep it BDD/Gherkin.playwright
(modern, resilient, free); Python-centric → selenium-pytest-bdd.ios/+android/ / Swift → mobile: appium; else none.api: schemathesis; else none.allure; else markdown-csv (free default).case_management: testmo; else in-repo.functional_agent → playwright-mcp (free) unless a self-hosted Autonoma is detected.qa/qa.config.yml (qa-flow forces NO stack)If qa/qa.config.yml already exists, use it. Otherwise present the recommended config
from step 1's detection — one short rationale per non-default line (e.g. "web_e2e: cypress-cucumber — found cypress + *.feature in the repo"; "mobile: appium — detected
android/ + ios/"; "api: schemathesis — OpenAPI at docs/openapi.yml") — and let the
engineer confirm or override any line before you write it. You propose; the engineer
decides. If detection is inconclusive for a tier, propose the free default and say so. This
file is the override point every qa-flow agent reads. Schema (free defaults shown):
base_url: env:QA_BASE_URL
app: # how /qa-flow:smoke boots the app (stack-agnostic; Rails defaults)
start: bin/dev # boot command (e.g. `bin/rails server -p 3000`)
port: 3000
health: /up # 200-when-ready route (Rails 8 default health endpoint)
routes: [/, /up] # key routes the smoke gate hits (5xx = fail)
boot_timeout: 60 # seconds for the SERVER to answer /health at all
route_timeout: 90 # seconds for the FIRST hit of each route (see below)
runtime: # browser console/network capture (#109)
ignore: [] # substrings matched on message or resource URL
links: # link/anchor audit during the crawl (#113)
forms: # form-submission safety (#461)
destructive: [delete, remove, destroy, cancel, deactivate, close-account, pay, charge, refund,
subscribe, unsubscribe, transfer, send]
coverage: # route coverage denominator (#119)
exclude: [] # substrings: health endpoints, dev-only, ActiveStorage
authenticated_prefixes: [] # e.g. /admin — declared, never guessed from the path
fail_on: none # none | untested | unmeasured | both (#1029). DEFAULT none:
# the gap is the deliverable, and a gate red for a known
# backlog is one people learn to merge past. Arm an axis only
# once you have reached full coverage on it.
blast_radius: # derived regression scope (#134)
exclude: [] # substrings: paths a change to cannot affect the app
high_risk: # ADDS to the built-in axes; it can never switch one off
auth: [] # e.g. app/models/api_key.rb
tenancy: []
money: []
web_e2e: playwright # playwright | cypress-cucumber | selenium-pytest-bdd | none
mobile: none # appium | none
functional_agent: playwright-mcp # playwright-mcp | autonoma-selfhosted | none
api: schemathesis # schemathesis | none
perf: k6 # k6 | none
security: zap # zap | none
a11y: axe # axe | none
reporting: markdown-csv # markdown-csv | allure | both
case_management: in-repo # in-repo (free CSV) | testmo (paid, opt-in)
walkthrough: # /qa-flow:walkthrough refuses to run without this block (#993)
personas: # persona: [how that persona REALLY signs in]
guest: [password+code] # fixture-session | password | password+code | password+totp | magic-link
admin: [fixture-session]
journeys: # the spec documents each page is judged against
- docs/product/roles/admin.md
viewports: [1440, 820, 390] # one per band: expanded, medium, compact (responsive.md §4)
stand_ins: [] # model calls the fixtures already make, run via the project runner
Everything defaults free. A team overrides any line — e.g. web_e2e: cypress-cucumber,
mobile: appium, or case_management: testmo. Re-running setup-qa reconciles scaffolding to
the current config. Paid/optional backends are opt-in and need credentials, never
committed.
Two keys are easy to conflate, so they are deliberately separate (#110):
boot_timeout — how long the server may take to answer the health path at all.route_timeout — how long the first hit of any single route may take. Dev servers
compile per route on demand: a Next.js + Turbopack app reported "Ready in 10s" and then
spent 45–60s compiling each route on first visit. With one timeout covering both, the
crawl passes boot and dies on route 2, which reads as a broken app rather than a slow
compile. Generous by default because being wrong here fails a healthy build.blast_radius.high_risk is additive only, and that is a decision rather than an
oversight. /qa-flow:verify calls the wide selection non-negotiable for auth, tenancy, money,
migrations and shared concerns; a key that could empty one of those axes would make the
non-negotiable configurable, so declaring migration: [] adds nothing and removes nothing. Use it
to name the paths this project's naming conventions hide — a Ledger model called Posting, an
authorization concern called Gatekeeper. blast_radius.py's selftest pins both halves.
runtime.ignore suppresses known third-party console/network noise (browser extensions,
framework devtools banners) so the check does not go red on every run and get switched off.
Suppressed findings are still counted in the runtime CSV's Ignored column — a suppression
that leaves no trace is how a red check turns green with nobody deciding to.
coverage.* feeds the route-coverage denominator. Both keys are declared, never inferred:
whether a route needs authentication is not guessable from its path, and a heuristic would be wrong
on exactly the routes that matter most. exclude drops health endpoints, dev-only routes and
framework-mounted paths — and the excluded set is always printed, even when empty, because a
suppression that leaves no trace turns a coverage number into a lie.
forms.destructive is the list a form is never submitted against, and it exists because the
rule used to say "the configured destructive pattern" while nothing configured one (#461). Every
auditor invented their own, so two runs against the same app could disagree about whether a form was
safe to submit — for forms that delete data or take payment.
The default above is a starting point, not a claim of completeness: it is matched against the form's action, id and submit-button text, case-insensitively, as substrings. Add your own verbs before the first run; an under-inclusive list submits a destructive form, an over-inclusive one silently drops coverage, and only the second leaves a trace.
The trace is enforced: a skipped-destructive row whose Notes do not name the pattern that
matched is refused by validate_evidence.py. A form skipped without a trace is indistinguishable
from one that passed.
External targets are counted, never fetched, and there is no switch. Internal links and
#fragment targets are always checked — fast, deterministic, and ours to fix. External ones are
none of those: a gate that fails because someone else's site was down teaches people to ignore it.
This used to be documented as a links.check_external toggle. Nothing read it — link_audit.py
counts external targets and has no code path that fetches one, so setting it true changed nothing
while telling a reader it would. A config key the scaffolder writes and no code honours is worse
than an absent feature, because the reader believes they have opted in. If fetching is ever built,
the switch comes back with the code, not before it.
functional_agent: playwright-mcp → enable the MCP: claude mcp add playwright -- npx @playwright/mcp@latest (then restart). autonoma-selfhosted → point at the self-hosted
instance. none → skip.case_management: testmo (paid, opt-in) → confirm TESTMO_URL + TESTMO_TOKEN are set in
the environment (gitignored, never committed); case-author then mirrors the CSV to Testmo
via its REST API. Absent creds → stay in-repo and report how to enable. (Testmo is not an
MCP — REST/CLI only.)qa/ — only what the config enablesAlways: qa/qa.config.yml, qa/seed.rb (idempotent QA personas — one per role + a
second-tenant user), qa/plans/, qa/reports/, qa/README.md, and the free stack-agnostic
core:
qa/test-cases.csv (header Test ID,Title,Area,Type,Priority,Status,Source,Notes + one
example) — the catalogue /qa-flow:cases authors/maintains.qa/manual-tests/ + screenshots/ (.gitkeep) — where /qa-flow:functional writes its
Markdown + CSV report.qa/requirements.yml + qa/requirements-uncased-baseline.txt — copy ${CLAUDE_PLUGIN_ROOT}/scaffold/qa/requirements.yml and
.../requirements-uncased-baseline.txt (an empty registry with # rows: 0 and an empty baseline with # size: 0). For features, also copy .../e2e-unselected-baseline.txt and list the runner files under e2e_paths: runners: in qa/qa.config.yml (see /qa-flow:cases). Requirements go here, one per entry; the gate
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/check_requirements.py" fails a requirement that no ACTIVE case names (#1855). If the project already
keeps its own registry, point requirements: in qa/qa.config.yml at it (registry, cases, baseline) instead of scaffolding one.Per web_e2e (scaffold ONE):
qa/package.json (@playwright/test, @axe-core/playwright, typescript — the typecheck needs tsc), qa/playwright.config.ts
(setup + chromium/firefox/webkit, baseURL from QA_BASE_URL, retries=1, trace/screenshot on
fail), qa/e2e/ (auth.setup.ts → storageState, fixtures/, a @smoke spec), and
qa/e2e/tsconfig.json with "strict": true and "noUncheckedIndexedAccess": true plus a
typecheck script (tsc --noEmit -p e2e/tsconfig.json), and a CI step running it —
npm --prefix qa run typecheck. Playwright does not type-check, so without that step strict
checks nothing, and the ts-strict gate refuses a script CI never runs (#1447; agents/e2e-tester.md).
Release-image robot helpers (#1835), when the project will run real-flow personas on its release image: copy
${CLAUDE_PLUGIN_ROOT}/scaffold/qa/e2e/support/{local-target,totp,qa-marker,mail-reader,personas,teardown}.ts into qa/e2e/support/
(not the *.test.ts beside them — those test the templates, in this plugin's CI). They import each other with an
explicit .ts extension, so add "allowImportingTsExtensions": true and "noEmit": true to qa/e2e/tsconfig.json,
and @types/node to qa/package.json (they use node:crypto, Buffer and process.env). Proven on 2026-10-11 (#1837): Playwright 1.56.1 loads and runs
all six helpers through those .ts imports, and TypeScript 5.9.3 typechecks them clean under strict,
noUncheckedIndexedAccess, allowImportingTsExtensions and noEmit; Playwright's docs do not cover explicit
extensions, so if a newer version fails to import them, report it rather than rewriting the imports. For the
release-image robot also copy ${CLAUDE_PLUGIN_ROOT}/scaffold/qa/seed/{image-e2e,assert-local-target.ts,local-target.setup.ts}
into qa/seed/ (point the image project's globalSetup at local-target.setup.ts) and write qa/robot.json
(robot_descriptor.py --check documents and validates it). What each refuses: assertLocalTarget — any
URL that does not dial 127.0.0.1, localhost or ::1, and any URL with userinfo (this, with the local catcher, is what
keeps the robot off real systems); the mail reader — any address not of the qa+<handle>@<domain> shape (the shape,
not the domain), before a request, and any catcher not on this machine. personas.ts keeps the persona and records manifests in QA_SEED_DIR (default qa/.qa-seed, owner-only files — gitignore it) and refuses a non-QA address on write and on read; teardown.ts's proveNothingLeft(<compose project>) runs after the stack's own down and fails if any container or volume of that project is left, or if docker cannot be asked — an unanswered "is anything left?" is a failure, not a pass.qa/package.json (cypress, @badeball/cypress-cucumber-preprocessor,
@testing-library/cypress), qa/cypress.config.js, qa/e2e/features/*.feature (+ step_definitions/),
cy.session() auth, @smoke/@regression tags.qa/requirements.txt (selenium, pytest, pytest-bdd), qa/e2e/features/*.feature
(+ steps/), conftest.py (WebDriverWait, driver fixture), Page Objects, pytest markers.
Per mobile: appium — qa/mobile/ (Appium caps, accessibility-id locators, shared .features).
Per perf/api/security/a11y — k6 skeleton / Schemathesis config / ZAP notes / axe wiring, only if enabled.Per reporting: allure (or both) — wire the free Allure reporter for the chosen
runner so every tier feeds one aggregated HTML report (allure-results/ → allure-report/):
allure-playwright to reporter in playwright.config.ts
(resultsDir: qa/reports/allure-results).allure-cypress (import in cypress/support, allureCypress
in config), results to qa/reports/allure-results.allure-pytest; run with --alluredir qa/reports/allure-results.allure-results/ so the report is unified.
Report dir: qa/reports/allure-results (raw, gitignored) → qa/reports/allure-report (HTML,
gitignored). both = keep the Markdown/CSV summary too. Default markdown-csv skips all this.Document required env: QA_BASE_URL, QA_SPEC_URL (optional), persona token vars.
Add .github/PULL_REQUEST_TEMPLATE.md (the PR Documentation Contract) if absent so
human PRs carry what qa-lead needs. Ensure qa/reports/* (including
qa/reports/allure-results and qa/reports/allure-report), /.playwright-mcp/ (ephemeral
Playwright-MCP session state — console logs + page-snapshot .ymls the functional-tester must
never commit), and node_modules are gitignored; commit configs, specs, seed, and the stamp
path is NOT gitignored (the gate reads it from the repo). Commit the stamp in a PR of its own, after
certifying: the gate allows exactly that one-file delta past the tested sha (#1337).
Every defect the QA flow files carries --label "qa,from-qa,severity:sN", and
gh issue create errors and creates nothing when a label does not exist — it does not fall
back to an unlabelled issue. So without this step the first real defect is lost, not
mislabelled. Run it now, and again on any re-run (it is idempotent):
gh label create qa --color 0E8A16 --description "Raised by the QA flow" --force
gh label create from-qa --color 0E8A16 --description "Filed by qa-reporter, not a human" --force
gh label create severity:s1 --color B60205 --description "Data loss, security, core blocked" --force
gh label create severity:s2 --color D93F0B --description "Broken feature, no workaround" --force
gh label create severity:s3 --color FBCA04 --description "Workaround exists, or serious a11y" --force
gh label create severity:s4 --color C2E0C6 --description "Cosmetic" --force
All four severities, not only the two that appear as literals. verify.md files
severity:sN for whatever grade the defect earned, and the ladder in qa-lead.md runs S1–S4, so
an S3 finding fails at gh issue create if only s1/s2 exist. --force makes a re-run update
the colour instead of failing on "already exists".
These are the QA severity labels (s1…s4), which are not the findings-record severity
field (P1/P2/P3). Two vocabularies on purpose: the record schema is shared with
rails-flow and gated by findings.py, while the ladder above is qa-flow's filing severity. Do not
"unify" them — the gate will fail.
If gh is unauthenticated, say so and skip: this step needs network and auth, and a setup that
dies here would block a workspace that is otherwise complete. Name it as not done rather than
letting it read as done.
List only the tools the chosen config needs, and which are present vs missing:
npx playwright install; cypress-cucumber → Node +
npm i -D cypress @badeball/cypress-cucumber-preprocessor @testing-library/cypress;
selenium-pytest-bdd → Python + pip install selenium pytest pytest-bdd + a WebDriver.npm i -g appium + drivers (appium driver install uiautomator2/xcuitest).claude mcp add playwright -- npx @playwright/mcp@latest (free).pipx install schemathesis · k6 (brew/choco/apt) · Docker (ZAP image).allure CLI. case_management: testmo → TESTMO_URL/TESTMO_TOKEN set.
All free except an opt-in testmo license the team already holds.Files created, personas seeded, tools to install, and the entry points: /qa-flow:cases
to author/maintain the case catalogue, /qa-flow:functional for agentic functional testing
from it, /qa-flow:verify after feature merges, /qa-flow:certify before release.
Files this command reads when invoked
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
8 commands in this plugin
/cases/qa-flow:cases — $ARGUMENTSAuthor and maintain the in-repo test-case catalogue (qa/test-cases.csv) from the PRD, app surface, qa-lead plan, and past defects. Automates the repetitive case-writing/upkeep; stable IDs, idempotent, Excel-openable. Free, no online tool./certify/qa-flow:certifyComprehensive release certification before dev->main — full regression plus release-only layers (load, DAST, cross-browser, a first-boot operator walkthrough, a forged-request authorization sweep); writes the stamp that unlocks the deploy gate/npx claudepluginhub fmanimashaun/claude-skills --plugin qa-flow