This document outlines the intended workflow based on the custom mode definitions found in the /modes directory, incorporating an adaptive approach to manage complexity and context size.
While you can compile your own modes, you can also use the pre-compiled modes:
- For Roo in ./custom_modes.yaml
- For Windsurf in ./.windsurf
The primary workflow involves the interaction of three key modes: Project Manager, Architect, and Code, operating with adaptive context management.
-
Initiation (User -> Project Manager):
- The user interacts with the
Project Managermode to define high-level project goals, scope, constraints, and desired outcomes. - The Project Manager focuses on understanding the big picture.
- The user interacts with the
-
Delegation to Planning (Project Manager -> Architect):
- The
Project Managerdelegates the detailed planning phase to theArchitectmode.
- The
-
Adaptive Planning & User Collaboration (Architect <-> User):
- The
Architectgathers context and assesses task complexity. - Lite-Touch (Default): For simple tasks, the Architect creates a single, concise
plan.mdand may execute simple steps directly. - Heavy-Touch (If Needed): For complex tasks, the Architect performs deeper research (using MCP), evaluates options, iterates with the user (Strawgate), and produces a full set of plans:
plan.md, individualplan-X.mdfor workers, andplan-verify.md. It also defines worker requirements. - Context Monitoring: The Architect monitors context size during planning.
- The
-
Plan Review & Implementation Kick-off (Project Manager -> Code Agents):
- The
Project Managerreviews the plan(s). - For heavy-touch plans, the PM assigns tasks to
Codeagents using theirplan-X.mdfiles and specifies logging requirements.
- The
-
Task Execution (Code Agents):
- Assigned
Codeagents execute steps from theirplan-X.md. - They use tools (like MCP) as needed and log progress (excluding raw code) to their work log.
- Context Monitoring: Code agents monitor context size during execution.
- Assigned
-
Adaptive Context Handoff (Architect/Code -> User/PM -> New Agent):
- Trigger: If the Architect (during planning) or a Code agent (during execution) approaches a context size threshold (e.g., ~50k tokens), they propose a handoff to the user.
- Handoff File Creation: If approved, the current agent creates a
/plans/<plan_name>/handoff-<timestamp>.mdfile containing: link to the main plan, status summary, remaining tasks, critical context, and the next step. - Notification: The agent notifies the user/PM that the handoff file is ready.
- New Instance Launch: The
Project Managerreceives the handoff notification (directly or via the user), identifies the next required agent, and initiates a new task for that agent. - Context Transfer: The PM instructs the new agent to use the specified
handoff-<timestamp>.mdfile as its primary starting context, along with the original plan files.
-
Verification & Completion (Project Manager -> Verification Agent -> User):
- Once work (potentially across multiple agent instances) is complete, the
Project Managerassigns an agent to perform verification usingplan-verify.md. - After successful verification, the
Project Manageroversees the final handoff to the user (Strawgate).
- Once work (potentially across multiple agent instances) is complete, the
This adaptive workflow aims to optimize token usage by defaulting to simpler processes and segmenting tasks via file-based handoffs when context limits are approached, while still leveraging the specialized roles of each mode.
uv sync
uv run compile_modes.pyThis will compile the modes into the following files:
- ./custom_modes.yaml
- ./.windsurf/rules/roo-modes
You can then use these files in your Roo or Windsurf instances.