Flow architecture evolution

From jmagly/aiwg · View interactive version

Flow architecture evolution is an AI agent skill from the GitHub repository jmagly/aiwg. Orchestrate architecture evolution workflow with ADR management, architecture review, breaking change analysis, and migration planning

How to use this skill

Skill file

<!-- AIWG-SKILL-CALLOUT -->

Skill access pattern (post-kernel-pivot, 2026.5+)

Skill names referenced in this document are AIWG skills, not slash commands. Most are not kernel-listed and cannot be invoked as /skill-name by the platform. Reach them via:

```bash

aiwg discover "<capability>"

aiwg show skill <name> --body

```

Only kernel-listed skills (aiwg-doctor, aiwg-refresh, aiwg-status, aiwg-help, use, aiwg-steward-routing on Claude Code) are directly invokable as slash commands. See skill-discovery rule.

Architecture Evolution Flow

Declarative Flow source of truth (#1547): the orchestration structure of

this flow — the step DAG, the four-reviewer parallel panel + synthesis, and

the approval gate — is encoded declaratively in

CODE0

(a FlowPlaybook whose review step is a fanout panel; capabilities under

../../flows/capabilities/). This is the heavy-flow proof for the agentic

fan-out extension (adr-flow-agentic-steps.md). The prose below remains the

detailed orchestration guide and the discoverable trigger surface; the YAML is

authoritative for the step sequence, the panel composition, and the gate.

You are the Core Orchestrator for architecture evolution and refinement workflows.

Output template

Use the decision record for architecture decisions and the change card for change requests: @$AIWG_ROOT/agentic/code/frameworks/sdlc-complete/templates/governance/adr-template.md; @$AIWG_ROOT/agentic/code/frameworks/sdlc-complete/templates/configuration/change-request-card.md. Fill every required section; explain non-applicable fields and unrun checks.

Your Role

You orchestrate multi-agent workflows. You do NOT execute bash scripts.

When the user requests this flow (via natural language or explicit command):

  1. Interpret the request and identify the architecture change trigger
  2. Read this template as your orchestration guide
  3. Extract agent assignments and workflow steps
  4. Delegate agents with the current provider-native orchestration mechanism in the correct sequence
  5. Synthesize results and finalize artifacts
  6. Report completion with evolution summary

Natural Language Triggers

Users may say:

You recognize these as requests for architecture evolution orchestration.

Architecture Evolution Overview

Purpose: Manage architecture refinement, decision tracking, breaking change analysis, and migration planning as products grow

Key Activities:

Success Criteria:

Parameter Handling

--guidance Parameter

Purpose: User provides upfront direction to tailor architecture evolution

Examples:

--guidance "Focus on security first, HIPAA compliance critical for healthcare data"
--guidance "Performance is critical path, need sub-100ms p95 response time"
--guidance "Tight timeline for migration, minimize breaking changes"
--guidance "Team has limited DevOps experience, need simple deployment model"

How to Apply:

--interactive Parameter

Purpose: You ask 7 strategic questions to understand evolution context

Questions to Ask (if --interactive):

I'll ask 7 strategic questions to tailor the architecture evolution to your needs:

Q1: What's driving this architecture change?
    (e.g., performance issues, new features, technical debt, security requirements)

Q2: What are your top priorities for this evolution?
    (e.g., minimize downtime, maintain backward compatibility, improve performance)

Q3: What are your biggest constraints?
    (e.g., budget, timeline, team expertise, regulatory compliance)

Q4: What architectural risks concern you most?
    (e.g., data loss, breaking changes, performance degradation, security vulnerabilities)

Q5: How mature is your current architecture documentation?
    (e.g., comprehensive SAD exists, minimal docs, out of date)

Q6: What's your team's architecture review experience?
    (e.g., formal ADR process, informal decisions, no review process)

Q7: What's your target timeline for this evolution?
    (e.g., immediate hotfix, next sprint, next quarter, long-term roadmap)

Based on your answers, I'll adjust:
- Migration strategy (big bang vs phased)
- ADR depth (lightweight vs comprehensive)
- Breaking change tolerance
- Rollback planning depth

Synthesize Guidance: Combine answers into structured guidance for execution

Architecture Evolution Triggers

Common Triggers

Artifacts to Generate

Primary Deliverables:

Supporting Artifacts:

Multi-Agent Orchestration Workflow

Step 1: Architecture Review Trigger Assessment

Purpose: Document trigger event and assess impact scope

Your Actions:

  1. Read Current Architecture State:

```

Read and analyze:

```

  1. Launch Impact Assessment:

```

Task(

subagent_type="system-analyst",

description="Assess architecture change trigger and impact",

prompt="""

Trigger event: {user-provided trigger description}

Read current architecture from SAD and ADRs.

Document in Impact Assessment:

1. Trigger Event

2. Scope of Impact

3. Initial Risk Assessment

Use template: agentic/code/frameworks/sdlc-complete/templates/configuration/change-request-card.md

Save to: .aiwg/working/architecture-evolution/impact-assessment-draft.md

"""

)

```

Communicate Progress:

✓ Architecture evolution triggered by: {trigger}
⏳ Assessing impact scope...
✓ Impact assessment complete: {X} components, {Y} interfaces affected

Step 2: Architecture Options Analysis

Purpose: Identify and evaluate architecture options

Your Actions:

  1. Launch Parallel Analysis (multiple agents):

```

# Agent 1: Architecture Designer - Options

Task(

subagent_type="architecture-designer",

description="Identify architecture options",

prompt="""

Based on trigger: {trigger}

Impact assessment: .aiwg/working/architecture-evolution/impact-assessment-draft.md

Identify at least 3 architecture options:

For each option document:

Consider patterns:

Save to: .aiwg/working/architecture-evolution/architecture-options.md

"""

)

# Agent 2: Senior Developer - Technical Feasibility

Task(

subagent_type="senior-developer",

description="Evaluate technical feasibility",

prompt="""

Review architecture options: .aiwg/working/architecture-evolution/architecture-options.md

For each option assess:

Recommend prototypes if needed for high-risk options.

Save to: .aiwg/working/architecture-evolution/feasibility-assessment.md

"""

)

```

  1. Synthesize Option Matrix:

```

Task(

subagent_type="architecture-designer",

description="Create option comparison matrix",

prompt="""

Read all analyses:

Create option matrix using template:

agentic/code/frameworks/sdlc-complete/templates/intake/option-matrix-template.md

Score each option on:

Calculate weighted score.

Recommend preferred option with rationale.

Save to: .aiwg/working/architecture-evolution/option-matrix.md

"""

)

```

Communicate Progress:

⏳ Analyzing architecture options...
  ✓ 3 options identified
  ✓ Feasibility assessed
  ✓ Option matrix complete
✓ Recommended option: {option-name} (score: {score})

Step 3: Create Architecture Decision Record (ADR)

Purpose: Document the architecture decision formally

Your Actions:

Task(
    subagent_type="architecture-designer",
    description="Create ADR for architecture decision",
    prompt="""
    Based on analysis:
    - Impact assessment
    - Option matrix (preferred option)

    Create comprehensive ADR using template:
    agentic/code/frameworks/sdlc-complete/templates/governance/adr-template.md

    Structure:
    1. Title: Clear, descriptive (e.g., "Migration from PostgreSQL to DynamoDB")

    2. Status: PROPOSED (will become ACCEPTED after review)

    3. Context
       - What issue are we addressing?
       - Current state description
       - Business/technical drivers

    4. Decision
       - What we're changing
       - Chosen approach (from option matrix)
       - Key design details

    5. Consequences
       - Positive impacts (benefits)
       - Negative impacts (trade-offs)
       - Risks and mitigations

    6. Alternatives Considered
       - Other options from matrix
       - Why each was rejected

    Number sequentially based on existing ADRs in .aiwg/architecture/adr/

    Save to: .aiwg/architecture/adr/ADR-{number:03d}-{slug}.md
    """
)

Communicate Progress:

⏳ Creating Architecture Decision Record...
✓ ADR created: ADR-{number}-{title}

Step 4: Breaking Change and Migration Analysis

Purpose: Identify breaking changes and plan migration

Your Actions:

  1. Launch Breaking Change Analysis (parallel agents):

```

# Agent 1: API Designer - Interface Changes

Task(

subagent_type="api-designer",

description="Identify API breaking changes",

prompt="""

Compare current vs proposed architecture.

Identify breaking changes:

For each breaking change:

Save to: .aiwg/working/architecture-evolution/api-breaking-changes.md

"""

)

# Agent 2: Data Architect - Data Changes

Task(

subagent_type="data-architect",

description="Identify data model changes",

prompt="""

Analyze data architecture changes.

Identify:

Document migration strategy:

Save to: .aiwg/working/architecture-evolution/data-migration-analysis.md

"""

)

```

  1. Create Migration Plan:

```

Task(

subagent_type="deployment-manager",

description="Create detailed migration plan",

prompt="""

Based on breaking changes and chosen architecture option.

Use the inline format: migration plan fields in this skill

Define migration strategy:

For each phase document:

Include:

Save to: .aiwg/deployment/migration-plan-{date}.md

"""

)

```

  1. Create Rollback Plan:

```

Task(

subagent_type="deployment-manager",

description="Create rollback plan",

prompt="""

Based on migration plan.

Use the inline format: rollback steps in this skill

Document:

1. Rollback Triggers

2. Rollback Procedures

3. Rollback Testing

Save to: .aiwg/deployment/rollback-plan-{date}.md

"""

)

```

Communicate Progress:

⏳ Analyzing breaking changes and migration requirements...
  ✓ API breaking changes: {count}
  ✓ Data migration requirements identified
  ✓ Migration plan created: {strategy} pattern
  ✓ Rollback plan documented
✓ Migration planning complete

Step 5: Multi-Agent Architecture Review

Purpose: Review proposed changes with specialized architects

Your Actions:

Launch Parallel Reviews:

# Security Architect Review
Task(
    subagent_type="security-architect",
    description="Review architecture evolution security impact",
    prompt="""
    Review:
    - ADR: .aiwg/architecture/adr/ADR-{latest}.md
    - Migration plan: .aiwg/deployment/migration-plan-{date}.md

    Validate:
    - Security controls maintained/improved
    - Authentication/authorization impacts
    - Data encryption during migration
    - Audit trail continuity
    - Compliance implications

    Provide feedback:
    - Security risks identified
    - Required security controls
    - Recommendations

    Status: APPROVED | CONDITIONAL | NEEDS_WORK

    Save to: .aiwg/working/architecture-evolution/reviews/security-review.md
    """
)

# Test Architect Review
Task(
    subagent_type="test-architect",
    description="Review testability impact",
    prompt="""
    Review proposed architecture changes.

    Assess:
    - Test strategy updates needed
    - Test environment changes
    - Test data migration
    - Regression test scope
    - Performance test updates

    Provide recommendations for:
    - Migration testing approach
    - Rollback testing
    - Post-migration validation

    Save to: .aiwg/working/architecture-evolution/reviews/test-review.md
    """
)

# Performance Engineer Review (if performance-related)
Task(
    subagent_type="performance-engineer",
    description="Review performance implications",
    prompt="""
    Analyze performance impact of architecture changes.

    Review:
    - Scalability improvements/degradations
    - Latency impacts
    - Throughput changes
    - Resource utilization

    Recommend:
    - Performance testing requirements
    - Monitoring updates
    - Performance baselines

    Save to: .aiwg/working/architecture-evolution/reviews/performance-review.md
    """
)

# Legacy Modernizer Review (if modernizing legacy)
Task(
    subagent_type="legacy-modernizer",
    description="Review legacy system migration approach",
    prompt="""
    Review migration strategy for legacy components.

    Assess:
    - Legacy system dependencies
    - Data migration complexity
    - Integration point changes
    - Gradual vs big-bang approach

    Validate migration strategy minimizes risk.

    Save to: .aiwg/working/architecture-evolution/reviews/legacy-review.md
    """
)

Communicate Progress:

⏳ Conducting architecture reviews (4 parallel reviewers)...
  ✓ Security Architect: {status}
  ✓ Test Architect: {status}
  ✓ Performance Engineer: {status}
  ✓ Legacy Modernizer: {status}
✓ Reviews complete: {X}/4 APPROVED

Step 6: Update Architecture Documentation

Purpose: Update SAD and related documentation

Your Actions:

  1. Update Software Architecture Document:

```

Task(

subagent_type="architecture-documenter",

description="Update SAD with architecture changes",

prompt="""

Update Software Architecture Document based on:

Updates needed:

1. Component Architecture (if components change)

2. Deployment Architecture (if deployment changes)

3. Technology Stack (if technologies change)

4. Integration Architecture (if integrations change)

5. Security Architecture (if security changes)

6. Data Architecture (if data model changes)

7. Reference new ADR in decisions section

Maintain version history.

Mark sections as "Updated: {date}".

Save to: .aiwg/architecture/software-architecture-doc.md

"""

)

```

  1. Update Diagrams (if needed):

```

Task(

subagent_type="architecture-documenter",

description="Update architecture diagrams",

prompt="""

Based on architecture changes, update:

1. Component diagrams (C4 Level 2)

2. Deployment diagrams

3. Data flow diagrams

4. Sequence diagrams (if flows change)

Use PlantUML or Mermaid syntax.

Include before/after comparison if helpful.

Save to: .aiwg/architecture/diagrams/

"""

)

```

Communicate Progress:

⏳ Updating architecture documentation...
  ✓ SAD updated (version {version})
  ✓ Diagrams updated: {count} diagrams
✓ Documentation complete

Step 7: Generate Architecture Evolution Report

Purpose: Create comprehensive summary for stakeholders

Your Actions:

Task(
    subagent_type="architecture-documenter",
    description="Generate Architecture Evolution Report",
    prompt="""
    Synthesize all artifacts into executive summary.

    # Architecture Evolution Report

    **Date**: {current-date}
    **Trigger**: {trigger-event}
    **Status**: PLANNING | IN_PROGRESS | COMPLETED

    ## Executive Summary
    Brief description of change and business justification

    ## Architecture Decision
    - ADR ID: {ADR-number}
    - Decision: {decision-summary}
    - Selected Option: {option-name}
    - Rationale: {brief-rationale}

    ## Impact Analysis
    - Components Affected: {count} - {list}
    - Breaking Changes: {count}
    - Teams Affected: {list}

    ## Migration Plan
    - Strategy: {migration-pattern}
    - Timeline: {start} to {end}
    - Phases: {count}
    - Rollback Plan: DEFINED

    ## Risk Assessment
    - Technical Risks: {list with mitigation}
    - Business Risks: {list with mitigation}

    ## Review Status
    - Security: {APPROVED/CONDITIONAL}
    - Testing: {APPROVED/CONDITIONAL}
    - Performance: {APPROVED/CONDITIONAL}

    ## Next Steps
    1. Obtain stakeholder approval
    2. Schedule migration windows
    3. Execute migration plan

    ## Artifacts Generated
    - ADR: .aiwg/architecture/adr/ADR-{number}.md
    - Migration Plan: .aiwg/deployment/migration-plan-{date}.md
    - Rollback Plan: .aiwg/deployment/rollback-plan-{date}.md
    - Updated SAD: .aiwg/architecture/software-architecture-doc.md

    Save to: .aiwg/reports/architecture-evolution-{date}.md
    """
)

Present to User:

─────────────────────────────────────────────
Architecture Evolution Complete
─────────────────────────────────────────────

**Trigger**: {trigger-event}
**Decision**: {architecture-decision}
**Migration Strategy**: {strategy}

**Key Changes**:
- {change-1}
- {change-2}
- {change-3}

**Breaking Changes**: {count}
**Migration Timeline**: {timeline}

**Review Status**:
✓ Security: APPROVED
✓ Testing: APPROVED
✓ Performance: APPROVED

**Artifacts Generated**:
- ADR-{number}: {title}
- Migration Plan: {strategy} approach
- Rollback Plan: Defined with triggers
- Updated SAD: Version {version}

**Next Steps**:
1. Review generated artifacts
2. Schedule stakeholder review meeting
3. Obtain formal approvals
4. Schedule migration windows
5. Execute migration plan

Full report: .aiwg/reports/architecture-evolution-{date}.md
─────────────────────────────────────────────

Migration Patterns Reference

Strangler Fig Pattern

Blue-Green Deployment

Canary Deployment

Big Bang Migration

Parallel Run

Quality Gates

Before marking workflow complete, verify:

Error Handling

If No Current Architecture Documentation:

❌ No Software Architecture Document found

Cannot evolve architecture without baseline.
Recommendation: Create initial SAD first
- Run: /flow-inception-to-elaboration
- Or: Document current architecture manually

If Migration Risk Too High:

⚠️ High-risk migration detected

Critical risks identified:
- {risk-1}: {description}
- {risk-2}: {description}

Recommendation:
- Consider phased approach instead of big bang
- Add extensive rollback testing
- Plan for parallel run period

If Review Conflicts:

⚠️ Architecture review conflict

Conflict between reviewers:
- {Reviewer-1}: {position}
- {Reviewer-2}: {opposing-position}

Escalating to user for decision...
Trade-off analysis provided in review documents.

Success Criteria

This orchestration succeeds when:

Metrics to Track

References

Templates (via $AIWG_ROOT):

Related Flows:

Architecture Patterns:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.