Inferensys

Prompt

Acceptance Criteria Generation Prompt Template

A practical prompt playbook for translating software requirements into structured, testable acceptance criteria. Designed for QA engineers, product managers, and agent planning pre-processors who need criteria with explicit preconditions, test steps, and expected outcomes before execution begins.
Wide-angle shot of a modern WeWork open floor plan with creative walls covered in AI system architecture diagrams, product team collaborating in standing desk area with industrial lighting.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the ideal conditions, required inputs, and pre-requisites for using the Acceptance Criteria Generation prompt template.

This prompt is designed for teams that need to convert a requirement statement into a set of acceptance criteria that a tester, automation script, or downstream agent can execute without ambiguity. Use it when you have a functional requirement or user story and need criteria with clear preconditions, discrete test steps, and measurable expected outcomes. This prompt belongs in the planning pre-processing stage of an agent workflow, before task decomposition or execution begins. It assumes the input requirement is already clarified and scoped. If the requirement is still vague or contains unresolved constraints, run an Ambiguous Goal Refinement or Constraint Elicitation prompt first.

The ideal input is a single, self-contained requirement statement that describes a specific behavior or outcome. The prompt works best with requirements that have a clear actor, action, and expected result. It is not suitable for non-functional requirements like performance benchmarks or security policies unless those can be expressed as testable conditions. Do not use this prompt for exploratory testing scenarios where the expected outcome is unknown, or for requirements that span multiple independent workflows without clear boundaries. The output criteria are designed to be consumed by test automation frameworks, QA engineers, or verification agents that need step-by-step reproducibility.

Before invoking this prompt, confirm that the requirement has been reviewed for completeness and that any domain-specific terminology is defined. The prompt includes placeholders for [INPUT] (the requirement text), [CONTEXT] (system state, user role, or environmental conditions), and [CONSTRAINTS] (regulatory, technical, or business rules). If your workflow involves high-risk domains such as healthcare, finance, or safety-critical systems, pair this prompt with a human review step and an evidence-grounding check. The generated criteria should be treated as a draft that requires validation against the original requirement and any implicit assumptions the model may have introduced.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Acceptance Criteria Generation prompt template delivers value and where it introduces risk. Use these cards to decide if this prompt fits your workflow before you integrate it.

01

Good Fit: Structured Requirements

Use when: you have a written requirement, PRD section, or user story that needs translation into testable acceptance criteria. Guardrail: feed the prompt a single, bounded requirement per call to keep criteria focused and traceable.

02

Bad Fit: Exploratory Discovery

Avoid when: requirements are still being discovered through conversation or prototyping. Risk: the prompt will produce criteria that look complete but lock in premature assumptions. Guardrail: use a goal clarification prompt first, then generate criteria only after scope is stable.

03

Required Inputs

What you must provide: a clear requirement statement, the target system or feature context, and any known constraints. Guardrail: if the requirement is ambiguous, run it through the Ambiguous Goal Refinement prompt template before generating criteria. Garbage in, garbage out applies here.

04

Operational Risk: False Completeness

What to watch: the model may produce criteria that cover the stated requirement but miss implicit expectations, edge cases, or non-functional needs. Guardrail: always run the output through the Edge Case Elicitation prompt template and have a domain expert review for missing negative cases.

05

Operational Risk: Untestable Criteria

What to watch: criteria that use vague language like 'works correctly' or 'is fast enough' without measurable thresholds. Guardrail: add a post-generation validation step that checks each criterion for a concrete precondition, action, and observable expected outcome. Reject criteria that cannot be automated or manually verified.

06

When to Escalate

What to watch: requirements involving safety-critical systems, regulatory compliance, or irreversible actions. Guardrail: the prompt output is a draft, not a sign-off. Route all criteria for these domains through a human approval workflow and pair with the Constraint Completeness Check prompt template before any test execution.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready system prompt that instructs the model to generate a JSON array of testable acceptance criteria from a source requirement, including preconditions, test steps, expected outcomes, and traceability.

This prompt template is the core instruction set for generating structured acceptance criteria. It is designed to be pasted directly into the system or developer message of your model request. The prompt forces the model to produce a predictable JSON array, map each criterion back to the source requirement, and explicitly flag any criteria that cannot be tested. This structure is essential for downstream validation, automated test generation, and traceability audits.

text
You are a requirements analyst converting a source requirement into a set of testable acceptance criteria.

Your task is to analyze the provided [REQUIREMENT] and produce a JSON array of acceptance criteria objects. Each object must include preconditions, test steps, and expected outcomes. You must also flag any criterion that is not practically testable and map every criterion back to the source requirement.

