# continue-pr-auto

Adopt this skill: https://proskills.md/skills/other/clickhouse-clickhouse-claude-skills-continue-pr-auto

Page: https://proskills.md/skills/other/clickhouse-clickhouse-claude-skills-continue-pr-auto
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: .claude/skills/continue-pr-auto/SKILL.md
size: 34270
sha: 748b75bc720d370ca149b1137eb2dc7532a02acf
upstream: https://github.com/clickhouse/clickhouse/blob/master/.claude/skills/continue-pr-auto/SKILL.md
truncated: true

````text
---
name: continue-pr-auto
description: Unattended variant of continue-pr for automation (driven by utils/continue-all-prs.sh). Resolves conflicts - reworking stale features to reconcile with current master when a mechanical merge is not enough - fixes CI, addresses feedback, and pushes without ever asking the user. For interactive use, prefer continue-pr.
argument-hint: <pr-number>
disable-model-invocation: true
allowed-tools: Agent, Task, Bash, Read, Write, Edit, Glob, Grep, WebFetch, WebSearch
---

# Continue Work on a Pull Request (Unattended)

Pick up an existing pull request, resolve conflicts, fix CI failures, address reviewer feedback, and push updates.

This is the **unattended** variant used by automation (`utils/continue-all-prs.sh`). It must never wait for user input: resolve conflicts and address feedback with your best judgment and push, and when a branch is too stale for a mechanical merge, rework the feature to reconcile it with the latest master (step 3a). The only hard stop is a genuinely missing PR number. For interactive use where asking is acceptable, use `continue-pr` instead.

## Arguments

- `$0` (required): PR number in the current repository (e.g., `12345`)

## Process

### 1. Parse arguments and fetch PR metadata

Extract the PR number from `$0`. This skill runs unattended and must never stop to ask the user anything: if the PR number is not provided, stop with a clear error message instead of prompting.

Validate that the PR number contains only digits. Reject any non-numeric input immediately — do not pass unvalidated input to shell commands or GraphQL queries.

Determine which repository you are operating in — the public `ClickHouse/ClickHouse` or the private `ClickHouse/clickhouse-private`:

```bash
gh repo view --json nameWithOwner --jq .nameWithOwner   # or: git remote get-url origin
```

Remember it as `$REPO` and use it everywhere below instead of the literal `ClickHouse/ClickHouse` in `gh` commands, API URLs, and GraphQL `repository(owner:, name:)` arguments. The repository also decides whom to ask about unrelated CI failures (step 4): `@groeneai` in `ClickHouse/ClickHouse`, `@oranjeai` in `ClickHouse/clickhouse-private`.

Fetch PR metadata using `gh` if available, otherwise use `WebFetch` on the GitHub API:

```bash
GH_USER=$(gh api user --jq .login)
gh pr view "$PR_NUMBER" --json number,title,body,headRefName,baseRefName,state,mergeable,mergeStateStatus,author,url,headRepository,headRepositoryOwner,isCrossRepository,maintainerCanModify,statusCheckRollup,reviews,comments,reviewRequests
```

If `gh` is not available or not authenticated, use WebFetch to get the data. Append `?per_page=100` and follow the `Link` header for pagination (the `rel="next"` URL) to fetch all pages:
- `https://api.github.com/repos/ClickHouse/ClickHouse/pulls/$PR_NUMBER`
- `https://api.github.com/repos/ClickHouse/ClickHouse/pulls/$PR_NUMBER/reviews?per_page=100`
- `https://api.github.com/repos/ClickHouse/ClickHouse/pulls/$PR_NUMBER/comments?per_page=100`

Report the PR title, author, branch, and current state to the user.

### 1a. Verify "already integrated" claims before closing

Treat closing a PR as already integrated or obsolete as a high-confidence decision. Verify both of these independently against freshly fetched refs:

1. **Historical ancestry:** Resolve and print the exact base and PR-head OIDs, then check the candidate commit in this direction only:
   ```bash
   HEAD_REMOTE=origin
   if [ "$IS_CROSS_REPOSITORY" = "true" ]; then
       HEAD_REMOTE="pr-$AUTHOR_LOGIN"
       git remote add "$HEAD_REMOTE" "$FORK_URL" 2>/dev/null || git remote set-url "$HEAD_REMOTE" "$FORK_URL"
   fi
   git fetch origin "$BASE_BRANCH"
   git fetch "$HEAD_REMOTE" "$HEAD_BRANCH"
   git rev-parse "origin/$BASE_BRANCH" "$HEAD_REMOTE/$HEAD_BRANCH"
   git merge-base --is-ancestor "$CANDIDATE_COMMIT" "origin/$BASE_BRANCH"
   ```
   Derive `$IS_CROSS_REPOSITORY`, `$AUTHOR_LOGIN`, and `$FORK_URL` from the PR metadata as in step 2. Exit status `0` means the base contains the commit; any other status means it does not. Never check against `HEAD`, the PR branch, `--all`, or a worktree and describe that result as containment by the base branch. If this check is nonzero, do not claim the commit is in the base and do not close the PR as integrated.
2. **Current effective state:** An ancestor commit may have been reverted or backed out later. Ancestry, `git branch --contains`, `git cherry`, and patch-equivalence results are historical evidence only; none proves that the change remains effective. Inspect all later base-branch commits touching the changed paths, search for explicit and manual reverts/backouts, compare the current base tree with the PR's intended effect, and run the reproducer or regression test against the current base when feasible. If the change was fully or partially reverted, count it as **not integrated**. If the current effect cannot be established confidently, leave the PR open for human review.

Before posting a closure comment, state the fetched base OID and the evidence for both ancestry and the current effective state. Do not close from a remembered ref, a stale local branch, a matching subject, or a commit merely visible somewhere in the repository.

### 2. Check out the PR branch locally

Determine whether the PR branch is in the main repository or in the author's fork.

**If the branch is in the main repository (`ClickHouse/ClickHouse`):**
```bash
HEAD_REMOTE=origin
git fetch "$HEAD_REMOTE" "$HEAD_BRANCH"
git checkout --detach "$HEAD_REMOTE/$HEAD_BRANCH"
```

**If the branch is in the author's fork:**

Derive the fork clone URL from the PR metadata (`headRepository.url` or `headRepository.owner.login` + `headRepository.name`) rather than hardcoding the repository name (forks can be renamed). Use a `pr-` prefixed remote name to avoid colliding with existing remotes like `origin`:

```bash
REMOTE_NAME="pr-$AUTHOR_LOGIN"
FORK_URL="https://github.com/$FORK_OWNER/$FORK_REPO.git"  # from headRepository in PR metadata
git remote add "$REMOTE_NAME" "$FORK_URL" 2>/dev/null || git remote set-url "$REMOTE_NAME" "$FORK_URL"
HEAD_REMOTE="$REMOTE_NAME"
git fetch "$HEAD_REMOTE" "$HEAD_BRANCH"
git checkout --detach "$HEAD_REMOTE/$HEAD_BRANCH"
```

Immediately after either checkout completes, discard any state left by an
earlier PR before recording the immutable baseline. The automation uses a
dedicated worker worktree, so it must never preserve staged, unstaged, or
untracked files from a previous session. This is the only authoritative record
of the PR surface that existed when the worker began:

```bash
git fetch origin "$BASE_BRANCH"
# The automation may have already prepared a validated, conflict-free merge of
# the base branch into the pull-request head in this worktree (the triage phase
# of `utils/continue-all-prs.sh` records it). Keep that merge instead of
# throwing it away and paying for a second merge and rebuild. Accept the
# recorded commit only when it is exactly that merge: a two-parent commit whose
# first parent is the current remote pull-request head and whose second parent
# is the current base-branch head. Anything else - a stale marker from an
# earlier pull request, a commit with a different shape - is ignored.
VALIDATED_MERGE_FILE="$(pwd)/tmp/continue-all-prs/validated-base-merge"
CHECKOUT_TARGET="$HEAD_REMOTE/$HEAD_BRANCH"
if [ -s "$VALIDATED_MERGE_FILE" ]; then
    VALIDATED_MERGE=$(cat "$VALIDATED_MERGE_FILE")
    if git cat-file -e "${VALIDATED_MERGE}^{commit}" 2>/dev/null \
        && [ "$(git rev-parse "${VALIDATED_MERGE}^@")" = "$(git rev-parse "$HEAD_REMOTE/$HEAD_BRANCH" "origin/$BASE_BRANCH")" ]; then
        CHECKOUT_TARGET="$VALIDATED_MERGE"
    fi
fi
git reset --hard "$CHECKOUT_TARGET"
git clean -ffdx -e build/ -e tmp/continue-all-prs/
test -z "$(git status --porcelain)"
mkdir -p tmp
PR_BASELINE_DIR="$(pwd)/tmp/continue-pr-${PR_NUMBER}-baseline"
rm -rf "$PR_BASELINE_DIR"
mkdir -p "$PR_BASELINE_DIR"
INITIAL_PR_HEAD=$(g
````

## File: README.md
upstream: https://github.com/clickhouse/clickhouse/blob/master/README.md

````text
<div align=center>

[![Website](https://img.shields.io/website?up_message=AVAILABLE&down_message=DOWN&url=https%3A%2F%2Fclickhouse.com&style=for-the-badge)](https://clickhouse.com)
[![Apache 2.0 License](https://img.shields.io/badge/license-Apache%202.0-blueviolet?style=for-the-badge)](https://www.apache.org/licenses/LICENSE-2.0)

<picture align=center>
    <source media="(prefers-color-scheme: dark)" srcset="https://github.com/ClickHouse/clickhouse-docs/assets/9611008/4ef9c104-2d3f-4646-b186-507358d2fe28">
    <source media="(prefers-color-scheme: light)" srcset="https://github.com/ClickHouse/clickhouse-docs/assets/9611008/b001dc7b-5a45-4dcd-9275-e03beb7f9177">
    <img alt="The ClickHouse company logo." src="https://github.com/ClickHouse/clickhouse-docs/assets/9611008/b001dc7b-5a45-4dcd-9275-e03beb7f9177">
</picture>

<h4>ClickHouse® is an open-source column-oriented database management system that allows generating analytical data reports in real-time.</h4>

</div>

## How To Install (Linux, macOS, FreeBSD)

```
curl https://clickhouse.com/ | sh
```
Or skip the install: try [ClickHouse Cloud](https://console.clickhouse.cloud/signUp?utm_medium=referral&utm_source=github) for free and start querying in minutes.

## Useful Links

* [Official website](https://clickhouse.com/) has a quick high-level overview of ClickHouse on the main page.
* [ClickHouse Cloud](https://clickhouse.com/cloud) ClickHouse as a service, built by the creators and maintainers.
* [Tutorial](https://clickhouse.com/docs/getting_started/tutorial/) shows how to set up and query a small ClickHouse cluster.
* [Documentation](https://clickhouse.com/docs/) provides more in-depth information.
* [YouTube channel](https://www.youtube.com/c/ClickHouseDB) has a lot of content about ClickHouse in video format.
* [Slack](https://clickhouse.com/slack) and [Telegram](https://telegram.me/clickhouse_en) allow chatting with ClickHouse users in real-time.
* [Blog](https://clickhouse.com/blog/) contains various ClickHouse-related articles, as well as announcements and reports about events.
* [X](https://x.com/ClickHouseDB) and [LinkedIn](https://www.linkedin.com/company/clickhouseinc/) for short news.
* [Code Browser (github.dev)](https://github.dev/ClickHouse/ClickHouse) with syntax highlighting, powered by github.dev.
* [Contact us](https://clickhouse.com/company/contact) to discuss your use case with a ClickHouse expert.

## Monthly Release & Community Call
The [ClickHouse **26.9** Release Call](https://www.youtube.com/watch?v=wLrTlU5LLWI) took place on September 17, 2026 — watch the recording and the [slides](https://presentations.clickhouse.com/2026-release-26.9/).

The [ClickHouse **26.8** Release Call](https://www.youtube.com/watch?v=5A9gRYE0v2M) took place on August 27, 2026 — watch the recording and the [slides](https://presentations.clickhouse.com/2026-release-26.8/).

The [ClickHouse **26.7** Release Call](https://www.youtube.com/watch?v=mKBNLaFOVDA) took place on July 23, 2026 — watch the recording and the [slides](https://presentations.clickhouse.com/2026-release-26.7/).

The [ClickHouse **26.6** special "10 Year Anniversary" Release Call](https://www.youtube.com/watch?v=-NmqMH9y4EY) — recording and [slides](https://presentations.clickhouse.com/2026-release-26.6/).

Watch all release presentations and videos at [ClickHouse Theater](https://presentations.clickhouse.com/) and [YouTube Playlist](https://www.youtube.com/playlist?list=PL0Z2YDlm0b3jAlSy1JxyP8zluvXaN3nxU).

## Upcoming Events

Keep an eye out for upcoming meetups and events around the world.
Want to speak? Apply [here](https://forms.gle/3h4XCEENJZ3eaVGy7)
You can also peruse [ClickHouse Events](https://clickhouse.com/company/news-events) for a list of all upcoming trainings, meetups, speaking engagements, etc.

Upcoming meetups
* [Observability with ClickStack Fundamentals (KubeCon Training)](https://luma.com/clickh-migc) – November 9th, 2026
* [AI Builders Night](https://luma.com/clickh-z8rr) – November 9th, 2026
* [ClickHouse ClubHouse - Atlanta](https://luma.com/clickh-hv90) – November 10th, 2026
* [KubeCon NA 2026: Afterparty Social](https://luma.com/vgcotljq) – November 10th, 2026
* [AprèsKube SLC: Keyboards & Keys](https://luma.com/apreskube-slc) – November 11th, 2026
* [2026 Super Demo Day](https://luma.com/2a7wm1zs) – November 16th, 2026
* [AI Infrastructure Night](https://luma.com/1ihtxydc) – November 17th, 2026
* [San Francisco Data Engineering Meetup with ClickHouse](https://luma.com/clickh-z0ty) – November 17th, 2026
* [Matinée de l'Observabilité — Paris](https://luma.com/clickh-bvnl) – November 17th, 2026
* [Build it. Trace it. Ship it. — a Demo Night with Langfuse](https://luma.com/clickh-1tj5) – November 17th, 2026
* [Hands-on training: Agent Observability with Langfuse](https://luma.com/clickh-1p8m) – November 18th, 2026
* [Toronto Data Engineering Meetup with ClickHouse](https://luma.com/clickh-4120) – November 18th, 2026
* [ClickHouse Meetup - Seattle: Real-Time Analytics in Production](https://luma.com/clickh-0alm) – November 19th, 2026
* [Search Week After Party: Pub Quiz by Qdrant with ClickHouse](https://luma.com/londonsearchweek_2026) – November 24th, 2026
* [ClickHouse x OliveYoung x NxtCloud 서울 밋업](https://luma.com/clickh-gb3i) – November 25th, 2026
* [Maxa x ClickHouse: Data Developer Meetup MTL](https://luma.com/4812th4n) – November 26th, 2026
* [Scaling Data Systems with ClickHouse Cyprus Meetup](https://luma.com/clickh-hs3o) – November 26th, 2026
* [See What Your Agent Did: Trace it. Debug it. Ship it.](https://luma.com/clickh-k5ti) – November 26th, 2026
* [House Party Las Vegas](https://luma.com/85fo8u3e) – December 1st, 2026
* [AI Builders and Databases Munich](https://luma.com/clickh-rsxf) – December 3rd, 2026
* [kickoff(): hack, demo, play FC27 at Fulham's Craven Cottage](https://luma.com/clickh-gqb5) – December 17th, 2026

Recent meetups
* [AI Builders and Databases Tel Aviv](https://luma.com/clickh-satv) - October 12th, 2026
* [Hands-on training: Agent Observability with Langfuse in New York](https://luma.com/piww2zyw) - October 15th, 2026
* [Hands-on training: Agent Observability with Langfuse in Menlo Park](https://luma.com/clickh-3qe8) - October 19th, 2026
* [AI Builders and Databases London](https://luma.com/clickh-ykgp) - October 21st, 2026
* [AI Builders and Databases Dubai](https://luma.com/clickh-vtzf) - October 22nd, 2026
* [AI Builders Night New York @ Modal](https://luma.com/clickh-qu9s) - November 3rd, 2026
* [LibreChat Meetup New York](https://luma.com/clickh-3qx0) - November 5th, 2026

## Recent Recordings

* **Recent Meetup Videos**: [Meetup Playlist](https://www.youtube.com/playlist?list=PL0Z2YDlm0b3iNDUzpY1S3L_iV4nARda_U) Whenever possible recordings of the ClickHouse Community Meetups are edited and presented as individual talks. 

## Interested in joining ClickHouse and making it your full-time job?

ClickHouse is a nice DBMS, and it's a good place to work.

Check out our **current openings** here: https://clickhouse.com/company/careers

Email: careers@clickhouse.com!
````
