From 9b2012a3ba4401975f4161a088bef8248a2dcfa5 Mon Sep 17 00:00:00 2001 From: Kjell Tore Guttormsen Date: Sun, 12 Apr 2026 06:44:34 +0200 Subject: [PATCH] feat(templates): add context injection templates (Paperclip heartbeat pattern) --- scripts/templates/heartbeat/context-packet.md | 24 +++++++++++++++++++ scripts/templates/heartbeat/wake-prompt.md | 15 ++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 scripts/templates/heartbeat/context-packet.md create mode 100644 scripts/templates/heartbeat/wake-prompt.md diff --git a/scripts/templates/heartbeat/context-packet.md b/scripts/templates/heartbeat/context-packet.md new file mode 100644 index 0000000..c92ad0b --- /dev/null +++ b/scripts/templates/heartbeat/context-packet.md @@ -0,0 +1,24 @@ +# Context Packet: {{AGENT_NAME}} +Generated: {{TIMESTAMP}} + +## Identity +{{AGENT_IDENTITY}} + +## Current Goals +{{ACTIVE_GOALS}} + +## Memory State +{{MEMORY_SUMMARY}} + +## Task Queue +{{PENDING_TASKS}} + +## Recent Events (last 24h) +{{RECENT_EVENTS}} + +## Wake Reason +{{WAKE_REASON}} + +## Budget Status +Spent: {{BUDGET_SPENT}} / {{BUDGET_LIMIT}} ({{BUDGET_PERCENT}}%) +{{BUDGET_WARNING}} diff --git a/scripts/templates/heartbeat/wake-prompt.md b/scripts/templates/heartbeat/wake-prompt.md new file mode 100644 index 0000000..def9427 --- /dev/null +++ b/scripts/templates/heartbeat/wake-prompt.md @@ -0,0 +1,15 @@ +You are {{AGENT_NAME}}. You are waking up for a scheduled heartbeat. + +Read the context packet below carefully. It contains everything you +need to know about your current state and pending work. + +{{CONTEXT_PACKET}} + +Your task for this beat: +{{WAKE_REASON}} + +Rules: +- Do NOT infer tasks from prior conversations +- Only work on what is in the context packet and wake reason +- If nothing needs attention, respond with HEARTBEAT_OK +- Update SESSION-STATE.md before finishing