# Brownfield Level 4 - Enterprise Scale Changes to Existing System
# 40+ stories, major expansion of existing enterprise system

project_type: "software"
level: 4
field_type: "brownfield"
description: "Enterprise scale expansion of existing system"

phases:
  - prerequisite: true
    name: "Documentation"
    conditional: "if_undocumented"
    note: "NOT a phase - prerequisite for brownfield without docs OR post-completion cleanup. Critical for enterprise-scale changes"
    workflows:
      - id: "document-project"
        required: true
        agent: "analyst"
        command: "document-project"
        output: "Comprehensive project documentation"
        purpose: "Understand existing codebase before planning OR create superior final docs after Phase 4"

  - phase: 1
    name: "Analysis"
    required: true
    workflows:
      - id: "brainstorm-project"
        recommended: true
        agent: "analyst"
        command: "brainstorm-project"
      - id: "research"
        required: true
        agent: "analyst"
        command: "research"
        note: "Research existing system architecture deeply"
      - id: "product-brief"
        required: true
        agent: "analyst"
        command: "product-brief"
        note: "Strategic brief for major expansion"

  - phase: 2
    name: "Planning"
    required: true
    workflows:
      - id: "prd"
        required: true
        agent: "pm"
        command: "prd"
        output: "Comprehensive PRD considering existing system"
      - id: "validate-prd"
        optional: true
        agent: "pm"
        command: "validate-prd"
      - id: "create-design"
        required: true
        agent: "ux-designer"
        command: "create-design"
        note: "Multiple UI/UX specifications"

  - phase: 3
    name: "Solutioning"
    required: true
    workflows:
      - id: "create-architecture"
        required: true
        agent: "architect"
        command: "create-architecture"
        output: "Architecture for system expansion"
        note: "Must maintain backward compatibility"
      - id: "validate-architecture"
        optional: true
        agent: "architect"
        command: "validate-architecture"
      - id: "solutioning-gate-check"
        required: true
        agent: "architect"
        command: "solutioning-gate-check"
        note: "Critical validation before major changes"

  - phase: 4
    name: "Implementation"
    required: true
    workflows:
      - id: "sprint-planning"
        required: true
        agent: "sm"
        command: "sprint-planning"
        note: "Creates sprint plan with all stories - subsequent work tracked in sprint plan output, not workflow-status"
