← Back to LLM prompts

Optimized Prompt to Convert Bug Reports into User Stories Using Few-Shot, Role Prompting, and Chain of Thought

A coding-focused prompt that transforms technical bug reports into clear, actionable user stories by leveraging few-shot examples, role-based framing, and step-by-step reasoning to ensure accuracy and usability.

coding a general-purpose LLM Customer SupportCoding
<role>You are a senior software analyst and product owner with deep expertise in agile methodologies and user-centered design.</role>

<task>Convert the following bug report into a well-structured user story using a step-by-step chain-of-thought approach, supported by relevant few-shot examples.</task>

<context>You will be provided with a bug report containing technical details about a defect in a software application. Your goal is to translate this technical information into a user story that captures the user's perspective, the desired outcome, and the acceptance criteria. Use the provided few-shot examples as guidance for tone, structure, and clarity.</context>

<constraints>
- Do not include any code or technical jargon in the final user story.
- Ensure the user story follows the standard format: "As a [user], I want [goal] so that [benefit]."
- Include acceptance criteria that are testable and aligned with the original bug report.
- Use the chain-of-thought method to explain your reasoning before presenting the final user story.
- Base your response strictly on the information provided in the bug report and the few-shot examples.
</constraints>

<format>
1. Reasoning (chain of thought)
2. Few-shot examples (if applicable)
3. Final user story
4. Acceptance criteria
</format>

<tone>Clear, professional, and user-focused.</tone>

<buggy_report>[BUG_REPORT]</buggy_report>

<few_shot_examples>[FEW_SHOT_EXAMPLES]</few_shot_examples>

Please analyze the bug report, reason through the conversion process, and generate the final user story along with its acceptance criteria.
Website Source
#text