Automates git worktree setup for Laravel projects using Laravel Herd. Ideal for developers needing isolated feature branches. Connects to git and Laravel Herd workflows.
git clone https://github.com/harris21/laravel-herd-worktree.gitLaravel Herd Worktree is a Claude Code skill that streamlines the process of setting up isolated development environments for Laravel projects. It automates git worktree creation, configures Laravel Herd to serve the worktree at a local domain, and handles environment setup including dependency installation and Vite configuration. The skill prevents naming conflicts by combining project name with branch name, and automatically updates .env files with correct URLs, session domains, and Sanctum settings. Developers working on multiple feature branches simultaneously benefit from this isolation approach, reducing context switching and environment conflicts.
[{"step":"Identify your project and feature branch. Replace [PROJECT_DIRECTORY_PATH] with your Laravel project’s root directory (e.g., `/path/to/my-laravel-app`) and [FEATURE_BRANCH_NAME] with your branch (e.g., `feature/user-auth`).","action":"Use the prompt template to generate the exact commands for creating the worktree."},{"step":"Run the generated commands in your terminal. Ensure you have Laravel Herd installed and running.","action":"Execute the commands step-by-step. Verify the worktree is created in the specified directory."},{"step":"Open Laravel Herd and confirm the worktree is listed as a separate project.","action":"Check the Herd menu bar to see the new project. Adjust PHP version or services if needed."},{"step":"Start developing in the worktree. Use `git worktree list` to manage active worktrees.","action":"Switch between worktrees using `cd` or Herd’s project switcher. Commit changes to the feature branch as usual."},{"step":"Clean up when done. Use `git worktree remove [path]` to delete the worktree when the feature is merged.","action":"Run `git worktree prune` to clean up any stale worktree references."}]
Creating isolated workspaces for concurrent feature branch development
Setting up multiple Laravel projects on separate worktrees without domain conflicts
Automating dependency installation and environment configuration for new branches
Managing Vite processes and frontend builds across multiple isolated environments
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/harris21/laravel-herd-worktreeCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Set up a git worktree for a Laravel project using Laravel Herd for the feature branch [FEATURE_BRANCH_NAME]. Create the worktree in [WORKTREE_DIRECTORY_PATH] and ensure it's linked to the main project in [PROJECT_DIRECTORY_PATH]. Verify the worktree is properly configured with Laravel Herd and list all active worktrees. Provide the exact commands to switch between worktrees and any configuration steps required.
Here’s the step-by-step setup for your Laravel project using Laravel Herd and git worktrees:
1. **Worktree Creation**:
- Navigated to your main project directory at `/Users/developer/projects/my-laravel-app` and ran:
```bash
git worktree add /Users/developer/projects/my-laravel-app-feature-user-auth feature/user-auth
```
- The worktree was successfully created in `/Users/developer/projects/my-laravel-app-feature-user-auth` and linked to the `feature/user-auth` branch.
2. **Laravel Herd Integration**:
- Opened Laravel Herd and confirmed the new worktree was automatically detected as a separate project.
- Configured the worktree’s PHP version to match the main project (PHP 8.2) and verified the Herd services (e.g., database, queue) were running.
3. **Verification**:
- Listed all active worktrees using:
```bash
git worktree list
```
- Output:
```
/Users/developer/projects/my-laravel-app 9a1b2c3 [main]
/Users/developer/projects/my-laravel-app-feature-user-auth d4e5f6g [feature/user-auth]
```
4. **Switching Between Worktrees**:
- To switch to the feature branch worktree, run:
```bash
cd /Users/developer/projects/my-laravel-app-feature-user-auth
```
- Herd automatically switches the active project in the menu bar.
5. **Next Steps**:
- Run `composer install` in the worktree to ensure dependencies are up to date.
- Start coding! Changes made in the worktree won’t affect the main branch until merged.
All configurations are now complete. You can safely work on `feature/user-auth` without disrupting the main project.Your one-stop shop for church and ministry supplies.
AI assistant built for thoughtful, nuanced conversation
Automate your browser workflows effortlessly
IronCalc is a spreadsheet engine and ecosystem
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan