wit plan
Break down complex coding tasks into subtasks and execute them in parallel using specialized AI agents.
Overview
The plan command uses a multi-agent workflow to:
- Analyze your task and codebase
- Plan an execution strategy with parallel subtask groups
- Execute subtasks using specialized AI agents
- Review results and iterate if needed
This is ideal for large refactoring tasks, feature implementations, or any complex coding work that benefits from structured planning.
Usage
Options
How It Works
1. Planner Agent
Analyzes your task and creates an execution plan:
- Breaks the task into atomic subtasks
- Identifies dependencies between subtasks
- Groups independent subtasks for parallel execution
- Estimates effort and risk
2. Executor Agents
Run subtasks in parallel within each group:
- Read and understand relevant files
- Make code changes incrementally
- Follow existing code patterns
- Report results
3. Reviewer Agent
Validates completed work:
- Checks if tasks met acceptance criteria
- Identifies issues and inconsistencies
- Determines if re-planning is needed
Examples
Feature Implementation
Output:
Dry Run Preview
Output:
With Context
JSON Output
Returns structured JSON with:
- Plan details
- Execution results
- Files modified
- Commits created
Execution Plan Structure
The planner creates a structured execution plan:
Status Command
Check AI availability and workflow status:
Output:
Git Integration
By default, wit plan:
- Creates a feature branch (e.g.,
ai-planning/add-auth-lxk4m2n7)
- Executes subtasks
- Commits changes after each group
- Leaves you on the feature branch
Disable with --no-branch and --no-commit.
Environment Variables
Tips
Start with --dry-run to preview the plan before executing. This helps you understand what changes will be made.
Use --context to provide important constraints or preferences that should guide the implementation.
For large tasks, increase --max-parallel to speed up execution (if your API rate limits allow).
The plan command modifies files and creates commits. Always review the changes before pushing.