AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

git-worktree-manager

Use when running several branches or agents in parallel on one repo. Creates worktrees with isolated ports and env via worktree_manager.py and removes stale ones with worktree_cleanup.py.

Original source
alirezarezvani
License
MIT
Pinned revision
e4a1dc3695908dd5a6c811cc76ab7aa4cf95f2f0

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

This skill also requires local files or dependencies. Remote reading alone may not be enough.

Ask your assistant

Use Agentic Memory skills to read alirezarezvani--git-worktree-manager at revision e4a1dc3695908dd5a6c811cc76ab7aa4cf95f2f0, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 4

references/docker-compose-patterns.md

Docker Compose Patterns For Worktrees

Pattern 1: Override File Per Worktree

Base compose file remains shared; each worktree has a local override.

docker-compose.worktree.yml:

services:
  app:
    ports:
      - "3010:3000"
  db:
    ports:
      - "5442:5432"
  redis:
    ports:
      - "6389:6379"

Run:

docker compose -f docker-compose.yml -f docker-compose.worktree.yml up -d

Pattern 2: .env Driven Ports

Use compose variable substitution and write worktree-specific values into .env.local.

docker-compose.yml excerpt:

services:
  app:
    ports: ["${APP_PORT:-3000}:3000"]
  db:
    ports: ["${DB_PORT:-5432}:5432"]

Worktree .env.local:

APP_PORT=3010
DB_PORT=5442
REDIS_PORT=6389

Pattern 3: Project Name Isolation

Use unique compose project name so container, network, and volume names do not collide.

docker compose -p myapp_wt_auth up -d

Common Mistakes

  • Reusing default 5432 from multiple worktrees simultaneously
  • Sharing one database volume across incompatible migration branches
  • Forgetting to scope compose project name per worktree