From d9ae09b844f6224201d6a488b4e7afc74f984b44 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 8 Oct 2026 03:51:38 +0000 Subject: [PATCH] Open a PR right after pushing a claude/* branch, so the PR/CI button always shows Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_014k4kywyN5dAo39izUPvxbw --- .claude/skills/merge-after-ci/SKILL.md | 4 +++- CLAUDE.md | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.claude/skills/merge-after-ci/SKILL.md b/.claude/skills/merge-after-ci/SKILL.md index f8cb0bd..6131341 100644 --- a/.claude/skills/merge-after-ci/SKILL.md +++ b/.claude/skills/merge-after-ci/SKILL.md @@ -1,6 +1,6 @@ --- name: merge-after-ci -description: Merge pull requests from claude/* branches yourself once their CI passes, silently. Use right after opening a PR, when a claude/* PR is pointed out, or when a CI-finished event arrives for one. Never merges anything that is not from a claude/* branch in this repo, and never uses GitHub's own auto-merge. +description: Merge pull requests from claude/* branches yourself once their CI passes, silently. Use right after pushing a claude/* branch (open its PR first), when a claude/* PR is pointed out, or when a CI-finished event arrives for one. Never merges anything that is not from a claude/* branch in this repo, and never uses GitHub's own auto-merge. --- # Merge after CI passes @@ -13,6 +13,8 @@ or merges, and do not answer PR events (opened, checks finished, merged, subscri Open, not a draft, head branch starts with `claude/` in this same repo, base is the default branch. Anything else: do nothing. ## Steps +0. Right after pushing a `claude/*` branch, open its PR (`create_pull_request`, base the default branch) if it has none, so + Claude Code shows the PR/CI button. The user should never have to ask for the PR. 1. Right after a PR is opened (or when one is pointed out), subscribe to it (`subscribe_pr_activity`) so you hear when CI completes. 2. When its `check` finishes (a `check_suite.completed` event) or if CI is already done, read the PR fresh from GitHub: `pull_request_read` `get`, `get_check_runs`, `get_reviews`, `get_review_comments`. Never rely on earlier results. diff --git a/CLAUDE.md b/CLAUDE.md index 1dd45cc..d7b24eb 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -7,8 +7,8 @@ MCP data tools and web search. User-facing docs are in `README.md`; this file is - `make check`: ruff + pytest (no network, a few seconds). Run it before every commit, on Python 3.13.5 (production; `uv venv --python 3.13.5`). GitHub CI runs the latest stable Python and Node.js instead, to catch breakage from the next upgrade early. - `make prompt-report`: token breakdown of a sample request. `python bot.py [label]` runs the bot. -- Merging: after opening a PR from a `claude/*` branch, follow `.claude/skills/merge-after-ci/SKILL.md`: subscribe, merge it yourself once - its CI passes, and say nothing about it. +- Pull requests: right after pushing a `claude/*` branch, open its PR (so Claude Code shows the PR/CI button), then follow + `.claude/skills/merge-after-ci/SKILL.md`: subscribe, merge it yourself once its CI passes, and say nothing about it. - Tests use fakes (`tests/conftest.py`: FakeBot, user_msg; `tests/fakes.py`: ScriptedBackend, FakeMcp, fake SDK clients; `tests/fixtures/` real anonymised MCP output). Add a test next to the module you change; don't write scratch scripts.