/loop-dispatch:loop-dispatchfrom loop-dispatch
Single front door for a repo's automation loops, so one routine per repo can handle every loop event instead of one routine per event. Deterministically routes each triggering GitHub event to the matching loop skill; a non-matching event is a quiet no-op. It only routes; each loop owns its own guardrails. Repo-agnostic; github-ops required. Trigger from one per-repo routine wired to all the loop events.
Ships in loop-dispatch. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The front door to a repo's automation loops. A committed GitHub Action routes each
loop event at the edge (via route-event.sh) and fires this routine only on a match,
handing it the resolved route. This skill dispatches that route to the matching loop —
one routine per repo instead of one per loop/event.
It is a router, not a worker. It never builds, merges, or releases anything itself; it invokes the loop skill that owns that job, and that skill enforces all its own gates and models. loop-dispatch adds no policy of its own.
route-event.sh (run at the edge by the caller workflow — see new-loop-routine and
references/webhook-context.md, not here) maps the exact
(event, action, label|state) tuple to a loop. After changing the routing table, run
test/run.sh to verify its decisions stay correct. Anything unmatched → the routine is
never fired. The mapping it applies:
| event | action | label / state | Run |
|---|---|---|---|
issues | labeled | label = ai-ready | /issue-build-loop |
issues | labeled | label = auto-releasing (issue title release <version>) | /auto-release-loop |
issues | labeled | label = ai-discussing | /issue-discuss-loop |
issue_comment | created | issue carries ai-discussing + is open, comment is unsigned and doesn't start //, author is a trusted User, not a PR | /issue-discuss-loop |
pull_request | labeled | label = auto-merging | /merge-flow |
pull_request | labeled | label = auto-reworking | /rework-loop |
The issue_comment row is the only one that isn't a label event: it carries the next round of
an ai-discussing conversation. The comment payload has no .label, so the router reads the
labels already on the issue (.issue.labels[]) instead, plus the gates in the table row
above. See references/webhook-context.md for the exact fields and why each gate exists —
all of them fail closed, a missing or unexpected field routes nowhere.
Rework is a label, not the review event — uniform with the rest, and it works with one
account (you can't fire a pull_request_review workflow by reviewing your own PR, and
the loop's identity is often the reviewer's). Flow: a reviewer leaves comments, then adds
auto-reworking to say "address these". Review events route nowhere.
Everything else — pull_request.opened, a PR labelled dependencies/javascript, an
issue labelled anything else, a comment on an issue without ai-discussing, any review event —
matches no row, so the edge never fires the routine. This is what kills the wasteful fires: a Dependabot PR labelled
dependencies woke merge-flow 4× overnight under per-event routines; here the edge
stops immediately, waking no routine.
Your turn contains the decision the edge already made — e.g.
route=merge-flow repo=umbraco/… number=269. The caller workflow ran route-event.sh
and only fired you because it matched, so take that route as given; don't re-derive it.
(If a fire ever arrives with no resolved route, quiet no-op — never go looking for work.)
The fire may also come from the agent-orchestration Worker instead of the caller workflow,
on a repo that has handed dispatch over to it; the route line is identical, so handle it the
same way.
Re-check the entity before acting. Between the event and this session a label can be
removed or the PR/issue closed. Fetch it (github-ops → issue_read/pull_request_read,
method: "get", exact owner/repo/number) and confirm it still carries the
triggering label / is still open. If not, quiet no-op.
If the fire text carries a log_token=…, pass it to the loop too ("record the work log with the work-log
skill, log_token=…"); never echo it anywhere else.
Invoke the matched skill exactly as its own dedicated routine would, scoped to the specific issue/PR, and follow that skill's instructions verbatim:
ai-ready issue → /issue-build-loop for that issue. It detects the repo's shape itself and picks the matching build
playbook — the MCP toolchain one for server repos and Umbraco-MCP-Base (SDK monorepo,
full test suite), the lightweight content playbook for repos with no toolchain (the ops
repo, docs/plugin repos). Same route=issue-build-loop signal either way.auto-merging PR → /merge-flow for that PR (it handles only the PR the fire names).auto-reworking PR label → /rework-loop for that PR.route=review-loop on an ai-reviewing PR (only ever from the orchestrator, once the
PR's CI is green) → /review-loop for that PR.auto-releasing issue → /auto-release-loop, version taken from the issue title.route=release-publish on an auto-releasing issue (only ever from the orchestrator,
after it merged the release PR) → /release-publish, or the publish skill the
repo's CLAUDE.md names instead.ai-discussing issue, or a comment on one → /issue-discuss-loop for that issue. It
discusses only: no code, no PR, and it never clears its own label (the human owns
ai-discussing; at the round cap the Worker removes it after discussion_capped), so
don't expect the label to be gone afterwards and don't remove it here.One event → one loop. Do not chain (don't build then merge then release in a single fire) — each of those has its own event that will dispatch its own run. Hand off and stop.
There is deliberately no sweep / "check everything" fallback — routing is only ever
driven by a real event through route-event.sh. No event, or an unmatched one, is a
quiet no-op.
ai-ready for building, auto-merging as the
merge approval, auto-releasing to ship. loop-dispatch does not relax any of them.fable. The dispatcher runs on a cheap base model (inherit the
routine's model); the real work — and its model choice — happens inside the loop
skills and their subagents.To stand up the one routine per repo, use the
new-loop-routine skill — it owns the standardised
config, the locked prompt template, and the event-wiring steps.
What SKILL.md sets; muted values are Claude Code's defaults
3 skills in this plugin
/new-loop-routineStand up the standardised loop-dispatch routine and caller GitHub Action for a repo — the one-time setup that onboards a repo to the loop automation. Use when onboarding a new repo to the loops, or to standardise/rewrite existing routines. Interactive/local./worker-envWhat THIS cloud worker environment provides for Umbraco MCP work — the .NET SDK, whether SQL Server is available, and how to bring a fresh Umbraco instance up per session — plus how to read it from the manifest the env-build writes. Consult this BEFORE any DB-backed work (running integration tests, chaining to a live CMS) so you use what's already installed instead of probing or reinstalling.Other plugins' skills for the same job
npx claudepluginhub hifi-phil/umbraco-mcp-ops --plugin loop-dispatch