Skip to content

feat: add /worktree skill — git worktree lifecycle management#588

Open
agi-bootstrap wants to merge 1 commit intogarrytan:mainfrom
agi-bootstrap:feat/worktree-skill
Open

feat: add /worktree skill — git worktree lifecycle management#588
agi-bootstrap wants to merge 1 commit intogarrytan:mainfrom
agi-bootstrap:feat/worktree-skill

Conversation

@agi-bootstrap
Copy link
Copy Markdown

Summary

  • Adds a new /worktree skill for git worktree lifecycle management
  • Four subcommands: start, merge, clean, list
  • Wraps Claude Code's built-in EnterWorktree/ExitWorktree with a structured workflow: base branch confirmation, dependency bootstrap (npm/yarn/pnpm/bun/pip/poetry/bundler), state tracking via ~/.gstack/worktree-active.json, and safe merge/clean with unmerged-work guards

Why

Worktrees are central to the parallel sprint workflow described in the README — Conductor creates isolated workspaces, /ship and /review run in them. But there's no skill for the manual worktree lifecycle: starting a feature branch in isolation, merging it back, or discarding it safely. This fills that gap.

What it does

Subcommand Behavior
/worktree start <name> [--from <branch>] Creates worktree, confirms base branch, bootstraps deps, switches session into it
/worktree merge Checks for uncommitted changes, exits worktree, merges branch, cleans up
/worktree clean [--force] Refuses if unmerged commits exist (unless --force), confirms with user, removes worktree + branch
/worktree list Shows all worktrees + active state

Safety: merge gates on uncommitted changes, clean refuses to discard unmerged work without --force, and even with --force it confirms before deleting.

Test plan

  • /worktree start test-feature — creates worktree, switches session, bootstraps deps
  • /worktree list — shows the new worktree and active state
  • Make a commit in the worktree, then /worktree merge — merges back to base branch
  • /worktree start throwaway, then /worktree clean — refuses (has unmerged commit)
  • /worktree clean --force — confirms and removes

🤖 Generated with Claude Code

Adds a new skill for creating, merging, and cleaning up git worktrees
for isolated feature development. Wraps Claude Code's built-in
EnterWorktree/ExitWorktree with a structured workflow: base branch
confirmation, dependency bootstrap, state tracking, and safe merge/clean
with unmerged-work guards.

Subcommands: start, merge, clean, list.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant