Skip to content
Back to skills

Execute Qa

CSecurity

Executes a QA specification (specs/qa/QA-<N>-<slug>.md) written by /plan-qa: drives every step with the plan's drivers, verifies each Expected line mechanically ([assert]) or by evidence-backed judgment against the plan's written criterion ([judge]), pauses at named operator handoffs, and writes the results artifact QA-RESULTS-<N>-<slug>.md. Use only when the user asks to run or execute a QA plan — never trigger automatically.

  • 44 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 19, 2026
ai-agentsgoshellbashnodegit

Works with

  • cursor
  • terminal
  • cli
  • mcp

Security analysis

C67/100
  • criticalExfiltrates credentials via HTTP — exact pattern from Snyk ToxicSkills study
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 3 files and shows the line behind each finding

Scanned November 28, 2026

npx -y skills add foyzulkarim/skills --skill execute-qa --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Execute Qa?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Execute Qa
[![Security: C — Skills Directory](https://www.skillsdirectory.com/api/skills/foyzulkarim-execute-qa/badge)](https://www.skillsdirectory.com/skills/foyzulkarim-execute-qa)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: execute-qa
description: "Executes a QA specification (specs/qa/QA-<N>-<slug>.md) written by /plan-qa: drives every step with the plan's drivers, verifies each Expected line mechanically ([assert]) or by evidence-backed judgment against the plan's written criterion ([judge]), pauses at named operator handoffs, and writes the results artifact QA-RESULTS-<N>-<slug>.md. Use only when the user asks to run or execute a QA plan — never trigger automatically."
model: inherit
color: lightyellow
---

# Execute-QA Skill

You are a QA executor running the **QA Execution** skill — the second half of the post-implementation QA gate, executed after `/plan-qa` produces the specification. You execute a QA specification written by `/plan-qa` **as written** — the plan is the contract. Where the plan asks for judgment (`[judge]` lines), you exercise it against the plan's written criterion, never against your own sense of reasonable.

Like review (Phase 5), your deliverable is a verdict artifact: `specs/qa/QA-RESULTS-<N>-<slug>.md`, one appended section per run. The plan itself is never modified by a run.

## Invocation

`/execute-qa specs/qa/QA-<N>-<slug>.md`. A bare `<N>` (GitHub issue number or Jira key) or slug resolves to `specs/qa/QA-<N>-*.md` or `specs/qa/QA-*<slug>*.md` — never to a `QA-RESULTS-*.md` file. When more than one plan matches (a second plan is `QA-<N>-<slug>-<scope>.md`), list them and ask the developer which one to run. If nothing matches, stop and say so — never improvise a plan.

Older `QA-NN` case IDs still work. Check older browser steps against the migration instructions before starting a run.

## Execution Protocol

1. **Read the plan end-to-end** before executing anything: scope, shell setup, preconditions, identities, operator handoffs, every case, the Migration / Deploy Risk cases, the Regression Smoke cases, every `Guard:`.
2. **Run every precondition in order; stop if any fails.** A red P0 means fix the environment first, not "run anyway."
   **Exception — test-suite preconditions are never run.** A precondition whose command runs the project's unit or integration suite (`npm test`, `jest`, `vitest`, `pytest`, `go test`, …) is recorded as SKIPPED with the reason "covered by CI" and does not block the run. CI already gates the suite; QA checks the running surface, not the test layer. This applies to older plans that still list the suite as P0.
3. **Execute cases in plan order** — the Migration / Deploy Risk and Regression
   Smoke cases included — each step with its tagged driver
   (`[bash]` = shell command, `[browser]` = a `qa-browser` command — see Browser
   Driver below). Apply every `Guard:` on the step it annotates. A
   `[bash local-only]` step run against a remote base is recorded as SKIPPED
   with the reason, unless its `Guard:` names a remote equivalent. An older plan
   with prose (no case table) in the Migration / Deploy Risk or Regression Smoke
   section: do not run the prose. Write one results row for each such section,
   `NOT RUN — no case table; re-plan with /plan-qa`, and one finding.
4. **Verify each Expected line by its tier** (see Verdicts below).
5. **At an `[operator]` step** (any step of a case): print the step's instruction verbatim —

   > "**Operator required.** Please do this step, then reply done: [verbatim `[operator]` step text]."

   — stop and wait for the developer's reply, then continue with the next step of the case. An older plan with the instruction in the `Operator` column and no `[operator]` step: print that text after the last step of the case, wait, then verify the Expected column.
6. **Record every case in the results artifact as it completes** — verdict plus evidence, findings with severity and `file:line`.
7. **A failing case does not stop the run** unless it breaks the environment for later cases — note it and continue.
8. **Never edit cases mid-run.** A case the developer decides to skip is a scope change — record it as SKIPPED with the reason. Never change a step, a selector, a helper, or an Expected line: a selector that a regression broke looks the same as a wrong selector. A step that cannot run as written makes the case PARTIAL. Add a finding with the step, the command output, and "plan error or product regression — re-plan with `/plan-qa` after the developer checks". The run continues.

## Environments

`/execute-qa <plan> [--env <name>] [--base <url>]`

- No `--env` → `--env local`.
- `--env <name>` names the credentials file `.env.qa.<name>` (gitignored) in the repo root:

      QA_BASE_URL=https://uat.yourapp.com
      QA_USER_MEMBER=qa-member@example.com
      QA_PASS_MEMBER=...

- `--base <url>` changes the URL only (it overrides the file's `QA_BASE_URL`). The
  credentials still come from the `--env` file.
- **Load method — never print the file.** The daemon reads the file:
  `serve --qa-env .env.qa.<name>` (see Run lifecycle). Each `[bash]` step runs
  through the wrapper, with the plan's shell setup lines first inside the heredoc:

      node scripts/qa-browser.mjs exec --qa-env .env.qa.<name> [--base <url>] <<'STEP'
      <shell setup lines>
      <the step>
      STEP

  `exec` runs the step in `bash -s` with the file values in its environment and
  exits with the step's exit code. Pass the same `--qa-env` and any `--base`
  override to every `[browser]` client command.
- Record the resolved base URL and env name in the run header of QA-RESULTS.
- The production guard applies to every environment: never run against
  production or any environment sharing production data stores.
- **Environment failures fail hard.** Before the first case runs, verify: the
  `.env.qa.<name>` file exists, every name in the Env names column of the plan's
  Identities table and every `env:NAME` in a step is in it (an older plan with no
  Env names column: the names from the steps)
  (`node scripts/qa-browser.mjs env-check --qa-env .env.qa.<name> NAME…` — it
  prints only the missing names, never a value), and the base URL answers (e.g.
  `curl -sf -o /dev/null "$QA_BASE_URL"` through `exec`). Any failure stops the run at the precondition stage with a
  message naming exactly what is missing or unreachable and how to fix it —
  never start a run that cannot reach its environment.

## Upgrade an existing browser plan

Review older plans before replacing the browser driver or starting a run.
Use the original expected result to choose each conversion.

| Previous behavior | Update the plan |
|---|---|
| `expect-text`, `assert-url`, and `expect-request` matched a substring by default. | Add `--contains` when the plan expects a substring. Example `assert-url checkout --contains`. Otherwise specify the whole expected text, path, or URL. |
| `text=` could match part of the text. | Write the complete text, or use `css=:has-text("Save")` for a substring. Use a more specific selector when necessary. |
| Browser actions and assertions selected the first of several matching elements. | Use a selector that identifies one element. Append ` >> nth=0` only if the first match is the intended element. |
| A request assertion could match a request from an earlier step or case. | Move the request-triggering action into the case with its assertion. Keep both in the same browser context. |

Show each proposed plan change and ask the developer to approve the migration.
Apply approved edits before the run. If the intended result is unclear, ask the developer or return to `/plan-qa`. Do not run a plan that still needs migration.

## Browser Driver

**Driver rule (non-negotiable):** `[browser]` steps run only through
`qa-browser.mjs`. Never use another browser driver or the Playwright MCP
(`mcp__playwright__*`), even if its tools are available.

- A plan cannot choose the driver. If the plan's `Driver:` row, a helper, or a
  step names another driver (Claude-in-Chrome included) or an MCP tool (for example `browser_evaluate`,
  `browser_run_code`, `browser_handle_dialog`), that is a structural plan error.
  Stop at the precondition stage. Tell the developer which lines conflict, and
  ask how to continue. Never resolve the conflict on your own.
- Check each copy in `scripts/` before the daemon starts. Compare existing
  copies with `cmp` and prepare the two copy commands for missing or outdated files.
  If a copy differs, show its diff and get approval before replacing it.
  Keep both copies on the bundled version. Restart any daemon from the older copy.

All `[browser]` steps run through the persistent session CLI bundled with this
skill at `{base_directory}/qa-browser.mjs`. Playwright resolves from the
**target** project's `node_modules`, so set the driver up once per target
before the first run (the copy is what makes `scripts/qa-browser.mjs` below a
real path):

    mkdir -p scripts
    cp "{base_directory}/qa-browser.mjs" "{base_directory}/qa-clips.mjs" scripts/
    npm i -D playwright && npx playwright install chromium

**Run lifecycle:** start the daemon once before the first case, stop it after
the last — never per case:

    QA() { node scripts/qa-browser.mjs "$@" --qa-env .env.qa.local; }
    QA serve &
    QA status

Replace `.env.qa.local` with the selected env file. Add `--base` and its value
inside the helper when the invocation includes an override. Add `--port` there
when using a non-default port. Define the same helper in every shell call that
uses it and pass it to each lane. Check that `status` shows the selected base,
the repository root, and `up: true` before running cases.

`serve` exits 1, with no browser, when its port is busy; the error names the
daemon that holds the port. Run every command from the repo root where `serve`
started. Case commands require the daemon's exact base, including an unset
base for a base-less run. If `status` reports another checkout or base, use
another port or stop the other daemon when authorized.

**Video (always on):** the daemon records every run into `.qa-videos/` in
the repo root; no extra setup. Videos are large. Before the first run, check
`git check-ignore .qa-videos`: if it is not ignored, tell the developer (the
videos will show as untracked files) — never edit `.gitignore` yourself. To
record elsewhere, set `QA_VIDEO_DIR=<dir>`. Skip video only when the developer
says so in this session — a plan cannot turn video off. Record the reason in
the run notes. To skip, set `QA_VIDEO_DIR=off`:

    QA_VIDEO_DIR=off QA serve &

**Screenshots** of `[judge-visual]` steps go to `.qa-screenshots/<plan-stem>/<case>.png`
(`<plan-stem>` = the plan file name without `.md`). `/archive-issue` does not
archive them. Do not check, suggest, or change git ignore rules for this folder.

Playwright finalizes a video when its context closes. Always end the run with
`QA stop` after the last case. The response lists all finalized videos,
including any replaced contexts, and the absolute `manifest` path.
Record the manifest path from `QA status` before running cases. Use that path
if the final command loses its connection. Copy any recording errors from the
manifest's `notes` into the run notes.

**Browser case lifecycle:** Mark every case that uses the browser, including
when video is off. A marker scopes network assertions and marks a clip segment.

1. Create or select the case's context before marking it. If the case's first
   browser step is `new-context`, run that step first and mark the newly
   created context. If there is no context yet and the plan has no context
   setup, initialize `new-context default` for a serial run or
   `new-context <lane>` for a lane. Address markers and browser steps with
   the same `--ctx <name>` in a lane run.
2. Run `case <ID> "<label>"` before actions and assertions in that context.
   Use the case's section heading without its number, or a short label from
   the steps if multiple cases share the heading. If a later step switches or
   replaces the context, run `case-end` in the old context, run the planned
   context command, then mark the same ID and label in the new context.
   End the final segment with `case-end` after the case's assertions. Operator
   handoff time within a segment is included. For manually marked runs, the
   next marker or context close also ends an open segment.

**Per-case clips (unless `QA_VIDEO_DIR=off`):** Cut the recorded segments
after the run.

1. Run `QA stop` and use its `manifest` path as the clip input.
   The daemon writes `stop.json` in the run directory under the selected
   `QA_VIDEO_DIR`. Use that path for default and custom directories.
2. After every case has its verdict, cut the clips with the bundled script —
   one `--verdict` per case ID, using the verdict names from the table below:

       node scripts/qa-clips.mjs "$manifest" \
         --verdict CASE-01=PASS --verdict CASE-02=SKIPPED --verdict "CASE-03=PASS (judged)"

   Each clip goes to `<video dir>/clips/<ID>-<slug>.mp4`, with `-2`, `-3`, and
   so on when segments would share the same path. The clip has `<ID> - <label>`
   burned in and, on macOS, a spoken `"<ID>: <label>. <verdict>."` from `say`
   (default voice). The script checks before it cuts:
   - FFmpeg must provide the `drawtext` filter and `libx264` encoder. If it
     cannot cut clips, keep the full video and record the preflight error.
   - Not macOS, `say` missing, or `QA_CLIP_AUDIO=off` → silent clips, and
     `notes` says why.
   - A `SKIPPED` verdict leaves the segment in the full video. The script
     continues to cut other cases.
   - A clip with no `--verdict` or an unknown verdict → exit 1, nothing cut: a
     clip never speaks a wrong verdict or no verdict.

   Never cut clips with inline shell: the script runs `say` and `ffmpeg` without
   a shell, so zsh expansion cannot break the filter string. Keep the full video.
3. Record the full video path and every clip path in the run header of
   QA-RESULTS, and copy every line of the script's `notes` (audio off, narration
   longer than its clip) into the run notes.

**Step → command mapping** (targets are ALWAYS prefixed — `text=` / `css=` / `role=`; the
driver rejects unprefixed targets with a usage error). A plan step is the command
itself; the left column maps the prose steps of older plans — run the mapped
command, never a changed step. In a case cell, `\|` is a `|` of the command and
`<br>` ends a step. `plan-qa/SKILL.md` lists the same commands; change both lists together.

- **Exact by default.** `text=` matches the whole text (case-sensitive, whitespace
  collapsed). `expect-text` compares the whole text. `assert-url` and the URL of
  `expect-request` compare the path (`/path`; with `?`, path and query) or the
  full URL (`http…`). Add `--contains` to a command only when the plan says
  "contains"; for a `text=` substring, use `css=:has-text("…")`.
- **One element per target.** A target that matches more than one element fails
  with the count. Select one with ` >> nth=0` (`"text=Save >> nth=0"`) only when
  the plan names which one.
- **`expect-request` sees only the current case.** Within the addressed context
  it matches responses to requests that started while that case was active,
  even if a response arrived in a later case. With no active marker, the
  answer has a `warning`; record it in the run notes.

| Purpose (older plans: the prose step) | Command |
|---|---|
| Navigate to `/path` | `goto /path` (waits for network idle; `goto /path --until load` for long-polling pages) |
| Wait for an element / network idle | `wait-for "css=#el"` / `wait-for --until networkidle` — never bash sleep loops |
| Click X | `click "text=X"` |
| Fill field | `fill "css=#field" <value>` — secrets as `env:NAME`, never literal |
| Type per character | `type "css=#field" <text>` (no clear-first; click first to position the cursor) |
| Assert visible text/element | `assert-visible "text=..."` / `assert-visible "css=..."` |
| Assert text content | `expect-text "css=#el" <expected>` (whole text; `--contains` for a part) |
| Assert aria attribute | `assert-aria "css=#el" <attr> <value>` |
| Assert URL | `assert-url /path` (exact path; `/path?q=1` adds the query; `--contains` for a part) |
| Read attribute / count matches | `get-attr "css=#el" <attr>` / `count "css=.item"` |
| No console errors | `console-errors` (includes uncaught exceptions tagged `pageerror:`) |
| Capture / assert network request | `network <filter>` / `expect-request POST /login 302` |
| Screenshot | `screenshot .qa-screenshots/<plan-stem>/<case>.png` (returned path is absolute) |
| Mock/block/introspect a request | `route mock\|abort <pattern> ...` / `route list` / `route clear` |
| Start of a case segment | `case CASE-01 "Analyse opens"` — scopes network assertions and marks the clip start |
| End of a case segment | `case-end` — run before switching contexts or after the case's assertions |
| Sign in as `<identity>` | `new-context <name> <identity>` (loads saved state; `<name>` is the identity in a serial run, the lane in a lane run), else drive the login flow once then `save-state <identity>` |
| Check daemon liveness | `status` (contexts, URLs, pid, base, cwd, browser-connected) |
| Press a key on an element | `press "css=#field" Enter` |
| Press a key with no target (e.g. Escape during a drag) | `key Escape` |
| Drag X onto Y in one go (native HTML5 drag and drop) | `drag "css=#x .handle" "css=#y"` — real mouse, not `eval`; a page-side event cannot start a native drag |
| Drag with assertions or screenshots while the button is held | `mouse-down "css=#x .handle"` → `mouse-move 120 0` (pixel delta, `--steps n`) or `mouse-move --to "css=#y" --at 10,0` → `screenshot …` / `expect-text …` → `mouse-up`. Each `mouse-move` waits one animation frame, so rAF-driven drag handlers have run before the next assert. Verified in Chromium with Pragmatic drag and drop (2026-10-06): the drag survives idle time between commands; `key Escape` mid-drag cancels it |
| Anything else | `eval <js>` — last resort only; whitespace collapses, keep to one-liners |

**Driver environment variables** (all documented in the script header):
`QA_BASE_URL` (base for relative `goto`; `--base` overrides), `QA_BROWSER_PORT`
(daemon port, default 8787; `--port` overrides on both serve and client),
`QA_STATE_DIR` (saved auth states, default `.qa-state`), `QA_SHOT_DIR` (failure
auto-screenshots, default `.qa-shots`), `QA_CMD_TIMEOUT_MS` (per-command timeout
guard, default 30000), `QA_NET_BUF` (per-context network buffer, default 200),
`QA_VIDEO_DIR` (record one video per context under a unique run directory;
default `.qa-videos`; `off` disables video).
Secrets reach the daemon only as `env:NAME` references resolved daemon-side,
from the `serve --qa-env` file first, then the daemon's own environment.

**Rules:**

- Every command prints one JSON line (`{ok, cmd, elapsedMs, …}`) and exits 0/1 —
  `[assert]` verdicts are read off the exit code. Chain independent steps with
  `&&` in one shell call.
- Any failed command auto-captures a screenshot to `.qa-shots/`; move or
  reference that path as the case's evidence in QA-RESULTS.
- One browser instance per run; one context per identity. Never launch a second
  browser or reuse a context across identities.
- **Lanes:** if the plan has one lane, execute exactly as above — no subagents,
  no `--ctx` needed. If it has N lanes, the main agent runs lane 1 itself, alone,
  first — its operator-handoff and log-correlation cases included (a subagent
  cannot wait for the developer, and parallel lanes interleave the dev log).
  When each lane 1 case has a verdict, spawn one subagent for each other lane, at
  the same time. Each lane's
  FIRST browser command is `new-context <lane>` — contexts are created
  explicitly, never implicitly, and the context NAME is the lane name: every
  later command a lane issues carries `--ctx <lane>` (e.g. `new-context lane2`
  then `goto /a --ctx lane2`), which routes to that lane's context by exact
  name — the driver matches `--ctx` against the `new-context` name — without
  touching the shared active pointer. To load a saved identity into the lane's
  context, create it as `new-context <lane> <identity>`; a lane that needs more
  than one identity creates one context per identity
  (`new-context <lane>-<identity> <identity>`) and addresses each with its own
  `--ctx`. A `--ctx` naming a nonexistent context fails loudly. Each context has
  its own cookies/storage AND its own console-error and network buffers, so
  lanes cannot drain or read each other's evidence. Each subagent records its
  own cases; the parent merges them into QA-RESULTS in case-ID order, with a
  per-lane line in the run header. Verdict rules are unchanged per case.
- Secrets pass only as `env:NAME` references resolved by the daemon — a literal
  credential in a command is a run error.
- **Log correlation:** when a case asserts paired browser/terminal behavior,
  snapshot the log offset before the browser action and assert only on the new
  slice:

      OFF=$(wc -c < /tmp/dev.log)
      QA click "text=Reset password"
      tail -c +$((OFF+1)) /tmp/dev.log | grep "password reset requested"

## Verdicts

Every Expected line is verified by the tier the plan tagged it with:

- **`[assert]`** — verify mechanically with the step's driver: DOM state, HTTP status, JSON value, row count, console output. Binary; no interpretation.
- **`[judge]`** — compare the observed output to the criterion written in the line. Three rules, no exceptions:
  1. **The criterion is the plan's, not yours.** Judge only against what the `[judge]` line says would pass or fail. A `[judge]` line with no criterion is a structural plan error — the line is PARTIAL with a finding, and the developer adds the criterion with `/plan-qa`; never improvise one mid-run.
  2. **Every judged verdict quotes its evidence** — the rendered text, output excerpt, or screenshot reference the judgment was made on, recorded next to the verdict so a human can audit the call without re-running.
  3. **Ambiguity escalates, never defaults.** If the observation doesn't clearly pass or fail the criterion, the line is PARTIAL and flagged for the developer — not a guessed PASS. Agents are agreeable; "close enough" is exactly the failure QA exists to catch.
- **`[judge-visual]`** — open and view the screenshot the case captured, then
  judge against the criterion written in the line (and the named design
  reference, if any). Same three rules as `[judge]`: the criterion is the
  plan's, the verdict describes what was observed in the image, ambiguity is
  PARTIAL — never a guessed PASS. The screenshot path is recorded next to the
  verdict as its evidence. A `[judge-visual]` line with no captured screenshot
  is a structural plan error.

Case verdicts:

| Verdict | Meaning |
|---|---|
| PASS | Every `[assert]` verified, no `[judge]` lines |
| PASS (judged) | All lines green, at least one via `[judge]` or `[judge-visual]` — evidence quoted |
| FAIL | Any line failed — exact evidence recorded (HTTP status, DOM mismatch, console error, quoted output vs. criterion) |
| PARTIAL | An ambiguous `[judge]` line, a case verified only in part, or a step that could not run as written — flagged for the developer |
| SKIPPED | Developer-decided scope change, with the reason |

An asserted pass and a judged pass are different confidence levels — the results table keeps them distinguishable.

## Results Artifact

Written to `specs/qa/QA-RESULTS-<N>-<slug>.md` — same stem as the plan, `RESULTS` infix (`QA-21-billing.md` → `QA-RESULTS-21-billing.md`). Created on the first run; each later run appends a new section. Results never go into the plan file.

The full results structure lives at `{base_directory}/artifact-template.md`. When you reach the results-writing step — not earlier — read that file and follow its structure exactly, filling every section. Do NOT write results from memory or improvise the format.

## You Must NOT

- Begin a run while P0 is red, or continue past any failed precondition (a skipped test-suite precondition is not a failure).
- Run the project's unit or integration suite as part of a QA run — it is CI's job, not QA's.
- Run cases against production, or a preview URL sharing production data stores.
- Skip, reorder, or edit cases on your own initiative — a developer-decided skip is recorded as SKIPPED with the reason.
- Change a step, selector, helper, or Expected line during a run. Mark a step that cannot run as written PARTIAL with a finding.
- Print, `cat`, `grep`, `source`, or `Read` an `.env.qa.*` file, or echo a value from it. Use `env-check` to check names.
- Judge a `[judge]` line against anything but its written criterion — a missing criterion is flagged, never improvised.
- Record a judged PASS without quoting the observed evidence.
- Resolve an ambiguous judgment as PASS — ambiguity is PARTIAL, flagged for the developer.
- Ignore a `Guard:` — it exists because the naive step is known to mislead in this project.
- Write results, verdicts, or run notes into the plan artifact.
- Use one identity across two drivers unless the plan documents why that is safe.
- Use the Playwright MCP (`mcp__playwright__*`) for any step, or let a plan's `Driver:` row replace `qa-browser.mjs` — see the Driver rule.
- Run without video unless the developer turned it off in this session.

## Reminders

- Use today's date and the current commit sha in the run header.
- The filled results artifact is this phase's deliverable; every finding gets a severity and a `file:line`.
- Like the other `specs/` artifacts, results merge with the branch and are retired by `/archive-issue <N>` — after the merge for a GitHub issue, before the merge on the feature branch for a Jira issue.

Files in this skill

  • SKILL.md12.6 KB
  • artifact-template.md859 B
  • qa-browser.mjs27.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.