Agent skill

Worktree PR

by scarletkc in scarletkc/agents

Decide whether a task deserves its own git worktree and, if chosen, run it end to end: branch from the integration branch rather than the current tree, keep the main working copy untouched while the…

Apache-2.0Auto-check passedDevelopment

Install Worktree PR

skills CLI
$ npx skills add scarletkc/agents --skill worktree-pr -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install scarletkc/agents worktree-pr --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/scarletkc/agents.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/worktree-pr .claude/skills/worktree-pr && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
worktree-pr
GitHub stars
225
Token cost
~1.2k tokens
SKILL.md length
581 words
Files
1
Skills in repo
11
Repo updated
First seen
Licence
Apache-2.0

At a glance

Decide whether a task deserves its own git worktree and, if chosen, run it end to end: branch from the integration branch rather than the current tree, keep the main working copy untouched while the…

  • A request says to do the work in a new worktree
  • SKILL.md covers Deciding, Running, Before declaring it done and Landing
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • A change is large

What it does

Worktree PR is an agent skill from scarletkc/agents. Decide whether a task deserves its own git worktree and, if chosen, run it end to end: branch from the integration branch rather than the current tree, keep the main working copy untouched while the task runs, compare the result against the untouched baseline before declaring it done, and prepare it for a pull request instead of merging. Use when a request says to do the work in a new worktree or branch, when a change is large or risky enough that the main tree should stay usable, when several tasks need to run…

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Git worktrees. It works with Git. The repository describes itself as: Shared standards and reusable skills for Claude Code, Codex CLI, and other AI coding agents. The licence is Apache-2.0.

When your agent uses it

  • A request says to do the work in a new worktree
  • A change is large
  • Risky enough that the main tree should stay usable
  • Several tasks need to run in parallel on one repository

Example prompts

  • “/worktree-pr”

What it can do on your machine

Read from SKILL.md and the folder at commit eb55005. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Worktree PR loads about 1.2k tokens when it runs. Until then it costs about 180 tokens; SKILL.md has 581 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~180
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from scarletkc/agents at commit eb55005, republished under its Apache-2.0 licence (© scarletkc). 581 words, ~1,174 tokens.

