agentleFS
kazemcodeskazemcodes/skill-tree/skills/git-worktrees/SKILL.md

git-worktrees

Skill1 starsChanged 5 months agoMITView on GitHub

Create isolated git worktrees for feature work — protects current branch, enables parallel development

  • Installs packages

24 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use obsidian-bases, verification-before-completion and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • wangzhuofengSkill

    obsidian-bases

    Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian.

    Also in 3 projects that use this

  • OpenAISkill

    verification-before-completion

    Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always

    Also in 4 projects that use this

  • SentrySkill

    security-review

    Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.

    Also in 4 projects that use this

  • OpenAISkill

    systematic-debugging

    Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

    Also in 4 projects that use this

  • CloudflareSkill

    receiving-code-review

    Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation

    Also in 3 projects that use this

  • CloudflareSkill

    security-audit

    Security guidance and vulnerability review for codebases, APIs, services, CLI tools, libraries, and daemons. Use for security questions, focused reviews, vulnerability research, security audits, or pen tests. Run the complete workflow only for explicit codebase audit or pen-test requests, full/comprehensive/end-to-end reviews, or requested report artifacts.

    Also in 3 projects that use this

  • +3 more from openai

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 24 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create isolated workspaces for feature work without stashing or switching branches.

    line 8
  2. Very specific:

    If GIT_DIR != GIT_COMMON → already in a worktree.

    line 26
  3. Very specific:

    Always verify .worktrees/ is in .gitignore before creating

    line 79
  4. Distinctive:

    Always run baseline tests

    line 80
  5. Distinctive:

    Don't create nested worktrees

    line 81
  6. Distinctive:

    Don't remove worktrees you didn't create

    line 82

“Common” is measured: kept by at least 6 in 10 of the 24 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Git Worktrees

Create isolated workspaces for feature work without stashing or switching branches.

When to Use

  • Starting new feature while current work is in-progress
  • Need to test on main without losing local changes
  • Parallel development on multiple features
  • Hotfix while feature branch is dirty

Process

Step 0: Detect Existing Isolation

GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)

If GIT_DIR != GIT_COMMON → already in a worktree. Skip creation.

Step 1: Create Worktree

# Check if .worktrees is gitignored
git check-ignore -q .worktrees 2>/dev/null

# Create worktree
git worktree add .worktrees/feature-name -b feature-name

# Enter it
cd .worktrees/feature-name

Step 2: Setup

# Auto-detect and install dependencies
[ -f package.json ] && npm install
[ -f Cargo.toml ] && cargo build
[ -f requirements.txt ] && pip install -r requirements.txt
[ -f go.mod ] && go mod download

Step 3: Verify Baseline

# Run tests to ensure clean start
npm test / cargo test / pytest / go test ./...

Cleanup

# From main repo root
git worktree remove .worktrees/feature-name
git worktree prune
git branch -d feature-name

Quick Reference

SituationAction
Already in worktreeSkip creation
.worktrees/ existsUse it (verify gitignored)
Neither existsCreate .worktrees/, add to .gitignore
Permission errorWork in current directory instead
Tests fail at baselineReport failures, ask whether to proceed

Rules

  • Always verify .worktrees/ is in .gitignore before creating
  • Always run baseline tests
  • Don't create nested worktrees
  • Don't remove worktrees you didn't create

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.