Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/jerseycheese/agent-skillsnpx agentmods add skills/jerseycheese/agent-skills/worktree-enhancedWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/jerseycheese/agent-skills/worktree-enhanced)<a href="https://agentmods.dev/skills/jerseycheese/agent-skills/worktree-enhanced"><img src="https://agentmods.dev/badge/skills/jerseycheese/agent-skills/worktree-enhanced.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00097 | $0.02351 |
| Opus 5 | $0.00048 | $0.01175 |
| Sonnet 5 | $0.00019 | $0.00470 |
| Haiku 4.5 | $0.00010 | $0.00235 |
Grade A, and why
worktree-enhanced scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 332 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Enhanced Worktree Workflow
When to Use This Skill
Use this skill when:
- Starting work on a new feature or bug fix
- Need isolation from current workspace
- Want parallel development on multiple issues
- Executing implementation plans that require clean state
This skill handles the full worktree setup workflow with:
- Dev server detection and coordination
- Local env file propagation from the main checkout
- Automatic dev server startup option
- Project-specific worktree conventions
Enhanced Features
1. Dev Server Awareness
Every worktree gets its own dev-server port — never assume port 3000 belongs to the worktree you're in. If the project has adopted the per-worktree port pattern (scripts/worktree-port.cjs, installed by install-worktree-port.sh), resolve the port before checking it:
# Resolve this checkout's port: the per-worktree script if the project has it
# installed, else the port recorded in .claude/launch.json, else 3000 (the
# main-checkout default)
if [ -f scripts/worktree-port.cjs ]; then
PORT="$(node scripts/worktree-port.cjs)"
else
PORT="$(node -p "require('./.claude/launch.json').configurations[0].port" 2>/dev/null || echo 3000)"
fi
DEV_SERVER_PID=$(lsof -ti:"$PORT")
if [ -n "$DEV_SERVER_PID" ]; then
echo "Dev server already running on port $PORT (PID: $DEV_SERVER_PID)"
else
echo "No dev server running on port $PORT yet"
fi
If the project has no per-worktree port scripts yet, run install-worktree-port.sh <project-dir> (in shared/Development/tools/dev-server/) before creating more worktrees — otherwise every worktree's npm run dev fights over the same port.
2. Worktree Creation
# Standard worktree creation from base skill
git worktree add [path] -b [branch] [base-branch]
# Copy ignored local env files from the main checkout, if present. These files
# stay untracked, but worktrees need the same server-side keys and feature flags.
main_worktree="$(git worktree list --porcelain | awk '
/^worktree / { path = substr($0, 10) }
/^branch / && $2 !~ /worktrees/ {
print path
exit
}
')"
for env_file in .env.local .env.development.local .env.test.local; do
if [ -n "$main_worktree" ] &&
[ "$main_worktree" != "[worktree-path]" ] &&
[ -f "$main_worktree/$env_file" ] &&
[ ! -f "[worktree-path]/$env_file" ]; then
cp "$main_worktree/$env_file" "[worktree-path]/$env_file"
echo "Copied $env_file from main checkout"
fi
done
# Enhanced: Offer dev server startup
cd [worktree-path]
# Check if package.json exists
if [ -f package.json ]; then
echo "Found package.json"
echo ""
echo "Dev server options:"
echo "(a) Start dev server now (runs in background, on this worktree's own port)"
echo "(b) Skip (I'll start it manually later)"
echo "(c) Just point the browser at the main workspace's already-running server"
# If user chooses (a):
echo "Starting dev server in background..."
npm run dev > dev-server.log 2>&1 &
echo "Dev server started (PID: $!)"
echo "Logs: tail -f dev-server.log"
fi
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 332 lines · 97 tokens per session scan A a6efdd3fc259
worktree-enhanced is a skill published in the GitHub repository jerseycheese/agent-skills (1 stars, last pushed 6d ago), licensed MIT. It adds 97 tokens to every session and 2,351 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
lov-gh-access
Open a private GitHub repo to external clients or contractors without making it public. Accepts a mixed list of GitHub usernames and/or email addresses, resolves each to a GitHub account (falling back to an email invitation when the user has no discoverable account yet), and invites them as collaborators with a chosen…
lov-gh-tidy
Interactive GitHub repo hygiene skill. Lists all open issues, PRs, stale branches, and orphan labels, shows a summary of each with analysis, then asks the user how to handle each item (close, merge, comment, delete, keep). Executes all chosen actions via gh CLI. Use when the user says "清理 GitHub", "tidy repo", "clean…
intuitive-squash
Squash local GSD or agent-generated commit history into a clean, reviewable story while preserving important fixes. Use when the user asks to squash commits, clean git history, compress phase commits, prepare a branch before PR, compare aggressive vs moderate squash options, or preserve hotfix/security commits during…
campaign-commit
Choose the correct commit command in a camp, also called a campaign. Use when you are about to commit and need to select camp commit, camp p commit, fest commit, or intentional root pointer sync via camp refs-sync.
fest-execution
Execute active festival tasks. Use when finding the next task, marking tasks completed/blocked/reset, committing with festival traceability, advancing workflow steps, and validating sequence progress.
camp-projects
Manage a camp's projects. Use when committing inside projects/, deciding status/pull/push scope (root vs submodule vs all), or creating/removing project worktrees.