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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. ---
  2. name: 'step-05-validate-and-complete'
  3. description: 'Validate ATDD outputs and summarize'
  4. outputFile: '{test_artifacts}/atdd-checklist-{story_key}.md'
  5. ---
  6. # Step 5: Validate & Complete
  7. ## STEP GOAL
  8. Validate ATDD outputs and provide a completion summary.
  9. ## MANDATORY EXECUTION RULES
  10. - 📖 Read the entire step file before acting
  11. - ✅ Speak in `{communication_language}`
  12. - ✅ Validate against the checklist
  13. ---
  14. ## EXECUTION PROTOCOLS:
  15. - 🎯 Follow the MANDATORY SEQUENCE exactly
  16. - 💾 Record outputs before proceeding
  17. - 📖 Load the next step only when instructed
  18. ## CONTEXT BOUNDARIES:
  19. - Available context: config, loaded artifacts, and knowledge fragments
  20. - Focus: this step's goal only
  21. - Limits: do not execute future steps
  22. - Dependencies: prior steps' outputs (if any)
  23. ## MANDATORY SEQUENCE
  24. **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
  25. ## 1. Validation
  26. Use `checklist.md` to validate:
  27. - Prerequisites satisfied
  28. - Test files created correctly
  29. - Checklist matches acceptance criteria
  30. - Tests are generated as red-phase scaffolds and marked with `test.skip()`
  31. - Story metadata and handoff paths are captured for downstream workflows
  32. - [ ] CLI sessions cleaned up (no orphaned browsers)
  33. - [ ] Temp artifacts stored in `{test_artifacts}/` not random locations
  34. Fix any gaps before completion.
  35. ---
  36. ## 2. Polish Output
  37. Before finalizing, review the complete output document for quality:
  38. 1. **Remove duplication**: Progressive-append workflow may have created repeated sections — consolidate
  39. 2. **Verify consistency**: Ensure terminology, risk scores, and references are consistent throughout
  40. 3. **Check completeness**: All template sections should be populated or explicitly marked N/A
  41. 4. **Format cleanup**: Ensure markdown formatting is clean (tables aligned, headers consistent, no orphaned references)
  42. ---
  43. ## 3. Completion Summary
  44. Report:
  45. - Test files created
  46. - Checklist output path
  47. - Story key / story file handoff path
  48. - Key risks or assumptions
  49. - Next recommended workflow (usually `dev-story`; `automate` comes after implementation)
  50. ---
  51. ## 4. Save Progress
  52. **Save this step's accumulated work to `{outputFile}`.**
  53. - **If `{outputFile}` does not exist** (first save), create it with YAML frontmatter:
  54. ```yaml
  55. ---
  56. stepsCompleted: ['step-05-validate-and-complete']
  57. lastStep: 'step-05-validate-and-complete'
  58. lastSaved: '{date}'
  59. storyId: '{story_id}'
  60. storyKey: '{story_key}'
  61. storyFile: '{story_file}'
  62. atddChecklistPath: '{outputFile}'
  63. generatedTestFiles: []
  64. ---
  65. ```
  66. Then write this step's output below the frontmatter.
  67. - **If `{outputFile}` already exists**, update:
  68. - Add `'step-05-validate-and-complete'` to `stepsCompleted` array (only if not already present)
  69. - Set `lastStep: 'step-05-validate-and-complete'`
  70. - Set `lastSaved: '{date}'`
  71. - Ensure `storyId`, `storyKey`, `storyFile`, and `atddChecklistPath` are present and populated
  72. - Ensure `generatedTestFiles` remains populated with the deterministic list of present generated test paths
  73. - Append this step's output to the appropriate section.
  74. ## 🚨 SYSTEM SUCCESS/FAILURE METRICS:
  75. ### ✅ SUCCESS:
  76. - Step completed in full with required outputs
  77. ### ❌ SYSTEM FAILURE:
  78. - Skipped sequence steps or missing outputs
  79. **Master Rule:** Skipping steps is FORBIDDEN.
  80. ## On Complete
  81. Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete`
  82. If the resolver succeeds and returns a non-empty `workflow.on_complete`, execute that value as the final terminal instruction before exiting.
  83. If the resolver fails, returns no output, or resolves an empty value, skip the hook and exit normally.