# /brownfield-create-epic Task

When this command is used, execute the following task:

---
docOutputLocation: .vcsys/epics/epic-[auto-increment].yaml  
template: ".vcsys/templates/epic-tmpl.yaml"
---

# Brownfield Epic Creation Task

Create comprehensive epics for adding new capabilities to existing projects, with focus on integration, migration, and legacy considerations.

## Purpose

This task creates epics specifically for brownfield (existing project) enhancements that:

- Account for existing architecture and constraints
- Plan integration with legacy systems
- Minimize disruption to current operations
- Enable incremental delivery of new capabilities
- Address technical debt and modernization needs

## Brownfield Considerations

### System Analysis Requirements

**Existing System Assessment:**
- Current architecture and technology stack
- Existing data models and business logic
- Integration points and dependencies
- Performance characteristics and bottlenecks
- Security and compliance current state

**Legacy Constraints:**
- Technology limitations and compatibility
- Data migration requirements
- User workflow disruptions
- Rollback and recovery strategies
- Compliance and regulatory impacts

## Process

### Step 1: Brownfield Epic Type Classification

Present these numbered options for brownfield epic types:

1. **Enhancement Epic** - Adding new features to existing functionality
2. **Integration Epic** - Connecting existing systems with new capabilities  
3. **Modernization Epic** - Upgrading or refactoring existing components
4. **Migration Epic** - Moving from legacy systems to new approaches
5. **Performance Epic** - Optimizing existing system performance
6. **Security Epic** - Enhancing existing system security
7. **Data Epic** - Improving data handling, quality, or analytics
8. **User Experience Epic** - Modernizing existing user interfaces
9. **Compliance Epic** - Meeting new regulatory or business requirements

### Step 2: Legacy System Context Gathering

**System Documentation Review:**
- What existing documentation is available?
- What are the current system boundaries?
- Who are the current system stakeholders?
- What are the existing user workflows?

**Technical Landscape Analysis:**
- Current technology stack and versions
- Database schemas and data flows
- API endpoints and integration patterns
- Deployment and infrastructure setup
- Monitoring and operational procedures

**Business Context Assessment:**
- Current business processes supported
- Key performance metrics and SLAs
- User base characteristics and usage patterns
- Revenue or cost implications
- Competitive positioning factors

### Step 3: Epic Information Gathering

**Standard Epic Information:**
- Epic title and vision statement
- Business objectives and success metrics
- Target user types and beneficiaries
- Timeline and delivery expectations

**Brownfield-Specific Information:**

**Integration Requirements:**
- Which existing systems must integrate?
- What data needs to be shared or migrated?
- Are there API compatibility requirements?
- What are the performance implications?

**Migration Considerations:**
- Is this a replacement or enhancement?
- What data migration is required?
- How will user workflows change?
- What training or communication is needed?

**Risk Assessment:**
- What could break in existing systems?
- What are the rollback requirements?
- How will testing be conducted safely?
- What are the compliance implications?

### Step 4: Epic Structure Creation

#### A. Epic Header Section

```yaml
epic-id: "EPIC-[YYYY-MM-DD]-[###]"
title: "[Epic title focused on business outcome]"
type: "[Enhancement|Integration|Modernization|Migration|Performance|Security|Data|UX|Compliance]"
priority: "[Critical|High|Medium|Low]"
complexity: "[Simple|Moderate|Complex|Enterprise]"
status: "planning"

brownfield-context:
  existing-systems: ["system1", "system2"]
  integration-complexity: "[Low|Medium|High]"
  migration-required: "[Yes|No|Partial]"
  rollback-strategy: "[Blue-Green|Feature-Toggle|Database-Rollback|Full-Restore]"
  
agents:
  owner: "product-owner"
  editors: ["scrum-master", "architect", "developer"]
  readonly: ["qa"]
```

#### B. Vision and Objectives

