factory-worktree

Assign each agent a dedicated jj or git worktree for isolated parallel development.

19|3|Updated Feb 4, 2021
One-click install
npx skills add https://github.com/laulauland/dotfiles --skill factory-worktree
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: factory-worktree
Source: https://github.com/laulauland/dotfiles/tree/main/shared/.pi/agent/extensions/pi-factory/skills/factory-worktree
Command: npx skills add https://github.com/laulauland/dotfiles --skill factory-worktree

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When multiple agents need to edit files at the same time, they risk conflicts in a shared working directory. This skill provides per-agent worktrees or git worktrees so each developer has their own complete copy while sharing the underlying repository, enabling isolation, independent testing, and cleaner merges.

Core Features & Use Cases

  • No merge conflicts during work — each agent has its own copy of every file
  • Full toolchain access — each worktree can run its own dev server, tests, linter
  • Atomic merges — combine results after all agents finish
  • Clean rollback — discard a worktree if an agent fails
  • Variants: jj workspaces and git worktrees for different repository setups
  • Use cases include parallel feature development, refactoring, and simultaneous experimentation

Quick Start

Create separate worktrees for each task and begin development in isolated working copies.

Frequently Asked Questions about factory-worktree

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

FAQPage Schema
How do I prevent file conflicts during parallel development with multiple agents?

Per-agent git worktrees prevent file conflicts during parallel development by giving each agent its own isolated working copy while sharing the underlying repository, keeping changes independent until merged.

What is the best way to run independent experiments and feature work in git without merge conflicts?

Using git worktrees or jj workspaces is the best way to run independent experiments without merge conflicts. Each agent gets a full copy of every file, allowing isolated feature work, independent testing, and clean rollbacks before an atomic merge.

Does this parallel development approach support both jj workspaces and git worktrees?

Yes, the parallel development workflow supports both jj workspaces and git worktrees. It handles per-worktree setup, dependency installation, and merge or cleanup workflows using either version control system to unify results.

How do I merge results and clean up after parallel tasks finish in separate worktrees?

To merge results after parallel tasks finish, you perform an atomic merge using jj or git to combine changes from dedicated worktrees. You unify results after all agents complete, and discard any worktree where an agent failed.

Can each agent run its own dev server and tests inside an isolated worktree?

Yes, each agent can run its own dev server, tests, and linter inside an isolated worktree. Full toolchain access is maintained because every worktree is a complete copy of the repository, enabling independent testing during parallel development.

When should I not use git worktrees for multi-agent coding?

You should not use git worktrees for multi-agent coding if you need simultaneous file edits within a single shared directory without independent copies. Worktrees are also less suitable if your repository setup lacks support for jj workspaces or git worktree isolation.