askill
worktree-check

worktree-checkSafety 80Repository

Use before git write operations (commit, push, merge, rebase) to verify you are in a git worktree. Guides worktree setup if missing. Keywords: worktree, isolation, git commit, git push.

0 stars
1.2k downloads
Updated 1/22/2026

Package Files

Loading files...
SKILL.md

Worktree Check

Ensure git write operations happen inside an isolated worktree.

When to Use

  • Before git commit, git push, git merge, or git rebase
  • When unsure if you are in a worktree

Verify Worktree

# Worktree indicators
[ -f .git ] && echo "worktree"

git rev-parse --git-dir 2>/dev/null | grep -q "/worktrees/" && echo "worktree"

If neither check confirms a worktree, create one before proceeding.

Create Worktree (Recommended)

# Prefer .worktrees/ if present
ls -d .worktrees worktrees 2>/dev/null

# Ensure gitignored
git check-ignore -q .worktrees || echo ".worktrees/" >> .gitignore

# Create and enter worktree
branch="feature/your-branch"
git worktree add .worktrees/your-branch -b "$branch"
cd .worktrees/your-branch

Proceed Safely

Re-run the git command from inside the worktree once it is created.

Notes

  • If the user asks to proceed without a worktree, confirm explicitly before running git write operations.

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

83/100Analyzed 2/18/2026

A well-structured git worktree verification skill with clear when-to-use triggers, actionable bash commands for detection and creation, and safety confirmation step. Located in global/skills folder suggesting broad reusability. Tags and metadata improve discoverability. Covers the full workflow from detection to creation to safe usage. Slight扣分 for missing edge case handling, but overall high-quality reference skill.

80
85
90
75
85

Metadata

Licenseunknown
Version-
Updated1/22/2026
Publishererikpr1994

Tags

ci-cd