Agent skill

Using Git Worktree

by c5inco in c5inco/compose-pokedexer

Creates and manages isolated Git worktrees with safe directory selection, explicit approval, clean-baseline verification, and Gradle-specific safeguards.

MITAuto-check passedDevelopment

Install Using Git Worktree

skills CLI
$ npx skills add c5inco/compose-pokedexer --skill using-git-worktree -a claude-code

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

GitHub CLI
$ gh skill install c5inco/compose-pokedexer using-git-worktree --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/c5inco/compose-pokedexer.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/using-git-worktree .claude/skills/using-git-worktree && 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
using-git-worktree
GitHub stars
143
Token cost
~1.4k tokens
SKILL.md length
720 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

Creates and manages isolated Git worktrees with safe directory selection, explicit approval, clean-baseline verification, and Gradle-specific safeguards.

  • Works in 3 steps: Run git rev-parse --git-common-dir and… → Run git branch --show-current and… → Treat a named non-default branch as…
  • Tasks that involve Git worktrees
  • SKILL.md covers Preflight: Check Whether…, Select and Verify the Directory, Choose the Branch and Base and Create the Worktree, plus 4 more sections
  • Calls git

What it does

Using Git Worktree is an agent skill from c5inco/compose-pokedexer. Creates and manages isolated Git worktrees with safe directory selection, explicit approval, clean-baseline verification, and Gradle-specific safeguards. Use before feature work when the main checkout should remain clean or whenever a worktree is requested.

Its SKILL.md is about 1.4k 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, Gradle, Jetpack Compose and Kotlin. The repository describes itself as: Pokedex app written in Compose, powered by PokeAPI.co. The licence is MIT.

When your agent uses it

  • Tasks that involve Git worktrees

Example prompts

  • “Use the using-git-worktree skill to create and manages isolated Git worktrees with safe directory selection, explicit approval, clean-baseline…”
  • “/using-git-worktree”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Run git rev-parse --git-common-dir and git rev-parse --git-dir. Different results mean the current checkout is
  2. Run git branch --show-current and identify the default branch with
  3. Treat a named non-default branch as existing task isolation. A detached HEAD is not task isolation.

What it can do on your machine

Read from SKILL.md and the folder at commit d2f8992. 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

    Shell commands in SKILL.md call:

    • git

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

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    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

Using Git Worktree loads about 1.4k tokens when it runs. Until then it costs about 69 tokens; SKILL.md has 720 words of instructions outside code blocks.

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

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 c5inco/compose-pokedexer at commit d2f8992, republished under its MIT licence (© c5inco). 720 words, ~1,369 tokens.

