Refactor prompt system: extract generic interactive agent prompt from telegram-specific template

t-626·WorkTask·
·
·
·Omni/Ava.hs
Createdyesterday·Updatedyesterday

Description

Edit

Currently telegram/system.mustache contains ~205 lines of non-partial content, but only ~40 lines are actually telegram-specific. The rest is generic 'ava as interactive agent' instructions that should be reusable across channels (CLI, web, other agents).

What to extract into a shared partial (e.g. partials/interactive_agent.mustache):

  • Skills system (~15 lines)
  • Memory usage (~12 lines)
  • Long-running work / projects.md (~9 lines)
  • Workspace (~4 lines)
  • Dates & time (~5 lines)
  • Tone & style (~16 lines)
  • Web citations (~9 lines)
  • Tool usage / task workflow (~27 lines)
  • Subagent delegation (~24 lines)
  • Domain knowledge / PIL (~10 lines)

What stays telegram-specific:

  • Message protocol (send_message/send_photo, AGENT_DONE, private vs group)
  • Telegram formatting (legacy Markdown rules)
  • Group chat response rules
  • Heartbeat system

What already exists as partials:

  • base_identity (4 lines)
  • instruction_hierarchy (7 lines)
  • safety_rules (8 lines)

Goal: telegram/system.mustache becomes shared partials + telegram-specific sections. A future CLI or web agent template reuses the same shared partials with its own channel-specific sections.

Approach: 1. Create partials/interactive_agent.mustache with the generic content 2. Refactor telegram/system.mustache to include the new partial 3. Verify no behavioral change in telegram agent 4. Document the partial system so new channels can compose their own system prompt

Timeline (4)

🔄[human]Open → InProgressyesterday
🔄[human]InProgress → Reviewyesterday
💬[human]yesterday

Done in 51a6939. Created partials/interactive_agent.mustache with ~130 lines of shared content. telegram/system.mustache now includes the partial and only contains telegram-specific sections (~80 lines). All content verified preserved via set comparison. Ava builds and prompt tests pass.