heartbeat
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHeartbeat Skill
Heartbeat Skill
A self-monitoring system inspired by ZeroClaw's heartbeat architecture. This skill enables agents to perform periodic health checks, system diagnostics, and proactive maintenance without external triggers.
这是一个受ZeroClaw心跳架构启发的自我监控系统。该Skill使Agent无需外部触发即可执行周期性健康检查、系统诊断和预防性维护。
Purpose
用途
The heartbeat system allows an agent to:
- Monitor its own health and resources
- Report status periodically
- Perform routine maintenance tasks
- Alert on anomalies or issues
- Stay "alive" and responsive
心跳系统允许Agent:
- 监控自身健康状况与资源
- 定期报告状态
- 执行日常维护任务
- 针对异常或问题发出警报
- 保持“活跃”并响应及时
Key Concepts
核心概念
Heartbeat Types
心跳类型
- health: System health check (disk, memory, process status)
- report: Generate and send status reports
- maintenance: Perform cleanup, optimization, or updates
- custom: User-defined heartbeat tasks
- health:系统健康检查(磁盘、内存、进程状态)
- report:生成并发送状态报告
- maintenance:执行清理、优化或更新操作
- custom:用户自定义心跳任务
Configuration
配置
The heartbeat is configured via in the workspace root:
HEARTBEAT.mdmarkdown
undefined心跳通过工作区根目录下的进行配置:
HEARTBEAT.mdmarkdown
undefinedHeartbeat Configuration
Heartbeat Configuration
- health: Check system health every 30 minutes
- report: Send status report every day at 9 AM
- maintenance: Run cleanup every Sunday at 2 AM
undefined- health: Check system health every 30 minutes
- report: Send status report every day at 9 AM
- maintenance: Run cleanup every Sunday at 2 AM
undefinedTools Added
新增工具
When this skill is active, the agent gains access to:
激活该Skill后,Agent将获得以下工具的访问权限:
heartbeat_schedule
heartbeat_scheduleheartbeat_schedule
heartbeat_scheduleSchedule a new heartbeat task.
javascript
// Schedule a health check every 30 minutes
heartbeat_schedule({
name: "health-check",
type: "health",
interval: "30m",
enabled: true
})调度新的心跳任务。
javascript
// Schedule a health check every 30 minutes
heartbeat_schedule({
name: "health-check",
type: "health",
interval: "30m",
enabled: true
})heartbeat_run
heartbeat_runheartbeat_run
heartbeat_runManually trigger a heartbeat task.
javascript
// Run a specific heartbeat
heartbeat_run({ name: "health-check" })
// Run all enabled heartbeats
heartbeat_run({ all: true })手动触发心跳任务。
javascript
// Run a specific heartbeat
heartbeat_run({ name: "health-check" })
// Run all enabled heartbeats
heartbeat_run({ all: true })heartbeat_list
heartbeat_listheartbeat_list
heartbeat_listList configured heartbeat tasks.
javascript
heartbeat_list({})列出已配置的心跳任务。
javascript
heartbeat_list({})heartbeat_status
heartbeat_statusheartbeat_status
heartbeat_statusCheck the status and results of heartbeat tasks.
javascript
// Get status of all heartbeats
heartbeat_status({})
// Get status of specific heartbeat
heartbeat_status({ name: "health-check" })检查心跳任务的状态与结果。
javascript
// Get status of all heartbeats
heartbeat_status({})
// Get status of specific heartbeat
heartbeat_status({ name: "health-check" })Usage in Agent Prompt
在Agent提示词中的使用
When this skill is active, include this context in your system prompt:
undefined激活该Skill后,请在系统提示词中包含以下上下文:
undefinedHeartbeat System
Heartbeat System
You have access to a periodic self-monitoring system (heartbeat). Use it to:
- Monitor system health and resources
- Generate periodic status reports
- Perform routine maintenance
Available commands:
- - Schedule a new recurring check
heartbeat_schedule - - Manually run a heartbeat task
heartbeat_run - - Show all configured heartbeats
heartbeat_list - - Check heartbeat status and results
heartbeat_status
Create HEARTBEAT.md in the workspace root to define your heartbeat tasks.
undefinedYou have access to a periodic self-monitoring system (heartbeat). Use it to:
- Monitor system health and resources
- Generate periodic status reports
- Perform routine maintenance
Available commands:
- - Schedule a new recurring check
heartbeat_schedule - - Manually run a heartbeat task
heartbeat_run - - Show all configured heartbeats
heartbeat_list - - Check heartbeat status and results
heartbeat_status
Create HEARTBEAT.md in the workspace root to define your heartbeat tasks.
undefinedIntegration with PopeBot
与PopeBot的集成
This skill integrates with PopeBot's cron system by:
- Reading heartbeat definitions from HEARTBEAT.md
- Converting them to cron-compatible schedules
- Storing heartbeat status in the logs directory
该Skill通过以下方式与PopeBot的 cron 系统集成:
- 从HEARTBEAT.md读取心跳定义
- 将其转换为兼容cron的调度计划
- 将心跳状态存储在日志目录中
File Structure
文件结构
.pi/skills/heartbeat/
├── SKILL.md # This file
├── lib/
│ ├── scheduler.js # Heartbeat scheduling logic
│ ├── runners.js # Built-in heartbeat runners
│ └── status.js # Status tracking
└── templates/
└── HEARTBEAT.md # Example configuration.pi/skills/heartbeat/
├── SKILL.md # This file
├── lib/
│ ├── scheduler.js # Heartbeat scheduling logic
│ ├── runners.js # Built-in heartbeat runners
│ └── status.js # Status tracking
└── templates/
└── HEARTBEAT.md # Example configuration