Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .agents/skills/do/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: do
description: 'End-to-end autonomous task executor. Takes a task description and handles the full lifecycle: research, plan, implement, review with specialist skills, iterative CodeRabbit review, and merge via PR. Use when given a task to execute end-to-end.'
description: 'End-to-end autonomous task executor. Takes a task description and handles the full lifecycle: research, plan, implement, review with specialist skills, best-effort CodeRabbit review, and merge via PR. Use when given a task to execute end-to-end.'
---

# End-to-End Task Executor
Expand All @@ -17,7 +17,7 @@ Read the full workflow from `.claude/commands/do.md` and execute it. Use `.claud
5. **Validate** — full quality suite: lint, typecheck, test, build
6. **Review** — invoke local specialist skills / local subagents ($go-specialist, $cloudflare-specialist, etc.)
7. **Staging** — check for existing staging deploys (wait 5min if active), trigger manual deployment via `gh workflow run deploy-staging.yml --ref <branch>`. **Use `$CF_TOKEN` to 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.
8. **PR** — create with `gh pr create`, wait for CI, then request CodeRabbit through the trusted GitHub Actions path: apply the `coderabbit-review` label with `gh pr edit <pr-number> --add-label coderabbit-review`; if an explicit retry is needed for the current ready state, run `gh workflow run coderabbit-bot-review.yml --ref main -f pr_number=<pr-number>`. Do not post `@coderabbitai review` directly with an agent token. Treat CodeRabbit as merge-blocking unless the user explicitly waives it: implement or review/close all CodeRabbit feedback, rely on incremental CodeRabbit reviews after pushed fixes, and repeat until the agent and CodeRabbit agree there is no unresolved feedback. If the user requested draft PR / do-not-merge, stop at the draft PR and do not merge.
8. **PR** — create with `gh pr create`, wait for CI, then request CodeRabbit through the trusted GitHub Actions path: apply the `coderabbit-review` label with `gh pr edit <pr-number> --add-label coderabbit-review`; if the label run did not fire (it never fires on a draft PR), run `gh workflow run coderabbit-bot-review.yml --ref main -f pr_number=<pr-number>`. Do not post `@coderabbitai review` directly with an agent token. Then wait about 15 minutes. 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 add `needs-human-review` or 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, stop at the draft PR and do not merge.
9. **Cleanup** — remove worktree, pull main

## ⚠️ Anti-Compaction: State File
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/do/agents/openai.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
interface:
display_name: "Do (Task Executor)"
short_description: "End-to-end autonomous task execution"
default_prompt: "Use $do to execute a task end-to-end: research, implement, review, and complete a CodeRabbit-gated PR."
default_prompt: "Use $do to execute a task end-to-end: research, implement, review, request CodeRabbit, and merge via PR."
19 changes: 8 additions & 11 deletions .claude/commands/do.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TodoWrite([
{ content: "Phase 4: Pre-PR validation (lint, typecheck, test, build)", status: "pending", activeForm: "Running full quality suite" },
{ content: "Phase 5: Review (local specialist subagents)", status: "pending", activeForm: "Running local reviewer subagents" },
{ content: "Phase 6: Staging verification (deploy + Playwright)", status: "pending", activeForm: "Verifying on staging" },
{ content: "Phase 7: Create PR, wait for CI and CodeRabbit, merge", status: "pending", activeForm: "Creating PR and completing review gates" },
{ content: "Phase 7: Create PR, wait for CI, request CodeRabbit and wait, merge", status: "pending", activeForm: "Creating PR and completing review gates" },
])
```

Expand Down Expand Up @@ -274,30 +274,27 @@ You made a mistake. Close the PR, complete staging verification, then re-open. D

3. **If CI fails:** inspect logs, fix issues, commit, push, repeat.

4. **Once CI is fully green and every non-CodeRabbit gate is satisfied**, request CodeRabbit review through the repository's trusted GitHub Actions path, not by posting `@coderabbitai review` yourself. Apply the opt-in label first:
4. **Once CI is fully green, every other gate is satisfied, and the PR is not a draft**, request CodeRabbit review through the repository's trusted GitHub Actions path, not by posting `@coderabbitai review` yourself. Apply the opt-in label first:

```
gh pr edit <pr-number> --add-label coderabbit-review
```

If the label-triggered run needs an explicit retry for the current ready state, dispatch the same workflow from `main`:
If the label-triggered run did not fire (the label path never fires on a draft PR), dispatch the same workflow from `main`:

```
gh workflow run coderabbit-bot-review.yml --ref main -f pr_number=<pr-number>
```

Agents MUST NOT post `@coderabbitai review` directly with their own GitHub App token; CodeRabbit ignores bot-authored review commands. The workflow is the human-identity bridge.

