Skip to content
Skills Library
Programming · Building & coding

worktree

/worktree

Manage git worktrees with their own dev ports, symlinked .env files, playground, and simulations. Use when the user asks to create, set up, list, enter, or remove a worktree.

Repository
rhesis ↗
Licence
MIT
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Manage git worktrees with their own dev ports, symlinked .env files, playground, and simulations. Use when the user asks to create, set up, list, enter, or remove a worktree.

Original author description

Manage git worktrees with their own dev ports, symlinked .env files, playground, and simulations. Use when the user asks to create, set up, list, enter, or remove a worktree.

How it works

  1. --init on an existing worktree
  2. Notes
Original SKILL.md headings · 53 lines, 381 words
SKILL.md preview
---
name: worktree
description: Manage git worktrees with their own dev ports, symlinked .env files, playground, and simulations. Use when the user asks to create, set up, list, enter, or remove a worktree.
---

# Worktrees

Run `./rh worktree $ARGUMENTS` from the repo root. Why worktrees must go through this command at
all — and how the `WorktreeCreate` hook routes `EnterWorktree` into it — is in `AGENTS.md`; this
skill is the command surface.

If the user gave no arguments, ask which operation they want:

| Command | What it does |
| --- | --- |
| `./rh worktree <name>` | Create a worktree branching from current HEAD, with its own dev ports |
| `./rh worktree --init` | Give an existing worktree the same setup — run it from inside that worktree |
| `./rh worktree <name> --load` | Launch a shell in the worktree |
| `./rh worktree <name> --remove` | Remove the worktree, its dev containers and volumes, and its branch |
| `./rh worktree --list` | List all worktrees |

`./rh worktree help` prints the same list with per-flag detail.

## `--init` on an existing worktree

For a worktree made with a bare `git worktree add`, or one the hook only partly set up. Run it
from inside the worktree — it locates the main checkout itself:

```bash
cd ~/worktrees/rhesis/<name> && ./rh worktree --init
```

From the main checkout, name the target instead: `./rh worktree <name> --init`.

It allocates a free port block into `.rhesis-ports`, symlinks `playground/`, `simulations/`,
`domain.local/`, the `.env` files and the Claude config, then copies `apps/backend/.env` and
`apps/frontend/.env.local` and shifts their ports. It's idempotent — re-running reports what's
already linked and leaves it alone.

Two things it won't do: run in the main checkout, or touch a directory git doesn't list as a
worktree. Both exit with an error rather than provisioning the wrong tree.

If the worktree's branch predates the `--init` flag, its own `./rh` won't have it. Run the main
checkout's copy instead — it resolves the target from your current directory, not from where the
script lives:

```bash
/path/to/main/rh worktree --init
```

## Notes

- A worktree outside `~/worktrees/rhesis/` gets provisioned fine, but `--load` and `--remove`
  can't find it by name — remove it with `git worktree remove` after `./rh dev clean` inside it.
- `--remove` deletes the branch too, and only deletes it if it's fully merged.
- After creating or adopting one, `./rh dev status` inside it shows the ports it actually got.

Versions

RepositoryScoreLicence
This page · rhesis-ai/rhesis100MIT
vanducng/skills100MIT
tony/skills100MIT
zts212653/clowder-ai100MIT
duronext/jig100MIT
guangshinhaha/shinstack100MIT
PranamRDoshi/dotclaude100MIT
kronael/tools100Unlicense
zipstack/unstract100AGPL-3.0

Database snapshot: 13.11.2026 · package version e587e0454ebe (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100task-onboarding
    Onboard a git repo onto tt worktree tasks — unique per-task ports and env templating. Use when the user asks to "onboard this repo for tasks", "set up tt tasks", "make worktrees get unique ports", or when a repo's tasks render an empty `.env` and it needs per-task ports.…
  • 96flow-next-worktree-kit
    Manage git worktrees (create/list/switch/cleanup) and copy .env files. Use for parallel feature work, isolated review, clean workspace, or when user mentions worktrees.
  • 96flow-next-worktree-kit
    Manage git worktrees (create/list/switch/cleanup) and copy .env files. Use for parallel feature work, isolated review, clean workspace, or when user mentions worktrees.
  • 90worktrees
    Use when creating, entering, checking, repairing or removing a git worktree, or when a worktree lacks dependencies, git hooks, skills or ignored files such as .env that the main checkout has.
  • 100flux-worktree-kit
    Manage git worktrees (create/list/switch/cleanup) and copy .env files. Use for parallel feature work, isolated review, clean workspace, or when user mentions worktrees.
  • 100git-worktrees
    Git worktree management for parallel agent team development. Triggers: 'create worktree', 'worktree setup', or during /delegate dispatch. Do NOT use for branch creation without delegation context.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.