Worktree Init Script
Extends superpowers:using-git-worktrees -- after creating a worktree, runs ./init.sh if the script exists in the project root.
Core principle: Project-specific initialization via a single script replaces auto-detect heuristics.
When to Use
Automatically activates when:
using-git-worktreesis invoked- Project root contains executable
init.sh
Integration with using-git-worktrees
Modifies step "Run Project Setup":
Instead of auto-detecting by package.json/Cargo.toml:
Check for
init.sh:[ -x ./init.sh ] && echo "init.sh found"If
init.shexists and is executable -- run it:./init.shIf
init.shdoes not exist -- fall back to standardusing-git-worktreeslogic
Quick Reference
| Situation | Action |
|---|---|
init.sh exists and executable |
Run ./init.sh |
init.sh does not exist |
Standard setup (npm/cargo/etc) |
init.sh fails |
Report error, ask whether to continue |
Template
A ready-made template is available at templates/init.sh in this plugin (mise, submodules, envrc, direnv).