```yaml
vision:
  problem-statement: "[What problem in existing system are we solving?]"
  solution-vision: "[How will the enhanced system work better?]"
  success-criteria: "[Measurable outcomes for success]"
  user-impact: "[How will users benefit from these changes?]"

business-objectives:
  primary-goals:
    - "[Specific business outcome 1]"
    - "[Specific business outcome 2]"
  success-metrics:
    - metric: "[Specific metric]"
      current-state: "[Current measurement]"
      target-state: "[Target measurement]"
  roi-expectations: "[Expected return on investment]"
```

#### C. Brownfield Analysis

```yaml
existing-system-analysis:
  current-architecture:
    components: ["component1", "component2"]
    technologies: ["tech1", "tech2"]
    data-stores: ["db1", "cache1"]
    integrations: ["system1", "api2"]
    
  current-limitations:
    - limitation: "[Specific limitation]"
      impact: "[Business/technical impact]"
      priority: "[High|Medium|Low]"
      
  integration-requirements:
    - system: "[Existing system name]"
      integration-type: "[API|Database|File|Message]"
      complexity: "[Simple|Complex]"
      risk-level: "[Low|Medium|High]"
      
  migration-scope:
    data-migration:
      required: "[Yes|No]"
      complexity: "[Simple|Moderate|Complex]"
      estimated-volume: "[Amount of data]"
      downtime-required: "[None|Minimal|Significant]"
    
    user-migration:
      workflow-changes: "[Minimal|Moderate|Significant]"
      training-required: "[Yes|No]"
      communication-strategy: "[How to inform users]"
```

#### D. Technical Strategy

```yaml
technical-approach:
  implementation-strategy: "[Incremental|Big-Bang|Parallel|Strangler-Fig]"
  
  modernization-approach:
    - component: "[System component]"
      strategy: "[Refactor|Replace|Enhance|Retire]"
      rationale: "[Why this approach]"
      
  risk-mitigation:
    - risk: "[Technical risk]"
      probability: "[High|Medium|Low]"
      impact: "[High|Medium|Low]"
      mitigation: "[Mitigation strategy]"
      
  rollback-plan:
    strategy: "[Rollback approach]"
    triggers: ["[Condition that triggers rollback]"]
    recovery-time: "[Estimated recovery time]"
    data-recovery: "[How to recover data changes]"
```

#### E. Delivery Planning

```yaml
delivery-strategy:
  phases:
    - phase: "Phase 1 - [Phase name]"
      objectives: ["[Objective 1]", "[Objective 2]"]
      deliverables: ["[Deliverable 1]", "[Deliverable 2]"]
      duration: "[Estimated duration]"
      success-criteria: ["[Criteria 1]", "[Criteria 2]"]
      
  dependencies:
    internal:
      - dependency: "[Internal dependency]"
        type: "[Technical|Business|Resource]"
        impact: "[What happens if delayed]"
        
    external:
      - dependency: "[External dependency]"
        stakeholder: "[Who controls this]"
        timeline: "[When needed]"
        risk: "[Risk if not available]"
        
  testing-strategy:
    environments:
      - environment: "[Test environment name]"
        purpose: "[What will be tested]"
        data-strategy: "[Test data approach]"
        
    testing-phases:
      - phase: "[Testing phase]"
        scope: "[What will be tested]"
        criteria: "[Pass/fail criteria]"
        rollback-trigger: "[What triggers rollback]"
```

#### F. Story Breakdown Guidance

```yaml
story-breakdown:
  suggested-themes:
    - theme: "[Story theme]"
      rationale: "[Why group stories this way]"
      stories-count: "[Estimated number of stories]"
      
  story-sizing-considerations:
    - consideration: "[Brownfield-specific sizing factor]"
      impact: "[How it affects story size]"
      
  integration-stories:
    - integration: "[System integration]"
      complexity-factors: ["[Factor 1]", "[Factor 2]"]
      testing-requirements: ["[Requirement 1]"]
      
  migration-stories:
    - migration-type: "[Type of migration]"
      story-approach: "[How to structure stories]"
      validation-needs: ["[Validation requirement]"]
```

### Step 5: Stakeholder and Impact Analysis

