H1: Git Add -A Safety
- Add check_sensitive_files() to detect untracked secrets
- Replace git add -A with git add -u (tracked files only)
- Update prompts to use explicit file staging
H2: Cleanup on Exit
- Add cleanup() function with trap handler for EXIT/INT/TERM
- Save checkpoint file for resume capability
- Finalize metrics and report uncommitted changes on exit
- Track CURRENT_STORY_INDEX throughout main loop
H3: Test Count Parsing (Multi-Framework)
- Add extract_test_count() supporting Jest, Mocha, Vitest, AVA, TAP, pytest, Go, Rust
- Try JSON output first, fall back to regex patterns
- Replace inline patterns in init_regression_baseline() and execute_regression_gate()
H4: Story Discovery (Word Boundaries)
- Fix grep pattern with word boundary: ${EPIC_ID}([^0-9]|$)
- Prevents "Epic: 1" from matching "Epic: 10" or "Epic: 100"
- Add associative array deduplication (bash 4+) with fallback
H5: Prompt Size Limits
- Add MAX_PROMPT_SIZE config (default 150KB)
- Add get_byte_size(), truncate_content(), build_sized_prompt()
- Truncate large workflow YAML and decision logs
- Add verbose logging of prompt sizes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements the final two improvements from bmad_improvements_v2.md:
## Structured JSON Output (Improvement #6)
- New module: scripts/epic-execute-lib/json-output.sh
- Functions for extracting and parsing JSON from Claude output
- Unified check_phase_completion() with JSON + text fallback
- Updated prompts to request JSON result blocks
- Added --legacy-output flag to disable JSON parsing
## Test-First Flow (Improvement #7)
- New module: scripts/epic-execute-lib/tdd-flow.sh
- execute_test_spec_phase() - Generates BDD specs from acceptance criteria
- execute_test_impl_phase() - Creates failing tests from specs
- execute_test_verification_phase() - Verifies tests fail correctly
- Integration with dev phase for TDD context
- Added --skip-tdd, --skip-test-spec, --skip-test-impl flags
All 7 improvements from the analysis are now complete.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add decision log module for context preservation across phases
- Add regression gate module for test baseline tracking
- Add design phase module for pre-implementation planning
- Enhance fix phase to include real tooling output
- Pass design and decision context to dev phase
- Add --skip-design and --skip-regression CLI flags
- Modularize into epic-execute-lib/ for maintainability
Implements improvements from bmad_improvements_v2.md:
- Phase 2.1: Real test output in fix loops
- Phase 2.2: Cumulative decision log
- Phase 2.3: Regression test gate
- Phase 3.1: Pre-implementation design phase
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The script marks stories with lowercase "done" but was checking for
capitalized "Done", causing --skip-done to never match completed stories.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add architecture compliance check (per-story) with fix loop
- Add test quality review (per-story) with TEA patterns
- Add requirements traceability (per-epic) with self-healing test generation
- Add --skip-arch, --skip-test-quality, --skip-traceability flags
- Update workflow.md to v2.0 with new flow diagram
- Add step templates for each quality gate phase
- Include improvements doc and execution report
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace inline prompts with actual BMAD workflow files:
- dev-story workflow (workflow.yaml, instructions.xml, checklist.md)
- code-review workflow (workflow.yaml, instructions.xml, checklist.md)
- UAT generation templates (step-04-generate-uat.md, uat-template.md)
- Add workflow validation at startup to ensure all required files exist
- Implement self-healing fix loop for review failures:
- When review fails, capture HIGH/MEDIUM severity findings
- Spawn new fix phase using dev-story workflow in targeted fix mode
- Re-run review after fixes to verify resolution
- Retry up to 3 times before marking story as failed
- Enhanced metrics tracking:
- fix_loop.total_fix_attempts: count of all fix phases
- fix_loop.stories_requiring_fixes: stories needing at least one fix
- fix_loop.max_retries_hit: stories that failed after 3 attempts
- story_details: per-story fix attempt outcomes with timestamps
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add two new implementation workflows for the Scrum Master agent:
- epic-execute: Sequential story execution with isolated dev/review phases
- epic-chain: Multi-epic execution with dependency detection
Includes orchestration scripts and SM agent menu items.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>