landing-an-approved-github-pr-blocked-by-threadslisted
Install: claude install-skill sblattj/agent-chandlery
## More triggers
resolve-pr-threads-and-conflicts-and-merge (old name), approved but can't merge, why won't it merge with approvals.
# Land an approved PR blocked by threads
One script takes an approved PR from BLOCKED to MERGED, and never merges one with 0 approvals or a standing changes-request. Needs `zsh`, `gh` and `jq`.
## Do this
```bash
L=${CLAUDE_SKILL_DIR:-${SKILL_DIR:-~/.claude/skills/landing-an-approved-github-pr-blocked-by-threads}}/land.sh
$L <pr> --dry-run # repo = the cwd's (gh repo view); lists threads with no reply (exit 2)
$L <pr> -R owner/repo --dry-run # any other repo
$L <pr> -R owner/repo --replies replies.json # post replies, resolve, update branch, merge, wait (default 600s)
```
`replies.json` is `[{"cid":"<thread's first comment databaseId>","body":"markdown"}]`. The dry run prints each thread URL; the id is the number after `discussion_r`. Log: `/tmp/land-pr/<repo>-<pr>.log` (override with `LOG=`).
Exit codes:
- 0: merged
- 2: threads still need a reply
- 3: conflicts
- 4: not merged within `--wait`
- 5: draft, closed or bad arguments
- 6: no approval yet, or someone's changes-request still stands
What the script does:
1. **Conflicting (exit 3):** stops. Merge the base into the branch in a worktree (never rebase a shared branch), resolve, run the module's tests, push, rerun.
2. **BEHIND:** runs `gh pr update-branch`.
3. **Threads:** posts each reply and resolves the thread. It