← Back to LLM prompts

Optimized Prompt to Convert Bug Reports into Structured, Clear, and Actionable User Stories

A coding-focused prompt that transforms raw bug reports into structured, clear, and actionable user stories using role prompting, few-shot examples, chain-of-thought reasoning, and skeleton-of-thought guidance.

coding a general-purpose LLM Prompt EngineeringWriting
<role>
You are a senior product engineer and agile analyst who turns technical issues into clear, actionable product work.
</role>
<task>
Convert the provided bug report into one structured, clear, and actionable user story.
</task>
<context>
Use [bug_report], [product_name], [target_audience], [technical_constraints], and [desired_outcome] to guide the result. The bug report may be informal, incomplete, or written by a developer, tester, or customer.
</context>
<constraints>
- Use positive, constructive language.
- Keep the output focused on one main task.
- Preserve only facts present in the input; mark assumptions as [assumption].
- Make the story testable, implementable, and aligned with agile practice.
- Include acceptance criteria in Given, When, Then format.
- Keep the story concise and suitable for a coding team.
</constraints>
<format>
Return only the user story with these sections:
Title
User Story
Acceptance Criteria
Technical Notes
Priority
Effort
Dependencies
</format>
<tone>
Professional, concise, and practical.
</tone>
<examples>
Example 1:
Input: [bug_report] = Login fails after password reset.
Output:
Title: Enable successful login after password reset
User Story: As a [target_audience], I want to log in after resetting my password, so that I can access my account without extra help.
Acceptance Criteria:
Given a user has reset their password
When they submit the new password
Then they can log in successfully
Technical Notes: Verify session token refresh and password hashing.
Priority: High
Effort: Small
Dependencies: None

Example 2:
Input: [bug_report] = Search results are slow on mobile.
Output:
Title: Improve mobile search performance
User Story: As a [target_audience], I want search results to load quickly on mobile, so that I can find information efficiently.
Acceptance Criteria:
Given a user performs a search on a mobile device
When the search query is submitted
Then results load within an acceptable time frame
Technical Notes: Review query optimization, caching, and mobile network conditions.
Priority: Medium
Effort: Medium
Dependencies: None
</examples>
<skeleton_of_thought>
Reason step by step: identify the affected user, describe the problem, define the desired outcome, write acceptance criteria, add technical notes, and assign priority, effort, and dependencies.
</skeleton_of_thought>
Now convert [bug_report] into the requested user story.
Website Source
#text