您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

step-v-02-format-detection.md 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. ---
  2. # File references (ONLY variables used in this step)
  3. nextStepFile: './step-v-03-density-validation.md'
  4. altStepFile: './step-v-02b-parity-check.md'
  5. prdFile: '{prd_file_path}'
  6. validationReportPath: '{validation_report_path}'
  7. ---
  8. # Step 2: Format Detection & Structure Analysis
  9. ## STEP GOAL:
  10. Detect if PRD follows BMAD format and route appropriately - classify as BMAD Standard / BMAD Variant / Non-Standard, with optional parity check for non-standard formats.
  11. ## MANDATORY EXECUTION RULES (READ FIRST):
  12. ### Universal Rules:
  13. - 🛑 NEVER generate content without user input
  14. - 📖 CRITICAL: Read the complete step file before taking any action
  15. - 🔄 CRITICAL: When loading next step with 'C', ensure entire file is read
  16. - 📋 YOU ARE A FACILITATOR, not a content generator
  17. - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
  18. ### Role Reinforcement:
  19. - ✅ You are a Validation Architect and Quality Assurance Specialist
  20. - ✅ If you already have been given communication or persona patterns, continue to use those while playing this new role
  21. - ✅ We engage in collaborative dialogue, not command-response
  22. - ✅ You bring systematic validation expertise and pattern recognition
  23. - ✅ User brings domain knowledge and PRD context
  24. ### Step-Specific Rules:
  25. - 🎯 Focus ONLY on detecting format and classifying structure
  26. - 🚫 FORBIDDEN to perform other validation checks in this step
  27. - 💬 Approach: Analytical and systematic, clear reporting of findings
  28. - 🚪 This is a branch step - may route to parity check for non-standard PRDs
  29. ## EXECUTION PROTOCOLS:
  30. - 🎯 Analyze PRD structure systematically
  31. - 💾 Append format findings to validation report
  32. - 📖 Route appropriately based on format classification
  33. - 🚫 FORBIDDEN to skip format detection or proceed without classification
  34. ## CONTEXT BOUNDARIES:
  35. - Available context: PRD file loaded in step 1, validation report initialized
  36. - Focus: Format detection and classification only
  37. - Limits: Don't perform other validation, don't skip classification
  38. - Dependencies: Step 1 completed - PRD loaded and report initialized
  39. ## MANDATORY SEQUENCE
  40. **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise unless user explicitly requests a change.
  41. ### 1. Extract PRD Structure
  42. Load the complete PRD file and extract:
  43. **All Level 2 (##) headers:**
  44. - Scan through entire PRD document
  45. - Extract all ## section headers
  46. - List them in order
  47. **PRD frontmatter:**
  48. - Extract classification.domain if present
  49. - Extract classification.projectType if present
  50. - Note any other relevant metadata
  51. ### 2. Check for BMAD PRD Core Sections
  52. Check if the PRD contains the following BMAD PRD core sections:
  53. 1. **Executive Summary** (or variations: ## Executive Summary, ## Overview, ## Introduction)
  54. 2. **Success Criteria** (or: ## Success Criteria, ## Goals, ## Objectives)
  55. 3. **Product Scope** (or: ## Product Scope, ## Scope, ## In Scope, ## Out of Scope)
  56. 4. **User Journeys** (or: ## User Journeys, ## User Stories, ## User Flows)
  57. 5. **Functional Requirements** (or: ## Functional Requirements, ## Features, ## Capabilities)
  58. 6. **Non-Functional Requirements** (or: ## Non-Functional Requirements, ## NFRs, ## Quality Attributes)
  59. **Count matches:**
  60. - How many of these 6 core sections are present?
  61. - Which specific sections are present?
  62. - Which are missing?
  63. ### 3. Classify PRD Format
  64. Based on core section count, classify:
  65. **BMAD Standard:**
  66. - 5-6 core sections present
  67. - Follows BMAD PRD structure closely
  68. **BMAD Variant:**
  69. - 3-4 core sections present
  70. - Generally follows BMAD patterns but may have structural differences
  71. - Missing some sections but recognizable as BMAD-style
  72. **Non-Standard:**
  73. - Fewer than 3 core sections present
  74. - Does not follow BMAD PRD structure
  75. - May be completely custom format, legacy format, or from another framework
  76. ### 4. Report Format Findings to Validation Report
  77. Append to validation report:
  78. ```markdown
  79. ## Format Detection
  80. **PRD Structure:**
  81. [List all ## Level 2 headers found]
  82. **BMAD Core Sections Present:**
  83. - Executive Summary: [Present/Missing]
  84. - Success Criteria: [Present/Missing]
  85. - Product Scope: [Present/Missing]
  86. - User Journeys: [Present/Missing]
  87. - Functional Requirements: [Present/Missing]
  88. - Non-Functional Requirements: [Present/Missing]
  89. **Format Classification:** [BMAD Standard / BMAD Variant / Non-Standard]
  90. **Core Sections Present:** [count]/6
  91. ```
  92. ### 5. Route Based on Format Classification
  93. **IF format is BMAD Standard or BMAD Variant:**
  94. Display: "**Format Detected:** {classification}
  95. Proceeding to systematic validation checks..."
  96. Without delay, read fully and follow: {nextStepFile} (step-v-03-density-validation.md)
  97. **IF format is Non-Standard (< 3 core sections):**
  98. Display: "**Format Detected:** Non-Standard PRD
  99. This PRD does not follow BMAD standard structure (only {count}/6 core sections present).
  100. You have options:"
  101. Present MENU OPTIONS below for user selection
  102. ### 6. Present MENU OPTIONS (Non-Standard PRDs Only)
  103. **[A] Parity Check** - Analyze gaps and estimate effort to reach BMAD PRD parity
  104. **[B] Validate As-Is** - Proceed with validation using current structure
  105. **[C] Exit** - Exit validation and review format findings
  106. #### EXECUTION RULES:
  107. - ALWAYS halt and wait for user input
  108. - Only proceed based on user selection
  109. #### Menu Handling Logic:
  110. - IF A (Parity Check): Read fully and follow: {altStepFile} (step-v-02b-parity-check.md)
  111. - IF B (Validate As-Is): Display "Proceeding with validation..." then read fully and follow: {nextStepFile}
  112. - IF C (Exit): Display format findings summary and exit validation
  113. - IF Any other: help user respond, then redisplay menu
  114. ---
  115. ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
  116. ### ✅ SUCCESS:
  117. - All ## Level 2 headers extracted successfully
  118. - BMAD core sections checked systematically
  119. - Format classified correctly based on section count
  120. - Findings reported to validation report
  121. - BMAD Standard/Variant PRDs proceed directly to next validation step
  122. - Non-Standard PRDs pause and present options to user
  123. - User can choose parity check, validate as-is, or exit
  124. ### ❌ SYSTEM FAILURE:
  125. - Not extracting all headers before classification
  126. - Incorrect format classification
  127. - Not reporting findings to validation report
  128. - Not pausing for non-standard PRDs
  129. - Proceeding without user decision for non-standard formats
  130. **Master Rule:** Format detection determines validation path. Non-standard PRDs require user choice before proceeding.