---
name: qa-generate
description: Entry-point command for the QA Test Generator bundle. Routes to the right skill based on input type — paste a story for Gherkin, a feature file for Playwright scripts, or a test directory for a coverage matrix.
argument-hint: "<story|feature-file|tests-dir>"
allowed-tools:
  - Read
  - Glob
---

# qa-generate

This command inspects the argument (or prompts if absent) and routes to the appropriate skill in the `qa-test-generator` bundle.

## Routing logic

1. If the argument is a `.feature` file path → invoke `qa-playwright-scripts` with that file
2. If the argument is a directory containing `*.feature` or `*.spec.ts` files → invoke `qa-coverage-matrix` with that directory
3. If the argument is a `.md` / `.txt` file, or pasted story text → first run `qa-edge-case-analysis` to build the edge-case inventory, then run `qa-gherkin-scenarios` to produce the feature file
4. If the argument is empty → print the menu below and wait for selection

## Menu (shown when no argument given)

```
QA Test Generator — choose a task:

  1. Generate Gherkin scenarios from a story
     → paste your story or provide a file path

  2. Analyse edge cases for a story or feature area
     → paste the story or describe the feature

  3. Generate Playwright scripts from a feature file
     → provide the path to a .feature file

  4. Build a Requirements Traceability Matrix (RTM)
     → provide the stories directory and tests directory

  5. Run the full pipeline for a new story
     → paste or provide the story; runs edge-case analysis → Gherkin → RTM

Type the number or describe what you want to do.
```

## Pipeline mode (option 5)

When the user selects the full pipeline:
1. Run `qa-edge-case-analysis` on the story → produces edge-case inventory
2. Run `qa-gherkin-scenarios` on the story, using the edge-case inventory to ensure non-happy-path scenarios are included → produces `.feature` file + traceability companion
3. Run `qa-coverage-matrix` on the story file + new feature file → produces RTM with release gate

Print a combined summary at the end showing outputs from all three steps.
