Agent Skills: Git Worktree Integration

Auto-create git worktrees for workflows. Isolate changes, merge on success, discard on failure.

UncategorizedID: nguyenthienthanh/aura-frog/git-worktree

Install this agent skill to your local

pnpm dlx add-skill https://github.com/nguyenthienthanh/aura-frog/tree/HEAD/aura-frog/skills/git-worktree

Skill Files

Browse the full folder contents for git-worktree.

Download Skill

Loading file tree…

aura-frog/skills/git-worktree/SKILL.md

Skill Metadata

Name
git-worktree
Description
"Auto-create git worktrees for workflows. Isolate changes, merge on success, discard on failure."

AI-consumed reference. Optimized for Claude to read during execution. Human-readable explanation: see docs/architecture/HIERARCHICAL_PLANNING.md or docs/getting-started/ depending on topic.

Git Worktree Integration

Auto-create git worktree when starting a workflow. All changes on isolated branch. Discard on failure -- zero damage to main.


When to Use

  • Auto: /run when AF_WORKTREE=true
  • Manual: User says "use a worktree"
  • Skip: Quick fixes, config changes, single-file edits

Lifecycle

worktree_lifecycle[5]{event,action}:
  run:start,"git worktree add .worktrees/[id] -b af/[id]"
  Phase 1 approved,All edits in worktree directory
  Phase 5 complete,"Offer: merge / create PR / keep branch / discard"
  run:cancel,"git worktree remove .worktrees/[id]"
  run failed,Discard worktree — main untouched

Configuration

export AF_WORKTREE=true
export AF_WORKTREE_DIR=".worktrees"  # default

Add .worktrees/ to .gitignore.


Safety

safety[4]{rule,reason}:
  Never force-delete with uncommitted changes,User may lose work
  Always offer merge/PR/keep/discard,User decides
  Auto-discard only on explicit cancel/failure,Don't assume
  Checkpoint commits before discarding,Last chance to recover

Works with phase-checkpoint.cjs -- checkpoints are commits on worktree branch, main never affected until explicit merge.