End-to-End Task Executor
Read the full workflow from .claude/commands/do.md and execute it. Use .claude/rules/00-rule-routing.md and the nearest AGENTS.md to find the rules for the changed paths, and read them before editing.
For CI waits, default to check_suite.completed + workflow_run.completed for the
full 40-character PR head SHA. Opt in to check_run.completed only for early
per-job failure or job-specific progress. Reconcile all current GitHub checks on
every resume; one suite/workflow completion includes failures and is not all-CI
success. Subscriptions stay active after delivery: while required checks are
pending on the same SHA, retain the existing subscription and fallback and end
your turn again; do not recreate them on each wake. Keep one bounded fallback schedule for missing terminal webhooks; follow
docs/guides/ci-wait-recovery.md for registration, reconciliation and cleanup.
When you open the PR, also subscribe to source: github, subjectType: pull_request,
subjectId: <PR number> (no eventType) so Codex, CodeRabbit and human reviews/comments
wake you; address or reply to every finding before merge.
Quick Summary
- Research — understand the request, search the codebase, read related docs
- If the user explicitly asks for local subagent critique before implementation, gather bounded local subagent reviews and reconcile them before editing.
- Task file — create in
tasks/backlog/, commit to main - Worktree — create feature branch and worktree
- Implement — follow checklist, push frequently, run quality checks. After the first push open the PR as a draft (
gh pr create --draft); draft PRs run only quick CI checks. For UI changes: run mandatory Playwright visual audit with mock data on mobile + desktop viewports (see.claude/rules/17-ui-visual-testing.md) - Validate — full quality suite: lint, typecheck, test, build. As soon as the candidate is complete, mark the PR ready (
gh pr ready <pr-number>), which starts the full CI suite, and request CodeRabbit at the same moment; reviews and staging then run in parallel with CI and CodeRabbit - Review — invoke local specialist skills / local subagents ($go-specialist, $cloudflare-specialist, etc.)
- Staging — there are two installations,
staging(sammy.party) andstaging2(sammy2.party); read both queues withnode scripts/deploy/staging-lease.mjs status <name>(onegh apicall) and use the free or shorter one with-f environment=<name>(staging2 sign-in: workload identity). A branch adding a Durable Object migration tag that main lacks must use staging2 and, if unmerged when done, tear staging2 down, redeploy main before releasing, and file an inbox item asking Raphaël to redo staging2's manual credential setup (teardown erases it). Reserve first:gh workflow run deploy-staging.yml --ref <branch> -f environment=<name> -f lease_action=reserve -f sam_task_id=<task-id>; schedule a SAM wake at your turn start (shown in the run summary andstatus) instead of polling or chatting, and never dispatch a deploy while another branch holds the lease or has its turn. On your turn deploy with the same command minuslease_action(only the head of the queue may take a freed slot, for a 10-minute grace period by default). After live checks release with-f lease_action=release, confirm success, and if you released early message the next task in the queue. Configurable hold defaults/cap and commands:.agent-instructions/reference/rules/13-staging-verification-full.md. Use$CF_TOKENto query D1/KV/DNS directly (see.claude/rules/32-cf-api-debugging.md) to verify migrations, data state, and feature flags — this is faster and more precise than UI-based checks. Then verify changed behavior end-to-end via Playwright. For infrastructure changes (cloud-init, VM agent, DNS, TLS, scripts/deploy): MUST provision a real VM and verify heartbeat arrives. - PR — the PR is already ready from step 5 (create it now if not, not as a draft). Wait for the full CI run on the ready PR (the required
Durable Object Workerscheck reports only after every job finished). CodeRabbit is requested when the PR is marked ready, through the trusted GitHub Actions path: apply thecoderabbit-reviewlabel withgh pr edit <pr-number> --add-label coderabbit-review; if the label run did not fire (it never fires on a draft PR), rungh workflow run coderabbit-bot-review.yml --ref main -f pr_number=<pr-number>. Do not post@coderabbitai reviewdirectly with an agent token. Then wait about 15 minutes from the request, ending at once on aReview skipped, rate-limit or quota reply. A CodeRabbit review is not required, but one that arrives blocks merge: implement or resolve every finding with a reason, and give incremental reviews after pushed fixes the same wait. If no review arrives (silence,Review skipped, rate limit), record that in the PR's CodeRabbit Review Evidence and continue. Do not re-trigger in a loop, and never addneeds-human-reviewor wait for a waiver because CodeRabbit is silent (see.claude/rules/25-review-merge-gate.md). If the user requested draft PR / do-not-merge, do not mark it ready; get the full suite withgh workflow run ci.yml --ref <branch>, stop at the draft PR and do not merge. - Cleanup — remove worktree, pull main
⚠️ Anti-Compaction: State File
Long /do runs lose context to compaction. You MUST maintain .do-state.md (local-only, snapshot-visible; never commit) as external memory. Re-read it before every phase. See .claude/rules/14-do-workflow-persistence.md.