/woterclip:heartbeat runs instead · from woterclip
Executes the WoterClip heartbeat cycle: picks up assigned GitHub issues, resolves the right persona, does the work, and reports back with structured comments.
This skill never runs in Claude Code
It ships in woterclip at skills/, but /woterclip:heartbeat (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
Execute the WoterClip heartbeat cycle: pick up assigned GitHub issues, resolve the right persona, do the work, and report back with structured comments. All GitHub operations go through the gh CLI — no MCP server required.
Arguments:
--dry-run — Show what would be picked up without doing work--persona <name> — Only pick issues matching a specific personaReference files (consult as needed during execution):
${CLAUDE_PLUGIN_ROOT}/references/comment-format.md — Comment templates and rules${CLAUDE_PLUGIN_ROOT}/references/label-conventions.md — Label lifecycle and atomic label operations${CLAUDE_PLUGIN_ROOT}/references/status-mapping.md — GitHub state model, sort order, inbox filtering${CLAUDE_PLUGIN_ROOT}/references/sub-issues.md — Canonical create/attach/verify procedure for sub-issues${CLAUDE_PLUGIN_ROOT}/references/persona-dispatch.md — Subagent dispatch, outcome contract, and fallback rules${CLAUDE_PLUGIN_ROOT}/references/beat-economics.md — Clock capture, time ceiling, stop reasons, log fieldsAll gh issue / gh api calls below target the repo from config github.repo (pass --repo <owner/name> explicitly — never rely on the working directory's default remote).
.woterclip/config.yaml. If missing, stop and instruct the user to run /woterclip-init. Nothing is created yet, so this exit records nothing..woterclip/.heartbeat-lock.
stale_lock_hours old → stop: "Previous heartbeat still active. Skipping." This beat never took the lock — do not delete it and do not record a beat line.stale_lock_hours → delete it, log: "Cleaned stale lockfile."printf '{"beat_id":"%s","started_at":"%s","started_epoch":%s}\n' \
"$(date -u +%s)-$$" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$(date -u +%s)" \
| tee .woterclip/.heartbeat-lock
Carry the printed beat_id and started_epoch forward — they are the beat's identity and its clock..woterclip/.heartbeat-lock. Delete it only if it still carries this beat's beat_id; if it is missing or carries another id, a later beat cleaned and re-took it — leave it alone. Deleting a lock this beat does not own hands two beats the same repo.--dry-run and a superseded beat record none. The exit-to-reason map is in ${CLAUDE_PLUGIN_ROOT}/references/beat-economics.md. Beat elapsed is $(date -u +%s) minus started_epoch.Check quiet hours: if quiet_hours.enabled and current time is within the quiet window:
behavior: "skip" → record a quiet_hours beat line, apply the ownership rule, exit: "Quiet hours active. Skipping."behavior: "triage-only" → proceed but only load Orchestrator persona (skip worker personas in step 3).gh issue list --repo <owner/name> --assignee @me --state open \
--json number,title,labels,createdAt --limit 100
${CLAUDE_PLUGIN_ROOT}/references/status-mapping.md § Filter Rules and § Sort Order (labels come from the JSON above).agent-working labels: if an issue has agent-working but no heartbeat comment within stale_lock_hours, clean the stale label (gh issue edit N --remove-label agent-working, post cleanup comment).--persona <name> flag is set, filter to only issues matching that persona's label.--dry-run, report what would be picked, then apply the ownership rule and exit. No beat occurred, so record no beat line:
Dry run — would pick:
#12 [backend] "Issue title" (in-progress, priority:high)
Queue:
#15 [frontend] "Other issue" (todo)
queue_empty when zero issues were worked this beat, otherwise complete with the running count), apply the ownership rule, exit: "No issues in queue. Heartbeat complete."personas map in config.is_default: true (typically Orchestrator)..woterclip/<persona.path>/:
SOUL.md → inject into context as identity instructionsTOOLS.md → inject into context as tool guidanceconfig.yaml → read runtime settingsThe persona's config.yaml supplies model, thinking_effort, max_turns, and enable_chrome; how each feeds the step 8 dispatch is defined in ${CLAUDE_PLUGIN_ROOT}/references/persona-dispatch.md.
Read required_tools from persona config. Verify each entry by its kind:
gh → verify with gh auth status (exit 0) — this proves both the CLI and authenticationmcp__* entries (e.g., mcp__neon) → these are MCP tool prefixes, not executables: verify by checking whether any tool starting with that prefix is available in the current session. Never run command -v on an mcp__* name.docker) → verify with command -v <tool>If gh itself is unavailable or unauthenticated: no GitHub mutation is possible — do not attempt the blocked-comment path (it needs gh). Record a blocked_exit beat line, apply the ownership rule, and exit with an error message telling the user to run gh auth login. (Same rule as the mid-work failure in step 8.)
If any other required tool is unavailable → stop work on this issue immediately:
agent-blocked label, remove agent-working if present:
gh issue edit N --add-label agent-blocked --remove-label agent-workinggh issue view N --json labels --jq '.labels[].name'.agent-working is already present (from a previous heartbeat on same issue), proceed.gh issue edit N --add-label agent-working (atomic — no need to rewrite the label set).date -u +%s and carry the printed value as this issue's start epoch — it covers the dispatch. Separate from the beat clock in the lockfile.gh issue view N --json title,body,comments.Parent: #N reference in the issue body (guaranteed by the sub-issue creation procedure in ${CLAUDE_PLUGIN_ROOT}/references/sub-issues.md), then gh issue view <parent> --json title,body,comments.Heartbeat #N pattern. Next comment will be #N+1. If none found, start at #1.Dispatch the work to a persona subagent per ${CLAUDE_PLUGIN_ROOT}/references/persona-dispatch.md — prompt composition, the model parameter, fallback, error handling, and the outcome contract are all defined there. The branch shape:
model; the subagent returns a structured outcome that steps 9–10 consume.The work itself — wherever it runs — follows the persona's SOUL.md instructions and varies by persona:
Orchestrator persona: Triage the issue – apply persona labels, create sub-issues, or escalate. Never write code.
CEO persona: Make strategic decisions – prioritization, scope, architecture, coordination. Never write code.
Worker personas (backend, frontend, etc.):
${CLAUDE_PLUGIN_ROOT}/references/sub-issues.md (create with --assignee @me + persona label + Parent: #N body reference, attach by issue ID with -F sub_issue_id=, verify the attach, summarize in your returned outcome)max_turns from persona config as a work budgetIf gh auth expires or GitHub API errors persist mid-work: Stop immediately. Leave agent-working in place (cleaned as stale by a later beat). Record a blocked_exit beat line, apply the ownership rule, exit.
Before posting, re-read the lockfile and confirm it still carries this beat's beat_id, and that the issue still carries agent-working. If a later beat superseded this one, exit silently — no comment, no beat line, no lock deletion; all three are the successor's. A beat line here would close its in-flight group. If the report post itself fails with persistent gh errors, follow the step 8 mid-work rule.
Post a structured comment on the GitHub issue: gh issue comment N --repo <owner/name> --body "...".
Follow the comment format from ${CLAUDE_PLUGIN_ROOT}/references/comment-format.md:
Heartbeat #N counter (incremented from step 7)**Model:** line naming the model that performed the work — the loop's dispatch parameter (session model on fallback, naming both configured and actual); the subagent's self-reported model is advisory onlygithub.board_user) and include the required **Clears when:** line naming what will unblock the issueAppend an issue line to .woterclip/heartbeat-log.jsonl — one per issue worked. duration_sec is date -u +%s now, minus the start epoch printed at step 7 — seconds on this issue, not the beat's cost:
{"heartbeat": N, "timestamp": "ISO", "issue": "#12", "persona": "name", "duration_sec": N, "status": "in_progress|completed|blocked|triaged|decomposed", "actions": ["description"]}
At each beat exit that still owns its lock — step 3, 5, 8, 9, or 11 — append exactly one beat line. Field, exception, and stop-reason definitions are in ${CLAUDE_PLUGIN_ROOT}/references/beat-economics.md:
{"type": "beat", "started_at": "ISO", "ended_at": "ISO", "beat_elapsed_sec": N, "issues_worked": N, "stop_reason": "time_ceiling"}
Read the issue's current labels (gh issue view N --json labels), then update based on outcome:
Transitions are defined in ${CLAUDE_PLUGIN_ROOT}/references/status-mapping.md § WoterClip Outcomes. Two ordering rules the loop must honor:
agent-working and in-progress before gh issue close (close does not touch labels, and stale-label cleanup only scans open issues). If a PR opened instead, swap to in-review and leave the issue open.gh issue edit N --remove-label agent-working --add-label agent-blocked.If any --add-label fails because the label doesn't exist on the repo, create it and retry (see ${CLAUDE_PLUGIN_ROOT}/references/label-conventions.md § Label Operations) — do not skip the transition.
For blocked issues: @-mention the Board user's GitHub login in the comment text (e.g., "@board-login — please review"). Note: GitHub does not notify a user of their own comments — if github.board_user is the same account gh is authenticated as, the mention will NOT produce a notification; the Board must watch the repo or check /woterclip-status for blocked items.
"Eligible issues remain" means the sorted inbox from step 2 minus issues worked this beat — do not re-query to answer these tests. The ceiling (1200s default) and stop reasons are defined in ${CLAUDE_PLUGIN_ROOT}/references/beat-economics.md.
time_ceiling.max_issues_per_heartbeat with issues remaining → stop intake, reason issue_budget.complete.Before exiting, add to the report: suggest pausing the schedule if 0 todo issues remain, and suggest Board attention rather than more heartbeats if 3+ issues are blocked. Then exit per the step 1 invariant.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
7 skills in this plugin
/heartbeat-logThis skill should be used when the user asks to "show heartbeat log", "heartbeat history", "what has woterclip done", "show agent activity", "summarize heartbeats", or wants to analyze past heartbeat activity. Parses heartbeat-log.jsonl for summaries and analytics./initwoterclip-initThis skill should be used when the user asks to "initialize woterclip", "set up woterclip", "woterclip init", "configure woterclip for this repo", or runs the /woterclip-init command. Scaffolds a repo with WoterClip config, persona directories, and GitHub labels./persona-createThis skill should be used when the user asks to "create a persona", "add a new persona", "set up a new agent role", "add a woterclip persona", or runs the /persona-create command. Interactively creates a new WoterClip persona with SOUL.md, TOOLS.md, and config.yaml.npx claudepluginhub wotai-dev/woterclip --plugin woterclipOther plugins' skills for the same job