Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/nirecom/agents/worktree-endnpx skills add nirecom/agents --skill worktree-endgit clone --depth 1 https://github.com/nirecom/agentsWrote 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/nirecom/agents/worktree-end)<a href="https://agentmods.dev/skills/nirecom/agents/worktree-end"><img src="https://agentmods.dev/badge/skills/nirecom/agents/worktree-end.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 | $0.00022 | $0.02487 |
| Opus 5 | $0.00011 | $0.01243 |
| Sonnet 5 | $0.00004 | $0.00497 |
| Haiku 4.5 | $0.00002 | $0.00249 |
Grade C, and why
worktree-end scanned grade C with 1 finding 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 yesterday.
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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
- Use `hooks/cleanup-orphan-dir.js` for orphan directory cleanup — never `rm -rf`. How it starts
The opening of the file, as written. The whole thing — 109 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Inventory gitignored state, merge the PR, then remove the worktree safely.
Procedure
When a hook blocks a sanctioned command, a fallback path is taken, or any unexpected outcome occurs, report via /supervisor-report (trigger conditions: rules/supervisor-reporting.md).
Read rules/github-issues.md before WE-4 — on-demand-only, never auto-injected; WE-4..WE-8 and WE-11 depend on it.
Read rules/mid-workflow-findings.md before WE-10 — on-demand-only, never auto-injected; WE-10 depends on its append CLI and severity tagging.
Read rules/coding.md before WE-4 — on-demand-only, never auto-injected; its Public GitHub Rules govern the PR body, issue comments, and history entries written from here on.
Step WE-1 — Resolve <PLANS_DIR>
PLANS_DIR="$(bash "$AGENTS_CONFIG_DIR/bin/workflow-plans-dir")" — run once; reuse. Canonical: skills/_shared/resolve-plans-dir.md.
Step WE-2 — Pre-flight
gh --version— abort with installation guidance if not found.- Verify linked worktree:
git rev-parse --git-common-dirmust differ fromgit rev-parse --git-dir; if equal, abort.
Step WE-3 — Unstaged tracked-file check
Run bash "$AGENTS_CONFIG_DIR/bin/check-unstaged-tracked.sh" "$WORKTREE_PATH". rc=0 → continue. rc=1 → display stdout and abort (git add / git stash push -u / <<WORKFLOW_ENFORCE_WORKFLOW_OFF: {reason}>> to bypass). rc=2/3 → surface stderr and abort. Skip when WORKFLOW_OFF or WORKTREE_OFF session marker is active.
Step WE-4 — PR resolution
Bootstrap probe: PROBE_JSON="$(bash "$AGENTS_CONFIG_DIR/bin/probe-remote-bootstrap.sh" "$WORKTREE_PATH")". preBootstrap === true AND classification === "empty-repo" → WE-4b. Any other classification → normal flow.
Push (git push -u origin <branch>), then gh pr view --json state,url — reuse if OPEN, else gh pr create --fill. Display URL. Capture PR_NUMBER=$(gh pr view --json number --jq .number); abort if empty.
Step WE-4b — Bootstrap mode (empty-repo only)
bash "$AGENTS_CONFIG_DIR/skills/worktree-end/scripts/bootstrap-complete.sh" "$WORKTREE_PATH" "$BRANCH" "$OWNER_REPO"— parseBOOTSTRAP_COMMIT_SHAandDEFAULT_BRANCH_SET. Non-zero → stop.- Set
BOOTSTRAP_MODE=1,PR_NUMBER="",PR_STATE="BOOTSTRAP". - Emit
<<WORKFLOW_USER_VERIFIED: bootstrap initial commit pushed to main>>viaskills/_shared/user-verified.md. - Skip WE-5 through WE-8; continue at WE-9, WE-12 (with
BOOTSTRAP_MODE=1andBOOTSTRAP_COMMIT_SHA), WE-15.
What ships with it
8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- scripts/bootstrap-complete.sh 5.6 KB runs code
- scripts/capture-env.sh 12 KB runs code
- scripts/cleanup-cascade.md 5.7 KB
- scripts/detect-restart.sh 3.7 KB runs code
- scripts/extract-pr-fields.js 846 B runs code
- scripts/read-notes-path.js 461 B runs code
- scripts/sibling-repos-json.js 1.0 KB runs code
- scripts/write-env-json.js 1.2 KB runs code
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.
- yesterday First seen · 109 lines · 22 tokens per session scan C f7991099065d
worktree-end is a skill published in the GitHub repository nirecom/agents (3 stars, last pushed today), licensed MIT. It adds 22 tokens to every session and 2,487 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
chat-pet-sprite-creation
Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…
insight-error-page
Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…