Download SKILL.mdSave it as .claude/skills/worktree-pr/SKILL.md (or your agent's skills folder).
name
worktree-pr
description
Decide whether a task deserves its own git worktree and, if chosen, run it end to end: branch from the integration branch rather than the current tree, keep the main working copy untouched while the task runs, compare the result against the untouched baseline before declaring it done, and prepare it for a pull request instead of merging. Use when a request says to do the work in a new worktree or branch, when a change is large or risky enough that the main tree should stay usable, when several tasks need to run in parallel on one repository, when a result has to be diffed against current behavior, and when deciding where screenshots, builds, and other artifacts produced in a worktree should end up.
license
Apache-2.0
metadata.author
scarletkc
metadata.source
https://github.com/scarletkc/agents
metadata.summary
Optionally run a task in its own worktree: branch from the integration branch, compare against the baseline, and prepare it for a PR.

Worktree & PR

A worktree buys two things: the main working copy stays usable while the task runs, and the untouched copy remains available as a baseline to compare against. Both are worth real setup cost, and neither applies to every change.

This covers the isolation mechanics. How large the change itself should be is scoped-change, and it applies inside a worktree exactly as it does anywhere else.

Deciding

Consider a worktree when at least one holds: the task is large enough that a half-finished state would block other work, several tasks need to progress on the same repository at once, the result has to be compared against current behavior, or the change is risky enough that abandoning it should cost nothing.

Skip it when the change is small, self-contained, and reviewable in one pass. Setting up an isolated copy for a typo fix or a one-line config edit costs more than it saves, and the extra branch, directory, and PR are all overhead that someone pays later. When the requester says to work directly on the current branch, that decision is already made.

Running

  • Branch from the integration branch, not from whatever is checked out. The point of the isolated copy is a clean starting state; inheriting unrelated in-progress edits forfeits it and makes the eventual diff unreadable. Fetch first so the base is current, not a stale local ref.
  • Leave the main working copy alone while the task runs. Editing both defeats the isolation and destroys the baseline. If the task turns out to need a change in the main tree, stop and say so rather than reaching across.
  • Parallel worktrees stay independent only while they stay disjoint. Two copies of one repository editing the same files converge into a conflict nobody scheduled, and the cost lands at merge time rather than now. Before opening a second one, check what the first is touching.
  • Name the artifacts' destination explicitly. Screenshots, builds, and exports produced inside a worktree vanish with it. Anything the requester needs to see must be written somewhere durable, or attached to the PR, and the location has to be stated rather than assumed.
Show full SKILL.md (224 more words)Show less

Before declaring it done

  • Compare against the untouched baseline, not against expectation. The reason to keep a clean copy is to run both and see the difference. For behavior changes this means exercising the old path and the new one; for visual changes it means the same view captured twice. "Should be equivalent" is a claim, and the baseline is right there to check it.
  • Account for what the tooling added. Generated output, formatter churn, and dependency lock updates accumulate in an isolated copy without anyone choosing them, and they are indistinguishable from intent once merged. Either explain why each belongs in this branch, or drop it.

Landing

Follow the user's established authorization preferences. If committing, pushing, or opening a pull request requires explicit authorization, complete and validate the local changes, then hand over the exact commands until authorized. When authorized, push the branch and open a pull request describing motivation, the commands exercised, and anything reviewers must check by hand; leave merging to the repository owner unless told otherwise. Say plainly which parts are done, which are unverified, and which were deliberately left out, since a worktree's isolation makes it easy to report an untested result as finished. Once the branch has landed, remove the worktree; a stale copy of a merged branch is a trap for the next session that opens it.

© scarletkc, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/worktree-pr of scarletkc/agents.

Open the folder on GitHubat commit eb55005

Compare with similar skills

Worktree PR next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Worktree PR compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Worktree PR this skillscarletkc/agents225—~1.2kAutomated safety check: PassApache-2.0
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Finishing A Development Branchfarm-fe/farm5.6k34 repos~1.8kAutomated safety check: PassMIT
Git Worktree Cleanuplobehub/lobehub83k—~2.8kAutomated safety check: PassCustom licence
Pre-Release PR Triagejamiepine/voicebox57k—~3.1kAutomated safety check: PassMIT
Ccmanager Configkbwo/ccmanager1.3k—~1.5kAutomated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • A skill your agent uses when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for…

    5.6k GitHub starsUsed in 34 repos~1.8k tokens
    DevelopmentAuto-check passed
  • Git Worktree Cleanup

    lobehub/lobehub

    Audits stale Git worktrees and branches with a bundled script, classifies each one, and deletes only after you approve the exact candidates.

    83k GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Pre-Release PR Triage

    jamiepine/voicebox

    Sorts a backlog of open pull requests into must-merge, candidate, superseded and deferred, writes a triage doc and works the merge loop before a release.

    57k GitHub stars~3.1k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Ccmanager Config

    kbwo/ccmanager

    Set up, review, or repair a CCManager config — .ccmanager.json at a git repository root, or the global ~/.config/ccmanager/config.json.

    1.3k GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Builds a Cap feature in an isolated Git worktree with disposable dev resources, verification, a recorded demo and a neutral pull request, started with /building.

    23k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check: warnings

More from scarletkc/agents

All 11 skills in this repo
  • Antigravity CLI

    scarletkc/agents

    Delegate bounded investigation, review, or implementation tasks to Antigravity CLI from a supervising agent.

    225 GitHub starsUsed in 1 repo~1.6k tokens
    Auto-check passed
  • Grok CLI

    scarletkc/agents

    Delegate bounded tasks to Grok Build from a supervising agent such as Codex.

    225 GitHub stars~1.5k tokensUpdated 16 days ago
    Auto-check: warnings
  • Talk Like Scarletkc

    scarletkc/agents

    按 scarletkc 本人的自然表达习惯代写、改写、润色和翻译文本,适用于推文、评论、聊天消息、模型或工具体验文、项目介绍、GitHub 文本和正式通信。用户要求撰写可直接使用的成稿、去除 AI 腔,或在翻译中保留本人语气和立场时使用,无需明确点名本 skill。单纯的事实问答、技术分析、代码审查和任务讨论不触发。

    225 GitHub stars~1.2k tokensUpdated 16 days ago
    Auto-check passed
  • Ask To Plan

    scarletkc/agents

    Guide a user from an unclear idea to an actionable plan through the agent harness's native ask tool and clickable choices.

    225 GitHub stars~2.4k tokensUpdated 16 days ago
    Auto-check passed
  • Codex CLI

    scarletkc/agents

    When handing work to the Codex CLI earns its cost, and how to size the run: second-model review, bounded implementation hand-offs, sandbox permissions, model and reasoning effort.

    225 GitHub stars~2.8k tokensUpdated 16 days ago
    Auto-check passed
  • Marketing Copy

    scarletkc/agents

    Write outbound promotional copy for a product or project: launch and update posts for community platforms and social media, store page descriptions and short blurbs, landing page headlines and calls…

    225 GitHub stars~1.3k tokensUpdated 16 days ago
    Auto-check passed

Works with

Categories

Questions about Worktree PR

What does Worktree PR do?

Decide whether a task deserves its own git worktree and, if chosen, run it end to end: branch from the integration branch rather than the current tree, keep the main working copy untouched while the…. Worktree PR is an agent skill from scarletkc/agents. Decide whether a task deserves its own git worktree and, if chosen, run it end to end: branch from the integration branch rather than the current tree, keep the main working copy untouched while the task runs, compare the result against the untouched baseline before declaring it done, and prepare it for a pull request instead of merging.

When should I use Worktree PR?

Worktree PR fits situations like: A request says to do the work in a new worktree; A change is large; risky enough that the main tree should stay usable; several tasks need to run in parallel on one repository.

How do I install Worktree PR in Claude Code?

Run `npx skills add scarletkc/agents --skill worktree-pr -a claude-code`. Or copy the skill folder (skills/worktree-pr in scarletkc/agents) into .claude/skills/worktree-pr in your project. Claude Code loads it when a task matches its description.

How do I install Worktree PR in Codex?

Run `npx skills add scarletkc/agents --skill worktree-pr -a codex`. Or copy the skill folder (skills/worktree-pr in scarletkc/agents) into .agents/skills/worktree-pr in your project. Codex loads it when a task matches its description.

Can I use Worktree PR in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add scarletkc/agents --skill worktree-pr -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/worktree-pr, .gemini/skills/worktree-pr, .github/skills/worktree-pr and .opencode/skills/worktree-pr in your project.

What does Worktree PR need to run?

SKILL.md names no scripts, command-line tools or credentials: Worktree PR is instructions for the agent only.

Does Worktree PR access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Worktree PR safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Worktree PR use?

Worktree PR is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Worktree PR use?

About 1.2k tokens (SKILL.md is roughly 4.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Worktree PR?

Skills that share tags, products or a category with Worktree PR: Finishing a Development Branch (obra/superpowers, 296k stars), Finishing A Development Branch (farm-fe/farm, 5.6k stars), Git Worktree Cleanup (lobehub/lobehub, 83k stars) and Pre-Release PR Triage (jamiepine/voicebox, 57k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Worktree PR?

scarletkc (a GitHub user) maintains it in scarletkc/agents, which has 225 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on September 21, 2026.

Source: scarletkc/agents on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.