Add qa spec

From brabos-ai/code-addiction · View interactive version

Add qa spec is an AI agent skill from the GitHub repository brabos-ai/code-addiction. Generate a code-free QA/E2E specification (reachability intent, UX acceptance criteria, functional E2E scenarios, capture states, target viewports, a11y expectations) from about.md + design.md + plan-*.md, and author the _tests/screens.json catalog (design: path only — no expect). Loaded by add-plan

How to use this skill

Skill file

QA/E2E Specification — Case Generation Rubric

<!-- uses:

-->

LANG: Respond in user's native language. Tech terms in English.

When to Use

When NOT to Use

Inputs

QA/E2E Case Generation

Emit one row per surface/subfeature that design.md declares — never skip a declared screen (the run's coverage gate treats a declared-but-unspecced screen as a blocker). Per surface, derive:

Output 1 — `plan-qa-spec.md`

Write to .codeadd/docs/features/${FEATURE_ID}/plan-qa-spec.md under a ## QA/E2E Specification heading:

| ID | surface | SF | reachability | viewports | capture states | UX acceptance | functional scenario | a11y |

|----|---------|----|--------------|-----------|----------------|---------------|---------------------|------|

| QA01 | entry-form | SF01 | modal (open via New-entry) | mobile,desktop | empty,filled,list | fields render + width rule | submit persists entry + list shows it | labels + focus trap |

Below the table, write a ## QA Seed Update block in the same file. Compare the screens in scope with what .codeadd/qa/README.md says the project's QA seed provides. The block reads none when the seed already covers every screen, otherwise one row per data or prerequisite to add, with the screen that needs it:

| Seed addition | Screen that needs it |

|---------------|----------------------|

| a second record in the list, so the empty state can be left | entry-list |

The block is the plan's seed-update task: {{cmd:add-build}} applies it in the same delivery. Never invent a data need no screen has. When .codeadd/qa/README.md is absent, write none and say the seed is not set up.

Output 2 — Screen Catalog (`_tests/screens.json`)

You OWN this file when dispatched by add-plan STEP qa-pipeline.qa-spec. (add-qa-setup STEP add-qa-setup.catalog only scaffolds it at setup time, before any plan exists.) One catalog entry per row of the table above.

Entry shape

{
  "feature": "<feature-id>",
  "screens": [
    { "id": "login", "sf": "SF02", "name": "Login", "kind": "route",
      "path": "/login", "auth": false,
      "design": ".codeadd/docs/features/<id>-.../subfeatures/SF02-.../design.md" },
    { "id": "entry-form", "sf": "SF01", "name": "Entry form", "kind": "modal",
      "open": [{ "goto": "/entries" }, { "click": "role=button[name=New entry]" }],
      "auth": true,
      "design": ".codeadd/docs/features/<id>-.../subfeatures/SF01-.../design.md" }
  ]
}

| Field | Rule |

|-------|------|

| id | stable kebab surface id — matches the surface column of your table |

| sf | the subfeature the surface belongs to (SF01, …); the merge key together with id |

| name | human label |

| kind | route \| modal \| overlay \| portal |

| path | route surfaces only |

| open | non-route surfaces only — ordered recipe, each step exactly one of {"goto":"<path>"}, {"click":"<selector>"}, {"fill":["<selector>","<value>"]}, {"select":["<selector>","<value>"]}, {"wait":"<selector \| ms>"}. Playwright role/testid syntax — never brittle CSS |

| auth | true when the surface requires an authenticated session |

| design | the design.md path actually used for that screen (SF-level when it exists, feature-level fallback). The only contract pointer — visual values live in that file's ## Design Contract. There is no expect key |

Route surfaces keep path; non-route surfaces declare kind + open. Both forms coexist in one catalog.

Read-merge-write (MANDATORY)

The catalog is feature-wide while a plan run is scoped to one SF — so it is NEVER rewritten from scratch. Merge by sf + id:

  1. Read the existing file. Absent → start from {"feature":"<feature-id>","screens":[]}.
  2. Entries whose sf is OUT of this run's scope are preserved byte-identically — never reorder, reformat, or "clean up" them.
  3. An in-scope entry (same sf AND same id) is replaced by the newly derived one.
  4. A newly derived in-scope entry with no match is appended.
  5. An in-scope entry whose screen no longer exists in the consolidated design.md is removed (out-of-scope entries stay untouchable — rule 2 above).

Store reachability INTENT only. If a design doc is missing or thin, list the screen with a note rather than inventing a route — flag it as a gap for the user.

Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.