# Adaptive Configuration Template
# [[LLM: This template adapts based on setup context - new project, migration, or reconfiguration]]

# Project Configuration
project:
  name: "{{project_name}}"
  key: "{{project_key}}"
  type: "{{project_type}}"  # software, business, hybrid
  
  # [[LLM: Auto-detect and suggest based on JIRA project type]]
  jira:
    url: "{{jira_url}}"
    project_keys: 
      - "{{primary_project_key}}"
    issue_types:
      story: "Story"
      bug: "Bug"
      epic: "Epic"
      task: "Task"

# Smart Field Mappings
# [[LLM: Intelligently map based on detected JIRA configuration]]
field_mappings:
  # Core fields (usually standard)
  summary: "summary"
  description: "description"
  status: "status"
  assignee: "assignee"
  
  # [[LLM: Auto-detect custom field IDs using MCP field search]]
  custom_fields:
    epic_link: "{{epic_field_id}}"      # Auto-detected
    story_points: "{{points_field_id}}"  # Auto-detected
    sprint: "{{sprint_field_id}}"        # Auto-detected
    
    # BMAD-specific fields (create if needed)
    bmad_id: "{{bmad_id_field}}"
    sync_status: "{{sync_status_field}}"
    last_synced: "{{last_synced_field}}"

# Workflow Configuration
# [[LLM: Map BMAD states to JIRA workflow]]
workflow_mapping:
  bmad_to_jira:
    draft: "To Do"
    in_progress: "In Progress"
    review: "In Review"
    done: "Done"
  
  jira_to_bmad:
    "To Do": "draft"
    "In Progress": "in_progress"
    "Code Review": "review"
    "Done": "done"
    "Closed": "done"

# Sync Preferences
# [[LLM: Apply smart defaults from utils/smart-defaults.md based on:
# - Team size (git contributors count)
# - Project type (greenfield/maintenance/platform)
# - User experience level
# - Detected patterns
# ]]
sync_preferences:
  mode: "{{sync_mode}}"  # Default: manual (1-5 people), scheduled (6-20), real-time (20+)
  frequency: "{{sync_frequency}}"  # Default: on-demand, hourly, continuous
  
  # Intelligent sync rules
  auto_sync:
    on_commit: {{auto_sync_commits}}
    on_story_update: {{auto_sync_stories}}
    on_status_change: {{auto_sync_status}}
  
  # Conflict resolution
  conflict_resolution:
    strategy: "{{conflict_strategy}}"  # manual, bmad_wins, jira_wins, newest_wins
    notify: true

# Team Configuration
# [[LLM: Adapt based on team structure]]
team:
  size: "{{team_size}}"  # small, medium, large
  distributed: {{is_distributed}}
  
  # Role mappings
  roles:
    product_owner: "{{po_jira_user}}"
    scrum_master: "{{sm_jira_user}}"
    tech_lead: "{{tl_jira_user}}"

# Integration Features
# [[LLM: Enable based on detected capabilities]]
features:
  git_integration: {{enable_git}}
  mcp_tools: {{mcp_available}}
  slack_notifications: {{slack_enabled}}
  automated_reports: {{auto_reports}}
  
  # Advanced features
  advanced:
    three_way_sync: {{three_way_sync}}
    ai_suggestions: {{ai_suggestions}}
    predictive_analytics: {{predictive}}

# Quick Setup Profiles
# [[LLM: Suggest profile based on answers]]
profile: "{{suggested_profile}}"  # starter, standard, advanced, enterprise

# Validation Rules
validation:
  require_description: {{require_desc}}
  min_story_points: {{min_points}}
  require_acceptance_criteria: {{require_ac}}

# [[LLM: Configuration notes and warnings]]
notes: |
  {{configuration_notes}}
  
  Generated: {{timestamp}}
  Profile: {{profile}}
  MCP Status: {{mcp_status}}