## Input
[REQUIREMENT]: The full text of the requirement to be decomposed.
[CONTEXT]: Optional additional context, such as product documentation, user stories, or technical constraints.
[CONSTRAINTS]: Optional constraints on the criteria, such as a maximum number of criteria, specific test environments, or regulatory standards to apply.

## Output Schema
Return ONLY a valid JSON object with the following structure. Do not include any text outside the JSON object.

{
  "requirement_id": "string",
  "criteria": [
    {
      "criterion_id": "AC-001",
      "description": "A concise description of the criterion.",
      "source_requirement_section": "Quote the specific part of the requirement this maps to.",
      "preconditions": [
        "State that must be true before the test can begin."
      ],
      "test_steps": [
        "Ordered action to perform."
      ],
      "expected_outcome": "The observable result that indicates success.",
      "is_testable": true,
      "untestable_reason": null
    }
  ]
}

## Instructions
1.  **Decompose the requirement** into discrete, independent acceptance criteria. Each criterion should verify one logical condition.
2.  **Write preconditions** that are specific and reproducible. Avoid vague states like "system is working."
3.  **Write test steps** as a clear, ordered sequence of actions. A new user should be able to follow them.
4.  **Define expected outcomes** that are observable and unambiguous. Use precise values where possible.
5.  **Map every criterion** back to the exact sentence or clause in the source requirement it validates. Use the `source_requirement_section` field.
6.  **Flag untestable criteria**: If a criterion cannot be verified through a practical test (e.g., it requires subjective judgment, access to unavailable systems, or infinite data), set `is_testable` to `false` and explain why in `untestable_reason`.
7.  **Ensure complete coverage**: After generating the list, review the source requirement and confirm that every functional and non-functional aspect is addressed by at least one criterion. If not, add the missing criteria.
8.  **Apply constraints**: If [CONSTRAINTS] are provided, ensure every criterion respects them. For example, if a regulatory standard is specified, include steps that verify compliance.

To adapt this template, replace the square-bracket placeholders with your actual data. The [REQUIREMENT] is the only strictly required input; the model can still produce useful output without [CONTEXT] or [CONSTRAINTS], but providing them will improve specificity and reduce the number of untestable criteria. For high-risk domains, ensure the [CONSTRAINTS] field includes any relevant regulatory or compliance standards. After pasting the prompt, always run the output through a JSON schema validator before ingesting it into your test management system. The next section covers how to wire this prompt into a production application harness with validation, retries, and logging.

IMPLEMENTATION TABLE

Prompt Variables

Each placeholder required by the Acceptance Criteria Generation prompt, its purpose, a concrete example, and actionable validation rules to prevent common input errors before the prompt is sent.

PlaceholderPurposeExampleValidation Notes

[REQUIREMENT_TEXT]

The raw, unstructured requirement or user story to be decomposed into testable acceptance criteria.

As a user, I want to filter search results by date range so that I can find recent documents quickly.

Check that input is a non-empty string with at least 20 characters. Reject inputs that are only a title or a single sentence fragment. If null or whitespace-only, abort and request valid input.

[SYSTEM_CONTEXT]

Describes the application, its users, and the technical environment to ground criteria in real constraints.

Internal document management system used by legal teams; web-based; supports up to 10,000 concurrent users; PostgreSQL backend.

Validate that the context includes at least one of: user persona, platform, or data constraint. If empty, append a warning to the output that criteria may lack environmental grounding.

[CONSTRAINT_LIST]

Explicit boundaries such as performance budgets, security rules, or regulatory requirements that each criterion must respect.

Search results must return in under 500ms; date range cannot exceed 5 years; must respect document-level ACLs.

Parse as a list. If fewer than 2 constraints are provided, flag a low-constraint risk in the eval step. Reject any constraint that is a vague statement like 'it should be fast' without a measurable threshold.

[ACCEPTANCE_CRITERIA_COUNT]

The target number of acceptance criteria to generate, controlling output granularity.

5

Must be an integer between 3 and 15. If outside this range, default to 5 and log a warning. Values above 15 risk generating low-quality filler criteria.

[OUTPUT_FORMAT]

Specifies the required structure for each criterion: Gherkin, bullet-list, or a custom schema.

Gherkin (Given/When/Then)

Must be one of: 'Gherkin', 'Bullet', or 'JSON'. If an unrecognized format is provided, default to 'Gherkin' and append a format-fallback note to the output metadata.

[EDGE_CASE_HINTS]

Optional hints about known edge cases, boundary conditions, or failure modes the criteria should cover.

Date range with reversed start/end dates; empty result set; single-day range; max range boundary.

Allow null or empty. If provided, check that each hint is a distinct string. Deduplicate hints before injection. If more than 10 hints are provided, select the top 10 by specificity to avoid prompt bloat.

[PREVIOUS_CRITERIA]

Existing acceptance criteria that the new set must not duplicate, used to ensure additive coverage.

Given a logged-in user, when they enter a search term, then results are displayed within 2 seconds.

Allow null. If provided, run a semantic deduplication check after generation. If generated criteria overlap with [PREVIOUS_CRITERIA] above a 0.8 similarity threshold, flag for human review.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the acceptance criteria generation prompt into an application, agent, or CI pipeline with validation, retries, and human review.

This prompt is designed to be called programmatically from a product management tool, CI pipeline, or planning agent. The caller must supply a structured [REQUIREMENT] object containing the feature description, any existing constraints, and the target domain context. The model returns a JSON array of acceptance criteria objects, each with precondition, testSteps, and expectedOutcome fields. The application layer should validate this output before storing it or passing it to downstream systems such as test case generators or ticketing tools.

Validation and repair loop: Parse the model's JSON response immediately. Validate that every criterion object has all three required fields, that testSteps is a non-empty array, and that no criterion is a near-duplicate of another (use cosine similarity on concatenated field text with a threshold of 0.85). If validation fails, construct a repair prompt that includes the original requirement, the invalid output, and the specific validation errors, and retry once. If the retry also fails, log the failure and route to a human review queue rather than silently accepting incomplete criteria. Model choice: Use a model with strong JSON-following behavior and a context window large enough to hold the full requirement plus output schema. For high-stakes requirements (regulated domains, safety-critical features), add a [RISK_LEVEL] parameter that, when set to high, forces the prompt to include a mandatory human-approval step before criteria are considered final.

Integration points: Wire this prompt behind an API endpoint that accepts a requirement payload and returns validated criteria. In a CI pipeline, trigger the endpoint when a PRD or feature spec is merged, and post the generated criteria as a comment on the associated ticket. For agent workflows, treat the output as a planning artifact: the agent should not proceed to implementation until all criteria have a status: approved flag set by a human reviewer. Observability: Log the prompt version, model used, input requirement hash, validation pass/fail status, and any repair attempts. This trace data is essential for debugging criteria quality regressions when requirements change in structure or complexity. What to avoid: Do not bypass validation and feed raw model output directly into automated test generation. Do not use this prompt for requirements that are still in active debate; the input should be a stable, reviewed requirement, not a rough user story draft.

IMPLEMENTATION TABLE

Expected Output Contract

The JSON structure, field definitions, data types, and pass/fail conditions for the acceptance criteria generation response. Use this contract to validate model outputs before they enter downstream test management or ticketing systems.

Field or ElementType or FormatRequiredValidation Rule

acceptance_criteria

Array of objects

Array length must be >= 1. Reject if empty or null.

acceptance_criteria[].id

String (slug)

Must match pattern ^AC-[0-9]{3}$. Must be unique within the array.

acceptance_criteria[].precondition

String

Must be non-empty. Must describe a state or input condition that must be true before the test step executes. Reject if it describes an action instead of a state.

acceptance_criteria[].test_steps

Array of strings

Array length must be >= 1. Each string must be non-empty and begin with an action verb (Given, When, Then, And). Reject if any step is a passive observation.

acceptance_criteria[].expected_outcome

String

Must be non-empty. Must describe a verifiable result, not a subjective quality. Reject if the outcome cannot be confirmed by a system check or human observer.

acceptance_criteria[].requirement_trace

Array of strings

Each string must reference a requirement ID from [REQUIREMENT_IDS]. Reject if any trace is orphaned or references an ID not provided in the input.

acceptance_criteria[].testability_score

Number (0.0-1.0)

Must be a float between 0.0 and 1.0 inclusive. Reject if score < 0.7 with a warning flag. Scores below 0.5 require human review before acceptance.

coverage_gap_summary

Array of strings or null

If non-null, each string must describe a requirement from [REQUIREMENT_IDS] that has zero linked acceptance criteria. Reject if a listed gap has existing coverage in the acceptance_criteria array.

PRACTICAL GUARDRAILS

Common Failure Modes

Acceptance criteria prompts fail in predictable ways when moved from prototyping to production. These are the most common failure modes and the operational guardrails that prevent them.

01

Untestable Criteria Generation

What to watch: The model produces vague criteria like 'the system should work correctly' or 'performance should be acceptable' that cannot be objectively verified. This happens when the prompt lacks explicit testability constraints or when requirements are themselves ambiguous. Guardrail: Add a testability validator that checks each criterion for measurable conditions, concrete inputs, and observable outputs. Reject criteria that contain subjective adjectives without thresholds.

02

Requirement Coverage Gaps

What to watch: Generated criteria cover the obvious happy path but miss edge cases, error conditions, non-functional requirements, and cross-cutting concerns present in the source requirements. The model optimizes for plausible completeness rather than actual coverage. Guardrail: Implement a coverage mapper that traces each criterion back to a specific requirement clause. Flag requirements with zero mapped criteria and re-prompt with explicit coverage instructions for gaps.

