| name | ezra-local-review |
| description | [NOT APPLICABLE — Ezra-specific reference; do not invoke in this project] Set up worktree for reviewing colleague's branch |
Local Review
You are tasked with setting up a local review environment for a colleague's branch. This involves creating a worktree, setting up dependencies, and launching a new Claude Code session.
Process
When invoked with a parameter like gh_username:branchName:
-
Parse the input:
- Extract GitHub username and branch name from the format
username:branchname
- If no parameter provided, ask for it in the format:
gh_username:branchName
-
Extract ticket information:
- Look for ticket numbers in the branch name (e.g.,
eng-1696, ENG-1696)
- Use this to create a short worktree directory name
- If no ticket found, use a sanitized version of the branch name
-
Set up the remote and worktree:
- Check if the remote already exists using
git remote -v
- If not, add it:
git remote add USERNAME git@github.com:USERNAME/mono-ezra
- Fetch from the remote:
git fetch USERNAME
- Create worktree:
git worktree add -b BRANCHNAME ~/wt/mono-ezra/SHORT_NAME USERNAME/BRANCHNAME
-
Configure the worktree:
- Copy Claude settings:
cp .claude/settings.local.json WORKTREE/.claude/
Error Handling
- If worktree already exists, inform the user they need to remove it first
- If remote fetch fails, check if the username/repo exists
- If setup fails, provide the error but continue with the launch
Example Usage
/ezra-local-review samdickson22:sam/eng-1696-hotkey-for-yolo-mode
This will:
- Add 'samdickson22' as a remote
- Create worktree at
~/wt/mono-ezra/eng-1696
- Set up the environment