laravel-herd-worktrees
Installation
SKILL.md
Laravel Herd + Git Worktrees
Run multiple branches of a Laravel project in parallel, each reachable at its own *.test URL through Laravel Herd, with isolated dependencies, env, database, and caches.
Mental Model
- A worktree is a sibling directory of the main checkout with its own
HEAD. Composer/Node deps,vendor/,node_modules/,storage/, andbootstrap/cache/are per-worktree — never share via symlink. - Herd's parked directory auto-serves every immediate subdirectory as
<dir>.test. Park the parent of all worktrees once and every new worktree gets a URL for free. .envis untracked, so it must be re-created in each worktree.APP_URL,DB_DATABASE, cache prefixes must differ per worktree to prevent cross-branch bleed.
When to Use This Skill
- User asks to create a worktree for a Laravel app served by Herd.
- User reports
vendor/, migrations, cache, or.envproblems after switching worktrees. - User wants per-branch URL like
myapp-feat.testwithout manual Nginx/Valet config. - User wants the same Laravel project on multiple PHP versions simultaneously.