ankyr-ci-worktree

Creates and manages git worktrees for branch work using wtp or git worktree.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/GuyErreich/AI_Agents --skill ankyr-ci-worktree-guyerreich
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ankyr-ci-worktree
Source: https://github.com/GuyErreich/AI_Agents/tree/main/plugins/ankyr-git/skills/ankyr-ci-worktree
Command: npx skills add https://github.com/GuyErreich/AI_Agents --skill ankyr-ci-worktree-guyerreich

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? It prevents agents and developers from editing the primary checkout or the AGENT.md base branch directly by enforcing a worktree-first workflow before any file edit. ## Core Features & Use Cases - Mandatory preflight gate: Detects checkout type (primary vs linked worktree), reads the base branch from the repository-root AGENT.md, and blocks edits until a correct worktree exists. - Worktree lifecycle: Creates, reuses, verifies, and cleans up worktrees with wtp, falling back to raw git worktree commands when wtp is unavailable. - Recovery and plan-mode rules: Moves accidental primary-checkout edits into a worktree via stash or cherry-pick, and requires every plan for branch-worthy work to open with a worktree Setup step. - Use Case: After a plan is approved to implement a GitHub issue, the agent runs the preflight, creates a feature worktree with wtp add -b feature/issue-slug dev, reports the absolute path, and continues all edits there. ## Quick Start Ask the agent to start work on a new feature branch and it will run the worktree preflight, create or reuse a worktree, and continue editing at that absolute path.

Frequently Asked Questions about ankyr-ci-worktree

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a git worktree for a new feature branch?▼

Run `wtp add -b <prefix>/<slug> <base>` when wtp is available, or `git worktree add -b <prefix>/<slug> <dir> <base>` as a fallback. The base branch comes from the repository-root AGENT.md Validate block, never hardcoded.

What is the difference between wtp and git worktree?▼

wtp (Worktree Plus) is preferred and reads the worktree root from the repo's .wtp.yml defaults.base_dir, running project post-create hooks. When wtp or .wtp.yml is absent, the skill falls back to raw git worktree commands with manual setup.

Can I edit the primary checkout instead of using a worktree?▼

Only with an explicit user waiver such as "work in place", "skip worktree", or "stay in this checkout". Plan approval alone is not a waiver, and the hard gate runs before the first file edit on any branch-worthy work.

How do I detect if I am in a linked worktree or primary checkout?▼

Check whether .git is a file or directory from the repository root: a file means linked worktree, a directory means primary checkout. Combine this with `git branch --show-current` and `git worktree list` to confirm the branch is not the AGENT.md base.

What should I do if I already edited files in the primary checkout?▼

Stop editing, create the worktree and branch, then move the work with `git stash push -u` in primary and `git stash pop` in the worktree, or commit on a throwaway branch and cherry-pick with user consent. Confirm primary is clean before leaving it.

When is it safe to remove a git worktree?▼

Only on explicit user request, using `wtp remove <name>` or `git worktree remove <path>`. Force removal with -f on a dirty worktree destroys uncommitted work and requires clear consent; --with-branch also deletes the branch.