5. **Complete the iterative CodeRabbit review loop before merge.** The PR is NOT good to go until the agent and CodeRabbit are in agreement:
- Read every CodeRabbit review comment, thread, and summary.
- Implement valid feedback, push fixes, and re-run the affected validation/CI checks.
- For feedback you believe is not applicable, explicitly review it, document the reason, and close/resolve the thread when GitHub supports that state.
- Keep the `coderabbit-review` label on the PR so CodeRabbit performs incremental reviews for subsequent commits.
- Repeat this loop until the latest CodeRabbit review after the final pushed fixes has no unresolved feedback and you independently agree the PR is ready.
5. **Wait about 15 minutes for CodeRabbit, then follow whichever case applies.** If CodeRabbit has visibly started a review that is still in progress, let it finish, up to about 45 minutes in total. A CodeRabbit review is not required; requesting one and waiting is. See `.claude/rules/25-review-merge-gate.md`.
- **A review arrived: it blocks merge until its feedback is resolved.** Read every CodeRabbit review comment, thread, and summary. Implement valid feedback, push fixes, and re-run the affected validation/CI checks. For feedback you believe is not applicable, explicitly review it, document the reason, and resolve the thread. Keep the `coderabbit-review` label on the PR so pushed fixes get incremental reviews, and give each one the same wait. You are done when no CodeRabbit feedback is unresolved and you independently agree the PR is ready. CodeRabbit not re-reviewing your fixes within the wait does not block.
- **No review arrived: skip CodeRabbit and continue.** This covers silence after the wait, a `Review skipped` status (for example `bot user not eligible for review`), a rate-limit or quota notice, and a failed request workflow. Record what you observed in the PR's "CodeRabbit Review Evidence" section. **Do NOT add `needs-human-review`, call `request_human_input`, or wait for a waiver because CodeRabbit is silent.**

**If CodeRabbit is unavailable, does not respond, or its feedback state cannot be inspected, the PR is not self-mergeable. Add `needs-human-review`, document the blocker, and do NOT merge.**
Do not re-trigger CodeRabbit in a loop; request again only for a materially new ready state. A review that lands after you stopped waiting but before merge is binding. One that lands after merge goes through a follow-up PR.

6. **Once CI is fully green and the CodeRabbit loop is complete**, merge the PR:
6. **Once CI is fully green and the CodeRabbit step is complete** (its feedback resolved, or no review arrived within the wait), merge the PR:

```
gh pr merge <pr-number> --squash --delete-branch
Expand Down
8 changes: 4 additions & 4 deletions .claude/rules/14-do-workflow-persistence.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ Phase 1: Research & Task Creation

## Phase 7: CodeRabbit Review Tracker

<populated when CodeRabbit review is requested — include `coderabbit-review` label application, unresolved findings, fix commits, incremental review status, and final no-unresolved-feedback status>
<Phase 7 is NOT merge-ready until the latest CodeRabbit review has no unresolved feedback and the agent agrees the PR is ready>
<populated when CodeRabbit review is requested — record the request time and method, then either the review's findings, fix commits, and incremental review status, or what you observed when no review arrived (silence after ~15 minutes, `Review skipped`, rate limit)>
<If CodeRabbit reviewed, Phase 7 is NOT merge-ready until no CodeRabbit feedback is unresolved. If no review arrived within the wait, record that and continue: a silent CodeRabbit never blocks merge (rule 25)>

## Implementation Progress

Expand Down Expand Up @@ -117,13 +117,13 @@ fallback bounded and record it in the workflow state file.
| Repeating already-done work | Checked items + notes show what's been accomplished |
| Jumping to PR creation early | Phase checklist enforces ordering |
| Merging before reviewers finish | Review Tracker blocks Phase 5 completion until all reviewers report back |
| Forgetting unresolved CodeRabbit feedback | Phase 7 CodeRabbit Review Tracker records label trigger, fix commits, incremental reviews, and final agreement |
| Forgetting unresolved CodeRabbit feedback | Phase 7 CodeRabbit Review Tracker records the request, the wait outcome, and any findings with fix commits |
| Silently failing production deploy | Phase 7 checklist includes deploy monitoring — task is not complete until deploy succeeds or user is alerted |
| Harness poller disappears after ACP prompt completion | Durable wait subscription wakes the parent through SAM-owned delivery |

## Cleanup

Delete `.do-state.md` at the end of Phase 7 (after CodeRabbit review completion, PR merge, deploy monitoring, and worktree cleanup). It's gitignored, so even if you forget, it won't pollute the repo.
Delete `.do-state.md` at the end of Phase 7 (after the CodeRabbit request-and-wait step, PR merge, deploy monitoring, and worktree cleanup). It's gitignored, so even if you forget, it won't pollute the repo.

## Phase 5 → Phase 6 Transition Guard

Expand Down
Loading
Loading