Saas qa plan

From Basinfy/Basinfy-SaaS-Studio · View interactive version

Saas qa plan is an AI agent skill from the GitHub repository Basinfy/Basinfy-SaaS-Studio. Generate sprint QA test plans covering unit, integration, E2E, security, and smoke scope.

How to use this skill

Skill file

<!-- Generated from .claude/skills by scripts/sync-agent-skills.py. -->

Running this workflow on this client

Run commands from the project root (use Git Bash on Windows if bash points to an unavailable WSL distro). Shared studio files live in .claude/; follow .agents/PORTABLE-RUNTIME.md and .claude/docs/config-resolution.md for client tools, delegation, and approval rules.

Run bash .claude/hooks/yaml-helper.sh resolve_config --keys locale,automation,workflow,qa.level,system_overrides and use its output below.

Resolved above — use as-is. No block → defaults in

.claude/docs/config-resolution.md.

QA Plan

Locale & User Profile: Match locale (pt-BR → natural Brazilian Portuguese questions/options, overriding English examples; en → English) and user_profile (founder → plain business language with (Recomendado) first, zero tech jargon; developer → technical). Keep code/tests in English.

This skill generates a structured QA plan for a sprint, feature, or individual

story. It reads all in-scope story files and their referenced PRDs, classifies

each story by test type, and produces a plan that tells developers exactly what

to automate, what to verify manually, what the smoke test scope is, and when

to bring in a usability tester.

Run this before a sprint begins so the team knows upfront what testing work

is required. A test plan written after implementation is a post-mortem, not a

plan.

Output: production/qa/saas-qa-plan-[sprint-slug]-[date].md


Every AskUserQuestion call follows .claude/docs/automation-modes.md

(collaborative asks always · guided major-only · autonomous logs and proceeds;

automation_always_ask categories always prompt).

Workflow tier: resolve per the PRD's system as each is read (per

.claude/docs/workflow-modes.md): workflow_overrides.system_overrides.<system>

if the block lists one, else the project value. It sets how many PRD sections

the test plan is mined from — see Phase 2.

qa.level: at minimal, produce only a minimal smoke

plan — drop the automated-test-required rows and the test-file DoD; at standard,

a full plan per story type; at full, also add per-system coverage targets.

Distinct axis from workflow (which sets how many PRD sections are mined).

No level drops the Visual/Feel and UI screenshot rows — tests are waived at

minimal, the look is not (.claude/docs/coding-standards.md).

Phase 1: Parse Scope

Argument: $ARGUMENTS (blank = ask user via AskUserQuestion)

Determine scope from the argument:

every story file path referenced. If production/sprint-status.yaml exists,

use it as the primary story list and fall back to the sprint plan for story

metadata.

to stories whose file path or title contains the system name. Also check the

epic index file (EPIC.md) in that system's directory.

"Specific story (enter path)", "Full epic"

After resolving scope, report: "Building QA plan for [N] stories in [scope]."

If a story file path is referenced but the file does not exist, note it as

MISSING and continue with the remaining stories. Do not fail the entire plan

for one missing file.

If the resolved scope contains ZERO stories, stop — do not build a plan.

Report NOT ASSESSED — no stories in scope, naming which scope was searched

and which path was empty, and route:

- no file in production/sprints/ → "No sprint plan found. Run /saas-sprint-plan new."

At workflow: minimal there are no sprints by design — route instead to

/saas-qa-plan feature: [epic-slug] or /saas-qa-plan story: [path].

- a sprint plan exists but references no stories → "Sprint plan [path] lists no

stories. Run /saas-create-stories [epic-slug]."

- feature:/story: scope matched nothing → name the glob that came back empty.

The N=0 guard is mandatory. Without it an empty scope reports "Building QA

plan for 0 stories" and continues into Phase 4, producing a plan document with

empty tables — and **a QA plan for zero stories looks exactly like a completed

QA plan.** This skill gates the hand-off to manual QA, so a false-clean here

sends a build to QA on the strength of a plan that tested nothing.

The rule at the top of this block still stands: one missing file among several

is MISSING-and-continue. This is the different case where there is no several.


Phase 2: Load Inputs

Establish the denominator first — glob the in-scope story files and count N —

then collect the fields below with **targeted section greps, not a full read of

each story**. A QA plan needs each story's type and acceptance criteria; it does

not need its implementation notes, out-of-scope boundaries or ADR rationale, and

reading N stories whole to reach two sections is where this phase's cost lives:

Grep pattern="^## Acceptance Criteria" glob="production/epics/**/story-*.md" output_mode="content" -A 15
Grep pattern="^> \*\*(Type|Status|Estimate)\*\*" glob="production/epics/**/story-*.md" output_mode="content"
Grep pattern="^## (Context|Dependencies)" glob="production/epics/**/story-*.md" output_mode="content" -A 8

