Skip to content

Artifact: plan.yaml

Related source files: src/agentmux/workflow/handoff_contracts.py, src/agentmux/workflow/handlers/planning.py, src/agentmux/integrations/mcp_server.py

plan.yaml is the canonical execution plan produced by the planner agent and submitted via the submit_plan MCP tool. It must use schema version 2. The orchestrator materializes all derived artifacts (plan_<N>.md, tasks_<N>.md, execution_plan.yaml, plan.md) from this single file.

Location: 04_planning/plan.yaml

Top-level fields

FieldTypeRequiredDescription
versionintyesMust be 2.
plan_overviewstringyesHuman-readable summary of the plan. Becomes the content of plan.md.
needs_designboolyesWhether a design phase is required before implementation. Controls planning → designing vs planning → implementing transition.
needs_docsboolyesWhether documentation updates are in scope. Informational only — does not affect transitions.
doc_filesstring[]yesPlanned documentation files to create or update. May be empty ([]).
groupslist[dict]yesExecution groups defining the scheduling order. See groups fields. Must have at least one group.
subplanslist[dict]yesSub-plans for the coder agents. See subplans fields. Must have at least one sub-plan.

Note: The review_strategy field has been removed. The architect nominates reviewers through submit_architecture(reviewers=[...]) during the architecting phase.

groups fields

Each entry in groups defines an execution group:

FieldTypeRequiredDescription
group_idstringyesUnique identifier for this group (e.g. "core-setup", "api-layer"). Must be unique across all groups.
modestringyesExecution mode: "serial" (one sub-plan at a time in order) or "parallel" (all sub-plans simultaneously).
planslist[dict]yesSub-plan references in this group. Each entry: {index: int, name: string}. Must reference valid subplan indices. Non-empty.

subplans fields

Each entry in subplans defines a sub-plan delivered to a coder agent:

FieldTypeRequiredDescription
indexintyes1-based unique integer. Must be contiguous from 1 to N. Referenced by groups[].plans[].index.
titlestringyesShort descriptive title shown in the monitor and plan summary.
scopestringyesWhat this sub-plan covers (which part of the system).
owned_filesstring[]yesFiles this sub-plan is responsible for creating or modifying. Non-empty.
dependenciesstringyesDescription of what must exist before this sub-plan runs (or "None").
implementation_approachstringyesStep-by-step description of how to implement this sub-plan.
acceptance_criteriastringyesConditions that must be met for this sub-plan to be considered done.
tasksstring[]yesOrdered checklist of implementation tasks. Non-empty.
isolation_rationalestringnoOptional note on why this sub-plan is isolated / why it can be parallelized.

Validation rules

  • version must be exactly 2.
  • All subplan index values must be unique and contiguous from 1 to the count of subplans.
  • All group group_id values must be unique.
  • Every subplan index must be referenced by exactly one group entry.
  • Every group plan reference must have a matching subplan.
  • groups[].mode must be "serial" or "parallel".

Example

yaml
version: 2
plan_overview: |
  Add JWT authentication to the API. Covers token generation, validation
  middleware, and protected route guards.
needs_design: false
needs_docs: true
doc_files: [docs/auth.md]
groups:
  - group_id: auth-core
    mode: serial
    plans:
      - index: 1
        name: JWT token service
      - index: 2
        name: Auth middleware
subplans:
  - index: 1
    title: JWT token service
    scope: Token generation and validation logic
    owned_files: [src/auth/tokens.py, tests/test_tokens.py]
    dependencies: None
    implementation_approach: |
      Implement generate_token() and validate_token() using PyJWT.
      Store secret in config. Add expiry handling.
    acceptance_criteria: Unit tests pass for generate and validate.
    tasks:
      - Create src/auth/tokens.py with generate_token and validate_token
      - Write tests/test_tokens.py with happy-path and expiry tests
  - index: 2
    title: Auth middleware
    scope: Request authentication middleware for FastAPI
    owned_files: [src/auth/middleware.py, src/main.py]
    dependencies: JWT token service (index 1)
    implementation_approach: |
      Create FastAPI dependency that extracts Bearer token from
      Authorization header and calls validate_token().
    acceptance_criteria: Protected routes return 401 on missing/invalid token.
    tasks:
      - Create src/auth/middleware.py with get_current_user dependency
      - Wire middleware into src/main.py for protected routes

Derived artifacts

The orchestrator materializes these files from plan.yaml:

ArtifactDescription
plan.mdHuman-readable plan summary from plan_overview
plan_<N>.mdPer-sub-plan implementation prompt for coder N
tasks_<N>.mdPer-sub-plan task checklist for coder N
execution_plan.yamlScheduling metadata consumed by the implementation phase

Released under the MIT License.