← ClaudeAtlas

working-in-worktreeslisted

Decides when agent work needs an isolated git worktree and how to create, enter, and clean one up safely. Use when starting code changes in a checkout that may be shared with another agent, dispatching a Linear task, executing a spec, or running any parallel work that mutates tracked files.
dork-labs/dorkos · ★ 8 · AI & Automation · score 73
Install: claude install-skill dork-labs/dorkos
# Working in Worktrees ## Overview This skill governs **workspace isolation** for code work in DorkOS — a repo that is routinely worked by several agents and sessions at once. It teaches the one decision rule (_one checkout, one writer_), the concrete failure mode that makes isolation non-optional, and the exact mechanics for creating, entering, and cleaning up a worktree without losing anyone's work. The repo-wide rule lives in `AGENTS.md` → **Worktrees**. This skill is the mechanics and the _why_. ## When to Use - You are about to make a code change and the checkout **may be shared** with another agent or session. - You are running the `/flow:execute` stage (the workspace-choice phase of the flow plugin's `executing-specs` skill) — the unified `/flow` execution gate. - You are running parallel work that mutates tracked files. - You need to create, enter, exit, or remove a worktree and want the safe procedure. - You are _unsure_ whether to isolate — the default answer for code work in this repo is **yes**. ## Key Concepts ### The rule: one checkout, one writer `main` is the **clean integration tree**, not a shared scratchpad. Code changes default to an **isolated worktree**; `main` stays clean and is where branches merge back. **Default to a worktree for any code change.** Stay in `main` only when _all three_ hold: 1. You are **certainly the sole writer** in this checkout, **and** 2. The work is **non-code** (`research/`, `specs/`, tracker, docs prose) **or** a sin