Worktree Manager for Openclaw

A comprehensive orchestrator for managing isolated Docker-based development environments and Git worktrees with automated database snapshots and proxy routing.

pereirajair
v1.0.3
May 10, 2026
0
745
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install worktree-manager

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install worktree-manager using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Worktree Manager?

Worktree Manager is a sophisticated tool designed for developers who need to jump between multiple features or branches without the overhead of switching contexts in a single directory. It automates the creation of isolated Git worktrees, each paired with its own Docker Compose stack, environment configuration, and dedicated database.

By leveraging Openclaw Skills, this manager integrates seamlessly with existing MySQL and Nginx-proxy services to provide a production-like local environment. Each instance is fully accessible via custom local subdomains, ensuring that frontend and backend services are correctly routed through a shared proxy network.

Worktree Manager Use Cases

  • Creating isolated feature environments for parallel development without stashing changes.
  • Rapidly spinning up temporary QA or review instances with cloned production-like data.
  • Managing multiple project versions simultaneously using Git worktrees and Docker isolation.
  • Automating local database seeding from a main snapshot for consistent development testing.

How Worktree Manager Works

  1. The user triggers the creation of a new worktree, which initializes a Git branch and a dedicated directory under .worktrees/.
  2. Worktree Manager generates a unique environment file (.env.worktree-) based on a base template.
  3. Upon starting the instance, the skill verifies that the shared MySQL and Proxy services are active.
  4. It creates a new database for the instance and clones the schema/data from the main development database.
  5. Docker Compose builds and launches the backend and frontend containers.
  6. The skill connects the Nginx-proxy to the instance network, instantly activating the local URLs.

Worktree Manager Setup

Ensure you have Docker and Git installed. First, start the required infrastructure dependencies, then initialize your app instance:

# 1. Start the proxy network
proxy-manager/run.sh start

# 2. Start the shared database
mysql-manager/run.sh start

# 3. Initialize the main application instance
./run.sh start main

# 4. (Optional) Make the script executable if needed
chmod +x run.sh

Worktree Manager Data Schema & Taxonomy

Worktree Manager maintains a strict organizational structure within your project root to ensure isolation and ease of cleanup:

Component Path / Naming Description
Worktree Directory .worktrees/<name>/ The physical Git worktree location (Gitignored).
Environment Files .env.worktree-<name> Per-instance configuration overrides.
Docker Projects codai-dev-<name> Docker Compose project prefix for container isolation.
Database <instance_db_name> Dedicated MySQL database for each worktree.
Routing *.frontend.localhost Automatic subdomains mapped via Nginx-proxy.

Worktree Manager Advanced Features

  • Automated database cloning: Automatically dumps and restores the main database into new worktree instances for instant data availability.
  • Dynamic Proxy Routing: Hot-plugs Docker containers into a shared Nginx-proxy network for real-time URL activation.
  • Multi-instance Lifecycle Management: Support for logs, restarts, and status checks across all active worktrees from a single CLI.
  • Safety Guards: Built-in validation for instance names and destructive action confirmations to prevent accidental data loss.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*