This prompt is designed for triage teams, QA engineers, and support-to-engineering pipelines that receive unstructured bug reports. Users describe symptoms in freeform text: 'the app crashed when I clicked save,' 'login is broken on my phone,' or 'the report shows wrong numbers after the update.' The prompt extracts these descriptions into numbered, ordered reproduction steps. Each step includes the action taken, the expected result, and the actual result observed. The output is structured enough to feed into a test case generator, a bug tracker, or a developer's investigation queue.
Prompt
Reproduction Step Extraction Prompt for Unstructured Reports

When to Use This Prompt
Defines the ideal input, user, and output contract for the reproduction step extraction prompt, and clarifies when not to use it.
Use this prompt when the input is a single bug report and the output must be a sequence of testable steps. The ideal input is a paragraph or short transcript describing what the user did, what they expected, and what happened instead. The prompt works best when the report contains a clear temporal sequence of actions, even if the language is vague or non-technical. It is not designed for batch classification, severity assignment, or duplicate detection. Those are separate triage prompts with different output contracts. Do not use this prompt when the input is a stack trace without user actions, a feature request disguised as a bug, or a report so incomplete that no sequence can be inferred.
Before wiring this prompt into a production pipeline, ensure the upstream intake form or support channel captures enough narrative detail to make step extraction possible. If the input is a one-liner like 'it's broken,' the prompt will produce low-quality or hallucinated steps. Pair this prompt with a completeness check prompt to gate extraction on sufficient input. The output should be validated for step atomicity—each step must describe a single action—and testability before it reaches a developer's queue.
Use Case Fit
Where this prompt works and where it does not. Understand the operational boundaries before wiring it into a triage pipeline.
Good Fit: Unstructured User Reports
Use when: Ingesting freeform bug descriptions from support tickets, emails, or chat transcripts. Guardrail: The prompt excels at extracting implicit steps from narrative text. Validate output atomicity with a step-count check before accepting.
Bad Fit: Pure Stack Traces
Avoid when: The input is only a raw stack trace without user narrative. Guardrail: This prompt extracts behavioral steps, not code execution paths. Route pure stack traces to a dedicated parsing prompt first, then combine outputs.
Required Inputs
Risk: Missing environment details (OS, version) lead to unreproducible steps. Guardrail: The harness must pre-process the report to extract or flag missing environment fields. Do not let the model hallucinate 'steps' that assume a default environment.
Operational Risk: Atomicity Drift
Risk: The model merges multiple actions into a single step (e.g., 'Log in and navigate to settings'). Guardrail: Implement a post-processing validator that rejects steps containing conjunctions like 'and' or 'then'. Force re-generation of granular steps.
Operational Risk: Testability Gap
Risk: Extracted steps describe the 'what' but not the 'how to verify' (expected vs. actual results). Guardrail: The output schema must require an 'expected result' and 'actual result' field per step. If missing, trigger a repair prompt before routing to QA.
Human-in-the-Loop Boundary
Risk: High-severity security or data-loss bugs may have incomplete reproduction steps. Guardrail: If the confidence score for step completeness is low, or the severity is S1, block automatic routing and escalate to a human triage lead for manual enrichment.
Copy-Ready Prompt Template
A copy-ready prompt for extracting ordered, testable reproduction steps from unstructured bug reports and user descriptions.
This prompt template is designed to be pasted directly into your system instructions or sent as a user message. It instructs the model to convert vague, freeform user descriptions into a numbered list of atomic, testable reproduction steps. Each step must include the action taken, the expected result, and the actual result observed. The prompt uses square-bracket placeholders that you must replace with real values before execution. The most critical placeholder is [BUG_REPORT], which should contain the raw, unstructured text of the user's issue. The [APPLICATION_CONTEXT] placeholder is where you provide essential domain knowledge, such as the application's name, its core features, and common user flows, which helps the model interpret ambiguous actions like 'I clicked the button.'
textYou are a QA triage engineer. Your task is to extract a precise, ordered list of reproduction steps from an unstructured bug report. **Input Report:** [BUG_REPORT] **Application Context:** [APPLICATION_CONTEXT] **Instructions:** 1. Read the entire report to understand the user's goal and the failure. 2. Identify every distinct action the user took, in chronological order. 3. For each action, determine the expected result (what the user thought would happen) and the actual result (what the user observed). If either is not stated, use "Not specified in report." 4. Number the steps sequentially. Each step must be atomic, describing a single action. 5. Ensure the final step clearly describes the failure state. **Output Format:** Return ONLY a valid JSON object with a single key "reproduction_steps". The value must be an array of objects, each with the keys "step_number" (integer), "action" (string), "expected_result" (string), and "actual_result" (string). **Example:** Input: "I tried to log in with my new password but it just kept spinning. I reset it yesterday." Output: { "reproduction_steps": [ { "step_number": 1, "action": "Navigate to the login page.", "expected_result": "Login page loads successfully.", "actual_result": "Not specified in report." }, { "step_number": 2, "action": "Enter email address and the new password reset yesterday.", "expected_result": "Successful authentication and redirect to the dashboard.", "actual_result": "The page shows a loading spinner indefinitely." } ] }
After pasting the template, the primary adaptation is filling the placeholders with high-quality context. For [BUG_REPORT], ensure you include any attached error messages or screenshots as text descriptions. For [APPLICATION_CONTEXT], be specific: instead of 'e-commerce site,' describe 'a B2B wholesale ordering platform where users build carts from a product catalog and submit purchase orders.' This detail prevents the model from hallucinating standard e-commerce features like a shopping cart icon that may not exist in your application. If the bug report is extremely long, consider pre-processing it to remove irrelevant log lines before insertion. The output is strictly JSON, making it suitable for direct ingestion into a ticketing system's API. You should always validate the output against a JSON schema to ensure the array is present and each object contains the required string keys. For high-severity bugs, a human QA lead must review the extracted steps for accuracy before the ticket is assigned to an engineering team.
Prompt Variables
Required and optional inputs for the Reproduction Step Extraction Prompt. Each placeholder must be populated before the prompt is assembled and sent to the model. Validation notes describe how the harness should check input quality before execution.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[BUG_REPORT_TEXT] | Raw unstructured bug report from user, support agent, or automated system | The app crashes when I click Save on the profile page. I was using Chrome on Windows. It happened twice today. | Check length > 20 characters. Reject empty or whitespace-only input. Warn if < 50 characters (likely incomplete report). |
[PRODUCT_CONTEXT] | Product name, version, and surface area to scope step extraction | Web App v3.2.1 - User Profile Settings | Must be non-empty string. Should match a known product entry in the component catalog if routing downstream. Null allowed only if product is unknown. |
[KNOWN_ENVIRONMENT_FIELDS] | List of environment dimensions the system tracks (OS, browser, device, app version) | ["OS", "Browser", "App Version", "Device Type", "Network"] | Must be a valid JSON array of strings. Each string should match a field in the downstream ticket schema. Empty array allowed if environment tracking is not configured. |
[OUTPUT_SCHEMA] | JSON Schema or type definition the extracted steps must conform to | {"type": "object", "properties": {"steps": {"type": "array", "items": {"type": "object", "properties": {"step_number": {"type": "integer"}, "action": {"type": "string"}, "expected_result": {"type": "string"}, "actual_result": {"type": "string"}}}}}} | Must be valid JSON Schema. Validate with a schema parser before prompt assembly. Reject if schema is malformed or missing required 'steps' array definition. |
[MAX_STEPS] | Upper bound on the number of reproduction steps to extract | 10 | Must be a positive integer between 3 and 20. Harness should truncate or request clarification if the model exceeds this limit. Prevents runaway step generation from verbose reports. |
[REQUIRE_EXPECTED_RESULT] | Whether each step must include an expected result field, even if the user did not state one | Must be boolean. When true, the harness post-processor must flag steps where expected_result is null or empty and either infer from context or mark as 'Not specified by reporter'. | |
[ALLOW_AMBIGUOUS_STEPS] | Whether to include steps the model is uncertain about, flagged with a confidence marker | Must be boolean. When false, the harness should drop steps with confidence below threshold and append them to an 'excluded_ambiguous_steps' field in the output for human review. |
Implementation Harness Notes
How to wire the reproduction step extraction prompt into a triage application with validation, retries, and human review gates.
This prompt is designed to sit inside a bug triage pipeline that receives unstructured user reports and must produce structured, testable reproduction steps before the ticket reaches an engineering queue. The harness should call the model with the raw report text injected into the [BUG_REPORT] placeholder, along with any available [ENVIRONMENT_CONTEXT] such as OS, browser, or app version extracted from the report or user metadata. The [OUTPUT_SCHEMA] placeholder should be populated with a strict JSON schema that defines the expected structure: an array of step objects, each containing step_number (integer), action (string), expected_result (string), actual_result (string), and is_atomic (boolean). The [CONSTRAINTS] field should enforce that each step describes exactly one user action, that steps are ordered chronologically, and that expected vs. actual results are stated per step rather than aggregated at the end.
After the model returns its output, the harness must run a validation layer before the result enters any downstream system. First, parse the JSON and check schema compliance—reject any response missing required fields or containing malformed step objects. Second, apply atomicity checks: if a step's action field contains multiple verbs or conjunctions like 'and then', flag it for decomposition. Third, verify testability by confirming that each action describes a concrete user operation (click, type, navigate, select) rather than an abstract observation. If validation fails, the harness should retry the prompt once with the validation errors appended to the [CONSTRAINTS] field as explicit correction instructions. If the second attempt also fails validation, route the report to a human triage queue with the partial output and error annotations attached. Log every attempt—raw input, model response, validation results, and retry decisions—for prompt debugging and eval dataset construction.
For model choice, prefer a model with strong instruction-following and structured output capabilities. GPT-4o, Claude 3.5 Sonnet, and Gemini 1.5 Pro all perform well on this extraction task, but you should run a calibration eval against a golden dataset of 50 manually annotated bug reports before selecting a production model. Measure step-level precision and recall against human-labeled reproduction steps, and track the rate of validation failures that require human escalation. Set a monitoring threshold: if the human-escalation rate exceeds 15% of incoming reports, revisit the prompt template, the validation rules, or the model choice. Do not use this prompt for safety-critical bug reports where incorrect reproduction steps could mask a data-loss or security vulnerability—those reports should always start with human triage regardless of automation confidence.
Expected Output Contract
Fields, types, and validation rules for the structured reproduction steps object returned by the prompt. Use this contract to build a post-processing validator before the output reaches your ticketing system.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
reproduction_steps | array of objects | Array length >= 1. Reject if empty or missing. | |
reproduction_steps[].step_number | integer | Must be sequential starting at 1. Validate monotonic increment. | |
reproduction_steps[].action | string | Must describe a single user or system action. Reject if empty or contains multiple sentences. | |
reproduction_steps[].expected_result | string | Must describe the expected system state after the action. Reject if identical to action string. | |
reproduction_steps[].actual_result | string | Must describe the observed deviation. Reject if identical to expected_result or empty. | |
environment | object | If present, validate keys against allowed list: [os, browser, app_version, device]. Strip unknown keys. | |
preconditions | array of strings | Each string must be a single precondition statement. Reject if any element is an empty string. | |
confidence | string | Must be one of enum: [high, medium, low]. Default to medium if missing or invalid. |
Common Failure Modes
Reproduction step extraction fails in predictable ways when the input is vague, the model hallucinates steps, or the output isn't testable. Here's what breaks first and how to guard against it.
Vague Input Produces Vague Steps
What to watch: The model generates generic steps like 'log in' or 'click the button' when the user report lacks specifics. The output looks structured but isn't actionable. Guardrail: Add a pre-extraction completeness check that flags missing environment, action, or result details before generation. Return a structured 'needs clarification' response instead of guessing.
Hallucinated Reproduction Steps
What to watch: The model invents plausible-sounding steps, UI elements, or expected results that don't exist in the source report. This is especially common when the report is short or the model tries to 'complete' an incomplete narrative. Guardrail: Require each step to cite a specific sentence or phrase from the source report. If no source evidence exists for a step, the harness must reject it or mark it as low-confidence inference.
Non-Atomic Steps That Combine Multiple Actions
What to watch: A single step contains multiple actions (e.g., 'Navigate to settings and change the email and save'). This makes the step untestable because a failure at any sub-action breaks the whole step. Guardrail: Post-process the output with an atomicity validator that splits steps containing conjunctions ('and', 'then') or multiple verbs into separate numbered steps before returning the final output.
Missing Expected vs. Actual Results Per Step
What to watch: The model outputs a flat list of actions without pairing each step with what the user expected and what actually happened. This strips away the diagnostic signal that makes reproduction steps useful for debugging. Guardrail: Enforce a strict output schema where every step object requires both expected_result and actual_result fields. If the source report doesn't provide one, the field must contain an explicit "UNKNOWN" marker, not be omitted.
Ordering Errors in Multi-Path Reports
What to watch: When a user describes multiple attempts or branches ('I tried X, then Y, then went back to X'), the model flattens the timeline into a single linear sequence that misrepresents the actual user path. Guardrail: Use a pre-processing prompt that identifies distinct attempt sequences before extraction. Output each attempt as a separate reproduction scenario with its own ordered steps, rather than merging them into one confused timeline.
Environment Assumptions Without Evidence
What to watch: The model silently assumes an OS, browser, app version, or device type when the report doesn't specify one, leading to steps that can't be reproduced in the actual user's environment. Guardrail: Extract environment details into a separate structured block before generating steps. Any field not found in the source must be set to null or "UNSPECIFIED". The harness should warn if environment fields are missing before the steps are used for reproduction.
Evaluation Rubric
Use this rubric to evaluate the quality of extracted reproduction steps before integrating the prompt into a production triage pipeline. Each criterion targets a specific failure mode common in unstructured bug report processing.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Step Atomicity | Each step describes exactly one user action or system observation. | Multiple actions joined by 'and then' or 'followed by' in a single step. | Parse step count; check for conjunction density per step using a simple token split. |
Actionability | Every step can be executed by a tester without guessing UI elements or data values. | Steps contain vague verbs like 'check', 'verify', or 'look at' without a specific target. | Manual review of a 20-sample golden set; flag steps lacking a concrete UI element or data input. |
Expected vs. Actual Pairing | Every step includes both an expected result and the actual (buggy) result. | Steps with only an action description or only an observation; missing one half of the pair. | Schema validation: each step object must have non-null [EXPECTED_RESULT] and [ACTUAL_RESULT] fields. |
Logical Ordering | Steps follow the chronological order a user would take to trigger the bug. | Steps reference a state or screen that has not been introduced yet (forward reference). | Trace prerequisite states; flag if step N+1 references an element created or navigated to in step N+2. |
Prerequisite Capture | All necessary preconditions (login state, data setup, permissions) appear before step 1. | The first actionable step fails because a required account type or data record is not mentioned. | Check for a non-empty [PREREQUISITES] block; verify it contains account, data, and permission context if the steps imply them. |
Environment Specificity | The reproduction steps include or explicitly inherit the environment details from the bug report. | Steps pass on one OS/browser but the bug report specifies a different environment; no environment block is present. | Confirm the output includes an [ENVIRONMENT] block or a null marker; cross-reference with the input [BUG_REPORT] for dropped fields. |
Hallucination Resistance | No invented UI elements, menu paths, or button labels that are not present in the source report. | A step instructs the tester to click a button or navigate to a menu that was never mentioned in the original report. | Diff extracted entities against the source [BUG_REPORT]; flag any noun phrase in steps not present in the input or its reasonable synonyms. |
Testability Closure | The final step leaves the system in a state where the bug is observable and verifiable. | The last step is an action without an actual result, or the bug symptom is described before the final triggering action. | Assert that the last step's [ACTUAL_RESULT] contains the core symptom described in the bug report summary. |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with a simple numbered-list output format. Skip strict JSON schema enforcement initially. Focus on getting step atomicity right before adding validation layers.
- Remove the
[OUTPUT_SCHEMA]constraint and ask for plain numbered steps. - Replace
[CONSTRAINTS]with a single line: "Each step must describe exactly one action." - Test with 10–15 real user reports and manually score step testability.
Watch for
- Steps that combine multiple actions ("log in and click the button").
- Missing expected vs. actual results per step.
- Overly broad instructions that produce paragraphs instead of discrete steps.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us