worktree

Create, destroy, list, and sync git worktrees with Herd TLS links, .env isolation, and optional database clones.

3|Updated Apr 11, 2026
One-click install
npx skills add https://github.com/bravros/bravros --skill worktree-bravros
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: worktree
Source: https://github.com/bravros/bravros/tree/main/plugins/tools/skills/worktree
Command: npx skills add https://github.com/bravros/bravros --skill worktree-bravros

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Parallel feature work in git normally collides on shared resources: the same .test domain, Redis keys, sessions, queue jobs, and database. This Skill manages parallel git worktrees so each checkout gets its own isolated environment — a unique Herd URL with TLS, an isolated .env (APP_URL, REDIS_PREFIX), and optionally a cloned MySQL database — without ever switching the parent checkout. ## Core Features & Use Cases - Create: Branch a new worktree off origin/<base> with runtime-dir cloning (vendor, node_modules) via APFS copy-on-write, Herd link + TLS for Laravel repos, and smoke-test verification. Non-Laravel repos get a plain git worktree automatically. - Destroy: Dry-run teardown scope with content-aware merge checks against both base and main, then gated teardown that unlinks Herd, drops only the clone DB, flushes prefixed Redis keys, and deletes merged branches. - List & Sync: Report all worktrees with link/cert status, merge state, and ahead/behind counts; rebase or merge a worktree onto a ref without pushing. - Use Case: Ask for two worktrees for two bugfixes and receive two paths, each with its own https://<repo><id>.test URL and isolated Redis prefix, ready to cd into. ## Quick Start Ask the agent to create a worktree for your current feature, for example: create a worktree for the login fix and give me the path and URL.

Frequently Asked Questions about worktree

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a git worktree for parallel feature development?▼

Run /worktree create with an optional id or let the skill derive a slug from your feature description. It branches off origin/<base>, clones runtime directories like vendor and node_modules, and reports the path, branch, and URL.

How do I safely delete a git worktree without losing unmerged code?▼

Run destroy with --dry-run first to see teardown scope and merge status against both base and main. The script refuses to remove worktrees with unmerged code unless you pass --force, and it only ever drops the cloned database, never the parent's.

Does this worktree workflow support non-Laravel projects?▼

Yes. Framework detection reads stack.framework from .bravros/config.json or checks for an artisan file. Go, Node, and Python repos get a plain git worktree plus runtime-dir clone, with Herd, .env, and database steps skipped automatically.

How are Redis and database collisions avoided between worktrees?▼

Each worktree gets a unique REDIS_PREFIX (<repo><id>_) written into its own .env, isolating queues, sessions, and cache keys. Databases are shared with the parent by default; pass --clone-db for a full MySQL schema clone.

Why does git fetch hang when listing or creating worktrees?▼

SSH agents like 1Password can block signature requests indefinitely. The scripts route fetches through a watchdog-timeboxed safe_fetch with a TTL cache, preferring gh-credential HTTPS for GitHub remotes and killing hung process trees after 15 seconds.

When should I use --clone-db versus the shared parent database?▼

Use --clone-db only when running migrations or seeders that must not touch the parent schema; it seeds from the newest local dump or a live mysqldump. The shared default is faster and correct for read-mostly feature work.