03

Precondition-Outcome Mismatch

What to watch: Criteria specify expected outcomes that are impossible given the stated preconditions, or preconditions that don't actually set up the test scenario. The model conflates setup conditions with verification conditions. Guardrail: Add a logical consistency check that validates precondition-to-outcome chains. Test each criterion by asking whether the preconditions are both necessary and sufficient for the expected outcome.

04

Over-Specification Drift

What to watch: The model generates criteria that test implementation details rather than behavior, locking tests to a specific solution approach. This makes criteria brittle when implementation changes and masks whether the actual requirement is met. Guardrail: Include explicit instructions to test observable behavior and outcomes, not internal state or implementation choices. Add a review step that flags criteria referencing specific algorithms, data structures, or UI elements by name.

05

Missing Negative Test Cases

What to watch: Generated criteria focus exclusively on confirming correct behavior and omit tests for invalid inputs, error handling, boundary violations, and failure modes. The model defaults to demonstration rather than verification. Guardrail: Require a minimum ratio of negative to positive test cases in the prompt constraints. Add a post-generation check that counts error-condition criteria and re-prompts if the ratio falls below threshold.

06

Context Window Truncation of Requirements

What to watch: When source requirements are long or complex, the model silently drops later requirements from consideration, producing criteria that appear complete but only cover the first portion of the input. This is especially dangerous because the output looks well-formed. Guardrail: Chunk long requirement documents and generate criteria per chunk with explicit cross-reference. Add a requirement count check comparing input requirement clauses to output criteria coverage before accepting results.

IMPLEMENTATION TABLE

Evaluation Rubric

Score the quality of generated acceptance criteria before shipping the prompt to production. Use this rubric for spot-checking, regression testing, or LLM-as-judge evaluation.

CriterionPass StandardFailure SignalTest Method

Testability

Every criterion includes a concrete, observable action and expected outcome; no subjective adjectives like 'works well'

Criteria contain vague terms like 'properly', 'correctly', or 'as expected' without measurable definition

LLM-as-judge: scan each criterion for a testable verb and a falsifiable expected result

Precondition Completeness

Each criterion states the required system state, user role, and data conditions before the test step executes

Missing preconditions for authenticated actions, empty-state scenarios, or permission-restricted features

Schema check: verify [PRECONDITIONS] field is non-empty and contains role, state, and data context

Requirement Coverage

Every requirement in [INPUT] maps to at least one acceptance criterion; no orphan requirements

A stated requirement has zero associated criteria, or criteria reference requirements not present in the input

Traceability matrix: map each requirement ID to at least one criterion; flag unmapped requirements

Boundary and Edge Case Handling

Criteria cover empty inputs, maximum values, unauthorized access, and concurrent modification where applicable

Only happy-path scenarios present; no criteria for null, overflow, timeout, or permission-denied cases

LLM-as-judge: check for presence of negative test cases and boundary-value criteria against [CONSTRAINTS]

Output Format Compliance

Generated criteria match [OUTPUT_SCHEMA] exactly; all required fields present and correctly typed

Missing [TEST_STEPS], malformed [EXPECTED_OUTCOME], or extra fields not defined in the schema

Schema validation: parse output against [OUTPUT_SCHEMA]; reject on missing required fields or type mismatches

Independence and Atomicity

Each criterion tests exactly one behavior; no compound criteria joined by 'and' that could partially fail

A single criterion describes multiple distinct behaviors, making pass/fail ambiguous

LLM-as-judge: flag criteria containing multiple action verbs with different expected outcomes

Clarity and Actionability

A tester unfamiliar with the feature can execute the criterion without asking clarifying questions

Criteria use internal jargon, skip navigation steps, or assume implicit knowledge not stated in preconditions

Spot-check: give a criterion to a peer reviewer; if they ask a clarifying question, the criterion fails

Non-Functional Coverage

Performance, security, accessibility, or data-integrity criteria are included when [CONSTRAINTS] specify them

Constraints mention latency, PII handling, or WCAG requirements but no corresponding acceptance criteria exist

Constraint-to-criterion mapping: verify each non-functional constraint in [CONSTRAINTS] has at least one matching criterion

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base template and a single requirement document. Remove the [OUTPUT_SCHEMA] placeholder and ask for a bulleted list instead of structured JSON. Skip the coverage eval step initially. Use a frontier model with a simple system prompt: "You are a requirements analyst. Generate testable acceptance criteria."

Watch for

  • Criteria that describe implementation steps instead of testable behaviors
  • Missing preconditions or vague trigger conditions
  • Criteria that cannot be verified without building the feature first
  • Overly broad criteria that cover multiple behaviors in one statement
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.