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} 📝 PUSH-ALL - Stage, commit, and push changes with comprehensive safety validation ⚡ PARALLEL AGENT MODE: When {{target_files}} is provided: - ONLY stage and commit the specified files - Do NOT use `git add .` or `git add -A` - Use `git add [specific files]` instead - This prevents committing work from other parallel agents 📋 ALL FILES MODE: When {{target_files}} is empty: - Stage ALL changes with `git add .` - Original behavior for single-agent execution 🔄 **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 â„šī¸ **No Changes to Commit** Working directory is clean. Nothing to push. HALT - No work to do 🔒 SAFETY CHECKS - Validate changes before committing 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 (not placeholders) Validate API keys are placeholders only: ✅ Acceptable placeholders: - API_KEY=your-api-key-here - SECRET=placeholder - TOKEN=xxx - API_KEY=${{YOUR_KEY}} - SECRET_KEY=<your-key> ❌ BLOCK real keys: - OPENAI_API_KEY=sk-proj-xxxxx (real OpenAI key) - AWS_SECRET_KEY=AKIA... (real AWS key) - STRIPE_API_KEY=sk_live_... (real Stripe key) - Any key with recognizable provider prefix + actual value **File Size Check:** Check for files >10MB without Git LFS configuration **Build Artifacts:** Check for unwanted directories/files that should be gitignored: - node_modules/, dist/, build/, .next/, __pycache__/, *.pyc, .venv/ - .DS_Store, Thumbs.db, *.swp, *.tmp, *.log (in root) - *.class, target/, bin/ (Java) - vendor/ (unless dependency managed) **Git State:** Verify: - .gitignore exists and properly configured - No unresolved merge conflicts - Git repository initialized 🚨 **DANGER: Secrets Detected!** The following sensitive data was found: {{list_detected_secrets_with_files}} ❌ **BLOCKED:** Cannot commit secrets to version control. **Actions Required:** 1. Move secrets to .env file (add to .gitignore) 2. Use environment variables: process.env.API_KEY 3. Remove secrets from tracked files: git rm --cached [file] 4. Update code to load from environment **Example:** ``` // Before (UNSAFE): const apiKey = 'sk-proj-xxxxx'; // After (SAFE): const apiKey = process.env.OPENAI_API_KEY; ``` Halting workflow for safety. HALT - Cannot proceed with secrets âš ī¸ **Warning: Large Files Detected** Files >10MB found: {{list_large_files_with_sizes}} **Recommendation:** Set up Git LFS ``` git lfs install git lfs track "*.{file_extension}" git add .gitattributes ``` Proceed with large files anyway? [y/n]: Halting. Please configure Git LFS first. HALT âš ī¸ **Warning: Build Artifacts Detected** These files should be in .gitignore: {{list_build_artifacts}} **Update .gitignore:** ``` node_modules/ dist/ build/ .DS_Store ``` Commit build artifacts anyway? [y/n]: Halting. Update .gitignore and git rm --cached [files] HALT âš ī¸ **Warning: Pushing to {{branch_name}}** You're committing directly to {{branch_name}}. **Recommendation:** Use feature branch workflow: 1. git checkout -b feature/my-changes 2. Make and commit changes 3. git push -u origin feature/my-changes 4. Create PR for review Push directly to {{branch_name}}? [y/n]: Halting. Create a feature branch instead. HALT ✅ **Safety Checks Passed** All validations completed successfully. 📊 **Changes Summary** **Files:** - Modified: {{modified_count}} - Added: {{added_count}} - Deleted: {{deleted_count}} - Untracked: {{untracked_count}} **Total:** {{total_file_count}} files **Changes:** - Insertions: +{{insertion_count}} lines - Deletions: -{{deletion_count}} lines **Safety:** {{if_all_safe}} ✅ No secrets detected ✅ No large files (or approved) ✅ No build artifacts (or approved) ✅ .gitignore configured {{endif}} {{if_warnings_approved}} âš ī¸ Warnings acknowledged and approved {{endif}} **Git:** - Branch: {{current_branch}} - Remote: origin/{{current_branch}} - Last commit: {{last_commit_message}} --- **I will execute:** 1. `git add .` - Stage all changes 2. `git commit -m "[generated message]"` - Create commit 3. `git push` - Push to remote **Proceed with commit and push?** Options: [yes] - Proceed with commit and push [no] - Cancel (leave changes unstaged) [review] - Show detailed diff first Execute: git diff --stat Execute: git diff | head -100 (show first 100 lines of changes) {{diff_output}} (Use 'git diff' to see full changes) After reviewing, proceed with commit and push? [yes/no]: ❌ **Push-All Cancelled** Changes remain unstaged. No git operations performed. You can: - Review changes: git status, git diff - Commit manually: git add [files] && git commit - Discard changes: git checkout -- [files] HALT - User cancelled 📎 **Targeted Commit Mode** (parallel agent safe) Staging only files from this story/task: {{target_files}} Execute: git add {{target_files}} Execute: git status ✅ **Targeted Files Staged** Ready for commit ({{target_file_count}} files): {{list_staged_files}} Note: Other uncommitted changes in repo are NOT included. Execute: git add . Execute: git status ✅ **All Changes Staged** Ready for commit: {{list_staged_files}} 📝 COMMIT MESSAGE - Generate conventional commit format Analyze changes to determine commit type: - feat: New features (new files with functionality) - fix: Bug fixes (fixing broken functionality) - docs: Documentation only (*.md, comments) - style: Formatting, missing semicolons (no code change) - refactor: Code restructuring (no feature/fix) - test: Adding/updating tests - chore: Tooling, configs, dependencies - perf: Performance improvements Determine scope (optional): - Component/feature name if changes focused on one area - Omit if changes span multiple areas Generate message summary (max 72 chars): - Use imperative mood: "add feature" not "added feature" - Lowercase except proper nouns - No period at end Generate message body (if changes >5 files): - List key changes as bullet points - Max 3-5 bullets - Keep concise Reference recent commits for style consistency 📝 **Generated Commit Message:** ``` {{generated_commit_message}} ``` Based on: - {{commit_type}} commit type - {{file_count}} files changed - {{change_summary}} **Use this commit message?** Options: [yes] - Use generated message [edit] - Let me write custom message [cancel] - Cancel push-all (leave staged) Enter your commit message (use conventional commit format if possible): Store user input as {{commit_message}} ✅ Using custom commit message ❌ Push-all cancelled Changes remain staged. Run: git reset to unstage HALT Use {{generated_commit_message}} as {{commit_message}} Execute git commit with heredoc for multi-line message safety: git commit -m "$(cat <<'EOF' {{commit_message}} EOF )" ❌ **Commit Failed** Error: {{commit_error}} **Common Causes:** - Pre-commit hooks failing (linting, tests) - Missing git config (user.name, user.email) - Locked files or permissions - Empty commit (no actual changes) **Fix and try again:** - Check pre-commit output - Set git config: git config user.name "Your Name" - Verify file permissions HALT - Fix errors before proceeding Parse commit output for hash ✅ **Commit Created** Commit: {{commit_hash}} Message: {{commit_subject}} 🚀 **Pushing to Remote** Pushing {{current_branch}} to origin... Execute: git push âš ī¸ **Push Rejected - Remote Has New Commits** Remote branch has commits you don't have locally. Attempting to rebase and retry... Execute: git pull --rebase ❌ **Merge Conflicts During Rebase** Conflicts found: {{list_conflicted_files}} **Manual resolution required:** 1. Resolve conflicts in listed files 2. git add [resolved files] 3. git rebase --continue 4. git push Halting for manual conflict resolution. HALT - Resolve conflicts manually Execute: git push â„šī¸ **No Upstream Branch Set** First push to origin for this branch. Setting upstream... Execute: git push -u origin {{current_branch}} ❌ **Push to Protected Branch Blocked** Branch {{current_branch}} is protected on remote. **Use PR workflow instead:** 1. Ensure you're on a feature branch 2. Push feature branch: git push -u origin feature-branch 3. Create PR for review Changes are committed locally but not pushed. HALT - Use PR workflow for protected branches ❌ **Authentication Failed** Git push requires authentication. **Fix authentication:** - GitHub: Set up SSH key or Personal Access Token - Check: git remote -v (verify remote URL) - Docs: https://docs.github.com/authentication Changes are committed locally but not pushed. HALT - Fix authentication ❌ **Push Failed** Error: {{push_error}} Your changes are committed locally but not pushed to remote. **Troubleshoot:** - Check network connection - Verify remote exists: git remote -v - Check permissions on remote repository - Try manual push: git push Halting for manual resolution. 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}}) --- Your changes are now on the remote repository. Execute: git log -1 --oneline --decorate **Latest commit:** {{git_log_output}} 🎉 **Push-All Complete, {user_name}!** **Summary:** - ✅ {{file_count}} files committed - ✅ Pushed to origin/{{current_branch}} - ✅ All safety checks passed **Commit Details:** - Hash: {{commit_hash}} - Message: {{commit_subject}} - Changes: +{{insertions}}, -{{deletions}} **Next Steps:** - Verify on remote (GitHub/GitLab/etc) - Create PR if working on feature branch - Notify team if appropriate **Git State:** - Working directory: clean - Branch: {{current_branch}} - In sync with remote