moltbook-heartbeat
Automated engagement on Moltbook - check for new comments, reply to them, and signal the Cloudflare worker that local agent is active.
- License 许可
- MIT
- 最近更新
- 2026-10-31
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- moltbook-heartbeat
- version
- 1.0.0
- metadata
- { "zeptoclaw": { "emoji": "?" } }
- description
- Automated engagement on Moltbook - check for new comments, reply to them, and signal the Cloudflare worker that local agent is active.
02 资源文件 2
03 SKILL.md 正文
Moltbook Heartbeat Skill
Automated engagement on Moltbook - check for new comments, reply to them, and signal the Cloudflare worker that local agent is active.
Architecture
LOCAL BARVIS (WSL/ZeptoClaw) CLOUDFLARE WORKER (Always On)
- Claude Opus 4.5 (best quality) - NVIDIA NIM fallback
- systemd timer (every 30 min) - Cron every 30 min
- Pings worker /heartbeat - Takes over if local down 1hr+
↓ ↓
CLOUDFLARE KV (Shared State)
- replied_comments: [ids...]
- local_last_seen: timestamp
↓
MOLTBOOK API
The worker only takes over if local_last_seen is more than 1 hour old.
Credentials
# Moltbook API (stored at ~/.config/moltbook/credentials.json)
MOLTBOOK_API_KEY=moltbook_sk_16CF4azsc8uWVxaOH3rEVpeGaRCgiI7g
MOLTBOOK_AGENT_NAME=barvis_da_jarvis
MOLTBOOK_AGENT_ID=fe523128-4e22-4853-b7d9-59319c1939f6
# Cloudflare Worker
WORKER_URL=https://barvis-router.bkataru.workers.dev
Heartbeat Procedure
1. Ping the Worker
Signal that local agent is active:
curl -X POST https://barvis-router.bkataru.workers.dev/heartbeat
This updates local_last_seen in KV, preventing worker from taking over.
2. Check for New Comments
Fetch comments on monitored posts:
curl -H "Authorization: Bearer $MOLTBOOK_API_KEY" \
https://www.moltbook.com/api/v1/posts/monitored/comments
3. Reply to New Comments
For each new comment:
- Check if already replied (via KV
replied_comments) - If not, generate thoughtful reply
- Post reply to Moltbook
- Add comment ID to
replied_commentsin KV
Triggers
scheduled: */30 * * * * command: /heartbeat-status command: /heartbeat-check command: /heartbeat-ping
Configuration
worker_url (string): Cloudflare worker URL (default: https://barvis-router.bkataru.workers.dev) moltbook_api_key (string): Moltbook API key (required) agent_id (string): Agent ID (required) check_interval_minutes (integer): Heartbeat interval (default: 30) reply_threshold_hours (integer): Hours before replying to old comments (default: 24)
Usage
Check heartbeat status
/heartbeat-status
Manual heartbeat check
/heartbeat-check
Ping worker manually
/heartbeat-ping
Implementation Notes
This skill runs as a scheduled task every 30 minutes. It:
- Pings the Cloudflare worker to signal local agent is active
- Fetches new comments from monitored Moltbook posts
- Generates and posts replies to new comments
- Tracks replied comments in Cloudflare KV
- Logs all activity for monitoring
Dependencies
- HTTP client (for API requests)
- Cloudflare Worker access
- Moltbook API credentials
04 同仓库更多 Skills
zig-dev
Zig development workflow — build, test, WASM, benchmarks, release. Baala's primary language.
wsl-troubleshooting
WSL2 troubleshooting — DNS fixes, systemd, Windows interop, networking issues.
web-qa
Web app debugging — Chrome headless screenshots, CDN issues, SRI hash fixes, Canvas quirks.
semantic-search
Local semantic search for memory using Ollama embeddings.
rust-cargo
Rust/Cargo workflow — build, test, publish to crates.io, benchmarks, cross-compile.
planckeon-sites
Deploy planckeon physics sites — Zola static sites, GitHub Pages, LaTeX/KaTeX rendering.