diff --git a/src/modules/bmm/workflows/4-implementation/batch-super-dev/instructions.md b/src/modules/bmm/workflows/4-implementation/batch-super-dev/instructions.md index 2242d558..a14e5df8 100644 --- a/src/modules/bmm/workflows/4-implementation/batch-super-dev/instructions.md +++ b/src/modules/bmm/workflows/4-implementation/batch-super-dev/instructions.md @@ -44,8 +44,86 @@ This workflow helps you "mind the gap" between story requirements and codebase r The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml You MUST have already loaded and processed: {project-root}/_bmad/bmm/workflows/4-implementation/batch-super-dev/workflow.yaml +⚕️ HOSPITAL-GRADE CODE STANDARDS ⚕️ +This code may be used in healthcare settings where LIVES ARE AT STAKE. +Every line of code must meet hospital-grade reliability standards. +QUALITY >> SPEED. Take 5 hours to do it right, not 1 hour to do it poorly. + + + Present execution mode options to user + + +╔═══════════════════════════════════════════════════════════════════╗ +║ BATCH SUPER-DEV: Execution Mode Selection ║ +╚═══════════════════════════════════════════════════════════════════╝ + +⚕️ HOSPITAL-GRADE CODE STANDARDS ACTIVE ⚕️ +Lives are at stake. All code must meet safety-critical reliability standards. + +Choose execution mode: + +[I] INTERACTIVE CHECKPOINT MODE (Recommended for oversight) + - After each story completes, pause for your review + - You approve before proceeding to next story + - Allows course correction if issues detected + - Best for: Critical features, new team members, complex epics + +[A] FULLY AUTONOMOUS MODE (Maximum quality, zero interaction) + - Process all selected stories without pausing + - ENHANCED quality standards (even more rigorous than interactive) + - Hospital-grade code verification at every step + - NO shortcuts, NO skimping, NO corner-cutting + - Best for: Well-defined stories, experienced implementation + +⚠️ AUTONOMOUS MODE = HIGHER QUALITY, NOT LOWER +In autonomous mode, quality standards are ENHANCED because there's no +human oversight in the loop. Every decision is double-checked. + +QUALITY >> DURATION. We prioritize correctness over speed. + +Which mode? [I/A]: + + + Read user input + + + Set execution_mode = "interactive_checkpoint" + +✅ Interactive Checkpoint Mode Selected + +After each story implementation: +- Full quality report displayed +- You approve before next story begins +- Allows real-time oversight and intervention + + + + + Set execution_mode = "fully_autonomous" + +⚕️ Fully Autonomous Mode Selected - HOSPITAL-GRADE STANDARDS ENFORCED + +Quality enhancements for autonomous mode: +✅ Double validation at each step +✅ Comprehensive error checking +✅ Detailed audit trail generation +✅ Zero-tolerance for shortcuts +✅ Hospital-grade code verification + +Processing will continue until ALL selected stories complete. +NO human interaction required until completion. + +QUALITY OVER SPEED: Taking time to ensure correctness. + + Activate hospital_grade_mode = true + Set quality_multiplier = 1.5 + + + Store execution_mode for use in subsequent steps + + Read {sprint_status} file Parse metadata: project, project_key, tracking_system @@ -674,6 +752,64 @@ Enter number (2-10) or 'all': ✅ COMPLETED: {{story_key}} (reconciled) Increment completed counter + + + PAUSE FOR USER REVIEW + +╔═══════════════════════════════════════════════════════════════════╗ +║ INTERACTIVE CHECKPOINT: Story {{story_key}} Complete ║ +╚═══════════════════════════════════════════════════════════════════╝ + +✅ Story {{story_key}} successfully implemented and reconciled + +Quality Summary: +- All tests passing +- Type checks passing +- Linter passing +- Code review completed +- Sprint status updated + +Remaining stories: {{remaining}} + +Options: +[C] Continue to next story +[R] Review implementation details +[P] Pause batch (exit workflow) + +Your choice [C/R/P]: + + + Read user input + + + ✅ Continuing to next story... + + + + 📋 Implementation Details for {{story_key}} + Display story file, test results, review findings + +Press [C] to continue or [P] to pause: + + Read user input + + ✅ Continuing to next story... + + + ⏸️ Batch paused. Run batch-super-dev again to continue with remaining stories. + Jump to Step 5 (Summary) + + + + + ⏸️ Batch paused. Run batch-super-dev again to continue with remaining stories. + Jump to Step 5 (Summary) + + + + + ✅ {{story_key}} complete. Automatically continuing to next story (autonomous mode)... + diff --git a/src/modules/bmm/workflows/4-implementation/super-dev-pipeline/steps/step-04-implement.md b/src/modules/bmm/workflows/4-implementation/super-dev-pipeline/steps/step-04-implement.md index 912077f5..473c124a 100644 --- a/src/modules/bmm/workflows/4-implementation/super-dev-pipeline/steps/step-04-implement.md +++ b/src/modules/bmm/workflows/4-implementation/super-dev-pipeline/steps/step-04-implement.md @@ -1,19 +1,19 @@ --- -name: 'step-03-implement' -description: 'Adaptive implementation - TDD for greenfield, refactor for brownfield, no vibe coding' +name: 'step-04-implement' +description: 'HOSPITAL-GRADE implementation - safety-critical code with comprehensive testing' # Path Definitions workflow_path: '{project-root}/_bmad/bmm/workflows/4-implementation/super-dev-pipeline' # File References -thisStepFile: '{workflow_path}/steps/step-03-implement.md' -nextStepFile: '{workflow_path}/steps/step-04-post-validation.md' +thisStepFile: '{workflow_path}/steps/step-04-implement.md' +nextStepFile: '{workflow_path}/steps/step-05-post-validation.md' # Role Continue role: dev --- -# Step 3: Implement Story +# Step 4: Implement Story (Hospital-Grade Quality) ## ROLE CONTINUATION @@ -28,6 +28,46 @@ Implement all unchecked tasks using appropriate methodology: 2. **Brownfield**: Refactor approach (understand existing, modify carefully) 3. **Hybrid**: Mix both approaches as appropriate per task +## ⚕️ HOSPITAL-GRADE CODE STANDARDS ⚕️ + +**CRITICAL: Lives May Depend on This Code** + +This code may be used in healthcare/safety-critical environments. +Every line must meet hospital-grade reliability standards. + +### Safety-Critical Quality Requirements: + +✅ **CORRECTNESS OVER SPEED** + - Take 5 hours to do it right, not 1 hour to do it poorly + - Double-check ALL logic, especially edge cases + - ZERO tolerance for shortcuts or "good enough" + +✅ **DEFENSIVE PROGRAMMING** + - Validate ALL inputs (never trust external data) + - Handle ALL error cases explicitly + - Fail safely (graceful degradation, never silent failures) + +✅ **COMPREHENSIVE TESTING** + - Test happy path AND all edge cases + - Test error handling (what happens when things fail?) + - Test boundary conditions (min/max values, empty/null) + +✅ **CODE CLARITY** + - Prefer readability over cleverness + - Comment WHY, not what (code shows what, comments explain why) + - No magic numbers (use named constants) + +✅ **ROBUST ERROR HANDLING** + - Never swallow errors silently + - Log errors with context (what, when, why) + - Provide actionable error messages + +⚠️ **WHEN IN DOUBT: ASK, DON'T GUESS** + If you're uncertain about a requirement, HALT and ask for clarification. + Guessing in safety-critical code is UNACCEPTABLE. + +--- + ## MANDATORY EXECUTION RULES ### Implementation Principles