diff --git a/.claude/skills/merge-after-ci/SKILL.md b/.claude/skills/merge-after-ci/SKILL.md deleted file mode 100644 index 6131341..0000000 --- a/.claude/skills/merge-after-ci/SKILL.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -name: merge-after-ci -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 - -Use the GitHub MCP tools (`mcp__github__*`), never `gh`. **No chatter**: do not report PR status, CI progress, subscriptions -or merges, and do not answer PR events (opened, checks finished, merged, subscription notices). Speak only for the cases under -"Say something" below, in one line. - -## Which PRs -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. -3. Merge only if ALL hold: `mergeable_state` is `clean`; every check run is `completed` with conclusion `success`; no review - is `CHANGES_REQUESTED`; no unresolved review thread. Then call `merge_pull_request` with `merge_method: merge` and - `expectedHeadSha` set to the head SHA you just read (a push that lands in between aborts the merge). Say nothing. -4. CI still running: do nothing and wait for the next event. CI red: fix it if the fix is small and yours, push, and wait again. -5. After the merge the subscription ends by itself. - -## Say something (one line each) -- CI failed and you cannot fix it, or the PR conflicts with `main` and the conflict is not a plain merge. -- A review asks for changes you cannot make on your own. - -## Never -- Enable or use GitHub's auto-merge, or touch the CI button's boxes. -- Merge a PR from another branch, a fork, a draft, or one whose checks have failed or are missing. -- Skip, disable or re-run tests to get green; force-push; approve reviews; close PRs; delete branches. diff --git a/CLAUDE.md b/CLAUDE.md index d7b24eb..32389d5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -7,8 +7,6 @@ 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. -- 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.