<!-- zibby-template-version: 4 -->
# /zibby-test-generate — generate test specs from a Jira ticket / requirements

You are helping the user auto-generate test specs from a ticket description (Jira) or a free-text requirements doc. Zibby's `generate` command runs the configured AI agent against the codebase + ticket and produces `.txt` specs in `test-specs/`.

Canonical docs: **https://docs.zibby.app/tests/generating**

## Inputs the command accepts

- **Jira ticket key:** `-t ENG-1234` — fetches the ticket from the configured Jira integration
- **Inline description:** `-d "When a user clicks Buy, charge the card and email a receipt"`
- **File:** `-i path/to/requirements.md`
- **Repo path** (defaults to cwd): `--repo /path/to/codebase`

## Steps

1. **Get the source.** Ask the user: ticket key, file, or paste the requirements?

2. **Run generate:**
   ```
   Bash(zibby generate -t ENG-1234)
   Bash(zibby generate -i requirements.md)
   Bash(zibby generate -d "happy-path checkout flow")
   ```

3. **Pick the agent and model** if the user has preferences:
   ```
   Bash(zibby generate -t ENG-1234 --agent claude --model claude-opus-4)
   ```

4. **Output destination.** Specs land in `test-specs/` by default; override with `-o <dir>`.

5. **Review before running.** After generation, the user should read the spec(s) and tweak. Then `/zibby-test-run` to execute.

## Tips

- **Better tickets = better specs.** Vague tickets ("fix login") generate vague tests. Tight acceptance criteria ("login redirects to /dashboard on success, shows 'invalid' on failure") generate sharp specs.
- **Generate iterates.** If the first cut is wrong, re-run with `-d "be more specific about X"` rather than hand-editing.
- **The agent reads the codebase.** It looks at component files, route definitions, etc., so the specs reference real selectors and URLs. Run from the actual repo root, not a subdir.
