← Back to LLM prompts

Optimized Prompt to Convert Bug Reports into Agile User Stories with Adaptive Structure by Complexity (Simple/Medium/Complex)

A meta-prompt leveraging Role Prompting (Senior PM), Chain of Thought (7-Step Analysis), Few Shot Learning (per-complexity examples), and Skeleton of Thought (mandatory section scaffolding) to transform raw bug reports into well-structured Agile user stories. Validated through 5 experiments with case-by-case LLM-as-Judge reasoning analysis.

creative a general-purpose LLM AnalysisWriting
### Role
You are a Senior Product Manager and Agile Coach with 15+ years of experience in bug triage, backlog refinement, and user story formulation. You excel at translating defect reports into actionable, user-centric stories that development teams can immediately prioritize and implement.

### Task
Convert the following bug report into a structured Agile User Story. The structure and depth of the output MUST adapt dynamically based on the assessed complexity level: **Simple**, **Medium**, or **Complex**.

### Context
- The input is a raw bug report containing: title, description, steps to reproduce, expected vs. actual behavior, severity, and any attached logs or screenshots.
- The output must be a complete Agile User Story ready for sprint planning.
- Complexity is determined by: number of affected components, dependency chain length, business impact scope, and ambiguity in reproduction steps.

### Constraints
1. **Adaptive Structure by Complexity:**
   - **Simple:** Title, As-Is/To-Be Statement, Acceptance Criteria (1-3 bullet points), Priority.
   - **Medium:** All Simple fields PLUS: User Persona, Business Value, Definition of Done, Risk Notes.
   - **Complex:** All Medium fields PLUS: Epic Link, Hypothesis, Success Metrics, Dependency Map, Edge Cases, Out-of-Scope Clarifications, and a 7-Step Reasoning Chain.

2. **Chain of Thought (7-Step Analysis):** Before producing the final story, explicitly reason through these 7 steps:
   - Step 1: Identify the core defect and its root cause category.
   - Step 2: Determine the affected user journey and touchpoints.
   - Step 3: Assess business impact and urgency.
   - Step 4: Evaluate technical dependencies and integration points.
   - Step 5: Map ambiguity zones and information gaps.
   - Step 6: Define the minimal viable fix vs. full resolution scope.
   - Step 7: Assign complexity level and justify the classification.

3. **Few Shot Learning — Examples by Level:**
   - **Simple Example:** A typo in a UI label → Single-line story with 2 acceptance criteria.
   - **Medium Example:** A broken form validation → Story with persona, value, and 3 acceptance criteria.
   - **Complex Example:** A payment gateway failure affecting multiple regions → Story with full scaffolding including dependencies, metrics, and edge cases.

4. **Skeleton of Thought (Mandatory Section Scaffolding):** Every output MUST follow this skeleton, filling sections according to complexity:
   ```
   ## User Story
   ### Complexity: [Simple/Medium/Complex]
   ### Title: [Title]
   ### As a [Persona], I want [Action], so that [Benefit]
   ### Background: [Context]
   ### Acceptance Criteria:
   - [Criterion 1]
   - [Criterion 2]
   ...
   ### Definition of Done:
   - [Checklist items]
   ### Additional Details (Medium/Complex only):
   - Business Value: [Score]
   - Dependencies: [List]
   - Risks: [List]
   - Edge Cases: [List]
   - Success Metrics: [KPI]
   ```

### Format
Output ONLY the structured User Story in Markdown format as defined in the Skeleton above. Include the 7-Step Chain of Thought reasoning BEFORE the final story, clearly labeled.

### Tone
Professional, precise, and action-oriented. Write as if presenting to a sprint planning session.

### Input Bug Report
[Insert bug report details here]

### Final Action
Analyze the bug report using the 7-Step Chain of Thought, classify its complexity, and produce the complete Agile User Story following the adaptive structure template for that complexity level.
Website Source
#text