What I do
- •Turn a short task title into a deterministic
feature/<slug>branch name. - •Create a git worktree at
../.worktrees/pluto/<branch_sanitized>. - •Guide sync with
origin/main(prefer rebase for clean history). - •Guide PR creation (GitHub, squash merge; do not merge automatically).
- •Guide safe cleanup (remove worktree only).
Naming
- •Base branch:
origin/main - •Branch:
feature/<slug> - •Slug rules:
- •lowercase
- •replace non-alphanumeric with
- - •collapse consecutive
- - •trim leading/trailing
- - •max length: 60 characters
- •if the user already provides a valid slug, keep it
- •Worktree path:
- •base:
../.worktrees/pluto - •
branch_sanitized: replace/with__ - •full:
../.worktrees/pluto/<branch_sanitized>
- •base:
Start workflow (create worktree)
- •Ask for the task title (or slug) if missing.
- •Compute
<slug>, branchfeature/<slug>, and worktree path. - •Guardrails:
- •If the branch is already checked out in another worktree, stop and report the existing worktree path.
- •If the worktree path already exists, stop and ask whether to reuse it or choose a different slug.
- •Run:
- •
git fetch origin - •If branch exists locally:
git worktree add <path> <branch> - •Else:
git worktree add -b <branch> <path> origin/main
- •
- •Print the worktree path and the next suggested steps (install/test) based on the repo docs.
Sync workflow (keep up to date)
- •Prefer:
git fetch originthengit rebase origin/main - •If rebase conflicts:
- •stop, explain conflict resolution, and do not force anything
PR workflow (GitHub, squash merge)
- •Push branch:
- •
git push -u origin HEAD
- •
- •Create PR using
gh pr create:- •base:
main - •head: current branch
- •remind: squash merge is preferred; do not merge automatically
- •base:
- •Recommend PR title uses Conventional Commits (important for changelog/semantic-release in this repo).
Cleanup workflow (worktree only)
- •Confirm the target path.
- •If
git status --porcelainis not empty, ask for confirmation before removal. - •Remove:
- •
git worktree remove <path> - •optional:
git worktree prune
- •