How this skill is triggered — by the user, by Claude, or both
Slash command
/rpi:setup-worktreeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
<step index=1 outputs=branchname,dirname>
1a. once you have a task dir, read ticket.md and plan.md if present:
Read(.humanlayer/tasks/eng-XXXX-description/ticket.md)
Read(.humanlayer/tasks/eng-XXXX-description/...plan.md)
If there is a ticket, it will include the branch name, so
branchname=[branch name from the ticket] dirname=[second half of branch name from the ticket, without the leading "$USER/"]
1b. if there is no task dir, determing the branchname and worktree dirname given the user's input
e.g.
user: use the rpi:setup-worktree skill for "new-spline-reticulator"
branchname="new-spline-reticulator" dirname="new-spline-reticulator"
check for a create_worktree.sh script:Bash(ls scripts/create_worktree.sh)
Run the script with just the branchname
```
Bash(./scripts/create_worktree.sh BRANCHNAME)
```
The script will handle all setup of .env, etc.
If you see there are any error messages or failures: report the error to the user and fix them, don't proceed to step 4 until the worktrees are created
If no script was found use the collected info to create a worktree.
You will need to know:
1. BRANCHNAME - the branch name (from the ticket)
2. DIRNAME - the directory name for the worktree - this is the branch name without the leading `username/`, e.g.
`fred/eng-1234-fix-ui` -> `eng-1234-fix-ui`
3. REPONAME - the current directory name
4. WORKTREES_BASE - the worktree base directory. If not specified, use `~/wt` as default
5. SETUP_COMMAND - the command to use to set up the repo - (e.g. npm install, bun run setup, etc)
Ask the user if you are missing any of this information, and have them confirm it before proceeding.
<example_confirmation>
I'm ready to create a worktree:
BRANCHNAME: ...
DIRNAME: ...
REPONAME: ...
WORKTREES_BASE: ...
SETUP_COMMAND: UKNOWN
Then I will create worktree at [WORKTREES_BASE/REPONAME/DIRNAME] with
```
git worktree add -b [BRANCHNAME] [WORKTREES_BASE/REPONAME/DIRNAME]
for f in .env*; do [ -f "$f" ] && cp "$f" WORKTREE_PATH/; done
cp .claude/settings.local.json WORKTREE_PATH/.claude/
[optional setup command here]
```
Let me know if you're ready or want to change anything.
If you need any setup like `npm install` let me know and I can include it.
</example_confirmation>
If you see there are any error messages or failures: report the error to the user work with the user to complete the setup
don't proceed to step 3/4 until the worktrees are created
if no script exists and the commands succeeded, offer to create a script for the user:
<example_offer>
Would you like me to capture these decisions in ./scripts/create_worktree.sh so you can automate this step in the future?
Based on our conversation, the script would use:
BRANCHNAME: ... DIRNAME: ... REPONAME: ... WORKTREES_BASE: ... SETUP_COMMAND: UKNOWN
Let me know if you'd like me to create it, or if you'd just like to proceed to implementation. </example_offer>
Read({SKILLBASE}/references/create_worktree_script_template.sh)./scripts/create_worktree.sh based on the conversation so far, adapting it based on the users WORKTREES_BASE and SETUP_COMMANDOnly output this if the worktree was successfully created.
If you encountered an error in Step 2, do NOT output this section.
<output_example> Worktree for ENG-XXXX has been configured. You can start implementation by running
use the rpi:implement-plan skill for task .humanlayer/tasks/eng-xxxx-description
in the [WORKTREE_FULL_PATH] directory
</output_example>
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub jturner421/rpi-skills