From pg-plugin
Use when the user wants to automate, schedule, or run work autonomously/remotely — setting up a /goal, /loop, routine, channel, or long unattended run, or asking "how do I keep Claude working on X". Designs the loop contract (prompt + verification + stop conditions) instead of just running the task.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pg-plugin:loop-architectThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Design loops and goals the way Boris Cherny does: "Turn workflows into skills, then loop them."
Design loops and goals the way Boris Cherny does: "Turn workflows into skills, then loop them." Output of this skill = a concrete, copy-pasteable setup (goal contract, loop prompt, or routine prompt) with verification and hard stops — not a vague plan.
A loop pays off only when ALL four hold. Check honestly; if one fails, recommend a plain one-shot prompt instead and say which condition failed.
| Situation | Primitive |
|---|---|
| Work until a verifiable end state is true | /goal (Haiku evaluator checks after every turn) |
| Poll/babysit on a cadence while a session is open | /loop <interval> <skill-or-prompt> |
| Recurring default maintenance for this repo | bare /loop + a .claude/loop.md |
| A backlog of shippable changes worked unattended | docs/goals queue — fill with define-goal, work with /loop 15m /dispatch |
| Must run with the laptop closed | Routine (/schedule; cloud; schedule / API / GitHub triggers) |
| Needs local files, machine on, no session open | Desktop scheduled task |
| React to external events (CI, chat) instead of polling | Channels (--channels) or Routine API trigger |
| Massively parallel / adversarial / unknown-size work | Dynamic workflow (pair with /goal for hard completion) |
| Deterministic check on every turn, all sessions | Stop hook |
Combos are normal: workflow + /goal for hard completion; skill + /loop for cadence;
routine + channel for laptop-closed with phone telemetry.
Workflow thresholds (per Claude Code docs): >5 independent agents or a multi-stage find→verify→synthesize loop → workflow; 2–4 parallel lookups → plain subagents, cheaper and simpler; anything that must survive the session (cross-iteration implementers, multi-day queues) → background agents + a state file, never a workflow — runs are session-bound and don't resume across sessions. The Workflow tool needs Claude Code ≥2.1.154 and can be disabled; design a plain-subagent fallback.
CRITICAL CONSTRAINT: the evaluator only reads the transcript. It cannot run commands or read files. Every clause must be demonstrable by output Claude prints (test results, exit codes, diffs, counts). Never write taste conditions ("clean", "better", "high quality").
/goal <end state> verified by <command + expected output Claude will print>
while preserving <what must not regress/change>.
Work only within <files/branches/tools boundaries>.
Between iterations, record what changed, what the check showed, and the next best action.
If blocked or no valid paths remain, stop and report attempted paths, evidence, the
blocker, and what would unlock progress. Stop after <N> turns.
/loop 10m /skill-name./loop uses .claude/loop.md if present.--resume.The prompt must be self-contained: what to read, what to do, how to verify, where to write
results, what success means, what to escalate. Pushes only to claude/-prefixed branches
unless unrestricted pushes were explicitly enabled. Scope repos, connectors, and network
access to the minimum the routine needs.
docs/goals/index.yaml queue (created by define-goal,
worked by /loop 15m /dispatch) — prefer it over inventing a new state file.config.execution: herdr): run
/loop 15m /dispatch from an orchestrator ideally inside a herdr pane (a plain terminal
also works — recovery then leans on lanes); it spawns each goal as a
fresh /goal claude in its own goal/NNN worktree pane, terminated by a unique
done-marker, and survives client detach via the herdr server. Capability-gated — degrades
to native in-process agents when herdr is absent. See dispatch/references/herdr-mode.md.Always include, in the prompt itself:
claude --rc <name> or /remote-control; server mode
claude remote-control --spawn worktree for multiple phone-spawned sessions/config → "Push when Claude decides"; or "notify me when X finishes" in
the prompt; channels (Telegram/Discord/iMessage) for two-way chat into a live session& / --teleport) to move
sessions between local and cloudDeliver: (1) chosen primitive + one-line why, (2) the exact contract/prompt block ready to paste, (3) the gate + state file, (4) the hard stops included, (5) any skill/loop.md file to create — create it if the user agrees or has asked for setup. Keep it to one screen.
npx claudepluginhub pragmaticgrowth/pg-plugin --plugin pg-pluginGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.