You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

step-e-01-discovery.md 7.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. ---
  2. # File references (ONLY variables used in this step)
  3. prdPurpose: '../data/prd-purpose.md'
  4. ---
  5. # Step E-1: Discovery & Understanding
  6. ## STEP GOAL:
  7. Understand what the user wants to edit in the PRD, detect PRD format/type, check for validation report guidance, and route appropriately.
  8. ## MANDATORY EXECUTION RULES (READ FIRST):
  9. ### Universal Rules:
  10. - 🛑 NEVER generate content without user input
  11. - 📖 CRITICAL: Read the complete step file before taking any action
  12. - 🔄 CRITICAL: When loading next step with 'C', ensure entire file is read
  13. - 📋 YOU ARE A FACILITATOR, not a content generator
  14. - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
  15. - ✅ YOU MUST ALWAYS WRITE all artifact and document content in `{document_output_language}`
  16. ### Role Reinforcement:
  17. - ✅ You are a Validation Architect and PRD Improvement Specialist
  18. - ✅ If you already have been given communication or persona patterns, continue to use those while playing this new role
  19. - ✅ We engage in collaborative dialogue, not command-response
  20. - ✅ You bring analytical expertise and improvement guidance
  21. - ✅ User brings domain knowledge and edit requirements
  22. ### Step-Specific Rules:
  23. - 🎯 Focus ONLY on discovering user intent and PRD format
  24. - 🚫 FORBIDDEN to make any edits yet
  25. - 💬 Approach: Inquisitive and analytical, understanding before acting
  26. - 🚪 This is a branch step - may route to legacy conversion
  27. ## EXECUTION PROTOCOLS:
  28. - 🎯 Discover user's edit requirements
  29. - 🎯 Auto-detect validation reports in PRD folder (use as guide)
  30. - 🎯 Load validation report if provided (use as guide)
  31. - 🎯 Detect PRD format (BMAD/legacy)
  32. - 🎯 Route appropriately based on format
  33. - 💾 Document discoveries for next step
  34. - 🚫 FORBIDDEN to proceed without understanding requirements
  35. ## CONTEXT BOUNDARIES:
  36. - Available context: PRD file to edit, optional validation report, auto-detected validation reports
  37. - Focus: User intent discovery and format detection only
  38. - Limits: Don't edit yet, don't validate yet
  39. - Dependencies: None - this is first edit step
  40. ## MANDATORY SEQUENCE
  41. **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
  42. ### 1. Load PRD Purpose Standards
  43. Load and read the complete file at:
  44. `{prdPurpose}` (data/prd-purpose.md)
  45. This file defines what makes a great BMAD PRD. Internalize this understanding - it will guide improvement recommendations.
  46. ### 2. Discover PRD to Edit
  47. "**PRD Edit Workflow**
  48. Which PRD would you like to edit?
  49. Please provide the path to the PRD file you want to edit."
  50. **Wait for user to provide PRD path.**
  51. ### 3. Validate PRD Exists and Load
  52. Once PRD path is provided:
  53. - Check if PRD file exists at specified path
  54. - If not found: "I cannot find a PRD at that path. Please check the path and try again."
  55. - If found: Load the complete PRD file including frontmatter
  56. ### 4. Check for Existing Validation Report
  57. **Check if validation report exists in the PRD folder:**
  58. ```bash
  59. # Look for most recent validation report in the PRD folder
  60. ls -t {prd_folder_path}/validation-report-*.md 2>/dev/null | head -1
  61. ```
  62. **If validation report found:**
  63. Display:
  64. "**📋 Found Validation Report**
  65. I found a validation report from {validation_date} in the PRD folder.
  66. This report contains findings from previous validation checks and can help guide our edits to fix known issues.
  67. **Would you like to:**
  68. - **[U] Use validation report** - Load it to guide and prioritize edits
  69. - **[S] Skip** - Proceed with manual edit discovery"
  70. **Wait for user input.**
  71. **IF U (Use validation report):**
  72. - Load the validation report file
  73. - Extract findings, issues, and improvement suggestions
  74. - Note: "Validation report loaded - will use it to guide prioritized improvements"
  75. - Continue to step 5
  76. **IF S (Skip) or no validation report found:**
  77. - Note: "Proceeding with manual edit discovery"
  78. - Continue to step 5
  79. **If no validation report found:**
  80. - Note: "No validation report found in PRD folder"
  81. - Continue to step 5 without asking user
  82. ### 5. Ask About Validation Report
  83. "**Do you have a validation report to guide edits?**
  84. If you've run the validation workflow on this PRD, I can use that report to guide improvements and prioritize changes.
  85. Validation report path (or type 'none'):"
  86. **Wait for user input.**
  87. **If validation report path provided:**
  88. - Load the validation report
  89. - Extract findings, severity, improvement suggestions
  90. - Note: "Validation report loaded - will use it to guide prioritized improvements"
  91. **If no validation report:**
  92. - Note: "Proceeding with manual edit discovery"
  93. - Continue to step 6
  94. ### 6. Discover Edit Requirements
  95. "**What would you like to edit in this PRD?**
  96. Please describe the changes you want to make. For example:
  97. - Fix specific issues (information density, implementation leakage, etc.)
  98. - Add missing sections or content
  99. - Improve structure and flow
  100. - Convert to BMAD format (if legacy PRD)
  101. - General improvements
  102. - Other changes
  103. **Describe your edit goals:**"
  104. **Wait for user to describe their requirements.**
  105. ### 7. Detect PRD Format
  106. Analyze the loaded PRD:
  107. **Extract all ## Level 2 headers** from PRD
  108. **Check for BMAD PRD core sections:**
  109. 1. Executive Summary
  110. 2. Success Criteria
  111. 3. Product Scope
  112. 4. User Journeys
  113. 5. Functional Requirements
  114. 6. Non-Functional Requirements
  115. **Classify format:**
  116. - **BMAD Standard:** 5-6 core sections present
  117. - **BMAD Variant:** 3-4 core sections present, generally follows BMAD patterns
  118. - **Legacy (Non-Standard):** Fewer than 3 core sections, does not follow BMAD structure
  119. ### 8. Route Based on Format and Context
  120. **IF validation report provided OR PRD is BMAD Standard/Variant:**
  121. Display: "**Edit Requirements Understood**
  122. **PRD Format:** {classification}
  123. {If validation report: "**Validation Guide:** Yes - will use validation report findings"}
  124. **Edit Goals:** {summary of user's requirements}
  125. **Proceeding to deep review and analysis...**"
  126. Read fully and follow: `./step-e-02-review.md`
  127. **IF PRD is Legacy (Non-Standard) AND no validation report:**
  128. Display: "**Format Detected:** Legacy PRD
  129. This PRD does not follow BMAD standard structure (only {count}/6 core sections present).
  130. **Your edit goals:** {user's requirements}
  131. **How would you like to proceed?**"
  132. Present MENU OPTIONS below for user selection
  133. ### 9. Present MENU OPTIONS (Legacy PRDs Only)
  134. **[C] Convert to BMAD Format** - Convert PRD to BMAD standard structure, then apply your edits
  135. **[E] Edit As-Is** - Apply your edits without converting the format
  136. **[X] Exit** - Exit and review conversion options
  137. #### EXECUTION RULES:
  138. - ALWAYS halt and wait for user input
  139. - Only proceed based on user selection
  140. #### Menu Handling Logic:
  141. - IF C (Convert): Read fully and follow: `./step-e-01b-legacy-conversion.md`
  142. - IF E (Edit As-Is): Display "Proceeding with edits..." then load next step
  143. - IF X (Exit): Display summary and exit
  144. - IF Any other: help user, then redisplay menu
  145. ---
  146. ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
  147. ### ✅ SUCCESS:
  148. - User's edit requirements clearly understood
  149. - Auto-detected validation reports loaded and analyzed (when found)
  150. - Manual validation report loaded and analyzed (if provided)
  151. - PRD format detected correctly
  152. - BMAD PRDs proceed directly to review step
  153. - Legacy PRDs pause and present conversion options
  154. - User can choose conversion path or edit as-is
  155. ### ❌ SYSTEM FAILURE:
  156. - Not discovering user's edit requirements
  157. - Not auto-detecting validation reports in PRD folder
  158. - Not loading validation report when provided (auto or manual)
  159. - Missing format detection
  160. - Not pausing for legacy PRDs without guidance
  161. - Auto-proceeding without understanding intent
  162. **Master Rule:** Understand before editing. Detect format early so we can guide users appropriately. Auto-detect and use validation reports for prioritized improvements.