```yaml
stakeholder-analysis:
  technical-stakeholders:
    - role: "[Stakeholder role]"
      concerns: ["[Primary concern]"]
      involvement: "[How they participate]"
      success-definition: "[What success means to them]"
      
  business-stakeholders:
    - role: "[Business stakeholder role]"  
      impact: "[How this affects them]"
      communication-needs: "[What they need to know]"
      approval-authority: "[What they can approve]"
      
  end-users:
    - user-type: "[Type of end user]"
      current-workflow: "[How they work today]"
      workflow-changes: "[How workflow will change]"
      change-management: "[How to support transition]"

impact-assessment:
  system-availability:
    during-development: "[Impact during development]"
    during-deployment: "[Impact during deployment]"
    rollback-impact: "[Impact if rollback needed]"
    
  performance-impact:
    expected-improvement: "[Performance improvements expected]"
    potential-degradation: "[Areas that might be slower]"
    monitoring-strategy: "[How to monitor performance]"
    
  security-impact:
    new-vulnerabilities: ["[Potential new vulnerabilities]"]
    security-improvements: ["[Security enhancements]"]
    compliance-changes: ["[Compliance impact]"]
```

### Step 6: Success Metrics and Validation

```yaml
success-metrics:
  technical-metrics:
    - metric: "[Technical metric]"
      measurement-method: "[How to measure]"
      baseline: "[Current measurement]"
      target: "[Target measurement]"
      timeline: "[When to achieve]"
      
  business-metrics:
    - metric: "[Business metric]"
      measurement-method: "[How to measure]"  
      baseline: "[Current measurement]"
      target: "[Target measurement]"
      timeline: "[When to achieve]"
      
  user-experience-metrics:
    - metric: "[UX metric]"
      measurement-method: "[How to measure]"
      baseline: "[Current measurement]"
      target: "[Target measurement]"
      timeline: "[When to achieve]"

validation-approach:
  testing-phases:
    - phase: "[Testing phase name]"
      objectives: ["[Testing objective]"]
      success-criteria: ["[Pass criteria]"]
      failure-response: "[What to do if tests fail]"
      
  pilot-strategy:
    approach: "[Pilot approach - if applicable]"
    selection-criteria: "[How to choose pilot users]"
    success-metrics: ["[Pilot success criteria]"]
    rollout-plan: "[How to expand from pilot]"
```

## Quality Gates

Before brownfield epic completion:

- [ ] Existing system analysis completed and documented
- [ ] Integration requirements clearly defined
- [ ] Migration scope and strategy documented
- [ ] Risk assessment and mitigation plans created
- [ ] Rollback strategy defined and feasible
- [ ] Stakeholder impact analysis completed
- [ ] Success metrics and validation approach defined
- [ ] Story breakdown guidance provided
- [ ] Technical approach validated with architecture team
- [ ] Business case and ROI estimates documented

## Advanced Considerations

### Legacy Data Handling

**Data Quality Assessment:**
- Current data quality and cleanup needs
- Data validation and transformation requirements
- Data archival and retention considerations
- Backup and recovery implications

**Migration Strategies:**
- Big bang vs. phased migration approaches
- Data synchronization during transition
- Rollback data recovery procedures
- Testing with production-like data

### Integration Patterns

**API Integration:**
- Backward compatibility requirements
- API versioning strategy
- Rate limiting and throttling considerations
- Error handling and retry logic

**Database Integration:**
- Schema migration strategies
- Data consistency across systems
- Transaction boundary considerations
- Performance optimization needs

### Change Management

**User Communication:**
- Change announcement timeline
- Training and support materials
- Feedback collection mechanisms
- Success story sharing

**Operational Readiness:**
- Support team training requirements
- Monitoring and alerting updates
- Incident response procedure updates
- Documentation updates needed

## Integration with Other Tasks

**From Analysis:**
- Use system analysis results for epic planning
- Incorporate technical debt assessment
- Apply architecture review findings

**To Story Creation:**
- Provide story breakdown guidance
- Define integration story patterns
- Establish migration story templates

**To Development:**
- Provide technical constraints and guidelines
- Define testing and validation requirements
- Establish rollback and recovery procedures