Skills for Real Engineers. Straight from my .agents directory.
using-git-worktrees
Agent skill fromGanyuanRan/Aegis
Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch switching, or the user or repository explicitly requires a worktree.
How to install using-git-worktrees
npx skills add GanyuanRan/Aegis# 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## Overview45A worktree is an exception for simultaneously checking out another Git history,6not a general safety badge. Prefer the current workspace and reuse an existing7suitable worktree. A branch decision and a worktree decision are separate.89**Core principle:** create only with necessity and ownership evidence; pair every10created worktree with a cleanup path.1112**Announce at start:** explain which concrete checkout conflict requires a13worktree.1415## Step 0: Environment Detection1617Before mutation, record the repository root, `HEAD`, branch/detached state,18staged/unstaged/untracked paths, active Git operations, and:1920```bash21git worktree list --porcelain22```2324Classify the current host surface's task/chat-bound managed workspace semantics25as `managed`, `non-managed`, or `unknown`. Use trusted host/session context, an26explicit host contract, or a host-native lifecycle result; do not infer the27classification from a product name, directory prefix, command-level `workdir`,28missing tool, or absent metadata. `non-managed` requires positive evidence that29the current surface lacks task-bound managed semantics. When the host exposes30workspace fields, record the task workspace and the command's default `cwd`31without a per-command directory override.3233Stop on unresolved conflicts, an active merge/rebase/cherry-pick/revert/bisect,34or an unexplained detached HEAD. A detached HEAD is acceptable only when35…
Excerpt shown under the repository's MIT license.
More skills in Aegis
Similar skill repositories
An agentic skills framework & software development methodology that works.
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
