Skip to content

feat: comprehensive enhancements combining all open PRs and fixes#1

Merged
ibro45 merged 1 commit into
mainfrom
feat/comprehensive-enhancements
Feb 2, 2026
Merged

feat: comprehensive enhancements combining all open PRs and fixes#1
ibro45 merged 1 commit into
mainfrom
feat/comprehensive-enhancements

Conversation

@ibro45
Copy link
Copy Markdown
Owner

@ibro45 ibro45 commented Feb 2, 2026

Summary

This PR combines and implements all open issues and PRs into a cohesive, production-ready solution. It addresses installation issues, adds major new features, and improves robustness.

Issues Resolved

  • #8, #11: Fixed installation issues (missing entry point, incorrect .gitignore)
  • #4: Added Windows support for justfile commands
  • #5, #6: Implemented per-workflow model configuration
  • #9: Fixed CLI argument order and added --verbose flag
  • #10: Tool is now properly installable (addresses OpenCode support)

Key Features

1. Fixed Installation & Build Issues

  • Created missing cmd/bmad-automate/main.go entry point
  • Fixed .gitignore pattern that was excluding the cmd directory
  • Windows users can now use just install and just build

2. Per-Workflow Model Configuration (PR #5, #6)

  • Configure Claude model per workflow in config/workflows.yaml:
    workflows:
      create-story:
        model: "opus"  # Complex reasoning
      dev-story:
        model: "sonnet"  # Fast implementation
  • Updated Executor interface to accept model parameter
  • Dry-run mode displays which model will be used for each step

3. Automatic Rate Limit Handling (PR #6)

  • New --auto-retry flag on run, queue, epic, and all-epics commands
  • Detects rate limit errors from Claude CLI stderr output
  • Parses reset time and waits intelligently before retrying
  • Up to 10 retry attempts with exponential backoff

4. All-Epics Command (PR #6)

  • New all-epics command processes all active epics in sequence
  • Automatically discovers epics from sprint-status.yaml
  • Excludes epics with status: done, deferred, optional
  • Supports both --dry-run and --auto-retry flags

5. CLI Robustness (PR #9)

  • Fixed CLI argument order: all flags now come before -p and prompt
  • Added --verbose flag required by Claude CLI for stream-json output
  • Added sync.WaitGroup synchronization for stderr handling
  • Used errors.As for proper error unwrapping (Go 1.13+)
  • Added context cancellation check in event processing loop

6. Windows Support (PR #4)

  • Added set windows-shell to use PowerShell on Windows
  • Added [unix] and [windows] recipe annotations for:
    • clean command
    • run command

7. Version Command

  • New version command displays current version (1.1.0) and release date

New Files

cmd/bmad-automate/main.go                    # CLI entry point
internal/cli/all_epics.go                    # All-epics command
internal/cli/retry.go                        # Auto-retry logic
internal/cli/version.go                      # Version command
internal/cli/version_test.go                 # Version tests
internal/ratelimit/detector.go               # Rate limit detection
internal/ratelimit/detector_state.go         # Thread-safe state
internal/ratelimit/detector_test.go          # Detector tests
internal/ratelimit/detector_state_test.go    # State tests

Modified Files

  • internal/claude/client.go - Updated Executor interface
  • internal/cli/*.go - Added new features and flags
  • internal/config/*.go - Added model configuration
  • internal/workflow/*.go - Model support
  • internal/router/lifecycle.go - Model field
  • internal/status/reader.go - GetAllEpics method
  • justfile - Windows support
  • .gitignore - Fixed exclusion pattern

Usage Examples

# Install
just install

# Version
bmad-automate version

# Single story with auto-retry
bmad-automate run 6-1-setup --auto-retry

# All stories in epic
bmad-automate epic 6 --auto-retry

# All active epics
bmad-automate all-epics --dry-run

# Queue with retry
bmad-automate queue 6-1 6-2 6-3 --auto-retry

Testing

  • All existing tests pass
  • Added comprehensive tests for new ratelimit package
  • Added tests for version command
  • 100% test coverage on new packages

Breaking Changes

None. All existing workflows remain fully compatible. The model parameter is optional and defaults to empty string (using Claude CLI's default model).

Benefits

  1. Unattended Execution: No manual intervention needed for rate limits
  2. Cost Optimization: Use expensive models only where needed
  3. Better Planning: Preview models and workflows before execution
  4. Full Automation: Process entire projects with a single command
  5. Cross-Platform: Works on macOS, Linux, and Windows

Documentation

All commands have updated help text. Example:

bmad-automate run --help
bmad-automate all-epics --help

🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com

This commit combines and implements all open issues and PRs into a cohesive,
production-ready solution:

Fixes:
- Fix #8, #11: Add missing cmd/bmad-automate/main.go entry point
- Fix #8, #11: Fix .gitignore to not exclude cmd/bmad-automate directory
- Fix #9: Reorder CLI arguments (--flags before -p prompt) and add --verbose
- Fix #9: Add sync.WaitGroup for stderr handling in ExecuteWithResult
- Fix #9: Use errors.As instead of type assertion for Go 1.13+ compatibility
- Fix #4: Add Windows support to justfile with PowerShell and platform-specific recipes

Features:
- Feat #5, #6: Add per-workflow model configuration (opus/sonnet/haiku)
- Feat #6: Add --auto-retry flag for rate limit handling (run/queue/epic/all-epics)
- Feat #6: Add all-epics command to process all active epics at once
- Feat #6: Add rate limit detection package with intelligent wait time parsing
- Feat: Add version command displaying current version and release date
- Feat: Enhanced dry-run mode showing which model will be used per workflow

New Files:
- cmd/bmad-automate/main.go - Entry point for the CLI
- internal/cli/all_epics.go - New command to process all epics
- internal/cli/retry.go - Auto-retry logic with rate limit handling
- internal/cli/version.go - Version command
- internal/cli/version_test.go - Tests for version command
- internal/ratelimit/detector.go - Rate limit error detection
- internal/ratelimit/detector_state.go - Thread-safe rate limit state
- internal/ratelimit/detector_test.go - Tests for detector
- internal/ratelimit/detector_state_test.go - Tests for state

Modified:
- internal/claude/client.go - Updated Executor interface with model parameter
- internal/cli/root.go - Added new commands and interfaces
- internal/cli/run.go - Added --auto-retry flag and model display in dry-run
- internal/cli/epic.go - Added --auto-retry flag and model display
- internal/cli/queue.go - Added --auto-retry flag and model display
- internal/config/types.go - Added Model field to WorkflowConfig
- internal/config/config.go - Added GetModel() method
- internal/workflow/workflow.go - Updated to pass model to executor
- internal/workflow/steps.go - Added Model field to Step
- internal/router/lifecycle.go - Added Model field to LifecycleStep
- internal/status/reader.go - Added GetAllEpics() method
- justfile - Added Windows support
- .gitignore - Fixed to not exclude cmd directory
- All test files updated for new interfaces

Co-Authored-By: Claude <noreply@anthropic.com>
@ibro45 ibro45 merged commit d774888 into main Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant