Skip to content

Commit 28b56d7

Browse files
authored
v0.7.38: mothership improvements, clickup, rocketlane integrations, gitlab tools, deployment state machine, gitlab tools, rich rendering
2 parents 9d23e25 + 7e975e7 commit 28b56d7

892 files changed

Lines changed: 131392 additions & 6638 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/babysit/SKILL.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
22
name: babysit
3-
description: Drive a PR to a clean review (Greptile 5/5, zero open threads) — ships if needed, triggers Greptile/Cursor Bugbot, fixes real findings, replies to and resolves every thread, and loops until clean
3+
description: Drive a PR to a clean review (Greptile 5/5, zero open threads) — ships if needed, keeps it mergeable against staging, triggers Greptile/Cursor Bugbot, fixes real findings, replies to and resolves every thread, and loops until clean
44
---
55

66
# Babysit PRs
77

88
Owns a PR end-to-end through review: ship it, wait for the automatic review round, and if it
99
isn't already clean, drive fix → reply → resolve → re-review cycles until Greptile reports 5/5
10-
and there are zero open comment threads. Designed to be run under `/loop` (no fixed interval —
11-
let it self-pace on review latency) so it survives across multiple wakeups in the same session.
10+
and there are zero open comment threads, keeping the branch mergeable against staging along the
11+
way. Designed to be run under `/loop` (no fixed interval — let it self-pace on review latency)
12+
so it survives across multiple wakeups in the same session.
1213

1314
## When to use
1415

@@ -33,8 +34,9 @@ round. Always check both conditions freshly after every push.
3334

3435
## Loop
3536

36-
1. **Check current state** before doing anything:
37+
1. **Check current state** before doing anything, including whether the PR is still mergeable:
3738
```bash
39+
gh pr view <n> --json mergeable
3840
gh pr view <n> --json comments -q '[.comments[] | select(.author.login=="greptile-apps")] | last | .body'
3941
gh api graphql -f query='
4042
query { repository(owner: "<owner>", name: "<repo>") { pullRequest(number: <n>) {
@@ -49,14 +51,18 @@ round. Always check both conditions freshly after every push.
4951
stop yet: re-run the same query with `after: "<endCursor>"` and keep paging until
5052
`hasNextPage` is `false` before evaluating "clean." A PR with more than 50 threads is rare but
5153
stopping on a partial page would silently miss unresolved ones past the cutoff.
52-
If Greptile is 5/5 and every thread across all pages has `isResolved: true`, stop — report the
53-
outcome (see "Reporting" below) and skip the rest of this list.
54+
If `mergeable` is `CONFLICTING`, fix that first (step 2). Otherwise, if Greptile is 5/5 and
55+
every thread across all pages has `isResolved: true`, stop — report the outcome (see
56+
"Reporting" below) and skip the rest of this list.
5457

55-
2. **If no review has run yet** (fresh PR, no Greptile/Cursor comments): they usually run
58+
2. **If the PR has a merge conflict**, merge `origin/staging`, resolve the conflicts, run the
59+
usual pre-push checks, push, and go to step 8 to re-trigger review.
60+
61+
3. **If no review has run yet** (fresh PR, no Greptile/Cursor comments): they usually run
5662
automatically on PR open — confirm via `gh pr checks <n>` (look for `Cursor Bugbot` /
5763
`Greptile Review`) and wait for that first round before doing anything else.
5864

59-
3. **If a review round has landed and it isn't clean**: for every thread where
65+
4. **If a review round has landed and it isn't clean**: for every thread where
6066
`isResolved: false`, triage the finding on its own merits — this is the part that requires
6167
judgment, not a mechanical loop:
6268
- **Real bug**: fix it in the cleanest way available. Match the codebase's existing
@@ -71,7 +77,7 @@ round. Always check both conditions freshly after every push.
7177
- **Already fixed by an earlier finding in the same round**: note that and resolve without a
7278
duplicate code change.
7379

74-
4. **Reply to every thread individually** before resolving it — never resolve silently:
80+
5. **Reply to every thread individually** before resolving it — never resolve silently:
7581
```bash
7682
gh api repos/<owner>/<repo>/pulls/<n>/comments/<databaseId>/replies -f body="<what was done and why>"
7783
```
@@ -80,7 +86,7 @@ round. Always check both conditions freshly after every push.
8086
gh api graphql -f query='mutation { resolveReviewThread(input: {threadId: "<threadId>"}) { thread { isResolved } } }'
8187
```
8288

83-
5. **Before pushing, re-run the full sync check from `/ship` step 2** — not just the log command,
89+
6. **Before pushing, re-run the full sync check from `/ship` step 2** — not just the log command,
8490
the whole check-and-recover flow (stash WIP if needed, rebase, verify the rebase didn't just
8591
cleanly replay stray commits, cherry-pick rebuild if it did or if it conflicted). A babysit
8692
loop spanning a long session is exactly the scenario where a branch can drift, and pushing
@@ -91,7 +97,7 @@ round. Always check both conditions freshly after every push.
9197
gates from `/ship` steps 4 and 5. A review-fix round is still a code change and can trip
9298
either gate just as easily as the original commit did.
9399

94-
6. **Commit and push** the round's fixes as one commit — `--force-with-lease` whenever step 5's
100+
7. **Commit and push** the round's fixes as one commit — `--force-with-lease` whenever step 6's
95101
sync check rewrote history, which includes a plain `git rebase origin/staging` that completed
96102
with no conflicts, not only the cherry-pick rebuild path; both rewrite commits already
97103
published to the remote, so a plain `git push` can be rejected either way — then run `/ship`
@@ -104,24 +110,24 @@ round. Always check both conditions freshly after every push.
104110
`git log` is newest-first, so without it a positional comparison can spuriously fail on any
105111
multi-commit branch.
106112
These two lists must describe the same commits. A review loop runs many pushes across many
107-
rounds; checking sync only before the push (step 5) and never after is how a bad push or a
113+
rounds; checking sync only before the push (step 6) and never after is how a bad push or a
108114
PR whose commit history quietly went stale between rounds goes unnoticed.
109115

110-
7. **Re-trigger review** by posting `@greptile` and `@cursor review` as **two separate PR
116+
8. **Re-trigger review** by posting `@greptile` and `@cursor review` as **two separate PR
111117
comments** — never combine them into one comment, each bot only responds to its own mention:
112118
```bash
113119
gh pr comment <n> --body "@greptile"
114120
gh pr comment <n> --body "@cursor review"
115121
```
116122

117-
8. **Wait for the new round**, then go back to step 1. Pace the wait with `ScheduleWakeup` using
123+
9. **Wait for the new round**, then go back to step 1. Pace the wait with `ScheduleWakeup` using
118124
a fallback delay of ~250–300s (Greptile/Cursor typically take 1–3 minutes) — never busy-poll
119125
in a sleep loop. Pass the same `/loop babysit PR <n>` prompt on each wakeup so the loop
120126
resumes correctly.
121127

122-
9. **Stop conditions**: clean state reached (see above), or the same unresolved finding survives
123-
two consecutive rounds with no new information (surface it to the user instead of looping
124-
forever), or the user interrupts.
128+
10. **Stop conditions**: clean state reached (see above), or the same unresolved finding or
129+
merge conflict survives two consecutive rounds with no new information (surface it to the
130+
user instead of looping forever), or the user interrupts.
125131

126132
## Reporting
127133

.claude/commands/babysit.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
2-
description: Drive a PR to a clean review (Greptile 5/5, zero open threads) — ships if needed, triggers Greptile/Cursor Bugbot, fixes real findings, replies to and resolves every thread, and loops until clean
2+
description: Drive a PR to a clean review (Greptile 5/5, zero open threads) — ships if needed, keeps it mergeable against staging, triggers Greptile/Cursor Bugbot, fixes real findings, replies to and resolves every thread, and loops until clean
33
---
44

55
# Babysit PRs
66

77
Owns a PR end-to-end through review: ship it, wait for the automatic review round, and if it
88
isn't already clean, drive fix → reply → resolve → re-review cycles until Greptile reports 5/5
9-
and there are zero open comment threads. Designed to be run under `/loop` (no fixed interval —
10-
let it self-pace on review latency) so it survives across multiple wakeups in the same session.
9+
and there are zero open comment threads, keeping the branch mergeable against staging along the
10+
way. Designed to be run under `/loop` (no fixed interval — let it self-pace on review latency)
11+
so it survives across multiple wakeups in the same session.
1112

1213
## When to use
1314

@@ -32,8 +33,9 @@ round. Always check both conditions freshly after every push.
3233

3334
## Loop
3435

35-
1. **Check current state** before doing anything:
36+
1. **Check current state** before doing anything, including whether the PR is still mergeable:
3637
```bash
38+
gh pr view <n> --json mergeable
3739
gh pr view <n> --json comments -q '[.comments[] | select(.author.login=="greptile-apps")] | last | .body'
3840
gh api graphql -f query='
3941
query { repository(owner: "<owner>", name: "<repo>") { pullRequest(number: <n>) {
@@ -48,14 +50,18 @@ round. Always check both conditions freshly after every push.
4850
stop yet: re-run the same query with `after: "<endCursor>"` and keep paging until
4951
`hasNextPage` is `false` before evaluating "clean." A PR with more than 50 threads is rare but
5052
stopping on a partial page would silently miss unresolved ones past the cutoff.
51-
If Greptile is 5/5 and every thread across all pages has `isResolved: true`, stop — report the
52-
outcome (see "Reporting" below) and skip the rest of this list.
53+
If `mergeable` is `CONFLICTING`, fix that first (step 2). Otherwise, if Greptile is 5/5 and
54+
every thread across all pages has `isResolved: true`, stop — report the outcome (see
55+
"Reporting" below) and skip the rest of this list.
5356

54-
2. **If no review has run yet** (fresh PR, no Greptile/Cursor comments): they usually run
57+
2. **If the PR has a merge conflict**, merge `origin/staging`, resolve the conflicts, run the
58+
usual pre-push checks, push, and go to step 8 to re-trigger review.
59+
60+
3. **If no review has run yet** (fresh PR, no Greptile/Cursor comments): they usually run
5561
automatically on PR open — confirm via `gh pr checks <n>` (look for `Cursor Bugbot` /
5662
`Greptile Review`) and wait for that first round before doing anything else.
5763

58-
3. **If a review round has landed and it isn't clean**: for every thread where
64+
4. **If a review round has landed and it isn't clean**: for every thread where
5965
`isResolved: false`, triage the finding on its own merits — this is the part that requires
6066
judgment, not a mechanical loop:
6167
- **Real bug**: fix it in the cleanest way available. Match the codebase's existing
@@ -70,7 +76,7 @@ round. Always check both conditions freshly after every push.
7076
- **Already fixed by an earlier finding in the same round**: note that and resolve without a
7177
duplicate code change.
7278

73-
4. **Reply to every thread individually** before resolving it — never resolve silently:
79+
5. **Reply to every thread individually** before resolving it — never resolve silently:
7480
```bash
7581
gh api repos/<owner>/<repo>/pulls/<n>/comments/<databaseId>/replies -f body="<what was done and why>"
7682
```
@@ -79,7 +85,7 @@ round. Always check both conditions freshly after every push.
7985
gh api graphql -f query='mutation { resolveReviewThread(input: {threadId: "<threadId>"}) { thread { isResolved } } }'
8086
```
8187

82-
5. **Before pushing, re-run the full sync check from `/ship` step 2** — not just the log command,
88+
6. **Before pushing, re-run the full sync check from `/ship` step 2** — not just the log command,
8389
the whole check-and-recover flow (stash WIP if needed, rebase, verify the rebase didn't just
8490
cleanly replay stray commits, cherry-pick rebuild if it did or if it conflicted). A babysit
8591
loop spanning a long session is exactly the scenario where a branch can drift, and pushing
@@ -90,7 +96,7 @@ round. Always check both conditions freshly after every push.
9096
gates from `/ship` steps 4 and 5. A review-fix round is still a code change and can trip
9197
either gate just as easily as the original commit did.
9298

93-
6. **Commit and push** the round's fixes as one commit — `--force-with-lease` whenever step 5's
99+
7. **Commit and push** the round's fixes as one commit — `--force-with-lease` whenever step 6's
94100
sync check rewrote history, which includes a plain `git rebase origin/staging` that completed
95101
with no conflicts, not only the cherry-pick rebuild path; both rewrite commits already
96102
published to the remote, so a plain `git push` can be rejected either way — then run `/ship`
@@ -103,24 +109,24 @@ round. Always check both conditions freshly after every push.
103109
`git log` is newest-first, so without it a positional comparison can spuriously fail on any
104110
multi-commit branch.
105111
These two lists must describe the same commits. A review loop runs many pushes across many
106-
rounds; checking sync only before the push (step 5) and never after is how a bad push or a
112+
rounds; checking sync only before the push (step 6) and never after is how a bad push or a
107113
PR whose commit history quietly went stale between rounds goes unnoticed.
108114

109-
7. **Re-trigger review** by posting `@greptile` and `@cursor review` as **two separate PR
115+
8. **Re-trigger review** by posting `@greptile` and `@cursor review` as **two separate PR
110116
comments** — never combine them into one comment, each bot only responds to its own mention:
111117
```bash
112118
gh pr comment <n> --body "@greptile"
113119
gh pr comment <n> --body "@cursor review"
114120
```
115121

116-
8. **Wait for the new round**, then go back to step 1. Pace the wait with `ScheduleWakeup` using
122+
9. **Wait for the new round**, then go back to step 1. Pace the wait with `ScheduleWakeup` using
117123
a fallback delay of ~250–300s (Greptile/Cursor typically take 1–3 minutes) — never busy-poll
118124
in a sleep loop. Pass the same `/loop babysit PR <n>` prompt on each wakeup so the loop
119125
resumes correctly.
120126

121-
9. **Stop conditions**: clean state reached (see above), or the same unresolved finding survives
122-
two consecutive rounds with no new information (surface it to the user instead of looping
123-
forever), or the user interrupts.
127+
10. **Stop conditions**: clean state reached (see above), or the same unresolved finding or
128+
merge conflict survives two consecutive rounds with no new information (surface it to the
129+
user instead of looping forever), or the user interrupts.
124130

125131
## Reporting
126132

0 commit comments

Comments
 (0)