(Scope the globs to the sprint plan's story paths in sprint mode.) From those:

test plan actually turns on them; full-read those individual stories

Never treat an absent section as an absent story. If a story matched no

## Acceptance Criteria, full-read that one and say so — a story with no

testable criteria is a QA finding in its own right, not a story to skip.

After reading stories, load supporting context once (not per story):

PRDs are approved

system's workflow tier (resolved above) — at full, mine all 8 sections; at

standard, mine the test-relevant subset of the required sections

(Acceptance Criteria and Edge Cases always, plus Formulas for any

system that defines numeric rules); at minimal, **Acceptance

Criteria only**. Do not load the full PRD

text. Use the project discovery protocol to find the relevant headings and read those sections. When the index cannot provide them, find the headings with a local text search and read the matching ranges. These sections contain the testable requirements, the math

to verify, and the boundary conditions tests must cover. If an Edge Cases section is absent (or

not expected at minimal), note per PRD: "No Edge Cases section found — edge case

coverage will be inferred from acceptance criteria only."

automated tests should guard against (if the file exists)

If no PRD is referenced in a story, note it as a gap but do not block the plan.

The story will be classified using acceptance criteria alone.


Phase 3: Classify Each Story

For each story, assign a Story Type:

| Story Type | Classification Indicators |

|---|---|

| Logic | Acceptance criteria reference calculations, formulas, numerical thresholds, state transitions, AI decisions, data validation, quota tracking, subscription transactions, or any testable computation |

| Integration | Criteria involve two or more systems interacting, signals or events propagating across system boundaries, persistence/hydration round-trips, network sync, or persistence |

| Visual/Feel | Criteria reference animation behaviour, UI transitions, responsive feedback, loading skeletons, perceived timing, or visual feedback quality |

| UI | Criteria reference navigation, App Shell elements, buttons, screens, modal dialogs, data tables, tooltips, or any user-facing interface element |

| Config/Data | Changes are limited to configuration settings, data files, or environment parameters — no new code logic is involved |

Mixed stories (e.g., a story that adds both a formula and a UI display):

assign the primary type based on which acceptance criteria carry the highest

implementation risk, and note the secondary type. Mixed Logic+Integration or

Visual+UI combinations are the most common.

After classifying all stories, produce a classification summary table in

conversation before proceeding to Phase 4. This gives the user visibility into

how tests will be allocated.


Phase 4: Generate Test Plan

Assemble the full QA plan document. Use this structure:

# QA Plan: [Sprint/Feature Name]
**Date**: [date]
**Generated by**: /saas-qa-plan
**Scope**: [N stories across [N systems]]
**Engine**: [engine name — `stack.frontend` from project.yaml if present and non-empty, else the Engine field from .claude/docs/technical-preferences.md, else "Not configured"]
**Sprint File**: [path to sprint plan if applicable]

---

## Test Summary

| Story | Type | Automated Test Required | Manual Verification Required |
|-------|------|------------------------|------------------------------|
| [story title] | Logic | Unit test — `tests/unit/[system]/` | None |
| [story title] | Integration | Integration test — `tests/integration/[system]/` | Smoke check |
| [story title] | Visual/Feel | None (not automatable) | Screenshot + lead sign-off |
| [story title] | UI | None (verified by its screenshots) | Retained screenshot of each screen touched |
| [story title] | Config/Data | Data validation test | Spot-check in-product values |

---

## Automated Tests Required

*(At `qa.level: minimal`, omit this entire section and blank the Test Summary's
"Automated Test Required" column — automated tests are not required there; list
manual/smoke verification only.)*

### [Story Title] — [Type]
**Test file path**: `tests/[unit|integration]/[system]/[story-slug]_test.[ext]`
**What to test**:
- [Specific formula or rule from the PRD Formulas section]
- [Each named state transition or decision branch]
- [Each side effect that should or should not occur]

**Edge cases to cover**:
- Zero/minimum input values (e.g., 0 usage, empty account catalog)
- Maximum/boundary input values (e.g., max seats, rate limit ceiling)
- Invalid or null input (e.g., missing payload, unauthenticated session)
- [Any edge case explicitly called out in the PRD Edge Cases section]

**Estimated test count**: ~[N] unit tests

[If no PRD formula reference was found for this story, note:]
*No formula found in referenced PRD — test cases must be derived from acceptance
criteria directly. Review the PRD Formulas section before writing tests.*

---

## Manual QA Checklist

### [Story Title] — [Type]
**Verification method**: [Screenshot + designer sign-off | Usability test session |
Manual step-through | Comparison against reference footage]
**Who must sign off**: [designer / lead-engineer / qa-lead / design-system-director]
**Evidence to capture**: [screenshot of X | video clip of Y | written usability test
notes | side-by-side comparison]

Checklist:
- [ ] [Specific observable condition — concrete and falsifiable]
- [ ] [Another condition]
- [ ] [Every acceptance criterion translated into a manual check item]

*If any criterion uses subjective language ("feels", "looks", "seems"), it must
be supplemented with a specific benchmark or a usability test protocol note.*

---

## Smoke Test Scope

Critical paths to verify before any QA hand-off for this sprint:

1. Application boots and serves landing/dashboard route without error (200 OK)
2. New product / new session can be started
3. [Primary workflow introduced or changed this sprint]
4. [Any system with a regression risk from this sprint's changes]
5. Save / load cycle completes without data loss (if save system exists)
6. Performance is within budget on target hardware (no new frame spikes)

*Smoke tests are verified by the developer via `/saas-smoke-check`. Reference this
list when running that skill.*

---

## Usability test Requirements

| Story | Usability test Goal | Min Sessions | Target User Type |
|-------|--------------|--------------|-------------------|
| [story] | [What question must the session answer?] | [N] | [new user / experienced] |

**Sign-off requirement**: Usability test notes must be written with `/saas-usability-test` to
`production/qa/usability tests/` (naming the story) and reviewed by
the [designer / qa-lead] before the story can be marked COMPLETE.

If no stories require usability test validation: *No usability test sessions required for
this sprint.*

---

## Definition of Done — This Sprint

A story is DONE when ALL of the following are true (at `qa.level: minimal`, drop
the test-file and smoke rows below — tests are waived there; the screenshot and
sign-off rows stay at every level, because the look is not):

- [ ] All acceptance criteria verified — via automated test result OR documented
      manual evidence (screenshot, video, or usability test notes with sign-off)
- [ ] Test file exists at the specified path for all Logic and Integration stories *(qa.level standard/full)*
- [ ] Retained screenshot of each screen touched, in `production/qa/evidence/`, for all Visual/Feel and UI stories *(every qa.level)*
- [ ] Signed-off evidence doc at `production/qa/evidence/[story-slug]-evidence.md` for all Visual/Feel stories *(every qa.level)*
- [ ] Smoke check passes (run `/saas-smoke-check sprint` before QA hand-off) *(qa.level standard/full)*
- [ ] No regressions introduced
- [ ] Code reviewed (via `/saas-code-review` or documented peer review)
- [ ] Story file updated to `Status: Complete` (via `/saas-story-done`)

When generating content, use the actual story titles, PRD formula text, and

acceptance criteria extracted in Phase 2. Do not use placeholder text — every

test entry should reflect the real requirements of these specific stories.


Phase 5: Write Output

Show the complete plan in conversation (or a summary if the plan is very long),

then ask two questions together using AskUserQuestion:

question: "Ready to write the QA plan. Choose output options:"
multiSelect: true
options:
  - "Write QA plan to production/qa/saas-qa-plan-[sprint-slug]-[date].md"
  - "Also back-fill test case specs into each story file's ## QA Test Cases section (Recommended — enables /saas-dev-story and /saas-code-review traceability)"

If "Write QA plan" is selected: write the plan file exactly as generated — do not truncate.

If "Also back-fill story files" is selected: for each Logic and Integration story in scope, edit the story file at its path. Find the ## QA Test Cases section and replace its content with the test case specs generated in Phase 4 for that story. If a story has no ## QA Test Cases section, append it before ## Test Evidence. For Visual/Feel and UI stories, write the manual verification steps instead of test specs.

After writing:

"QA plan written to production/qa/saas-qa-plan-[sprint-slug]-[date].md.

Next steps:

before marking stories done — /saas-story-done checks for them"

Silently append to production/session-state/active.md (create the file if it does not exist):

<!-- QA-PLAN: [date] | System: [system/sprint identifier] | Plan written: production/qa/saas-qa-plan-[identifier]-[date].md -->

Close with the verdict: COMPLETE — QA plan written (or COMPLETE — QA plan

shown, not written, if the write was declined). The only other outcome is the

NOT ASSESSED — no stories in scope path in Phase 1.


Collaborative Protocol

Applies in collaborative mode (the default). For guided and

autonomous modes, see .claude/docs/automation-modes.md — the rules below

describe what collaborative mode requires, not universal behavior.

Integration, classify it as Integration — it requires both unit and

integration tests.

support. If a formula is absent from the PRD, flag it rather than guessing.

is warranted for borderline Visual/Feel stories. Flag the case; do not mandate.

Keep all other phases non-interactive — present findings, then ask once to

approve the write.

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.