loop-heartbeat
Scheduled discovery automation that runs scans on a heartbeat interval, classifies findings, and routes them to goals or triage inbox.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 1.6k
- Forks
- 491
01 前言 Front Matter
- name
- loop-heartbeat
- origin
- ECC
- description
- Scheduled discovery automation that runs scans on a heartbeat interval, classifies findings, and routes them to goals or triage inbox.
03 SKILL.md 正文
Loop Heartbeat
Scheduled discovery automation that runs scans, finds issues, and routes findings to goals or triage. The heartbeat is what makes a loop a loop — not a one-shot run.
Based on Addy Osmani's Loop Engineering: "Automations are the thing that makes a loop an actual loop. Run prompts on a schedule. Findings go to a triage inbox; empty runs archive themselves."
When to Activate
- User invokes
/heartbeat startto begin scheduled scans - User invokes
/heartbeat runfor a one-shot scan - A goal converges and follow-up scanning is needed
- Project onboarding includes quality monitoring setup
Core Concept
The heartbeat is the "discovery layer" of a loop. It answers: "What's broken right now?" on a recurring basis without human prompting.
Every 30 minutes:
┌─ Run test suite ─── PASS → skip
├─ Run linter ─────── FAIL → create goal (auto-fix)
├─ Audit deps ─────── FAIL → triage inbox (human decision)
└─ Type check ─────── PASS → skip
Configuration
Create .claude/heartbeat.yaml in the project root:
heartbeat:
interval: "30m"
scans:
- name: "test-health"
command: "npm test 2>&1 | tail -10"
onFailure: "auto-goal"
description: "Test suite health"
- name: "lint-drift"
command: "npm run lint -- --quiet 2>&1 | wc -l"
threshold: 0
onFailure: "triage"
description: "Lint error count"
- name: "type-check"
command: "npx tsc --noEmit 2>&1; echo EXIT:$?"
onFailure: "auto-goal"
description: "TypeScript type errors"
budget:
maxDollarsPerHour: 2.0
pauseOnExhaust: true
Scan Result Classification
| onFailure | Behavior | Use When |
|---|---|---|
auto-goal |
Creates /goal automatically |
Machine can fix it (tests, lint, types) |
triage |
Adds to /triage inbox |
Human judgment needed (deps, security) |
notify |
Desktop notification only | Informational, no action required |
ignore |
Log silently | Monitoring only, aggregate later |
Budget Controls
maxDollarsPerHour: Pause heartbeat if scanning costs exceed thispauseOnExhaust: If true, pause (resumable); if false, stop entirely- Goal creation inherits the default goal budget from
/goalsettings
Empty Run Handling
When all scans pass:
- No goals or triage items are created
- Run is logged to
~/.claude/heartbeat-last-run.json - Next run proceeds on schedule
- This is the "archive themselves silently" behavior
Integration Points
/goal:auto-goalfailures create goals via completion-oracle.js/triage:triagefailures append to~/.claude/triage/inbox.jsonl- CronCreate: Scheduling uses the Claude Code CronCreate primitive
- ScheduleWakeup: Alternative for dynamic-interval loops
- Hooks: Runs as a scheduled task, not a synchronous hook
Hard Bans
- Heartbeat MUST NOT modify code (it's discovery-only)
- Heartbeat MUST NOT create goals without a stopping condition
- Budget limits MUST be enforced (no unbounded scan spending)
- Failed scans MUST be classified (no silent failures)
- Empty runs MUST NOT create noise (pass = skip)
Example Session
User: /heartbeat start
System:
Loaded .claude/heartbeat.yaml (3 scans configured)
Registered CronCreate: every 30m
Next run: 30m from now
Budget: $2.00/hour
[30 minutes later, heartbeat fires]
Scan results:
✓ test-health: all tests pass
✗ lint-drift: 4 lint errors found → created goal-a1b2c3d4
✓ type-check: no type errors
Summary: 2/3 scans passed, 1 goal created
04 同仓库更多 Skills
worktable-review-with-annotations
Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.
worktable-find-and-synthesize-context
Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.
worktable-create-or-update-docs
Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.
worktable-create-or-manage-records
Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.
worktable-create-or-manage-interactive-html
Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.
worktable-collaborate-threads
Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.