Best use case
worktree-agent is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Mandatory rules for agents in git worktree isolation.
Teams using worktree-agent should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/worktree-agent/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How worktree-agent Compares
| Feature / Agent | worktree-agent | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Mandatory rules for agents in git worktree isolation.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# Worktree Agent Rules Mandatory rules for any agent dispatched with `isolation: "worktree"`. ## Rule 1: Verify Your Working Directory On start, run `pwd`. Your path MUST contain `.claude/worktrees/`. If your CWD is the main repo path, **STOP** and report the error. ## Rule 2: Create Feature Branch First ```bash git checkout -b <branch-name> ``` Never commit on the default `worktree-agent-*` branch. Create your feature branch FIRST. ## Rule 3: Use Worktree-Relative Paths Never hardcode absolute paths from the main repo. Use `$(git rev-parse --show-toplevel)/path`. **Exception**: Reading gitignored ADR files requires the main repo absolute path. ## Rule 4: Ignore Auto-Plan Hooks Do NOT create or modify `task_plan.md`. If auto-plan hook fires, ignore it. Focus exclusively on your implementation tasks. ## Rule 5: Stage Specific Files Only ```bash git add path/to/specific/file.py ``` Never `git add .`, `git add -A`, or `git add --all`. Verify with `git diff --cached --stat`. ## Rule 6: Do Not Touch the Main Worktree Never write to paths outside your worktree directory. Never run `git checkout` in the main repo. ## Rule 7: Commit with Conventional Format Use the commit message specified in your prompt. No attribution lines. ## Rule 8: Run Both ruff Checks Before Declaring CI-Ready For any Python code changes, run both checks before pushing or creating a PR: ```bash ruff check . --config pyproject.toml ruff format --check . --config pyproject.toml ``` Running only `ruff check` misses formatting violations. The `Tests / lint` CI job runs both — if you skip `ruff format --check`, the PR will fail CI and cannot merge due to branch protection. ## Failure Modes This Prevents | Failure | Rule | Without It | |---------|------|-----------| | Agent edits main repo files | 1, 6 | Changes leak to main, get stashed/lost | | Context wasted on task_plan.md | 4 | Implementation budget consumed by planning | | Commit on wrong branch | 2 | Orchestrator merges wrong content | | PR has changes from 2 ADRs | 5, 6 | Cross-contamination between agents | | Branch locked by worktree | 2 | Fatal error on checkout | | PR fails CI on format | 8 | Merge blocked; `ruff format --check` was skipped |
Related Skills
x-api
Post tweets, build threads, upload media via the X API.
workflow
Structured multi-phase workflows: review, debug, refactor, deploy, create, research, and more.
workflow-help
Interactive guide to workflow system: agents, skills, routing, execution patterns.
wordpress-uploader
WordPress REST API integration for posts and media uploads.
wordpress-live-validation
Validate published WordPress posts in browser via Playwright.
with-anti-rationalization
Anti-rationalization enforcement for maximum-rigor task execution.
voice-writer
Unified voice content generation pipeline with mandatory validation and joy-check. 8-phase pipeline: LOAD, GROUND, GENERATE, VALIDATE, REFINE, JOY-CHECK, OUTPUT, CLEANUP. Use when writing articles, blog posts, or any content that uses a voice profile. Use for "write article", "blog post", "write in voice", "generate content", "draft article", "write about".
voice-validator
Critique-and-rewrite loop for voice fidelity validation.
vitest-runner
Run Vitest tests and parse results into actionable output.
video-editing
Video editing pipeline: cut footage, assemble clips via FFmpeg and Remotion.
verification-before-completion
Defense-in-depth verification before declaring any task complete.
universal-quality-gate
Multi-language code quality gate with auto-detection and linters.