A Go-based multi-agent orchestration system that automates feature development through a structured, human-in-the-loop workflow. Foreman combines AI coding agents (Claude Code, OpenAI Codex) with specification-driven development, code review automation, and real-time human feedback through Telegram.
Foreman manages the entire feature lifecycle from specification to implementation and deployment:
- Specification - Generate feature specs with SpecKit
- Planning - Create implementation plans with AI assistance
- Tasking - Break down plans into actionable tasks
- Implementation - Execute tasks using AI coding agents
- Review - Automated code review with linters, tests, and AI
- Approval - Human oversight at each critical phase
- Multi-Agent Support - Use Claude Code or OpenAI Codex for implementation
- Specification-Driven Development - Structured specs, plans, and tasks via SpecKit
- Human-in-the-Loop - Telegram integration for approvals and feedback
- Parallel Task Execution - Git worktrees enable safe concurrent development
- Automated Code Review - CodeRabbit, linters, tests, and LLM synthesis
- Persistence - Optional JSON storage for feature state across restarts
- Graceful Shutdown - Clean handling of interrupts and cancellation
- Go 1.21+ - Required to build Foreman
- Claude Code CLI - Primary AI coding agent (
claudecommand) - SpecKit CLI - Specification management (
specifycommand) - Telegram Bot - For human interaction and approvals
- Git - Version control for your project repository
Optional tools:
- CodeRabbit CLI - AI-powered code review
- Linters - eslint, golangci-lint, ruff, flake8, pylint (as needed)
- OpenAI Codex CLI - Alternative coding agent
- Clone the repository:
git clone https://github.com/bayological/foreman.git
cd foreman- Build the application:
go build -o foreman .- Create your configuration file:
cp configs/foreman.yaml.example configs/foreman.yamlEdit configs/foreman.yaml to customize Foreman for your project:
# Repository configuration
repo:
path: /path/to/your/project
remote: origin
main_branch: main
# Telegram bot configuration
telegram:
token: ${TELEGRAM_BOT_TOKEN}
chat_id: ${TELEGRAM_CHAT_ID}
# Agent configuration
agents:
claude-code:
enabled: true
timeout: 30m
priority: 1
codex:
enabled: false
timeout: 30m
priority: 2
# Code review configuration
review:
tools:
coderabbit: false
linters:
- eslint
test_command: "npm test"
use_llm: true
max_retries: 2
# Concurrency settings
concurrency:
max_tasks: 3
task_timeout: 30m
# Storage for feature persistence (optional)
storage:
path: ""
# Defaults
default_agent: claude-code
default_tech_stack: ""- Create a Telegram bot via @BotFather
- Get your bot token from BotFather
- Get your chat ID (send a message to the bot and check the API)
- Set environment variables:
export TELEGRAM_BOT_TOKEN="your-bot-token"
export TELEGRAM_CHAT_ID="your-chat-id"Start Foreman with the default config:
./foremanOr specify a custom config path:
./foreman -config /path/to/config.yaml| Command | Description |
|---|---|
/newfeature <name> | <description> |
Start a new feature development |
/features |
List all active features |
/feature <id> |
View details of a specific feature |
/techstack <stack> |
Set the tech stack for the current feature |
/answer <text> |
Answer clarifying questions from SpecKit |
/constitution |
View the system's operating principles |
/assign <agent> |
Manually assign an agent to a task |
/cancel |
Cancel the current task |
-
Create Feature: Send
/newfeature Add user authentication | Implement JWT-based login and registration -
Approve Specification: Review the generated spec and tap "Approve" or "Request Changes"
-
Answer Questions: If SpecKit needs clarification, answer with
/answer <your response> -
Approve Plan: Review the implementation plan and approve
-
Approve Tasks: Review the task breakdown and approve
-
Monitor Progress: Watch as agents implement tasks with automatic code review
-
Approve Code: Review and approve completed task implementations
-
Complete: Feature is merged to main when all tasks are approved
- Tasks marked with
[P]execute in parallel using separate Git worktrees - Sequential tasks queue and execute one at a time
- Failed tasks retry automatically (configurable max retries)
- Blocking issues escalate for human intervention
foreman/
├── main.go # Application entry point
├── configs/ # Configuration files
│ └── foreman.yaml.example
└── internal/
├── foreman/ # Core orchestration
│ ├── foreman.go # Main orchestrator
│ ├── workflow.go # Phase state machine
│ ├── feature.go # Feature management
│ ├── task.go # Task representation
│ ├── handlers.go # Telegram handlers
│ └── config.go # Configuration
├── agents/ # AI coding agents
│ ├── agent.go # Agent interface
│ ├── claude.go # Claude Code integration
│ ├── codex.go # OpenAI Codex integration
│ └── reviewer.go # Review orchestration
├── telegram/ # Telegram bot
│ ├── bot.go # Bot wrapper
│ └── notifications.go
├── speckit/ # SpecKit integration
│ ├── speckit.go # CLI wrapper
│ └── parser.go # Spec/plan/task parsing
├── git/ # Git operations
│ ├── repo.go # Repository wrapper
│ └── worktree.go # Worktree management
├── storage/ # Feature persistence
│ └── storage.go # JSON file storage
└── tools/ # Review tools
├── coderabbit.go # CodeRabbit integration
├── linter.go # Multi-linter support
└── runner.go # Command runner
| Phase | Description | Approval Required |
|---|---|---|
| Specifying | Generating feature specification | No |
| AwaitingSpecApproval | Waiting for spec approval | Yes |
| Clarifying | Answering questions | Yes |
| Planning | Creating implementation plan | No |
| AwaitingPlanApproval | Waiting for plan approval | Yes |
| Tasking | Breaking into tasks | No |
| AwaitingTaskApproval | Waiting for task approval | Yes |
| Implementing | Executing tasks | No |
| Reviewing | Running code review | No |
| AwaitingCodeApproval | Waiting for code approval | Yes |
| Complete | Feature finished | No |
github.com/go-telegram-bot-api/telegram-bot-api/v5- Telegram Bot APIgithub.com/google/uuid- UUID generationgopkg.in/yaml.v3- YAML configuration
claude- Claude Code CLIspecify- SpecKit CLIcodex- OpenAI Codex CLI (optional)coderabbit- CodeRabbit CLI (optional)- Linters as configured
See LICENSE for details.