Download SKILL.mdSave it as .claude/skills/using-git-worktree/SKILL.md (or your agent's skills folder).
name
using-git-worktree
description
Creates and manages isolated Git worktrees with safe directory selection, explicit approval, clean-baseline verification, and Gradle-specific safeguards. Use before feature work when the main checkout should remain clean or whenever a worktree is requested.

Using Git Worktrees

Use systematic directory selection and safety verification to isolate task work without disturbing another checkout. Also follow AGENTS.md and the git-github-ops skill for every Git operation.

Preflight: Check Whether Isolation Already Exists

Before asking about or creating a worktree:

  1. Run git rev-parse --git-common-dir and git rev-parse --git-dir. Different results mean the current checkout is already a linked worktree.
  2. Run git branch --show-current and identify the default branch with git symbolic-ref --short refs/remotes/origin/HEAD when available.
  3. Treat a named non-default branch as existing task isolation. A detached HEAD is not task isolation.

If either a linked worktree or a non-default feature branch is active, report its path and branch, then stop this workflow. Do not create nested or redundant isolation.

If the user already requested a worktree, treat that request as approval. Otherwise, when the session is in the main checkout on the default branch, ask the worktree question prescribed by AGENTS.md. Continue only with explicit user agreement; it authorizes the worktree and branch creation described in the prompt, but no unrelated Git mutation.

Select and Verify the Directory

Use this priority:

  1. Existing .worktrees/ directory.
  2. Existing worktrees/ directory if project policy explicitly allows it.
  3. Otherwise, project-local .worktrees/.

Before creation, verify the selected directory is ignored:

bash
git check-ignore -q .worktrees/

If it is not ignored, stop. Ask for approval to add it to .gitignore, or choose an already ignored external location. Do not create a project-local worktree whose directory can appear as untracked content.

Choose the Branch and Base

  1. Choose a descriptive task branch such as fix/search-race or feat/item-details.
  2. Inspect the current branch and the remote's default branch.
  3. If currently on the default branch, use the current HEAD as the base unless the user asks for another base.
  4. If currently on another branch, ask whether the worktree should start from that branch, the default branch, or a different ref.
  5. Inspect whether the selected base is behind its remote-tracking ref. Never fetch, pull, merge, or rebase without the explicit approval required by AGENTS.md; report stale state and ask how to proceed.

Create the Worktree

Resolve an absolute target path under .worktrees/, then create the branch and worktree in one operation:

bash
git worktree add <absolute-path> -b <branch-name> <base-ref>

For all subsequent tools and commands, use the worktree's absolute path or set the tool's working directory to that path. Do not assume a cd in one shell invocation changes later tool calls.

Show full SKILL.md (321 more words)Show less

Verify a Clean Baseline

From the new worktree:

  1. Run git status --short and confirm the checkout is clean.
  2. Run ./gradlew test as the baseline test suite.
  3. If the baseline fails, report the exact failure and ask whether to investigate or proceed. Do not silently attribute a pre-existing failure to later work.
  4. If it passes, report the absolute worktree path, branch, base ref, and successful command.

Gradle and Formatting Safeguards

  • Use the Gradle tasks configured by this repository, not a separately installed ktfmt CLI.
  • If the change includes .kt or .kts files, run ./gradlew ktfmtFormat before committing and inspect any formatting changes.
  • Run targeted tests during development and ./gradlew check before every push or PR. If it fails, follow the pre-existing check failure exception in AGENTS.md; never infer an exception from worktree isolation alone.
  • After an approved rebase or merge, find the merge base, inspect the branch diff, and verify that key changes survived before rerunning ./gradlew check.
  • Treat .gradle/, build/, .kotlin/, IDE state, and Android SDK configuration as checkout-local or ignored state; never stage them as part of task work.

Cleanup

Worktree removal, branch deletion, and destructive cleanup require explicit user approval. Perform cleanup from the main checkout, never from inside the worktree being removed:

bash
git worktree list --porcelain
git worktree remove <absolute-worktree-path>
git branch -d <branch-name>

Before removal, inspect git status --short in the target worktree. Do not use --force, git branch -D, rm -rf, or another destructive fallback unless the user explicitly confirms the affected changes are disposable.

If cleanup fails, diagnose the current registration, branch attachment, and local changes before selecting a recovery action. Never retry destructively by default.

Invariants

Always:

  • skip creation when isolation already exists;
  • obtain approval before worktree or branch mutations;
  • verify project-local worktrees are ignored;
  • select the base branch explicitly;
  • use the worktree path for every later operation;
  • verify a clean baseline;
  • run and resolve ./gradlew check, or satisfy the documented pre-existing failure exception, before pushing;
  • preserve all uncommitted work during cleanup.

© c5inco, MIT. 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 .agents/skills/using-git-worktree of c5inco/compose-pokedexer.

Open the folder on GitHubat commit d2f8992

Compare with similar skills

Using Git Worktree 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.

Using Git Worktree compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Using Git Worktree this skillc5inco/compose-pokedexer143—~1.4kAutomated safety check: PassMIT
Stewardyschimke/compose-ai-tools117—~2kAutomated safety check: PassApache-2.0
Android Developmentdpconde/claude-android-skill336—~1.7kAutomated safety check: PassMIT
Claude Android NinjaDrjacky/claude-android-ninja124—~5.2kAutomated safety check: PassApache-2.0
Improve Code Coveragealexvanyo/composelife267—~1.1kAutomated safety check: PassApache-2.0
Flake Triageyschimke/compose-ai-tools117—~1.5kAutomated safety check: PassApache-2.0

Similar skills

  • Steward

    yschimke/compose-ai-tools

    Drive a pull request on this repository to green — which fast checks to run before pushing, how to read a red check, and what to do about a review comment.

    117 GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check passed
  • Android Development

    dpconde/claude-android-skill

    Create production-quality Android applications following Google's official architecture guidance and NowInAndroid best practices.

    336 GitHub stars~1.7k tokensUpdated 10 mo ago
    MobileAuto-check passed
  • Claude Android Ninja

    Drjacky/claude-android-ninja

    Build and migrate Android apps with Kotlin, Jetpack Compose, MVVM, Hilt, Room 3 (KSP, SQLiteDriver, Flow/suspend DAOs), Navigation3, and multi-module Gradle.

    124 GitHub stars~5.2k tokensUpdated 8 days ago
    MobileAuto-check passed
  • Improve Code Coverage

    alexvanyo/composelife

    Helps increment code coverage in this Kotlin Multiplatform project.

    267 GitHub stars~1.1k tokensUpdated today
    MobileAuto-check passed
  • Flake Triage

    yschimke/compose-ai-tools

    Decide whether a preview the visual-diff bot flagged actually regressed or is simply nondeterministic, using a repeat-render oracle at a single commit.

    117 GitHub stars~1.5k tokensUpdated today
    MobileAuto-check passed
  • Composewebview Development

    parkwoocheol/compose-webview

    Builds, tests, and formats ComposeWebView multiplatform library.

    103 GitHub stars~1.3k tokensUpdated 1 mo ago
    MobileAuto-check passed

More from c5inco/compose-pokedexer

  • Git GitHub Ops

    c5inco/compose-pokedexer

    Handles Pokedexer Git and GitHub workflows: inspect changes, prepare commit messages, manage branches and pushes, and create or update issues and pull requests with safe file-based inputs.

    143 GitHub stars~1.3k tokensUpdated 5 days ago
    Auto-check passed
  • Xcodebuildmcp CLI

    c5inco/compose-pokedexer

    Official skill for the XcodeBuildMCP CLI. An agent skill from c5inco/compose-pokedexer.

    143 GitHub stars~415 tokensUpdated 5 days ago
    Auto-check passed

Questions about Using Git Worktree

What does Using Git Worktree do?

Creates and manages isolated Git worktrees with safe directory selection, explicit approval, clean-baseline verification, and Gradle-specific safeguards. Using Git Worktree is an agent skill from c5inco/compose-pokedexer. Creates and manages isolated Git worktrees with safe directory selection, explicit approval, clean-baseline verification, and Gradle-specific safeguards.

When should I use Using Git Worktree?

Using Git Worktree fits situations like: tasks that involve Git worktrees.

How do I install Using Git Worktree in Claude Code?

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

How do I install Using Git Worktree in Codex?

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

Can I use Using Git Worktree 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 c5inco/compose-pokedexer --skill using-git-worktree -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/using-git-worktree, .gemini/skills/using-git-worktree, .github/skills/using-git-worktree and .opencode/skills/using-git-worktree in your project.

What does Using Git Worktree need to run?

Going by SKILL.md and its folder, Using Git Worktree needs the command-line tools its instructions call (git).

Does Using Git Worktree access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Using Git Worktree 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 Using Git Worktree use?

Using Git Worktree is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Using Git Worktree use?

About 1.4k tokens (SKILL.md is roughly 5.5k 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 Using Git Worktree?

Skills that share tags, products or a category with Using Git Worktree: Steward (yschimke/compose-ai-tools, 117 stars), Android Development (dpconde/claude-android-skill, 336 stars), Claude Android Ninja (Drjacky/claude-android-ninja, 124 stars) and Improve Code Coverage (alexvanyo/composelife, 267 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Using Git Worktree?

c5inco (a GitHub user) maintains it in c5inco/compose-pokedexer, which has 143 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 3, 2026.

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