diff --git a/src/modules/bmgd/workflows/4-production/super-dev-story/instructions.xml b/src/modules/bmgd/workflows/4-production/super-dev-story/instructions.xml index 8c82eb7b..bef92e3b 100644 --- a/src/modules/bmgd/workflows/4-production/super-dev-story/instructions.xml +++ b/src/modules/bmgd/workflows/4-production/super-dev-story/instructions.xml @@ -17,19 +17,27 @@ 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): - - Step 1: Find and load story - - Step 1.5: Pre-dev gap analysis and task refinement - - Step 2: Load project context - - Step 3: Detect review continuation - - Step 4: Mark story in-progress - - Step 5: Implement task (red-green-refactor) - - Step 6: Author comprehensive tests - - Step 7: Run validations and tests - - Step 8: Validate and mark task complete - See dev-story/instructions.xml for complete details of these steps. + **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/bmgd/workflows/4-production/dev-story/instructions.xml + + + + @@ -359,4 +367,324 @@ + + 📝 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}} + + + + diff --git a/src/modules/bmm/workflows/4-implementation/super-dev-story/instructions.xml b/src/modules/bmm/workflows/4-implementation/super-dev-story/instructions.xml index c0878d5f..4d5644c9 100644 --- a/src/modules/bmm/workflows/4-implementation/super-dev-story/instructions.xml +++ b/src/modules/bmm/workflows/4-implementation/super-dev-story/instructions.xml @@ -367,4 +367,324 @@ + + 📝 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}} + + + +