Heartbeat

From aaronjmars/aeon · View interactive version

Heartbeat is an AI agent skill from the GitHub repository aaronjmars/aeon. Ambient fleet-health check that surfaces anything worth attention (default), or an on-demand priority brief - the 3 things to focus on, why now, and what moved (var=brief)

How to use this skill

Skill file

${var} — selector. Empty (default) = the ambient fleet check — the live path a cron runs once a day; leave it empty for the scheduled run. brief = the priority brief. See the grammar below.

Selector / `${var}` grammar

Shared setup (every run)

Read memory/MEMORY.md and the last 2 days of memory/logs/ for context.

Parse ${var} to pick the branch:

The two branches are mutually exclusive — run exactly one per invocation.


Ambient check (default — empty `${var}`; the LIVE scheduled path)

If ${var} is set to a focus area, focus checks on that specific area.

Checks (in priority order)

P0 — Failed & stuck skills (check first)

Read memory/cron-state.json. If the file is missing or empty (e.g. a fresh fork whose scheduler hasn't written it yet), treat state as empty: report no cron-state yet for the P0 tier, skip the failure/degradation checks below, and still render the status page (every enabled skill shows not yet run). This file tracks every scheduled skill's state and quality metrics:

{
  "skill-name": {
    "last_dispatch": "2026-04-06T12:00:00Z",
    "last_status": "dispatched|success|failed",
    "last_success": "2026-04-06T12:05:00Z",
    "last_failed": "2026-04-05T12:03:00Z",
    "total_runs": 10,
    "total_successes": 8,
    "total_failures": 2,
    "consecutive_failures": 0,
    "success_rate": 0.80,
    "last_quality_score": 4,
    "last_error": "error signature text"
  }
}

Bootstrap grace (fresh / warming-up fleets). Before flagging anything, decide whether the fleet has completed any run yet. A skill has completed a run if its entry has total_runs ≥ 1 or a non-null last_success/last_failed. A skill that only ever shows last_status: "dispatched" (or has no entry) has not completed a run — it is warming up, the normal state right after a fork or after a skill is enabled, not a failure. The scheduler stamps dispatched at run start and the outcome only lands after the run finishes, so a just-dispatched skill legitimately has no outcome yet.

Self-reference. Heartbeat is, by definition, running right now, so its own entry is never evidence of a problem:

Flag these conditions:

P1 — Stalled PRs & urgent issues
P2 — Flagged memory items
P3 — Missing scheduled skills

Read aeon.yml for enabled skills with schedules. Cross-reference with memory/cron-state.json:

Skip P3 entirely on a bootstrapping fleet (per Bootstrap grace — no skill has completed a run yet). On a fresh fork every skill is un-dispatched or warming up; that is expected, not a fleet of missing skills, and must not generate findings or a notification. Only run P3 once the fleet has warmed (at least one completed run), and even then a skill still in its very first dispatch window is warming up, not missing.

Do NOT use gh run list for this — the state file is authoritative.

Dedup & notification

Before sending any notification, grep memory/logs/ for the same item. If it appears in the last 48h of logs, skip it. Never notify about the same item twice.

Batch all findings into a single notification, grouped by priority tier:

🔴 FAILED: skill-a (failed 2h ago), skill-b (stuck 1h ago)
🟡 STALLED: PR #42 open 3 days
🔵 MEMORY: follow-up on X flagged 2 days ago

Public status page

After the priority checks (even when everything is green — this step always runs), regenerate docs/status.md so it reflects current fleet health.

Run time first. Before writing the page, run this as its own call and keep what it prints as NOW:

date -u '+%Y-%m-%d %H:%M UTC'

Paste NOW verbatim into the Updated: line. Never use the schedule time, a cron-state timestamp or a guess: readers judge staleness from this line. Every "now" on the page (the next scheduled run, the 45-minute dispatched window, Token pulse staleness) is measured from NOW.

Data sources
Overall status

Compute one of three overall states from the same signals used above. This verdict drives the public, fork-facing status page, so reserve 🔴 for skills that are currently broken — a single transient failure a skill has already recovered from must not flip the whole page red, and a fresh fork whose skills simply haven't finished their first cycle must never read 🔴:

Bootstrap first. If the fleet is warming up — no skill has completed a run yet (per Bootstrap grace) — the status is 🟢 OK, annotated 🌱 warming up — N skill(s) dispatched, awaiting first completed run. Skip the rest of this ladder. Warming-up skills (dispatched, never completed) never count toward 🔴 or 🟡 (except the >24h "may not be wired up" watch-item), and heartbeat's own entry never counts toward its own verdict.

Otherwise:

This refines only the public status-page colour. It does not change the P0 notification rules above — a fresh last_status: "failed" still fires its notification (deduped per the rules above) so the operator is always told; the page just won't read 🔴 for a blip the fleet has already shrugged off.

Format

Write docs/status.md with frontmatter so it renders as a status page:

---
layout: default
title: "Status"
permalink: /status/
---

# Agent Status

**Overall:** 🟢 OK
**Updated:** 2026-04-24 19:06 UTC
**Open issues:** 0
**Next scheduled run:** heartbeat at 08:00 UTC

Auto-generated by the `heartbeat` skill on every run (daily, on its `aeon.yml` schedule). If the Updated timestamp is more than ~26h stale, the agent is not running.

## Token pulse

| Token | Price | 24h | Liquidity | Volume (24h) | FDV |
|-------|-------|-----|-----------|--------------|-----|
| <TOKEN> | $0.0000032626 | -11.16% | $223.4K | $41.3K | $326.3K |

_Source: `output/articles/token-report-YYYY-MM-DD.md` · verdict: SLIDING_ (illustrative - symbol/figures come from the latest token-report)

## Skill health (last 7 days)

| Skill | Last run | Status | Success rate | Consecutive failures |
|-------|----------|--------|-------------:|---------------------:|
| token-report | 2026-04-24 12:30 UTC | ✅ success | 100% | 0 |
| fetch-tweets | 2026-04-24 06:53 UTC | ✅ success | 95% | 0 |
| …           | …                    | …         | …    | … |

## Open issues

_(if INDEX.md has any open rows, render them here; otherwise: "No open issues.")_

| ID | Title | Severity | Category | Detected |
|----|-------|----------|----------|----------|
| ISS-001 | … | medium | rate-limit | 2026-04-22 |

---
*Fork this repo and your copy inherits this page automatically - [how it works](/memory/).*
Rules
Token pulse rules

The file lands on main through the workflow's auto-commit step — no explicit git commands needed in this skill.

Output (ambient)

If nothing needs attention, log "HEARTBEAT_OK" (plus the overall status page verdict, e.g. HEARTBEAT_OK · STATUS_PAGE=OK) and end your response.

A bootstrapping / warming-up fleet counts as "nothing needs attention". Still regenerate docs/status.md (verdict 🟢 OK, warming-up note), log HEARTBEAT_OK · STATUS_PAGE=OK (warming up), and send no notification — a fresh fork should be quiet, not a red alert. Warming-up skills are not "findings".

If something needs attention:

  1. Write a single concise notification (grouped by priority as above) to a file such as /tmp/heartbeat.md and send it with ./notify -f /tmp/heartbeat.md
  2. Log the findings and actions taken to memory/logs/${today}.md (under the shared ### heartbeat heading — see Log — with a mode: ambient discriminator line)
  3. Log one line with the status-page verdict, e.g. STATUS_PAGE=DEGRADED — wrote docs/status.md

Priority brief (`${var}` = `brief` or `brief:<area>`)

<!-- autoresearch: variation B — priority-driven, decision-ready output (cut noise, demand "why now") -->

Runs instead of the ambient check. Any text after brief: (e.g. brief:crypto) is the area to emphasize; a bare brief covers all areas.

A good brief is a priming document, not a news dump. Every line must answer "so what?".

Today is ${today}. Read memory/MEMORY.md, memory/logs/${yesterday}.md (and today's if it exists), and memory/cron-state.json (if present).

1. Rank, don't aggregate

Collect candidate items from:

Score each candidate on leverage × urgency:

Keep at most 3 focus items. Everything else either goes in "Since yesterday" or is dropped. If the emphasis area is set (brief:<area>), bias ranking toward that area but do not force a focus item if nothing qualifies.

2. Headlines — only if they change priorities

Use WebSearch for 2 headlines in the user's tracked areas (AI and crypto by default; emphasize the brief:<area> value if set). Include a headline only if it meaningfully updates one of the 3 focus items, flags a new risk, or implies an action (a deadline, a market move, a shipped competitor, a disclosed exploit). If nothing qualifies, omit the Watch section entirely. No filler.

3. Format — terse, scannable, opinionated

*Priority Brief - ${today}*

*Focus today*
1. [item] - why now: [≤12 words]
2. [item] - why now: [≤12 words]
3. [item] - why now: [≤12 words]

*Since yesterday*
- [moved]: what changed (link if relevant)
- [stuck]: what's blocked, on whom

*Watch* (omit entirely if nothing qualifies)
- [headline] - implication for focus #N

*Running today*
- skill @ HH:MM UTC

Style rules:

4. Send via `./notify` and email

```

Authorization: Bearer {RESEND_API_KEY}

Content-Type: application/json

{

"from": "Aeon Briefings <onboarding@resend.dev>",

"to": ["<each recipient>"],

"subject": "[Aeon] Priority Brief - ${today}",

"html": "<html version>",

"text": "<plain-text version>"

}

```


Log

Both branches append to memory/logs/${today}.md under a single ### heartbeat heading (the health loop parses this shape). Begin the entry with a discriminator line naming the branch that ran:

Network note

Applies to both branches. curl works — there is no network sandbox. Use WebFetch as a fallback for a flaky public GET. For GitHub queries (both branches use gh pr list / gh issue list), use the gh CLI (handles auth internally) rather than curl. The priority-brief Resend POST carries the RESEND_API_KEY secret — a bare $RESEND_API_KEY on the command line is refused by the Bash permission layer, so send it with ./secretcurl using a {RESEND_API_KEY} placeholder (WebFetch can't carry a secret).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.