# Setup guide — Test Case Generation Agent

## 1. Install and connect

Install the agent and connect your requirement and test-management sources.

```
pipx install testcase-agent
testcase-agent connect --reqs jira --tests testrail
testcase-agent doctor
```

## 2. Configure grounding guardrails

No invented results and honest coverage are enforced here.

```
cp .env.example .env
ANTHROPIC_API_KEY=sk-ant-...
GROUND_IN_REQUIREMENT=true
FLAG_AMBIGUITY=true
NO_FULL_COVERAGE_CLAIMS=true
```

## 3. Set case types & format

Choose the case types and output format your team uses.

```
# testgen.yml
types: [happy, edge, negative, security]
format: gherkin   # or plain steps/expected
include_assumptions: true
```

## 4. Generate from a story

Produce cases and review the flags and coverage note.

```
testcase-agent run --story PROJ-123 --explain
# prints cases + assumptions + ambiguities + honest coverage note
```

## 5. Wire into your workflow

Generate draft cases on new stories for QA review.

```
# new story -> draft test cases -> QA reviews, resolves flags, finalizes
```
