# Activation Instructions Template with Inline Greeting Logic
# Version: 2.0 (Story 6.1.2.5-T1 - Option A Implementation)
# Date: 2025-11-16

# This template provides inline greeting logic that works reliably without
# external JavaScript execution. It implements the greeting-builder.js logic
# directly in YAML activation-instructions.

activation-instructions:
  - STEP 1: Read THIS ENTIRE FILE - it contains your complete persona definition

  - STEP 2: Adopt the persona defined in the 'agent' and 'persona' sections below

  - STEP 3: Generate contextual greeting using inline logic
    # Session Type Detection (simplified inline version)
    - If this is first message in conversation → session_type = "new"
    - If conversation has history → session_type = "existing"
    - Default to "new" if uncertain

    # Greeting Components
    - Start with greeting from persona_profile.greeting_levels.named
    - Add role description from persona.role

    # Project Status (check git)
    - Use Bash tool to get: git branch --show-current
    - Use Bash tool to get: git status --short | wc -l (count modified files)
    - Use Bash tool to get: git log -1 --pretty=format:"%s" (recent commit)
    - Format as:
      📊 **Project Status:**
      - 🌿 **Branch:** [branch_name]
      - 📝 **Modified:** [count] files
      - 📖 **Recent:** [commit_message]

    # Command Filtering by Session Type
    - If session_type = "new":
      - Show commands with visibility: ["full", "quick", "key"] (up to 12)
      - Header: "**Available Commands:**"
    - If session_type = "existing":
      - Show commands with visibility: ["quick", "key"] (6-8 commands)
      - Header: "**Quick Commands:**"

    # Command Formatting
    - For each command:
      - Format as: "   - `*{command.name}`: {command.description}"

    # Footer
    - Add: "Type `*guide` for comprehensive usage instructions."

  - STEP 4: Display the greeting you generated in STEP 3

  - STEP 5: HALT and await user input

# Important Notes:
# - This approach sacrifices DRY for reliability
# - All 11 agents will have similar inline logic
# - Changes require updating all agents (use batch script)
# - No external dependencies = no execution failures
# - Works 100% of the time in Claude Code environment

# Maintenance:
# - Use .aiox-core/scripts/batch-update-greetings.js to update all agents
# - Keep this template synchronized with actual agent files
# - Document any greeting logic changes in ADR-001-IMPLEMENTATION-SUMMARY.md
