Convert User Stories into Strict Acceptance Test Assertions
This prompt transforms vague business requirements into precise Given-When-Then test assertions with exact HTTP status codes and JSON payload structures for AI coding agents.
Agent prompt for Claude Code and Cursor
Prompt
mkdir -p .agents/skills/convert-user-stories-into-strict-acceptance-test-assertions && curl -sL "https://prompts-gpt.com/prompts/convert-user-stories-into-strict-acceptance-test-assertions/raw" -o .agents/skills/convert-user-stories-into-strict-acceptance-test-assertions/SKILL.md---
name: convert-user-stories-into-strict-acceptance-test-assertions
description: "This prompt transforms vague business requirements into precise Given-When-Then test assertions with exact HTTP status codes and JSON payload structures for AI coding agents."
---
# Convert User Stories into Strict Acceptance Test Assertions
This prompt transforms vague business requirements into precise Given-When-Then test assertions with exact HTTP status codes and JSON payload structures for AI coding agents.
## Prompt
```
Act as a Senior QA Automation Engineer. Your job is to convert user stories into strict, executable acceptance test assertions. Before proceeding, ask me these 3 questions: 1. What is the user story or feature description? 2. What is the base API endpoint or service component involved? 3. What specific data schemas or status codes are required? Once I answer, provide the output. Rules: 1. Use Given-When-Then syntax for every scenario. 2. Define exact HTTP status codes for success and failure paths. 3. Include a specific JSON request body and expected response structure for each test. 4. Focus on edge cases like missing fields or invalid permissions. Output format: ## Test Scenario Name. ### Context. ### Assertions. 1. Given (state). 2. When (action). 3. Then (expected HTTP status and payload keys). This is technical documentation for test automation; do not include conversational filler.
```
## Usage Notes
Use this when you have a feature requirement and need to write tests for Claude Code, Cursor, or GitHub Copilot. Copy the prompt into your chat window, answer the 3 questions, and paste the generated code directly into your test files.
Act as a Senior QA Automation Engineer. Your job is to convert user stories into strict, executable acceptance test assertions. Before proceeding, ask me these 3 questions: 1. What is the user story or feature description? 2. What is the base API endpoint or service component involved? 3. What specific data schemas or status codes are required? Once I answer, provide the output. Rules: 1. Use Given-When-Then syntax for every scenario. 2. Define exact HTTP status codes for success and failure paths. 3. Include a specific JSON request body and expected response structure for each test. 4. Focus on edge cases like missing fields or invalid permissions. Output format: ## Test Scenario Name. ### Context. ### Assertions. 1. Given (state). 2. When (action). 3. Then (expected HTTP status and payload keys). This is technical documentation for test automation; do not include conversational filler.Example output
Tips and common edits
Why this works
- Forces structured Given-When-Then format which AI agents parse reliably.
- Ensures exact technical requirements like HTTP codes are defined upfront.
- Eliminates ambiguity by requiring specific JSON payload keys in the output.
Use this when you have a feature requirement and need to write tests for Claude Code, Cursor, or GitHub Copilot. Copy the prompt into your chat window, answer the 3 questions, and paste the generated code directly into your test files.
Common edits
- Add specific header requirements like Authorization: Bearer tokens if your API is secured.
- Include database state assertions if your tests need to verify record persistence.
Reuse it: Use in a workflowAdapt in the builder
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
More like this
Create Automated Verification Loops for Long-Running Coding Agents
Generate a deterministic shell pipeline that combines linting, isolated unit testing, and diff-budget monitoring to validate AI agent code changes.
Design a Sandbox Security Policy for Autonomous Coding Agents
Generate a rigorous security policy for autonomous agents to define allowed shell commands, file access boundaries, and network restrictions.
Generate Database Migration and Rollback Specs for Coding Agents
Get a structured migration and rollback plan that ensures data integrity and zero-downtime execution for your database schema changes.
Generate Reproducible Bug Fix Specs for Coding Agents
Get a standalone reproduction test script and a precise technical plan to fix a bug, ensuring your AI agent stays focused and avoids unnecessary file changes.
Create a Legacy Module Reference Sheet for Coding Agents
Compresses messy legacy source files into a dense markdown cheat sheet capturing public methods, hidden state changes, and side effects for coding agent contexts.
Create a Verification Loop Script for AI Coding Agents
Generate a lightweight bash verification pipeline that validates linters, scoped test suites, and git diff budgets before an agent declares a task complete.
- Evaluate Coding Agent Test Suites for False Positive Traps
- Review AI Pull Requests for Phantom Imports and Bloat
- Structure a Multi-Repo Dependency Update Brief for Coding Agents
- Turn Bug Reports into Agent Reproduction Scripts and Fix Briefs
- Verify the Coding Agent's 'Done' Claim Against the Diff and Test Output
- Agent Session Handoff Brief with Resume Checklist and Verified State