The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml You MUST have already loaded and processed: {installed_path}/workflow.yaml Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level} Generate all documents in {document_output_language} ๐Ÿš€ SUPER-DEV MODE: Enhanced quality workflow with post-implementation validation and automated code review This workflow ensures stories are TRULY complete through multi-stage validation before marking done โš™๏ธ EXECUTION FLOW: First execute ALL dev-story steps (1-8), then continue with super-dev enhancements (9.5-9.6) ๐ŸŽฏ EXECUTE DEV-STORY STEPS 1-8 FIRST Follow all instructions in: {project-root}/_bmad/bmm/workflows/4-implementation/dev-story/instructions.xml Complete Steps 1 through 8 exactly as specified in dev-story workflow After Step 8 completes (all tasks checked), return here and continue with Step 9.5 below โš™๏ธ Super-dev-story includes ALL standard dev-story steps (1-8): **Standard Development Flow:** - Step 1: Find and load story (sprint-status or user-provided path) - Step 1.5: โœ… PRE-DEV GAP ANALYSIS - Validate tasks against codebase - Step 2: Load project context and story information - Step 3: Detect review continuation (if resuming after code-review) - Step 4: Mark story in-progress in sprint-status - Step 5: Implement task following red-green-refactor cycle (TDD) - Step 6: Author comprehensive tests (unit, integration, e2e) - Step 7: Run validations and tests (regression suite) - Step 8: Validate and mark task complete (strict gates) After completing Steps 1-8, super-dev mode adds ADDITIONAL quality validation below. **For complete details of Steps 1-8, see:** {project-root}/_bmad/bmm/workflows/4-implementation/dev-story/instructions.xml ๐Ÿ” POST-DEV VALIDATION - Verify all work actually completed! This catches incomplete implementations that were prematurely marked done ๐Ÿ”Ž **Post-Development Gap Analysis** All tasks marked complete. Verifying against codebase reality... Re-read story requirements and acceptance criteria Extract all tasks and subtasks that are marked [x] complete For each completed task, identify what should exist in codebase Use Glob to find files that should have been created Use Grep to search for functions/classes that should exist Use Read to verify implementation completeness (not just existence) Run tests to verify claimed test coverage actually exists and passes Compare claimed work vs actual implementation: **POST-DEV VERIFICATION:** โœ… Verified Complete: - List tasks where code fully exists and works - Confirm tests exist and pass - Verify implementation matches requirements โŒ False Positives Detected: - List tasks marked [x] but code missing or incomplete - Identify claimed tests that don't exist or fail - Note partial implementations marked as complete โš ๏ธ Quality Issues: - Implementations that exist but don't meet requirements - Tests that exist but have poor coverage - Code that works but violates architecture patterns โš ๏ธ **Post-Dev Gaps Detected!** **False Positives (marked done but not complete):** {{list_false_positives_with_details}} **Quality Issues:** {{list_quality_issues_with_details}} **Proposed Actions:** {{list_tasks_to_add_for_missing_work}} --- These issues must be addressed before story can be marked complete. Uncheck false positive tasks in story file Add new tasks for missing work to Tasks/Subtasks section Add note to Dev Agent Record: "Post-dev gap analysis found incomplete work - continuing implementation" Update Gap Analysis section with post-dev findings Set {{fix_iteration_count}} = {{fix_iteration_count}} + 1 ๐Ÿ›‘ **Maximum Fix Iterations Reached** Attempted {{fix_iteration_count}} fix cycles. Manual intervention required. Issues remaining: {{list_remaining_issues}} Add to Dev Agent Record: "HALTED - exceeded max fix iterations, manual review needed" HALT - require user intervention ๐Ÿ”„ Adding missing work to task list and continuing implementation... Continue implementation with added tasks โœ… **Post-Dev Validation Passed** All tasks verified complete against codebase. Proceeding to code review... Update Gap Analysis section with post-dev verification results Continue to Step 9.6 ๐Ÿ‘€ AUTO CODE REVIEW - Independent quality validation Fresh perspective catches issues the dev agent might miss ๐Ÿ” **Running Automated Code Review** Analyzing implementation for issues... Extract File List from Dev Agent Record Identify all files created or modified during implementation Perform comprehensive code review checking: - **Correctness:** Logic errors, edge cases, error handling - **Architecture:** Compliance with patterns and standards - **Security:** Vulnerabilities, input validation, authentication - **Performance:** Inefficiencies, N+1 queries, memory leaks - **Testing:** Test coverage, edge cases, test quality - **Code Quality:** Readability, maintainability, documentation Categorize all findings by severity: - CRITICAL: Security vulnerabilities, data loss, broken functionality - HIGH: Logic errors, missing error handling, test gaps - MEDIUM: Code quality issues, minor bugs, performance concerns - LOW: Style issues, documentation improvements, minor refactoring ๐Ÿšจ **Code Review Found Issues Requiring Fixes** **Critical Issues ({{critical_count}}):** {{list_critical_issues}} **High Priority Issues ({{high_count}}):** {{list_high_issues}} {{if_medium_or_low_exist}} **Medium/Low Issues ({{med_low_count}}):** {{list_medium_low_issues}} {{endif}} --- **These issues must be fixed before story completion.** Add "Code Review Findings" section to story file Add review findings as new tasks in Tasks/Subtasks with [AI-Review] prefix Add to Dev Agent Record: "Code review found {{total_issue_count}} issues - continuing with fixes" Set {{fix_iteration_count}} = {{fix_iteration_count}} + 1 ๐Ÿ›‘ **Maximum Fix Iterations Reached** Code review found issues on iteration {{fix_iteration_count}}. Manual review recommended. Issues found: {{list_all_issues}} Add to Dev Agent Record: "HALTED - code review issues after max iterations, manual review needed" HALT - require user intervention ๐Ÿ”ง Adding review findings to task list and implementing fixes... Implement fixes โ„น๏ธ **Code Review Found Minor Issues** **Medium Issues ({{medium_count}}):** {{list_medium_issues}} **Low Priority Issues ({{low_count}}):** {{list_low_issues}} --- Auto-fix these minor issues? Options: [Y] Yes - Add to task list and fix now [n] No - Document in story but don't fix (can address later) [s] Skip - Ignore these findings Add review findings as tasks with [AI-Review] prefix Add to Dev Agent Record: "Addressing {{issue_count}} minor code review findings" ๐Ÿ”ง Implementing minor fixes... Implement fixes Add "Code Review Findings" section documenting issues Add to Dev Agent Record: "Code review found {{issue_count}} minor issues - documented for future work" โ„น๏ธ Issues documented in story. Proceeding to completion... Continue to Step 9 โš ๏ธ Skipping minor issues. Proceeding to completion... Continue to Step 9 โœ… **Code Review Passed** No issues found. Implementation meets quality standards. Add to Dev Agent Record: "Code review completed - no issues found" Continue to Step 9 ๐ŸŽฏ FINAL VALIDATION - All quality gates must pass! Verify ALL tasks and subtasks are marked [x] (re-scan the story document now) Run the full regression suite (do not skip) Confirm File List includes every changed file Execute enhanced definition-of-done validation Validate super-dev quality gates: - โœ… Pre-dev gap analysis completed and approved - โœ… All tasks/subtasks marked complete with [x] - โœ… Implementation satisfies every Acceptance Criterion - โœ… All tests pass (no regressions, new tests successful) - โœ… Post-dev gap analysis passed (no false positives) - โœ… Code review completed (critical/high issues resolved) - โœ… File List includes every new/modified/deleted file - โœ… Dev Agent Record contains implementation notes - โœ… Change Log includes summary of changes Update the story Status to: "review" Load the FULL file: {sprint_status} Find development_status key matching {{story_key}} Verify current status is "in-progress" (expected previous state) Update development_status[{{story_key}}] = "review" Save file, preserving ALL comments and structure including STATUS DEFINITIONS โœ… Story status updated to "review" in sprint-status.yaml โ„น๏ธ Story status updated to "review" in story file (no sprint tracking configured) HALT - Complete remaining tasks before marking ready for review HALT - Fix regression issues before completing HALT - Update File List with all changed files HALT - Run post-dev validation before completing HALT - Run code review before completing Prepare comprehensive summary in Dev Agent Record โ†’ Completion Notes ๐ŸŽ‰ **SUPER-DEV STORY COMPLETE, {user_name}!** **Story:** {{story_key}} - {{story_title}} **Status:** review (ready for human review) --- **Quality Gates Passed:** โœ… Pre-dev gap analysis - Tasks validated before work started โœ… Development - All tasks completed with TDD โœ… Post-dev gap analysis - Implementation verified complete โœ… Code review - {{total_issues_found}} issues found and resolved โœ… All tests passing - No regressions **Implementation Summary:** - Files changed: {{file_count}} - Tests added: {{test_count}} - Issues fixed: {{review_issues_fixed}} - Fix iterations: {{fix_iteration_count}}/{{max_fix_iterations}} **Story File:** {{story_file}} --- **What Super-Dev Validated:** 1. ๐Ÿ” Tasks matched codebase reality before starting 2. ๐Ÿ’ป Implementation completed per requirements 3. โœ… No false positive completions (all work verified) 4. ๐Ÿ‘€ Code quality and security validated 5. ๐Ÿงช Comprehensive test coverage achieved **Next Steps:** - Review the completed story - Verify business requirements met - Merge when approved **Note:** This story went through enhanced quality validation. It should require minimal human review. Based on {user_skill_level}, ask if user needs any explanations about: - What was implemented and how it works - Why certain technical decisions were made - Gap analysis or code review findings - Any patterns, libraries, or approaches used Provide clear, contextual explanations tailored to {user_skill_level} Use examples and references to specific code when helpful ๐Ÿ’ก **Tip:** This story was developed with super-dev-story for enhanced quality. For faster development (fewer validations), use standard `dev-story` workflow. For maximum quality and fewer review cycles, continue using `super-dev-story`. ๐Ÿ“ PUSH-ALL - Stage, commit, and push all changes with safety validation โš ๏ธ Use with caution - commits ALL changes in repository ๐Ÿ”„ **Analyzing Repository Changes** Scanning for changes to commit and push... Run git commands in parallel: - git status - Show modified/added/deleted/untracked files - git diff --stat - Show change statistics - git log -1 --oneline - Show recent commit for message style - git branch --show-current - Confirm current branch Parse git status output to identify: - Modified files - Added files - Deleted files - Untracked files - Total insertion/deletion counts ๐Ÿ”’ SAFETY VALIDATION - Check for secrets, large files, and unwanted artifacts Scan all changed files for dangerous patterns: **Secret Detection:** Check for files matching secret patterns: - .env*, *.key, *.pem, credentials.json, secrets.yaml - id_rsa, *.p12, *.pfx, *.cer - Any file containing: _API_KEY=, _SECRET=, _TOKEN= with real values Validate API keys are placeholders only: โœ… Acceptable: API_KEY=your-api-key-here, SECRET=placeholder, TOKEN=xxx, API_KEY=${'{YOUR_KEY}'} โŒ BLOCK: OPENAI_API_KEY=sk-proj-*, AWS_SECRET_KEY=AKIA*, STRIPE_API_KEY=sk_live_* **File Size Check:** Check for files >10MB without Git LFS **Build Artifacts:** Check for unwanted directories/files: - node_modules/, dist/, build/, __pycache__/, *.pyc, .venv/ - .DS_Store, thumbs.db, *.swp, *.tmp **Git State:** Verify: - .gitignore properly configured - No merge conflicts - Repository initialized ๐Ÿšจ **DANGER: Secrets Detected!** The following sensitive data was found: {{list_detected_secrets}} โŒ **BLOCKED:** Cannot commit secrets to version control. **Actions Required:** 1. Move secrets to .env file 2. Add .env to .gitignore 3. Use environment variables in code 4. Remove secrets from tracked files Halting push-all workflow. HALT - Cannot proceed with secrets in changeset โš ๏ธ **Warning: Large Files Detected** Files >10MB found: {{list_large_files}} **Recommendation:** Use Git LFS for large files Continue anyway? [y/n]: Proceed with large files? [y/n]: Halting push-all. Please set up Git LFS for large files. HALT โš ๏ธ **Warning: Build Artifacts Detected** Should not be committed: {{list_build_artifacts}} **These should be in .gitignore** Continue anyway? [y/n]: Proceed despite build artifacts? [y/n]: Halting push-all. Update .gitignore to exclude build artifacts. HALT โš ๏ธ **Warning: Pushing to {{branch_name}}** You're on the main/master branch. Consider: - Creating a feature branch - Opening a PR for review Continue pushing to {{branch_name}}? [y/n]: Push directly to {{branch_name}}? [y/n]: Halting push-all. Create a feature branch instead. HALT ๐Ÿ“Š **Changes Summary** **Files:** - Modified: {{modified_count}} - Added: {{added_count}} - Deleted: {{deleted_count}} - Untracked: {{untracked_count}} **Changes:** - Insertions: +{{insertion_count}} - Deletions: -{{deletion_count}} **Safety Checks:** {{if_all_safe}} โœ… No secrets detected โœ… No large files โœ… No build artifacts โœ… .gitignore configured {{endif}} {{if_warnings}} โš ๏ธ {{warning_list}} {{endif}} **Git:** - Branch: {{current_branch}} โ†’ origin/{{current_branch}} - Last commit: {{last_commit}} --- **I will execute:** 1. git add . 2. git commit -m "[generated message]" 3. git push **Proceed with commit and push?** Type 'yes' to proceed, 'no' to cancel, or 'review' to see detailed diff: Run: git diff --stat Show detailed file changes Still proceed with commit and push? [yes/no]: โŒ Push-all cancelled. Changes remain unstaged. You can commit manually when ready. HALT - User cancelled Execute: git add . Execute: git status โœ… All changes staged Analyze changes to determine commit type and scope: - feat: New feature implementation - fix: Bug fixes - docs: Documentation updates - refactor: Code restructuring - test: Test additions/updates - chore: Tooling, configs, dependencies Generate commit message in conventional commit format: Format: [type](optional scope): Brief summary (max 72 chars) - Key change 1 - Key change 2 - Key change 3 Base message on: - Story title and key - Files changed - Acceptance criteria met - Recent commit style ๐Ÿ“ **Generated Commit Message:** ``` {{generated_commit_message}} ``` Use this commit message? [yes/edit/cancel]: Enter your commit message: Use user-provided message as {{commit_message}} โŒ Push-all cancelled. Changes remain staged. Run: git reset to unstage HALT Set {{commit_message}} = {{generated_commit_message}} Execute git commit with message: git commit -m "$(cat <<'EOF' {{commit_message}} EOF )" โŒ Commit failed Error: {{commit_error}} Common issues: - Pre-commit hooks failing - Missing git config (user.name/email) - Locked files Fix the issue and try again. HALT - Fix errors before proceeding โœ… Commit created: {{commit_hash}} Execute: git push โš ๏ธ Push rejected - remote has changes Attempting: git pull --rebase && git push Execute: git pull --rebase Execute: git push โ„น๏ธ No upstream branch set Executing: git push -u origin {{current_branch}} Execute: git push -u origin {{current_branch}} โŒ Push failed Error: {{push_error}} Your changes are committed locally but not pushed. You can push manually later with: git push HALT - Manual push required โœ… **Successfully Pushed to Remote!** **Commit:** {{commit_hash}} - {{commit_subject}} **Branch:** {{current_branch}} โ†’ origin/{{current_branch}} **Files changed:** {{file_count}} (+{{insertions}}, -{{deletions}}) **Story work is now on remote and ready for team review.** Execute: git log -1 --oneline --decorate Final commit: {{git_log_output}}