agentleFS
benjaminwesternbenjaminwestern/google-engineer-skills/skills/worktrunk/SKILL.md

worktrunk

Skill5 starsChanged 8 months agoMITView on GitHub

MUST USE when coordinating parallel AI coding agents with worktrunk (`wt`), or when creating, merging, pruning, and cleaning git worktrees. Covers worktree creation and switching, sub-agent prompt scaffolding, merge order, validation, hooks, and cleanup. Do NOT use for plain git tasks that do not involve worktrees or parallel agent workflows.

  • Installs packages

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. 0 are common, 7 are distinctive, and 11 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read references/configuration.md when the user needs custom wt.toml configuration, path templates, hooks, or LLM commit generation.

    line 49
  2. Distinctive:

    Ensure main is clean, up to date, and validated before spawning agent branches.

    line 66
  3. Distinctive:

    Create one worktree per ownership slice.

    line 69
  4. Very specific:

    Use short, scope-based names such as terminal-selection, judge-semantics, or session-history.

    line 71
  5. Distinctive:

    Run the repo's build or test command in the worktree that changed.

    line 83
  6. Very specific:

    Use wt switch --create <branch> to create a new branch and worktree from the current default branch.

    line 102
  7. Very specific:

    Use wt list to inspect active worktrees, ahead or behind state, and whether a branch is already integrated into the default branch.

    line 108
  8. Very specific:

    Use wt merge inside an agent worktree when you want worktrunk to handle the full squash, rebase, merge, and cleanup flow.

    line 113
  9. Very specific:

    Use wt remove from a safe worktree, usually main, when you want to purge completed branches and their worktrees.

    line 127
  10. Very specific:

    Use --force when untracked build artefacts would otherwise block removal.

    line 135
  11. Very specific:

    Use wt step prune for bulk cleanup after a merge wave.

    line 139
  12. Distinctive:

    When coordinating sub-agents, always define:

    line 148
  13. Distinctive:

    Do not ask multiple agents to edit the same hot files unless the user explicitly accepts integration overhead.

    line 156
  14. Very specific:

    Prefer wt merge when the branch is clearly bounded and conflict risk is low.

    line 161
  15. Distinctive:

    Prefer a dedicated integration worktree when multiple agents touched adjacent layers and the next step depends on reconciling them together.

    line 162
  16. Very specific:

    If the current worktree itself needs to be deleted, switch to main first or run wt remove <branch> from another worktree.

    line 164
  17. Distinctive:

    Keep worktree names stable across prompts, commits, and merge notes.

    line 166
  18. Very specific:

    After a merge wave, rerun wt list to confirm only the intended worktrees remain.

    line 167

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Worktrunk skill

Worktrunk (wt) is the right layer when the user wants parallel coding work split across multiple git worktrees and then merged back together cleanly. Use it for branch creation, switching, integration, cleanup, and disciplined sub-agent orchestration.

Quick start

# Install and enable shell integration
brew install worktrunk
wt config shell install

# Create a new worktree from the default branch
wt switch --create feature-auth

# See all worktrees and their status
wt list

# Merge the current worktree back into the default branch
wt merge

# Remove merged worktrees from a safe worktree such as main
wt remove feature-auth --foreground -y

Shell integration is required. Without wt config shell install, wt switch prints the path but does not move the shell into the worktree.

When to read references

Read references/configuration.md when the user needs custom wt.toml configuration, path templates, hooks, or LLM commit generation.

Read references/agent-orchestration.md when the user wants to:

  • spawn multiple coding agents in parallel;
  • generate consistent branch-specific prompts;
  • define ownership boundaries and validation commands;
  • merge work back in a controlled order; or
  • clean up completed worktrees after integration.

Recommended multi-agent workflow

  1. Stabilise the default branch.

    Ensure main is clean, up to date, and validated before spawning agent branches. Record the baseline commit if the user wants exact reproducibility.

  2. Create one worktree per ownership slice.

    Use short, scope-based names such as terminal-selection, judge-semantics, or session-history. Prefer module ownership over vague labels like fixes or misc.

  3. Give every agent a bounded prompt.

    Each agent should receive the same shared operator preamble plus a narrow ownership list, a concrete task, and explicit success criteria. Use the orchestration reference for prompt templates.

  4. Validate inside each worktree.

    Run the repo's build or test command in the worktree that changed. If the repo has multiple runtimes, require secondary validation when the agent touches those layers.

  5. Integrate one branch at a time.

    Merge foundational branches first, then higher-level UI or orchestration work. If conflicts are likely, use a dedicated integration worktree instead of merging directly into the default branch.

  6. Clean up aggressively.

    Once work is integrated and pushed, remove completed worktrees so the next batch starts from a clean state.

Core commands

wt switch

Use wt switch --create <branch> to create a new branch and worktree from the current default branch. Use wt switch <branch> to jump back into an existing one.

wt list

Use wt list to inspect active worktrees, ahead or behind state, and whether a branch is already integrated into the default branch.

wt merge

Use wt merge inside an agent worktree when you want worktrunk to handle the full squash, rebase, merge, and cleanup flow. This is the simplest path when the branch is self-contained.

Useful variants:

wt merge --no-remove
wt merge --no-squash
wt merge --no-ff

wt remove

Use wt remove from a safe worktree, usually main, when you want to purge completed branches and their worktrees.

wt remove branch-a branch-b --foreground -y
wt remove feature-x --force --foreground -y

Use --force when untracked build artefacts would otherwise block removal.

wt step prune

Use wt step prune for bulk cleanup after a merge wave.

wt step prune --dry-run
wt step prune

Prompt discipline

When coordinating sub-agents, always define:

  • the shared operator preamble;
  • owned files or modules;
  • one concrete task per agent;
  • repo-specific validation commands; and
  • a completion report format.

Do not ask multiple agents to edit the same hot files unless the user explicitly accepts integration overhead.

Practical rules

  • Prefer wt merge when the branch is clearly bounded and conflict risk is low.
  • Prefer a dedicated integration worktree when multiple agents touched adjacent layers and the next step depends on reconciling them together.
  • If the current worktree itself needs to be deleted, switch to main first or run wt remove <branch> from another worktree.
  • Keep worktree names stable across prompts, commits, and merge notes.
  • After a merge wave, rerun wt list to confirm only the intended worktrees remain.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.