Skip to content
Back to skills

Pr Takeover

ASecurity

Take over an open vibe pull request from its URL in Claude Code or Codex. Independently review the PR, verify findings, feed confirmed vibe mistakes into prevent-recurrence, fix the PR on its own branch, run required web and Desktop E2E, and report evidence without merging.

  • 123 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 10, 2026
ai-agentsgonoderailsgitdocumentation

Works with

  • claude code

Security analysis

A100/100

Scanned December 5, 2026

npx -y skills add closedloop-ai/claude-plugins --skill pr-takeover --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pr Takeover?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pr Takeover
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/closedloop-ai-pr-takeover/badge)](https://www.skillsdirectory.com/skills/closedloop-ai-pr-takeover)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: pr-takeover
description: Take over an open vibe pull request from its URL in Claude Code or Codex. Independently review the PR, verify findings, feed confirmed vibe mistakes into prevent-recurrence, fix the PR on its own branch, run required web and Desktop E2E, and report evidence without merging.
---

<!-- provider-rule -->
Lines that start `> Provider` stand for an optional provider's text. With no provider bound, follow the generic text.
<!-- end provider-rule -->

# Engineer takeover of a vibe pull request

Input: one GitHub pull request URL. This skill works in a new chat with no vibe session, fleet board, local ticket, worktree, or decision table. Discover those facts from the URL and live systems. Do not require a fleet program. The engineer owns the final merge; this skill never merges or arms auto-merge.

This is an engineer PR takeover, not migration of a dead vibe session writer. A dead writer stays in the existing `../fleet-orchestrator/SKILL.md` recovery path. This skill owns a new worktree and one writer for the PR source branch. Keep a separate claude-plugins worktree for the prevention worker. Neither worker edits the other's branch. Never reset, stash, or overwrite an existing worktree.

## 1. Resolve the PR before launching work

1. Parse the URL as a GitHub PR URL with owner, repository and numeric PR number. Refuse another URL shape before any write. Read the PR with `gh pr view` for state, base repository and branch, head repository and branch, head SHA, base SHA, author, body, review threads and checks. The live PR is the source of truth. Stop on a closed PR or missing push access and report the exact reason.
<!-- generic: read-scope -->
2. Read the pull request's description, its human comments and the applicable repository instruction files. A ticket body or a fleet instruction is not a human ruling. Preserve every settled behavior and flag-off path. Research its code scope as `../vibe/references/repository-intelligence.md` says, and verify each material finding against the checkout.
<!-- end generic: read-scope -->
> Provider `graph+tickets` (block `read-scope` of `pr-takeover-skill.md`)
3. Fetch the exact PR head and live base. Make a fresh worktree rooted at that head, with a local branch dedicated to this takeover and the PR's actual source branch and remote recorded. A source branch in a fork uses its head repository remote. Check the fetched head against the PR again before review and before every push. Keep one source writer in that worktree.
<!-- generic: lane-selection -->
4. Read the repository's own lane source for the PR diff (its CI workflows and the test command its `AGENTS.md` names) and its E2E, browser and Desktop instructions before naming CI coverage. Do not infer a run from a workflow's existence.
<!-- end generic: lane-selection -->
> Provider `recipes` (block `lane-selection` of `pr-takeover-skill.md`)

## 2. Review the PR independently

1. For a stacked PR, use its live base branch as the review diff base. Run `git merge-tree` against that base and separately against fetched `origin/main`. The first identifies the PR's own change; the second finds main conflicts the parent-base check misses. Do not review the parent PR's diff again as the child's. Preserve the parent-before-child delivery order.
<!-- generic: reviewers -->
2. Start read-only `../../agents/vibe-adversarial-reviewer.md` and `../../agents/vibe-guardrails-reviewer.md` through the current runtime's native reviewer launch path. In Claude Code that is the launcher's sessionless takeover route, never the native Agent tool: run `node ../vibe/scripts/dist/claude-worker.mjs` in the takeover worktree checked out at the fetched head, with one JSON object on stdin naming that worktree, the reviewer as `agentName`, mode `pull-request`, a `requestId`, the brief as `input`, every read of the bound provider's connections you can see as `capabilities` (`[]` with no provider), and `"sessionless": {"kind": "takeover", "evidence": {"prUrl": "<PR URL>", "headSha": "<full 40-character head SHA>"}}`. The launcher refuses another head, a checkout that holds a vibe session, and every other role, writers included. Save each output and capture it with `node ../handoff/scripts/review-receipts.mjs --worktree <takeover worktree> --role <reviewer> --result <output.json> --out <receipt.json> --pr-url <PR URL> --head <head SHA>`; the receipt records the PR URL, head SHA and worktree, and capture fails for any other head. For Codex reviewers, use the managed App Server thread and machine-observed receipt path in `../handoff/SKILL.md`, section `9. Hand it over`; a native subagent without a readable managed thread cannot clear review. Their PR-specific brief names the worktree, head SHA, live base ref and SHA, changed paths, acceptance criteria and exact review diff. It states that there is no previous vibe session or session decision table. Give both `../vibe/references/review-premises.md`. Override the adversarial reviewer's usual origin/main diff with the supplied live-base diff for a stacked PR. Use `../handoff/scripts/review-receipts.mjs` for structured results; a turn-end or prose-only clean claim is not a review receipt. A source change after review needs a new head SHA, a new launch and a new receipt.
<!-- end generic: reviewers -->
> Provider `graph` (block `reviewers` of `pr-takeover-skill.md`)
3. Require each finding to name a PR file and line, the broken behavior, and each material premise with primary evidence. The takeover root independently reopens every cited source line, reruns bounded safe reads, and checks current official documentation for platform claims. A citation alone does not verify its premise. A finding with any `UNVERIFIED` premise stays in the report as unverified. It is neither a confirmed bug to fix nor a confirmed vibe mistake to file. Do not initiate or retrigger automated PR review; observe existing reviews and checks only.
4. Include existing human and bot PR review comments in the audit. Validate each against current code and human rulings, including already resolved comments. Keep nits separate from confirmed correctness findings. Record the root's verification evidence next to each disposition.

## 3. Feed verified vibe mistakes back to vibe

1. For each verified defect, decide whether the failure class belongs to vibe's process or product code alone. State the class, PR file and line, actual effect, and the strongest feasible prevention rung from `closedloop-core:prevent-recurrence`. A rule already present but missed calls for a stronger check, not copied prose. Do not include unverified findings as facts.
<!-- generic: prevention-ticket -->
2. Record each verified uncovered class, with its instance, evidence and proposed prevention, in the takeover report for the operator; with no tracker there is no ticket to file.
3. Start one prevention worker in a separate worktree of the vibe plugin's own repository during this run when the operator keeps one. In Claude Code use a native Agent worker; in Codex use a native worker or the installed managed App Server worker path. Give it the classes and `closedloop-core:prevent-recurrence`; require class search, strongest rung, proof and closeout. The worker owns only the prevention branch. The takeover continues on the product PR while that worker runs. Record the worker identity and actual status. A failed launch is reported as incomplete prevention work, never as a started worker.
<!-- end generic: prevention-ticket -->
> Provider `tickets` (block `prevention-ticket` of `pr-takeover-skill.md`)
4. An audit with no verified vibe-origin mistake says so and creates no empty issue.

## 4. Repair the actual PR

1. Launch one NEW writer bound to the PR worktree. Claude Code runs `vibe-change-worker` through `node ../vibe/scripts/dist/claude-worker.mjs`, never the native Agent tool, with mode `request` or `fix` and `"sessionless": {"kind": "takeover", "evidence": {"prUrl": "<PR URL>", "headSha": "<full current head SHA>", "sourceBranch": "<PR source branch>"}}`. Its first launch writes the worktree's takeover record, which stands in for the session record. Every later request to that writer passes the same PR URL and source branch with the current head SHA, including the new head after the root commits a repair. The launcher refuses a second writer for another PR or source branch in that worktree. Codex uses the native agent path in `../handoff/SKILL.md`. The writer brief supplies PR URL, live ticket, worktree, source branch and remote, verified findings, root premise evidence, human rulings, base and main conflict evidence, and scope. This engineer takeover substitutes those PR facts for a prior vibe session record. The writer alone edits source and tests on that branch; the root coordinates and verifies. The writer does not commit or push.
2. Have that writer fix every verified PR bug, including semantic conflicts with current main. On a stacked child, bring in the updated parent first, then current main. Keep both sides' live behavior. Resolve Storybook version conflicts once and re-measure version-history counts. Preserve tests of live behavior, run the target repo's relevant tests, lint, typecheck and source gates, and use only supported headless or displayless automated E2E paths.
3. Independently inspect the completed diff and rerun the affected read-only review and verification on changed files. Fix confirmed gaps through the same writer. Keep a finding open until the fixing source and check evidence exist. No fix to an unverified finding is inferred from a reviewer suggestion.
4. When the audit calls for a source repair, the root runs `../vibe/scripts/commit-worktree.mjs` only after the diff is push-ready. Re-read the PR source commit and verify it equals the fetched parent of the repair. Push with ordinary `git push` to the recorded source repository and branch, for example `git push origin HEAD:<source branch>` when origin owns that branch. Never force push, skip hooks, merge the PR, or arm auto-merge. A moved remote ref stops the push for a new read and conflict resolution.
5. Refresh the PR body when source changed, using the pushed source and recorded evidence. Use the existing `../vibe/scripts/pr-threads.mjs` and `../handoff/scripts/review-threads.mjs` workflow. Answer each unresolved thread with its fixing commit or a source-backed rationale. Verify any answer already posted. Run the resolver for verified fixes and verified human rationales under the target repository's instructions, then re-read the threads to confirm resolution. This applies when the audit finds no source repair to commit. Do not start a new automated code review.

## 5. Run required E2E and record it on the PR

<!-- generic: lane-commands -->
1. Get exact commands from the repository's own lane source for the final diff. Run the existing `../vibe/scripts/pre-pr-lanes.mjs` check with its report option. A `not-run` result means the lane is incomplete even when that script permits publication.
<!-- end generic: lane-commands -->
> Provider `recipes` (block `lane-commands` of `pr-takeover-skill.md`)
2. Run selected web browser E2E through the repo-supported headless path and its existing `../vibe/scripts/e2e-lock.mjs` lock. Run selected Desktop Electron E2E under the documented Linux dbus, keyring and Xvfb displayless harness. The native macOS tier may run on a permitted remote machine through its configured E2E slot. Never open Chrome or Electron on the operator's interactive desktop. Ordinary Playwright headless does not make Electron displayless. Never silently fall back to headed execution.
3. Bind each run to the exact tested source commit and tree. For an external runner, run under `pre-pr-lanes.mjs witness` on that host. Copy the witness JSON and log, then use `pre-pr-lanes.mjs record --ran-on <host> --proof-commit <sha> --git-tree <tree> --witness <copied witness JSON> --run-log <copied log>` with the runner's source identity and matching environment. A local run goes through `pre-pr-lanes.mjs witness` and is recorded with `--witness`, plus its source option for uncommitted inputs. Read the receipt back. Record the exact command, runner, tested commit, result and evidence link in the PR. On a local lane with no supported path, stop that lane locally and record the precise limitation. Inspect only automatically started CI for the tested commit and the repo's documented premerge tier. Manual CI or review dispatch is forbidden. Postmerge `desktop-e2e/validated` never proves premerge Desktop E2E.
4. A failed lane returns to the same PR writer for a fix and a source-bound rerun. A missing supported runner and no qualifying automatic CI leaves takeover incomplete. State that explicitly on the PR and in the result. No `DONE` claim follows a not-run receipt or a control walk.

## 6. Finish without merging

Report the PR URL and final source commit, each finding's verified or unverified status, each fix and thread answer, prevention ticket and worker status, and every selected lane with its actual result or exact limitation. Name current-main and parent-base conflict outcomes separately. Say `DONE` only after confirmed bugs are fixed and pushed, review threads answered, prevention work started on the correct ticket, and required E2E has qualifying evidence recorded on the PR. Leave the PR open for the engineer. Never merge or arm auto-merge.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.