# Create Tests

> Create a test plan and test cases covering acceptance criteria, edge cases, and failure scenarios.

- **Type:** Skill
- **Install:** `agentstack add skill-tomzx-agents-create-tests`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [tomzx](https://agentstack.voostack.com/s/tomzx)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [tomzx](https://github.com/tomzx)
- **Source:** https://github.com/tomzx/agents/tree/main/skills/create-tests

## Install

```sh
agentstack add skill-tomzx-agents-create-tests
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Create Tests

Produces a test plan with structured test cases derived from requirements, acceptance criteria, and a specification.
Covers happy paths, edge cases, and failure scenarios across relevant test levels.

## Prerequisites

- Apply the shared SDLC conventions in `skills/sdlc/references/shared.md`.
- If no argument is provided, locate the feature directory under `.sdlc/features/` whose frontmatter `issue` field references `$ISSUE_NUMBER`.
- `.sdlc/features/N-/requirements.md` and `.sdlc/features/N-/specification.md` (both must have passed review with findings verdict `approved`), or documents provided in context or as a file path (`$1`)
- `.sdlc/features/N-/telemetry.md` (optional, if a telemetry plan was produced): include test cases that verify analytics events are emitted correctly
- `.sdlc/features/N-/observability.md` (optional, if an observability plan was produced): include test cases that verify metrics, logs, and traces are emitted correctly
- Information about the testing stack (if available)

## Steps

1. Read the requirements, specification, telemetry plan, and observability plan (if present).
2. List all acceptance criteria that need to be verified.
3. For each acceptance criterion, write at least one test case.
4. For each analytics event in the telemetry plan, write a test case verifying the event is emitted with correct properties.
5. For each metric, log entry, and trace span in the observability plan, write a test case verifying it is emitted correctly.
6. Add edge case and failure scenario tests beyond the acceptance criteria.
7. Organize test cases by test level (unit, integration, end-to-end).
8. Identify test infrastructure and fixtures needed.
9. Write the output to `.sdlc/features/N-/tests.md`.

## Test Case Format

```markdown
### TC-: 

**Level:** Unit / Integration / E2E
**Covers:** FR-1 / NFR-2 / Edge case
**Setup:** 
**Steps:**
1. 
2. 
**Expected:** 
```

## Output Format

Use the template at `skills/sdlc/templates/features/tests.md` (copied to `.sdlc/templates/features/tests.md` by `/initialize-sdlc-directory`; use the project's customized copy if present). Write the result to the artifact path named in the steps above.

## Outcome

If `$OUTCOME_YAML` is set, emit `verdict: approved` there per `skills/sdlc/references/shared.md`, If the test plan could not be produced, omit the file.

## Example Usage

**Scenario 1: Password reset feature**
Requirements define a 4-step reset flow.
Create unit tests for token generation and expiry, integration tests for the email dispatch call, and an E2E test for the full user journey.
Edge cases: expired token, already-used token, invalid email.

**Scenario 2: API endpoint**
Spec defines a `POST /orders` endpoint.
Write unit tests for input validation, integration tests for DB writes, E2E test for the full order placement flow, and failure tests for duplicate requests and DB errors.

## Completion Checklist

Before handing off to review, confirm:

- [ ] Telemetry events and observability signals have assertions verifying they fire correctly

Self-check the plan against the [`review-tests` checklist](../review-tests/SKILL.md) and fix what you can, so review finds less to flag.

## Next Step

Run `/review-tests` to audit coverage, correctness, and missing scenarios before moving on.
Once approved, continue with `/create-implementation`.

## Useful Commands Reference

No CLI commands required. This skill operates on document content provided in context.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [tomzx](https://github.com/tomzx)
- **Source:** [tomzx/agents](https://github.com/tomzx/agents)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-tomzx-agents-create-tests
- Seller: https://agentstack.voostack.com/s/tomzx
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
