skills/heartbeat-refinement/SKILL.md
Refined heartbeat scheduling with cleaner intervals, atomic task checkout, and goal ancestry tracking. Adapted from Paperclip's heartbeat principle.
npx skillsauth add 0x-wzw/OpenClaw_deployer_for_dummies heartbeat-refinementInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Cleaner scheduling, atomic task checkout, goal ancestry tracking
Adapted from Paperclip's heartbeat coordination principle
Agents wake on schedules to check work and act autonomously. Refined for the Swarm:
| Schedule | Time | Purpose | Action | |------------|------|---------|--------| | Micro | Every 5 min | Health checks | Quick status, keepalive | | Heartbeat | Every 30 min | Task coordination | Check pending, spawn agents | | Daily | 03:00 UTC | Full maintenance | Memory index, cost analysis, security scan | | Weekly | Sun 04:00 | Deep optimization | Skill suggestions, trend analysis, governance review | | Monthly | 1st 05:00 | Strategic review | ACS evaluation, mission alignment, roadmap update |
Prevent double-work with checkout system:
class TaskCheckout:
"""Atomic task checkout to prevent double-work."""
def checkout_task(self, agent_id: str, task_id: str) -> CheckoutResult:
"""
Atomically checkout task for agent.
Returns:
success: True if checkout succeeded
lock_id: Unique lock for this checkout
expires: Lock expiration time
"""
# Atomic operation
if self.is_task_checked_out(task_id):
return CheckoutResult(
success=False,
error="Task already checked out"
)
lock_id = generate_lock_id()
expires = datetime.now() + timedelta(minutes=30)
# Atomically write checkout
self._atomic_write_checkout(task_id, agent_id, lock_id, expires)
return CheckoutResult(
success=True,
lock_id=lock_id,
expires=expires
)
def release_checkout(self, lock_id: str):
"""Release task checkout."""
self._atomic_remove_checkout(lock_id)
Every heartbeat task includes ancestry:
class HeartbeatTask:
"""Task with goal ancestry for alignment."""
def __init__(self, description: str, ancestry: Ancestry):
self.description = description
self.ancestry = ancestry
self.alignment_score = calculate_alignment(ancestry)
def execute(self):
"""Execute with ancestry context."""
log(f"Executing: {self.description}")
log(f" Mission: {self.ancestry.mission}")
log(f" Goal: {self.ancestry.goal}")
log(f" Alignment: {self.alignment_score:.2f}")
# Execute task
return execute_with_context(self)
class HeartbeatController:
"""Refined heartbeat scheduling."""
SCHEDULES = {
"micro": {"interval": 300, "lightweight": True},
"heartbeat": {"interval": 1800, "lightweight": False},
"daily": {"time": "03:00", "timezone": "UTC"},
"weekly": {"day": 6, "time": "04:00", "timezone": "UTC"},
"monthly": {"day": 1, "time": "05:00", "timezone": "UTC"}
}
def run(self):
"""Main heartbeat loop."""
while True:
current = datetime.now()
# Check each schedule
for name, config in self.SCHEDULES.items():
if self.should_run(name, current):
self.execute_heartbeat(name)
time.sleep(60) # Check every minute
def execute_heartbeat(self, name: str):
"""Execute specific heartbeat."""
tasks = self.get_tasks_for_heartbeat(name)
for task in tasks:
# Atomic checkout
checkout = self.task_checkout.checkout(
agent_id=self.agent_id,
task_id=task.id
)
if checkout.success:
try:
result = task.execute()
self.task_checkout.release(checkout.lock_id)
except Exception as e:
self.task_checkout.release(checkout.lock_id)
log_error(f"Task failed: {e}")
| Aspect | Paperclip | Swarm Refined Heartbeat | |--------|-----------|------------------------| | Schedule | Single heartbeat | Multi-tier (micro/heartbeat/daily/weekly/monthly) | | Checkout | Basic locking | Atomic with expiration | | Goal tracking | Company goals | ACS + token economy aligned | | Recovery | Manual | Auto-retry with backoff | | Integration | Org structure | Swarm protocol + economics |
{
"heartbeat": {
"enabled": true,
"schedules": {
"micro": {
"enabled": true,
"interval": 300
},
"heartbeat": {
"enabled": true,
"interval": 1800
},
"daily": {
"enabled": true,
"time": "03:00"
},
"weekly": {
"enabled": true,
"day": 6,
"time": "04:00"
},
"monthly": {
"enabled": true,
"day": 1,
"time": "05:00"
}
},
"atomic_checkout": {
"enabled": true,
"lock_duration": 1800,
"auto_release": true
}
}
}
Refined heartbeat scheduling for Swarm coordination Adapted from Paperclip's heartbeat principle with atomic checkout
tools
Load skills only when needed to keep context window lean. Adapted from DeerFlow's progressive loading philosophy.
tools
Complete data isolation per deployment/tenant. Multiple swarms can coexist without data leakage. Adapted from Paperclip's isolation principle.
tools
Model Context Protocol (MCP) server integration for standardized tool extensibility. Adapted from DeerFlow's MCP ecosystem.
tools
Approval gates with versioned configuration changes and safe rollback. Adapted from Paperclip's governance principle.