# Epic and Story Decomposition Workflow
name: create-epics-and-stories
description: "Transform PRD requirements into bite-sized stories organized in epics for 200k context dev agents"
author: "BMad"

# Critical variables from config
config_source: "{project-root}/bmad/bmm/config.yaml"
project_name: "{config_source}:project_name"
output_folder: "{config_source}:output_folder"
user_name: "{config_source}:user_name"
communication_language: "{config_source}:communication_language"
document_output_language: "{config_source}:document_output_language"
user_skill_level: "{config_source}:user_skill_level"
date: system-generated

# Input requirements
recommended_inputs:
  - prd: "Product Requirements Document with FRs and NFRs"
  - product_brief: "Product Brief with vision and goals (optional)"
  - domain_brief: "Domain-specific requirements and context (optional)"

# Smart input file references - handles both whole docs and sharded docs
# Priority: Whole document first, then sharded version
input_file_patterns:
  prd:
    whole: "{output_folder}/*prd*.md"
    sharded: "{output_folder}/*prd*/index.md"

  product_brief:
    whole: "{output_folder}/*product*brief*.md"
    sharded: "{output_folder}/*product*brief*/index.md"

  domain_brief:
    whole: "{output_folder}/*domain*brief*.md"
    sharded: "{output_folder}/*domain*brief*/index.md"

# Module path and component files
installed_path: "{project-root}/bmad/bmm/workflows/2-plan-workflows/prd/create-epics-and-stories"
instructions: "{installed_path}/instructions.md"
template: "{installed_path}/epics-template.md"

# Output configuration
default_output_file: "{output_folder}/epics.md"

standalone: true
