Skip to content

Practical patterns, starters & CLI tools for loop engineering with AI coding agents. Design systems that prompt and orchestrate agents (inspired by Addy Osmani and Boris Cherny). Includes loop-audit, loop-init, loop-cost.

docs(hermes): add Hermes Loop Verifier example (L2 maker/checker split) (#548)

Gina49fa041c6642
diff --git a/examples/README.md b/examples/README.md
index e044e31..698b11a 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -43,3 +43,5 @@ L2 patterns ship multi-tool skills inside one starter folder — see `starters/<
| OpenClaw | [openclaw/daily-triage.md](./openclaw/daily-triage.md) (manual) | [openclaw/pr-babysitter.md](./openclaw/pr-babysitter.md) | [openclaw/ci-sweeper.md](./openclaw/ci-sweeper.md) | [openclaw/dependency-sweeper.md](./openclaw/dependency-sweeper.md) | [openclaw/post-merge-cleanup.md](./openclaw/post-merge-cleanup.md) | [openclaw/changelog-drafter.md](./openclaw/changelog-drafter.md) | [openclaw/issue-triage.md](./openclaw/issue-triage.md) |
| Hermes | [hermes/daily-triage.md](./hermes/daily-triage.md) (manual) | [hermes/pr-babysitter.md](./hermes/pr-babysitter.md) (manual) | [hermes/ci-sweeper.md](./hermes/ci-sweeper.md) (manual) | — | — | — | [hermes/issue-triage.md](./hermes/issue-triage.md) (manual) |
| Opencode | [minimal-loop-opencode](../starters/minimal-loop-opencode/) | [pr-babysitter-opencode](../starters/pr-babysitter-opencode/) | [ci-sweeper-opencode](../starters/ci-sweeper-opencode/) | [dependency-sweeper-opencode](../starters/dependency-sweeper-opencode/) | [post-merge-cleanup-opencode](../starters/post-merge-cleanup-opencode/) | [changelog-drafter-opencode](../starters/changelog-drafter-opencode/) | [issue-triage-opencode](../starters/issue-triage-opencode/) |
+
+L2 maker/checker split (any Hermes pattern): [hermes/loop-verifier.md](./hermes/loop-verifier.md)
diff --git a/examples/hermes/README.md b/examples/hermes/README.md
index dcc67fa..06d6add 100644
--- a/examples/hermes/README.md
+++ b/examples/hermes/README.md
@@ -8,6 +8,7 @@
| [pr-babysitter.md](./pr-babysitter.md) | PR Babysitter (L1 report → L2 worktree + verifier) |
| [ci-sweeper.md](./ci-sweeper.md) | CI Sweeper (L1 report → L2 worktree + verifier) |
| [issue-triage.md](./issue-triage.md) | Issue Triage (L1 propose-only → L2 allowlisted labels) |
+| [loop-verifier.md](./loop-verifier.md) | Loop Verifier (L2 — independent maker/checker split via `delegate_task`) |
Optional **channel delivery** (Telegram, Slack, Discord, WhatsApp, SMS, Feishu) is Hermes's differentiator — the same cron job can post its summary into any connected home channel.
diff --git a/examples/hermes/loop-verifier.md b/examples/hermes/loop-verifier.md
new file mode 100644
index 0000000..0b44c7a
--- /dev/null
+++ b/examples/hermes/loop-verifier.md
@@ -0,0 +1,129 @@
+# Loop Verifier — Hermes Agent (`delegate_task`)
+
+The verifier is the maker/checker half of any L2 Hermes loop. Claude Code ships it as
+[`.claude/agents/loop-verifier.md`](../../starters/pr-babysitter/.claude/agents/loop-verifier.md)
+and Codex as
+[`.codex/agents/verifier.toml`](../../starters/ci-sweeper/.codex/agents/verifier.toml);
+Hermes has no agent file format, so the verifier lives as a **skill** plus a
+**delegate call**. This page shows how to wire the repo's tool-agnostic
+[`loop-verifier` skill](../../skills/loop-verifier/SKILL.md) into a Hermes cron
+loop as an independent, test-running reviewer.
+
+The one rule that makes a verifier a verifier: **it must not live in the same run
+as the implementer.** In Hermes that means a `delegate_task` call with a
+review-only prompt and its own isolated session — never prompting the main agent
+to "review itself".
+
+## Setup
+
+```bash
+# User-scoped skill — available to every Hermes session
+mkdir -p ~/.hermes/skills/loop-verifier
+cp templates/SKILL.md.verifier ~/.hermes/skills/loop-verifier/SKILL.md
+
+hermes skills list | grep loop-verifier
+```
+
+For a project-scoped verifier, put it in `.hermes/skills/loop-verifier/` instead.
+
+## Week two — wiring the verifier into a loop
+
+Start with the L1 report loop from
+[`daily-triage.md`](./daily-triage.md). In week two, the same cron job proposes a
+fix but never applies it. The verifier runs as a separate `delegate_task` call.
+
+An L2 fixer cron job that hands off to the verifier:
+
+```bash
+hermes cron create "0 7 * * 1-5" \
+ --name "Triage → apply + verify" \
+ --deliver local \
+ --skill loop-triage \
+ --workdir "$PWD" \
+ "Read the injected triage output. If it contains a fenced patch: create an isolated git worktree, apply the patch, run the project's test command, then delegate a verifier subagent to review the diff. Escalate ambiguous or denylisted paths. Update STATE.md with the outcome."
+```
+
+The verifier call itself — **review-only**, its own session, no fix tools:
+
+```text
+delegate_task(
+ role="leaf",
+ goal="Run the loop-verifier skill on the change in the current worktree. " \
+ "Return APPROVE, REJECT, or ESCALATE_HUMAN with evidence.",
+ context="Fixing regression from STATE.md item #1241. Implementer proposes ...",
+ toolsets=["terminal", "read"]
+)
+```
+
+Split implementer and verifier across **two** cron jobs chained with
+`--context-from` (the upstream job's stdout is injected into the downstream
+job's prompt) when you need the verifier fully independent:
+
+```bash
+# 1. Implementer job proposes the fix
+IMPLEMENTER_ID=$(hermes cron create "5 7 * * 1-5" \
+ --name "daily-fix-propose" \
+ --deliver local \
+ --skill loop-triage \
+ --workdir "$PWD" \
+ "Run the loop-triage skill. For high-priority single-file bugfixes propose a minimal diff in a fenced patch block. Update STATE.md. Do not apply." \
+ | tail -1)
+
+# 2. Verifier job reviews the proposal, catching scope or test problems
+VERIFIER_ID=$(hermes cron create "10 7 * * 1-5" \
+ --name "daily-fix-verify" \
+ --deliver local \
+ --skill loop-verifier \
+ --workdir "$PWD" \
+ "Read the injected proposal. Review it against STATE.md using the loop-verifier skill: scope, intent, tests, no-cheating, risk. Update STATE.md with the verdict." \
+ | tail -1)
+
+hermes cron edit "$VERIFIER_ID" --context-from "$IMPLEMENTER_ID"
+```
+
+The jobs are independent sessions; `--context-from` joins them into a pipeline.
+This is the Hermes shape of the maker/checker split. The implementer can be a
+`delegate_task` too — but the verifier must always be a separate call or job.
+
+## Verification split
+
+| Role | Hermes shape |
+|------|--------------|
+| Triage | `loop-triage` skill + `hermes cron --deliver local` (see L1) |
+| Implementer | Main cron run (L2) or a leaf `delegate_task` in a git worktree |
+| Verifier | Second `delegate_task`, or a chained cron job via `--context-from` |
+
+Keep the verifier's tool allowance minimal: `terminal` (to run tests) and `file`
+(to read the diff) are enough for most review loops. Do not hand it write access
+to git or to MCP connectors unless the loop is fully trusted.
+
+## Safety (L1 → L2)
+
+- Week one stays report-only; the verifier adds no touch to production.
+- The verifier's default stance is **REJECT** until tests run and scope is
+ checked — the `loop-verifier` skill encodes this.
+- Do not trust the implementer's claim that tests passed; the verifier must run them.
+- Escalate ambiguous, auth, payments, security, or public-API changes to a human
+ (see [docs/safety.md](../../docs/safety.md)).
+
+## Cost & running
+
+```bash
+hermes cron list
+hermes cron status
+hermes cron run <job-id> # one-off test tick
+hermes cron edit "$VERIFIER_ID" --context-from "$IMPLEMENTER_ID"
+hermes cron pause <job-id>
+```
+
+Every verifier is a fresh agent session, so count it in a token/attempt budget —
+see [loop-budget.md](../../loop-budget.md) and
+[loop-cost](../../tools/loop-cost/). Typical L2: triage (cheap) → implement
+(expensive) → verify (medium). Attempt cap of 3 before escalation.
+
+## References
+
+- [Loop Verifier skill](../../skills/loop-verifier/SKILL.md) — the shared spec
+- [Hermes Daily Triage](./daily-triage.md) — L1 base this wires into
+- [Hermes PR Babysitter](./pr-babysitter.md) — L2 progression with worktrees
+- [docs/safety.md](../../docs/safety.md) — human gates
\ No newline at end of file