skills/heartbeat/SKILL.md
Agentic OS Orchestrator. Process and execute tasks from the shared .agent/state/tasks.json queue. Use when the user asks to 'check the queue', 'process tasks', or run the heartbeat.
npx skillsauth add baphomet480/claude-skills heartbeatInstall 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.
The Heartbeat skill acts as the background processor for the Agentic OS. It reads the .agent/state/tasks.json queue, identifies pending tasks, routes them to the appropriate skills, and updates the task status upon completion.
Use the heartbeat.py script in this skill's scripts/ directory to manage the queue:
heartbeat.py scopes first if you don't know what to work on. It lists every poppable queue under _<batch>_extension.<queue> paths with ready/in-progress/completed counts.heartbeat.py pop (legacy mode) or heartbeat.py pop --scope _round3_extension.ag_implementation_queue (scoped mode) to get the next task. If _*_extension queues exist in tasks.json, pop without --scope will refuse with exit 11 — pass the matching --scope.osint, deep-research) to fulfill the task.heartbeat.py complete <task_id> --scope <path> --outcome '{"result": "..."}' (scoped) or heartbeat.py complete <task_id> --outcome '...' (legacy). Failing logs to .agent/state/errors.json.Path varies by agent:
python3 ~/.gemini/skills/heartbeat/scripts/heartbeat.py …python3 ~/.claude/skills/heartbeat/scripts/heartbeat.py …(Both paths resolve through symlinks to the same canonical script in ~/github/claude-skills, so behavior is identical.)
When tasks.json contains a batch metadata block like _round3_extension, treat each list-of-dicts under it where every item has a task_id field as a scoped queue. The script enforces three rules from the project's AGENTS.md § Agentic OS Operating Discipline:
pop without --scope refuses (exit 11) when scoped queues exist. The broader pending list is off-limits while a scoped queue is active.gh_issue or task_id appears in any sibling blocked_on_* array is skipped automatically. The script tells you what was skipped and why.ready items remain in the scoped queue, exit 10 with a reminder to fill the evidence report and stop, not trawl pending.Example:
heartbeat.py scopes
# _round3_extension.ag_implementation_queue (3 ready / 0 in_progress / 0 completed / 3 total)
heartbeat.py pop --scope _round3_extension.ag_implementation_queue
# pops the first ready item, marks status=in_progress in place
heartbeat.py complete round3-edit-item-33-southern-qualifier \
--scope _round3_extension.ag_implementation_queue \
--outcome '{"pr": 502, "merged": true}'
in_progress handling (added in 1.2.0)If tasks.json has items in in_progress from a prior session that crashed or handed off, pop refuses with exit 12 and prints the stale items. Resolve with one of:
heartbeat.py clear-stale # move them all back to pending
heartbeat.py pop --accept-stale --scope <path> # adopt and proceed
This prevents a fresh agent from silently inheriting another session's half-finished work — a documented failure mode.
| Code | Meaning |
|------|---------|
| 0 | Normal pop / no pending tasks (legacy back-compat) |
| 10 | Scoped queue is drained — fill evidence report and stop |
| 11 | Scopes exist but --scope was not passed — pick one |
| 12 | Stale in_progress items present — clear or --accept-stale |
| 13 | Caller asked to pop a blocked item directly (reserved) |
| 14 | --scope path did not resolve to a list-of-dicts |
Wrappers (heartbeat-runner shells, AG launch scripts) should branch on these — exit 10 means stop, exit 11/12 mean the operator needs to make a decision, exit 14 is a config bug.
tasks.json legacy shape (still supported):
{
"pending": [
{
"id": "task-123",
"priority": "high",
"description": "Deep research the current state of local LLM orchestration.",
"assigned_skill": "deep-research",
"project_id": "claude-skills",
"agent_id": "antigravity",
"user_id": "matthias",
"created_at": "2026-04-25T12:00:00Z",
"completed_at": null
}
],
"in_progress": [],
"completed": [],
"failed": []
}
Scoped-queue shape (alongside the legacy fields):
{
"pending": [...],
"in_progress": [],
"completed": [],
"failed": [],
"_round3_extension": {
"ag_implementation_queue": [
{
"order": 1,
"task_id": "round3-edit-item-33-southern-qualifier",
"gh_issue": 496,
"estimate": "frontmatter only on 2 providers; ~10 min",
"risk": "minimal"
}
],
"blocked_on_client": [
{ "items": "Spanish PDFs", "issues": [390, 391], "blocker": "translator pending" }
]
}
}
The script treats anything under _*_extension whose items all have task_id as a poppable queue. Keys starting with blocked_on_ are filter inputs, not queues. Metadata lists like ag_pushed_branches (where items don't have task_id) are ignored by scopes discovery.
When invoked (or automatically on agent startup), the Heartbeat should process one task at a time to maintain stability and context length, unless explicitly asked to drain the queue. In a project with scoped queues, agents must pass --scope and respect the drained-queue stop signal — picking outside-queue work without authorization is the documented failure mode this version was written to prevent.
As a core OS component, this skill MUST log its own execution to .agent/state/last-run.json, noting which task was processed and what the outcome was. The 1.2.0 last-run schema adds a scope field so wrappers can tell scoped from legacy invocations.
development
Sets up, configures, and optimizes Google Analytics 4 (GA4) properties. Evaluates websites for proper GA4 implementation, tracking codes, and configuration improvements. Uses the Google Analytics Admin API for programmatic setup or provides manual integration paths via gtag.js or Next.js Third Parties.
development
Open-source intelligence on people, companies, domains, and B2B accounts. Use when the user wants to investigate, vet, research, or build a dossier on a target — phrases like "OSINT", "due diligence", "background check", "research this person", "look into [company/domain]", "vet this prospect/vendor", "what does X do", "is this account worth pursuing", "find me a contact at", "who's the buyer for", or any open-source investigation task. Disambiguates identities before reporting and grades every claim by independent source count.
development
Generate, edit, describe, restyle, restore, thumbnail, and batch-process images using xAI (Grok) or OpenAI image APIs and GPT-4o vision. Default provider is xAI ($0.02/image flat rate). Use this skill whenever the user asks to generate, create, make, draw, or design an image or picture using AI, or wants to edit, modify, transform, restyle, composite, or inpaint an existing image. Also handles image description and alt-text generation, background removal, style transfer, photo restoration, thumbnail creation, and batch generation from JSON manifests. Trigger when the user mentions DALL-E, gpt-image, Grok image, xAI image, OpenAI image generation, or wants AI-generated visuals for any purpose (logos, mockups, illustrations, thumbnails, icons, concept art, memes). Also trigger for batch image generation, generating a set or series of images, processing multiple images from a manifest, or creating consistent image collections. If the user says "make me an image of...", "generate a picture", "edit this photo to...", "describe this image", "remove the background", "make this look like watercolor", "restore this old photo", "create a thumbnail", "generate a batch of images", or "process this image manifest", this is the skill to use.
tools
Delegate a sub-task to Claude Code via the Agent Client Protocol (ACP). Use this skill whenever you want to hand off work to Claude — complex agentic coding with MCP tool access, detailed multi-file refactors, tasks requiring Claude's reasoning style, or anything where Claude's strengths give an advantage. Also invoke when the user asks you to "ask Claude", "use Claude for this", or "run this through Claude". The script handles subprocess lifecycle and ACP session setup; you just provide the prompt and read stdout.