Skills for Real Engineers. Straight from my .agents directory.
using-git-worktrees
Agent skill fromobra/superpowers
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback
How to install using-git-worktrees
npx skills add obra/superpowers# or add only this skill to Claude Code: copy the folder
skills/using-git-worktrees/
# into
~/.claude/skills/using-git-worktrees/ (all projects)
.claude/skills/using-git-worktrees/ (one project)
1# Using Git Worktrees23## Overview45Ensure work happens in an isolated workspace. Prefer your platform's native worktree tools. Fall back to manual git worktrees only when no native tool is available.67**Core principle:** Detect existing isolation first. Then use native tools. Then fall back to git. Never fight the harness.89**Announce at start:** "I'm using the using-git-worktrees skill to set up an isolated workspace."1011## Step 0: Detect Existing Isolation1213**Before creating anything, check if you are already in an isolated workspace.**1415```bash16GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)17GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)18BRANCH=$(git branch --show-current)19```2021**Submodule guard:** `GIT_DIR != GIT_COMMON` is also true inside git submodules. Before concluding "already in a worktree," verify you are not in a submodule:2223```bash24# If this returns a path, you're in a submodule, not a worktree — treat as normal repo25git rev-parse --show-superproject-working-tree 2>/dev/null26```2728**If `GIT_DIR != GIT_COMMON` (and not a submodule):** You are already in a linked worktree. Skip to Step 2 (Project Setup). Do NOT create another worktree.2930Report with branch state:31- On a branch: "Already in isolated workspace at `<path>` on branch `<name>`."32- Detached HEAD: "Already in isolated workspace at `<path>` (detached HEAD, externally managed). Branch creation needed at finish time."33…
Excerpt shown under the repository's MIT license.
More skills in superpowers
Similar skill repositories
A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.
Public repository for Agent Skills
Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.
Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Production-grade engineering skills for AI coding agents.
