Sync functional improvements developed in revive-dev into BMAD-METHOD
fork while preserving repo-specific paths:
- Add memory-safe Claude helpers (run_claude_to_file, read_phase_tail)
that pipe output to temp files instead of bash variables, preventing
GB-scale RAM usage during long epic executions
- Add kill_orphaned_test_processes() to clean up zombie jest/vitest/
playwright/pytest processes between stories and on exit
- Replace per-call `env -u CLAUDECODE` with global `unset CLAUDECODE`
at script start for cleaner nested session support
- Port metrics resume/accumulation logic that restores counters from
existing YAML on resumed runs and accumulates duration
- Add log truncation between stories (64KB cap) to prevent unbounded
log growth across multi-story runs
- Add log persistence and cleanup trap to epic-chain.sh
- Revert regression-gate.sh test commands to direct execution (matching
revive-dev pattern)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Wrap all Claude CLI subprocess calls with `env -u CLAUDECODE` to prevent
parent env var interference with child processes (17 sites across 7 files)
- Add `flush_log_to_repo()` to epic-execute.sh for incremental log persistence
after each story completes or fails (prevents log loss on interruption)
- Add portable `run_with_timeout` utility to utils.sh and wrap all test
invocations in epic-execute.sh and regression-gate.sh with configurable
timeout (default 120s via REGRESSION_TEST_TIMEOUT)
Co-Authored-By: Claude Opus 4.6 <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>