# scenario_definitions.template.yml - DETAILED WORK SCENARIOS
# Comprehensive definitions for each AI work scenario
# Reference this file: {{import: scenario_definitions.template.yml}}

scenarios:
  template_development:
    id: "template-development"
    name: "Developing or updating templates"
    
    trigger:
      condition: "Working in templates/ folder or updating .template.* files"
      detection: "file path contains 'templates/' or filename matches '.template'"
    
    action:
      mode: "Template Development Mode"
      location: ".cursorrules.md {#template-development-mode}"
    
    read_files:
      - file: ".ai-context.yml"
        section: "{#constraints-registry}"
        focus: "template_mode constraints"
      - file: ".cursorrules.md"
        section: "{#template-development-mode}"
        focus: "workflow rules"
      - file: "templates/README.md"
        focus: "template philosophy"
    
    ignore_sections:
      - "context/ folder (internal only)"
      - "memory-bank/releases/ folder (not relevant to templates)"
      - "Feature-specific requirements"
      - "Customer support guidance"
    
    constraints: "{{ref: constraints_registry.template_mode}}"
    
    rules:
      - "✋ NEVER replace {{PLACEHOLDERS}}"
      - "✋ Use generic examples only (no project-specific values)"
      - "✋ Test with mock data, not real project data"
      - "✋ Changes affect ALL projects using these templates"
      - "✋ Document all {{VARIABLES}} in metadata"
    
    validation_criteria:
      - "All {{VARIABLES}} must be preserved"
      - "Template works with all {{VARIABLE}} combinations"
      - "Example values are generic and reusable"
      - "No hardcoded paths or credentials"
    
    success_criteria: "Template works with all {{VARIABLE}} combinations and is tested with mock data"

  feature_implementation:
    id: "feature-implementation"
    name: "Building new features or fixing bugs"
    
    trigger:
      condition: "Working on source code, not templates"
      detection: "file path NOT in templates/, editing .ts/.js files"
    
    action:
      mode: "Feature Development Mode"
      location: ".cursorrules.md {#feature-development-mode}"
    
    read_files:
      - file: ".ai-context.yml"
        section: "{#ai-context-loading-order}"
        focus: "complete context sequence"
      - file: ".cursorrules.md"
        section: "{#feature-development-mode}"
        focus: "feature development rules"
      - file: "memory-bank/activeContext.md (or legacy context/vision.md)"
        focus: "current phase and implications"
      - file: "memory-bank/requirements/specs/"
        focus: "relevant technical specification"
      - file: "memory-bank/releases/current-release.md"
        focus: "scope and requirements"
    
    ignore_sections:
      - "templates/ documentation"
      - "Unrelated specs"
      - "Customer support guidance"
      - "Historical release notes"
    
    constraints: "{{ref: constraints_registry.feature_mode}}"
    
    rules:
      - "✅ Use real project values from context/"
      - "✅ Use /scope-release, /enrich-release, /analyze-repo"
      - "✅ Read memory-bank/activeContext.md (or legacy context/vision.md) for current phase"
      - "✅ Link epics ↔ specs in all work"
      - "✅ Follow TDD: Red → Green → Refactor"
      - "✅ Test in all 3 deployment modes"
    
    validation_criteria:
      - "All tests must pass (npm test)"
      - "All specs must be linked"
      - "Code is tested with edge cases"
      - "Error handling implemented"
      - "Config externalized (no hardcoded values)"
    
    success_criteria: "All tests green, spec linked, code reviewed, Definition of Done met"

  customer_support:
    id: "customer-support"
    name: "Helping customers or explaining features"
    
    trigger:
      condition: "GitHub Issues, discussions, support requests"
      detection: "Issue comment, PR review, or discussion response"
    
    action:
      mode: "Customer Support Mode"
      location: "README.md {#contributing}"
    
    read_files:
      - file: "README.md"
        focus: "public documentation only"
      - file: ".ai-context.yml"
        section: "{#file-purposes}"
        focus: "public-facing information only"
    
    ignore_sections:
      - ".cursorrules.md (internal only)"
      - "context/ (internal only)"
      - "Internal phase planning"
      - "Resource allocation strategies"
      - "Enterprise-only features"
      - "Private team workflows"
    
    constraints: "{{ref: constraints_registry.support_mode}}"
    
    rules:
      - "Use public language only"
      - "Reference README.md and public docs only"
      - "Don't expose internal strategies or roadmap"
      - "Point to public repositories for more info"
      - "Keep tone professional and helpful"
    
    validation_criteria:
      - "Response uses only public information"
      - "No internal details exposed"
      - "Links point to public resources"
      - "Clear and helpful tone"
    
    success_criteria: "Clear, helpful response using only public information"

  onboarding:
    id: "onboarding"
    name: "Understanding project for first time"
    
    trigger:
      condition: "New to this project"
      detection: "First-time context loading"
    
    action:
      mode: "Onboarding Mode"
      location: ".ai-context.yml {#ai-context-loading-order}"
    
    read_order:
      1: ".ai-context.yml"
      2: ".cursorrules.md"
      3: "README.md"
      4: "memory-bank/activeContext.md (or legacy context/vision.md)"
      5: "memory-bank/releases/current-release.md"
      6: "memory-bank/requirements/specs/"
    
    time_estimate: "15-20 minutes for complete context"
    
    validation_criteria:
      - "Can identify current phase"
      - "Can identify deployment mode"
      - "Understand team workflow rules"
      - "Know where to find specifications"
    
    success_criteria: "Full project context loaded and understood"

  open_source_contribution:
    id: "open-source-contribution"
    name: "Contributing to open source project"
    
    trigger:
      condition: "External contributor from GitHub"
      detection: "First-time contributor, non-team member"
    
    action:
      mode: "Open Source Contribution Mode"
      location: "README.md {#contributing}"
    
    read_files:
      - file: "README.md"
        section: "{#contributing}"
        focus: "contribution guidelines"
      - file: ".cursorrules.md"
        focus: "public sections only"
    
    skip_sections:
      - "Internal phase planning"
      - "Resource allocation strategies"
      - "Enterprise features"
      - "Private team workflows"
      - ".ai-context.yml internal sections"
    
    rules:
      - "Follow contribution guidelines from README.md"
      - "Create fork and feature branch"
      - "Include tests with changes"
      - "Follow code style guidelines"
      - "Request review from maintainers"
    
    validation_criteria:
      - "Pull request follows guidelines"
      - "Tests included and passing"
      - "Code style consistent"
      - "Documentation updated"
    
    success_criteria: "PR reviewed and merged by maintainers"
