Skip to content

feat(loop): handler skills for the event-driven loop (2/4) - #67

Merged
Ardnived merged 5 commits into
mainfrom
claude/loop-handlers
Sep 8, 2026
Merged

Ardnived merged 5 commits into
mainfrom
claude/loop-handlers

Conversation

@Ardnived

@Ardnived Ardnived commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Second of four. Stacked on #66; retarget to main once that merges. Adds the eight skills the event-driven routines will run. There is one routine per repo; handler-preflight learns which skill to follow from the dispatch record (handlers.<handler>.skill), so the routine prompt names no skill. Nothing running reads them: work-routine, preflight, journal and survey-routine are untouched, so the hourly and nightly routines behave exactly as before.

Design: ~/.claude/plans/let-s-consider-and-create-starry-church.md (rev. 3).

What each skill is for

Skill Replaces One rule that defines it
handler-preflight preflight minus the census The record is a pointer: validate it with payload.mjs, then re-read every fact from GitHub. Check the lock before the first write and every push.
handler-journal journal One comment per run with a hidden sydevs-dispatch-done marker and the session URL; release the lock last.
address-review rung 2 Adopt = commit + in-thread reply + resolve; rebut = evidence, leave open. Never start a thread.
fix-ci rung 2 (red CI) One pass; stale SHA or a conflict stops it; never weaken a test.
resolve-conflicts rung 1's rebase Merge commit only; semantic conflicts are questions, not guesses.
revise-ticket rung 4 (investigation) A deep codebase pass that rewrites Approach/criteria/checklist with file:line refs. Opus.
split-ticket rung 3's "split rather than start" Ordered children linked by Blocked by: lines (Actions makes them native).
answer-ticket rung 4 (reply) One reply from source; a request for work is not permission. Sonnet; tool grant has no push.

Every handler pushes and ends. None waits for CI, marks ready, merges, or writes awaiting/stuck/blocked/an assignee/the draft flag — Actions owns those.

Prose that survives verbatim

The revision conditions and the human's-PR steps (work-routine rung 2), the rung-4 table, the worktree rules from #62, reviews-are-comment-only, you-cannot-push-to-a-humans-pr, respondto-is-an-allowlist. Cited by (why: …) in each file.

Verification

  • claude plugin validate ./workflow --strict — passed.
  • rule-delta.mjs --base origin/main workflow/skills — additions only, none removed.
  • ste-lint.py on the eight new files — 0 hard violations.
  • Every docs/why.md#… anchor cited by the new skills resolves (22 anchors, 9 added here).
  • Sizes: handler-preflight 3.8 KB, handler-journal 2.8 KB — the two files every fire pays for. Plan targets were 3.0/2.5 KB; the overage is the (why:) citations, kept on purpose.

Next: 3/4 additive config (handlers, dispatch, ci, review.skipWhen, budgets) · 4/4 the dispatcher, dark.

2026-09-08 revision. One routine per repo instead of one per handler: handler-preflight step 2 reads the record's handler and follows handlers.<handler>.skill; docs/why.md#one-routine-per-repo-one-prompt records why.

2026-09-08, later. docs/why.md#there-is-no-wip-cap replaces approved-is-the-implement-queue: the human verb is the throttle; the weekly reflect reports usage from the journal tally.

Ardnived and others added 5 commits September 8, 2026 11:29
Each cloud routine now runs one skill for one item, fired by GitHub
Actions with a pointer. Two bookends replace `preflight` and `journal`:
`handler-preflight` (identity, validate the record with `payload.mjs`,
check the lock, ground from the body, resume on attempt > 1) and
`handler-journal` (one comment on the day's journal issue, then release
the lock as the last write). Six handlers replace the rungs:

- address-review: adopt with a commit or rebut with evidence, per thread;
  the allowlist re-applied per thread; stacked PR on a human's branch.
- fix-ci: one pass on a red run; stale SHA and conflicts stop it.
- resolve-conflicts: merge main in, resolve from both sides' intent.
- revise-ticket: a deep codebase pass that rewrites the body with
  file:line approach, criteria and an executable checklist.
- split-ticket: the same analysis ending in ordered children, linked by
  `Blocked by:` lines Actions turns into relationships.
- answer-ticket: one reply from source, on a tool grant with no push.

Every handler pushes and ends. None waits for CI, marks ready, merges, or
writes a label other than its own lock; Actions owns all of that. The
prose the rungs proved keeps its wording where it still applies, cited
by line in the plan.

No running skill reads these yet. `rule-delta`: additions only.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Anchors the new skills cite: actions-observes-classifies-locks-and-fires,
the-lock-label-is-the-lease, push-and-end, the-bot-actor-exception,
the-payload-is-a-pointer, thirteen-prompts-one-template,
awaiting-has-one-writer, the-critic-skips-small-prs,
approved-is-the-implement-queue. Each names the measured failure it
answers, from the 2026-09-07 audit.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…m the record

The handler is a field in the dispatch record and `handlers.<handler>.skill`
names the skill, so a routine no longer needs to know which handler it runs.
`payload.mjs --attached` refuses a record whose repo is not checked out,
which is the per-repo analogue of `--expect-handler`. The why.md story
explains what a routine still fixes — the repositories it clones — and
what the per-repo shape costs: one model and one tool grant per repo.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@Ardnived
Ardnived force-pushed the claude/loop-handlers branch from b8fc233 to da84dd3 Compare September 8, 2026 18:29
@Ardnived
Ardnived merged commit d18f654 into main Sep 8, 2026
1 check passed
@Ardnived
Ardnived deleted the claude/loop-handlers branch September 8, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant