agents/skills/git-worktree-workflow/SKILL.md
Use when working with git worktrees in pkey's repos — creating a branch, switching between worktrees, removing one, or starting a stacked PR with Graphite. The user has shell helpers (gwt, gwtn, gwtc, gwtl, gwtm, gwtrm, gwtrmf, gwtp) sourced from ~/dotfiles/tools/git-worktree.sh that enforce a consistent layout under ~/worktrees/<repo>/<branch>. Prefer these over raw `git worktree` commands so layout and main-worktree protection stay consistent.
npx skillsauth add pkey/dotfiles git-worktree-workflowInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The user does not branch in-place. Every branch is a separate git worktree, laid out as:
~/worktrees/<repo>/<branch-slug>
The main checkout lives at ~/code/<repo> and stays on main. Stack metadata and PR submission are handled by Graphite (gt) — the helpers below only manage physical worktrees.
git worktree)| Helper | What it does |
|---|---|
| gwt | Print the helper cheatsheet (no side effects). |
| gwtn <branch> [base] | Create a worktree at ~/worktrees/<repo>/<slug> from [base] (default HEAD) and cd into it. If <branch> already exists, attaches a worktree to it instead of creating a branch. Use this when you know the branch name you want and don't need to pick. |
| gwtc [branch] | Go to <branch>'s worktree, materializing one if it doesn't exist yet. Resolves <branch> against existing worktrees → local branches → origin/<branch> (in that order). With no arg, opens an fzf picker over worktrees + all local branches + all remote branches, marked [*] (worktree exists) or [ ] (branch only). Picking a [ ] row creates the worktree, then cds in. |
| gwtl | List worktrees for the current repo. |
| gwtm | cd to the main worktree (branch = $GWT_MAIN_BRANCH, default main). |
| gwtrm | Remove the current worktree. Refuses on main. cds to main first. |
| gwtrmf | Same as gwtrm but --force. |
| gwtp | git worktree prune. |
Source: ~/dotfiles/tools/git-worktree.sh (auto-sourced by ~/.zshrc).
gwtn <branch>. Never git checkout -b in the main checkout, and never git worktree add directly — both bypass the layout.gwtn <child-branch>. Default base is HEAD, which is the parent tip.gwtc. The picker shows worktrees and bare branches together; pick the row to go there. Picking a [ ] row auto-creates the worktree (and tracks origin/<branch> if remote-only). Use gwtc <branch> for the same behavior with a known name.gwtc and pick the [ ] origin/<branch> row, or gwtc <branch> directly (it falls back to origin/<branch> if no local branch exists). Run git fetch first if the remote ref isn't visible yet.gt sync (Graphite handles branch deletion), then from inside the merged worktree run gwtrm, then gwtp.gwtrm fails, surface the error — don't reach for gwtrmf unless they ask.gwtm # ~/code/<repo> on main
gwtn feature-a # ~/worktrees/<repo>/feature-a, branched off main
# ...edit, commit...
gt submit # Graphite: PR for feature-a
gwtn feature-b # from feature-a, creates feature-b stacked on it
# ...edit, commit...
gt submit # Graphite: stacked PR for feature-b
# after feature-a merges:
gwtm && gt sync # Graphite catches branches up and deletes merged ones
gwtc feature-a && gwtrm # remove the merged worktree
gwtp # prune admin records
gt create, gt submit, gt sync, gt restack, etc. stay as-is.gt sync's job.npm install, no mise/asdf reshim, no env bootstrap). If a new worktree needs deps, the user runs them.GWT_ROOT — root for all worktrees (default ~/worktrees).GWT_MAIN_BRANCH — protected main branch name (default main). Set to master for repos that use it.tools
Reference for Helix editor keybindings, commands, and configuration. Use when the user asks about Helix shortcuts, how to do X in Helix, Helix config options, or how to set up language servers/themes in Helix.
development
Google Sheets: Read and write spreadsheets.
development
Google Sheets: Read values from a spreadsheet.
development
Google Sheets: Append a row to a spreadsheet.