merge-worktree

merge-worktree is a cursor rule for Cursor from briangmilnes/APAS-VERUS. It costs 3,346 tokens per session, scanned A, original, MIT.

A Git worktree merge procedure for combining changes from several agent branches into a main branch.

In plain words
What is it for?
It is for merging agent1/ready through agent4/ready into the main APAS-VERUS worktree while excluding a deprecated review branch.
Why use it?
It reduces merge mistakes by requiring clean, pushed branches and a fixed order of checks and merge steps.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: reads .claude/ paths; mentions CLAUDE.md.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is cd ~/projects/APAS-VERUS && ./scripts/validate.sh.

Good fit It is for merging agent1/ready through agent4/ready into the main APAS-VERUS worktree while excluding a deprecated review branch.

Compare 6 cursor rules from other repositories ↓
Install

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.

Clone the repo
git clone --depth 1 https://github.com/briangmilnes/APAS-VERUS
agentmods
npx agentmods add rules/briangmilnes/apas-verus/merge-worktree

Made for: Cursor.

Wrote 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.

agentmods badge for merge-worktree

README.md
[![agentmods](https://agentmods.dev/badge/rules/briangmilnes/apas-verus/merge-worktree/github.svg)](https://agentmods.dev/rules/briangmilnes/apas-verus/merge-worktree)
Your own site
<a href="https://agentmods.dev/rules/briangmilnes/apas-verus/merge-worktree"><img src="https://agentmods.dev/badge/rules/briangmilnes/apas-verus/merge-worktree/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for merge-worktree

Your own site · 80×15
<a href="https://agentmods.dev/rules/briangmilnes/apas-verus/merge-worktree"><img src="https://agentmods.dev/badge/rules/briangmilnes/apas-verus/merge-worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,346 This file is loaded in full into every session.
When invoked 3,346 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.03346 $0.03346
Opus 5.5 $0.01338 $0.01338
Sonnet 5.5 $0.00669 $0.00669
Haiku 4.5 $0.00335 $0.00335

Measured 3mo ago against content hash 41862a7fa62c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

merge-worktree 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 3mo 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.

.cursor/rules/git/merge-worktree.mdc · 353 lines

How it starts

The opening of the file, as written. The whole thing — 353 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Merge Worktree

When to use

When merging agent worktree branches into main. Execute phases 0–5 in strict order. Do NOT skip phases. Do NOT reorder phases.

Agent worktree layout

Worktree Directory Branch
main ~/projects/APAS-VERUS main
agent1 ~/projects/APAS-VERUS-agent1 agent1/ready
agent2 ~/projects/APAS-VERUS-agent2 agent2/ready
agent3 ~/projects/APAS-VERUS-agent3 agent3/ready
agent4 ~/projects/APAS-VERUS-agent4 agent4/ready

Branches not used in merge

Do NOT merge review/prose. That branch is deprecated. It diverged before the Int→I64/Float→F64 rename and other lib.rs evolution. Merging it overwrites lib.rs with an outdated version and breaks the build. Only merge agent1/ready, agent2/ready, agent3/ready, and agent4/ready.

Phase 0: Ensure all worktrees are committed and pushed

All branches must be clean and pushed before merging. Do not proceed if any worktree has uncommitted changes or unpushed commits.

set -e
# 1. Check main
cd ~/projects/APAS-VERUS && git status
cd ~/projects/APAS-VERUS && git log origin/main..HEAD --oneline

# 2. Check agent1
cd ~/projects/APAS-VERUS-agent1 && git status
cd ~/projects/APAS-VERUS-agent1 && git log origin/agent1/ready..HEAD --oneline

# 3. Check agent2
cd ~/projects/APAS-VERUS-agent2 && git status
cd ~/projects/APAS-VERUS-agent2 && git log origin/agent2/ready..HEAD --oneline

# 4. Check agent3
cd ~/projects/APAS-VERUS-agent3 && git status
cd ~/projects/APAS-VERUS-agent3 && git log origin/agent3/ready..HEAD --oneline

# 5. Check agent4
cd ~/projects/APAS-VERUS-agent4 && git status
cd ~/projects/APAS-VERUS-agent4 && git log origin/agent4/ready..HEAD --oneline
  • git status must show "nothing to commit, working tree clean" in each worktree.
  • git log origin/<branch>..HEAD --oneline must show no output (no unpushed commits).

STOP. Do not proceed to Phase 1 until all five worktrees are committed and pushed.

Read the full file on GitHub · 353 lines

Changes

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.

  1. 3mo ago First seen · 353 lines · 3,346 tokens per session scan A 41862a7fa62c

Subscribe to this mod's changes

merge-worktree is a cursor rule published in the GitHub repository briangmilnes/APAS-VERUS (10 stars, last pushed 2mo ago), licensed MIT. It adds 3,346 tokens to every session, about $0.0134 per session on Opus 5.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.

Related

merge-worktree compared with cursor rules from other repositories

merge-worktree next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
merge-worktreebriangmilnes/APAS-VERUSCursor rule102mo agoMITA3,346Cursor
changesetsadobe/spectrum-design-dataCursor rule163yesterdayApache-2.0A0Cursor
release-policyv0id-user/setmacCursor rule1612d agoMITA319Cursor
irisils15/pantheon-legacyCursor rule1220d agoMITA43Cursor
release-notesthatrebeccarae/claude-marketingCursor rule2286mo agoMITA50Cursor
release-checklistyoreai/relayCursor rule23mo agoApache-2.0A215Cursor
github-cli-guideiHildy/jules-task-queueCursor rule199mo agoMITA21Cursor