agentsclimarketplace

Worktree manager

Skill smicolon/ai-kit/packs/worktree/skills/worktree-manager

Convention packs for any AI coding tool - agents, skills, commands, and rules for 15 tools including Claude Code, Cursor, Windsurf, and Copilot

Install
npx -y skills add smicolon/ai-kit --skill worktree-manager

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

This skill should be used when the user mentions "worktree", "wt", "new branch workspace", "parallel development", "feature branch setup", "work on multiple branches", "separate workspace for branch", "docker port conflict", "database isolation", "worktreeinclude", "env isolation", or wants to manage git worktrees for parallel feature development.

SKILL.md

4.3 KB, 963 tokens by cl100k_base, as published. Nobody here has run it

Git Worktree Manager Skill

Manages git worktrees for parallel development with automatic environment isolation.

Activation Triggers

This skill activates when the user:

  • Asks about "worktree" or "git worktree"
  • Mentions "wt" in context of git/branches
  • Wants to "work on multiple branches simultaneously"
  • Needs a "separate workspace for a feature"
  • Asks about "parallel development" setup
  • Wants to "set up a new branch workspace"
  • Has "docker port conflicts" between branches
  • Needs "database isolation" for parallel work
  • Asks about ".worktreeinclude" or "env isolation"

Commands Reference

CommandAliasDescription
/wt create <branch>/wt cCreate worktree with full isolation
/wt list/wt lsShow all worktrees
/wt remove <branch>/wt rmRemove worktree (stops Docker first)
/wt open <branch> [--editor]/wt oOpen (--cursor|-c, --agy|-a, --code|-v)

Naming Convention

Worktrees are created as siblings with -- separator:

~/[PARENT_DIRECTORY]/[REPO_NAME]/              # main repo
~/[PARENT_DIRECTORY]/[REPO_NAME]--[BRANCH_NAME]/   # worktree for [BRANCH_NAME]

Three-Layer Isolation

Layer 1: .worktreeinclude — File Selection

Gitignore-style file at repo root controlling which untracked files to copy. Auto-generated with sensible defaults on first wt create.

.env*
# apps/*/.env*

[rewrite]
auto

[docker]
auto

Layer 2: [rewrite] — Env Var Isolation

  • auto: Suffixes DB_NAME, POSTGRES_DB, DATABASE_URL, COMPOSE_PROJECT_NAME with branch slug
  • {{BRANCH}}: Template placeholder for custom vars

Layer 3: [docker] — Docker Compose Env Var Isolation

  • Patches compose file with ${WT_PORT_*:-default} and ${WT_CONTAINER_PREFIX:-default} syntax
  • Writes port/container env vars + COMPOSE_PROJECT_NAME to .env
  • Auto-creates databases in running Postgres

Auto-Setup Features

When creating a worktree, the following happens automatically:

  1. Branch handling: Creates new branch or checks out existing (local/remote)
  2. File copying: Copies files matching .worktreeinclude patterns
  3. Env rewriting: Suffixes database names and URLs with branch slug
  4. Docker isolation: Patches compose with env var interpolation, writes .env
  5. Database creation: Creates database in running Postgres (idempotent)
  6. Package manager: Detects bun/pnpm/yarn/npm from lockfiles
  7. Dependencies: Runs install at root (monorepo-aware)

Behavioral Expectations

When user asks about worktrees or parallel development:

  1. Suggest using /wt create <branch> for new worktrees
  2. Explain the three-layer isolation if they have Docker/database conflicts
  3. Mention .worktreeinclude for customizing which files are copied
  4. Show the cd command output for easy navigation
  5. Explain that wt remove stops Docker containers but preserves databases

Example Interactions

User: "I need to work on the auth feature while keeping my current work"

Response: Use /wt create feature/auth to create a parallel workspace. This will:

  • Create project--feature-auth/ as sibling directory
  • Copy your .env files and rewrite DB names with _feature_auth suffix
  • Generate Docker port offsets so both worktrees can run simultaneously
  • Install dependencies

User: "My worktrees are conflicting on port 5432"

Response: The .worktreeinclude file's [docker] section handles this. With auto enabled, wt create patches your compose file with ${WT_PORT_*:-default} env var interpolation and writes offset values to .env. Each worktree gets a deterministic offset based on the branch name. The compose file defaults still work on main.

User: "How do I customize which files are copied to worktrees?"

Response: Edit .worktreeinclude in your repo root. It uses gitignore-style patterns:

.env*
config/local.yml
apps/*/.env*

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.