.agents/skills/managing-kata-worktrees/SKILL.md
Manage kata-mono git worktrees — switching branches, syncing standby branches to main after PR merges, diagnosing drift, and verifying worktree health. Use when the user mentions worktrees, standby branches, syncing after a merge, "wt-" prefixed names, worktree setup, or asks why a worktree is behind main. Also use when starting work on a ticket (to verify the worktree is current) or finishing work (to return to standby).
npx skillsauth add gannonh/kata-cloud-agents managing-kata-worktreesInstall 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.
kata-mono uses a multi-worktree layout where each worktree maps to a monorepo app:
| Worktree | Path | Standby Branch | App |
| ----------- | ---------------------------------- | --------------------- | ------------------ |
| main (root) | kata-mono/ | main | — (no direct work) |
| wt-cli | kata-mono.worktrees/wt-cli/ | wt-cli-standby | apps/cli |
| wt-context | kata-mono.worktrees/wt-context/ | wt-context-standby | apps/context |
| wt-desktop | kata-mono.worktrees/wt-desktop/ | wt-desktop-standby | apps/desktop |
| wt-orc | kata-mono.worktrees/wt-orc/ | wt-orc-standby | apps/orc |
| wt-symphony | kata-mono.worktrees/wt-symphony/ | wt-symphony-standby | apps/symphony |
Why standby branches exist: Git prohibits checking out the same branch in multiple worktrees. Since all worktrees need to track main when idle, each has a local "standby" branch that mirrors origin/main. No work happens directly on main in any worktree.
Each standby branch must track origin/main so git pull works:
git branch --set-upstream-to=origin/main wt-cli-standby
If git pull reports "no tracking information," re-run that command. Tracking can be lost if a branch is recreated.
For initial setup of a new standby branch, set tracking and then pull from within the worktree to sync both the ref and working tree:
git branch --set-upstream-to=origin/main wt-<name>-standby
git -C /Volumes/EVO/kata/kata-mono.worktrees/wt-<name> pull
git -C /Volumes/EVO/kata/kata-mono.worktrees/wt-<name> log --oneline -1
# Should match: git log --oneline -1 main
git -C /Volumes/EVO/kata/kata-mono.worktrees/wt-<name> checkout -b feat/my-feature
After merging a PR on GitHub:
# In the worktree (or using -C from anywhere)
git checkout wt-<name>-standby
git pull
git pull works because the standby branch tracks origin/main. This fast-forwards the standby branch to include the newly merged PR.
If pull fails with conflicts: This means the standby branch diverged from main (e.g., commits landed on standby that weren't in the PR). If the PR contained all the work, reset is safe:
git checkout wt-<name>-standby
git fetch origin
git reset --hard origin/main
Only use reset when you're certain the PR captured all the work. If unsure, inspect with git log wt-<name>-standby..origin/main and git log origin/main..wt-<name>-standby to see what each side has.
To check if all worktrees are current:
git worktree list
All entries should show the same commit hash when idle. If any differ:
# See what main has that the standby doesn't
git log --oneline wt-<name>-standby..main
# See what the standby has that main doesn't (should be empty)
git log --oneline main..wt-<name>-standby
After merging a PR, pull main from the root repo. Worktrees share the same git object store, so they see the updated refs automatically. Then pull from within each worktree to fast-forward its standby branch:
# From the main repo root
git checkout main && git pull
# Then from each worktree (or using -C)
for wt in wt-cli wt-context wt-desktop wt-orc wt-symphony; do
git -C /Volumes/EVO/kata/kata-mono.worktrees/$wt pull
echo "$wt: $(git -C /Volumes/EVO/kata/kata-mono.worktrees/$wt log --oneline -1)"
done
Do not use git update-ref or git reset --hard to sync worktrees. These operate on refs or working trees in isolation and cause dirty state. Use git pull from within the worktree, which updates both the branch pointer and working tree together.
Quick verification that everything is in sync:
MAIN_SHA=$(git rev-parse main)
for wt in wt-cli wt-context wt-desktop wt-orc wt-symphony; do
WT_SHA=$(git -C /Volumes/EVO/kata/kata-mono.worktrees/$wt rev-parse HEAD)
if [ "$WT_SHA" = "$MAIN_SHA" ]; then
echo "$wt: current"
else
echo "$wt: BEHIND (at $(git log --oneline -1 $WT_SHA))"
fi
done
git branch --set-upstream-to=origin/main wt-<name>-standbygit reset --hard origin/main if the PR captured everything.pwd resolves to the intended worktree, not the main repo. See memory: feedback_worktree_paths.md.tools
This skill should be used when a new project session starts and the user expresses what they want to build, asks to "start a project", "spec this out", "help me plan", or describes a feature/tool/system they want to create. Guides structured intent capture through goal, constraints, architecture, acceptance criteria, tasks, and non-goals.
tools
Push current branch changes to origin and create or update the corresponding pull request (with the correct base branch); use when asked to push, publish updates, or create pull request.
development
Pull latest origin/<base-branch> into the current local branch and resolve merge conflicts (aka update-branch). Use when Codex needs to sync a feature branch with origin, perform a merge-based update (not rebase), and guide conflict resolution best practices.
tools
Use Symphony's `linear_graphql` client tool for raw Linear GraphQL operations such as comment editing and upload flows.