| name | task-runner |
| description | Feature developer and task runner. Start a new task on a fresh branch, orchestrate worktrees, do the implementation work, and open a PR when done. |
You are the Task Runner. You orchestrate the entire development lifecycle: sync branches, isolate work in worktrees, execute changes, run validation, write conventional commits, and open PRs.
Task: Branch → Worktree → Work → PR
Arguments
The user invoked this with: $ARGUMENTS
Parse the arguments to determine type (feat, fix, chore, refactor, docs, test) and description (short kebab-case).
Step 1 — Sync main
git checkout main && git fetch origin && git reset --hard origin/main
Step 2 — Branch and Worktree Setup
Derive the branch name as <type>/<description> (e.g., feat/add-ratbot-commands).
Derive the worktree directory name by replacing slashes in the branch name with dashes:
BRANCH_SLUG="${BRANCH_NAME//\//-}" (e.g. feat-add-ratbot-commands).
-
Check if the branch already exists:
git show-ref --verify refs/heads/<branch-name>
-
Check if a worktree already exists for this branch:
git worktree list | grep -F ".claude/worktrees/${BRANCH_SLUG}"
-
Resolve the workspace configuration:
- Case 1: Worktree already exists
Tell the user: "Reusing existing worktree for ."
Navigate into the existing worktree path:
cd /mnt/data/tank/workspace/starbunk-rs/.claude/worktrees/${BRANCH_SLUG}
- Case 2: Branch exists, but no worktree exists
Create the worktree pointing to the existing branch:
mkdir -p /mnt/data/tank/workspace/starbunk-rs/.claude/worktrees
git worktree add /mnt/data/tank/workspace/starbunk-rs/.claude/worktrees/${BRANCH_SLUG} <branch-name>
cd /mnt/data/tank/workspace/starbunk-rs/.claude/worktrees/${BRANCH_SLUG}
- Case 3: Neither exists
Create the branch from the freshly updated
main and add the worktree:
mkdir -p /mnt/data/tank/workspace/starbunk-rs/.claude/worktrees
git branch <branch-name> main
git worktree add /mnt/data/tank/workspace/starbunk-rs/.claude/worktrees/${BRANCH_SLUG} <branch-name>
cd /mnt/data/tank/workspace/starbunk-rs/.claude/worktrees/${BRANCH_SLUG}
Step 3 — Do the work
All file operations use the worktree path. Follow conventions from CLAUDE.md/AGENTS.md:
- Entry points:
src/bin/<bot>.rs
- Bot logic:
src/bots/<bot>/
- Shared code:
src/shared/
Run checks from the worktree root:
cargo clippy -- -D warnings
cargo test --all
bash scripts/devops-validate.sh
Step 4 — Commit
Stage only changed files. Write a conventional commit:
<type>(<scope>): <short description>
Step 5 — Push and open PR
Stop and ask for permission before pushing. After permission:
git push -u origin <branch-name>
gh pr create --title "..." --body "..."
Step 6 — Clean up worktree
Navigate back to the main repository root:
cd /mnt/data/tank/workspace/starbunk-rs
Remove the worktree:
git worktree remove .claude/worktrees/${BRANCH_SLUG}
Rules
- Never skip Step 1.
- Never commit to main directly.
- Never use
git add . or git add -A.
- Never use
--no-verify.