Rootwork is a workspace scaffold for Worktrunk.
- Rootwork sets up the project layout.
- Worktrunk does the actual worktree operations.
- Rootwork adds project-local AI context so agents understand the layout.
Current implementation note:
- The active runtime is still the shell implementation.
- There is an in-progress Go rewrite in
cmd/rwt,internal/, andgo.mod. - Go is not required to use Rootwork today.
- If behavior changes, keep the shell implementation and the Go implementation aligned until the Go version becomes the packaged runtime.
~/Projects/MyProject/
.worktree-config.yml
AGENTS.md
.agents/
repos/
MyProject/
trees/
feature-auth
bugfix-login
Git and Worktrunk branches stay normal:
feature/auth
bugfix/login
Worktrunk places them in flattened tree directories using sanitize:
trees/feature-auth
trees/bugfix-login
Rootwork manages this Worktrunk user-config line:
worktree-path = "{{ repo_path }}/../../trees/{{ branch | sanitize }}"From this repo:
cd ~/Dev/Projects/rootwork
./bootstrap-machineWhat it does:
- Installs the global
rwtcommand - Checks whether your bin dir is on
PATH - Refreshes Worktrunk shell integration
- Creates or updates your Worktrunk user config
- Sets the Rootwork
worktree-path
If wt is missing, the script stops and tells you how to install it.
After that:
source ~/.zshrc
type wt
command -v rwtIf command -v rwt prints nothing, your shell has not picked up the new PATH yet.
Create and enter the project directory first:
mkdir -p ~/Projects/MyDashboard
cd ~/Projects/MyDashboardThen scaffold the current directory and clone the app repo:
rwt init-project --git git@github.com:org/my-dashboard.gitThen validate it:
cd ~/Projects/MyDashboard
rwt doctorYou should now have:
~/Projects/MyDashboard/
.worktree-config.yml
AGENTS.md
.agents/
repos/
MyDashboard/
trees/
If a project already has the right directory structure and real repo location:
cd ~/Projects/MyDashboard
rwt adopt-projectThen validate it:
cd ~/Projects/MyDashboard
rwt doctorUse --force only if you want to overwrite Rootwork-managed files that already exist.
Rootwork does not manage worktrees directly.
Run Worktrunk inside the real repo:
cd ~/Projects/MyDashboard/repos/MyDashboard
wt switch --create feature/auth
wt list
wt removeFrom a project root:
cd ~/Projects/MyDashboard
rwt doctorrwt doctor verifies:
.worktree-config.ymlexistsrepos/<ProjectName>exists- the repo directory is a git repo
trees/existswtis installed- Worktrunk user config exists
- Worktrunk
worktree-pathmatches the Rootwork layout
It also reminds you to verify shell integration manually with:
type wtIf rwt doctor fails on the Worktrunk path setting, re-run:
cd ~/Dev/Projects/rootwork
./bootstrap-machinecd ~/Dev/Projects/rootwork
./bootstrap-machine
rwt init-project MyDashboard --git git@github.com:org/my-dashboard.git
cd ~/Projects/MyDashboard
rwt doctor
cd repos/MyDashboard
wt switch --create feature/auth
wt list
wt removerwt doctor
rwt init-project [--git <url>] [--git-branch <branch>]
rwt adopt-project [--repo-dir <relative-path>] [--base <branch>] [--force]
rwt install-global [target-bin-dir]
rwt uninstall-global [target-bin-dir]
Generated and adopted workspaces include:
AGENTS.md.agents/skills/rootwork-project-ops/
That gives future AI sessions project-local instructions about the Rootwork layout and the expected Worktrunk workflow.
- Public entrypoint:
rwt - Internal implementation scripts live under
libexec/ - Shared helpers live under
lib/ - Project workspace scaffold files live under
scaffold/project-root/