worktree-shared-repo

worktree-shared-repo is a cursor rule for Cursor from shapediver/AppBuilderSdk. It costs 480 tokens per session, scanned A, original, MIT.

A procedure for setting up the AppBuilderShared nested repository in new Git worktrees, which are separate working directories for branches.

In plain words
What is it for?
Use it when creating a worktree, initializing the shared repository, checking out matching branches, and configuring Git to detect the nested repository.
Why use it?
It prevents shared code from appearing empty or its changes from being hidden in the editor's change list.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when creating a worktree, initializing the shared repository, checking out matching branches, and configuring Git to detect the nested repository.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/shapediver/appbuildersdk/worktree-shared-repo
Install

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.

Clone the repo
git clone --depth 1 https://github.com/shapediver/AppBuilderSdk

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 worktree-shared-repo

README.md
[![agentmods](https://agentmods.dev/badge/rules/shapediver/appbuildersdk/worktree-shared-repo/github.svg)](https://agentmods.dev/rules/shapediver/appbuildersdk/worktree-shared-repo)
Your own site
<a href="https://agentmods.dev/rules/shapediver/appbuildersdk/worktree-shared-repo"><img src="https://agentmods.dev/badge/rules/shapediver/appbuildersdk/worktree-shared-repo/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 worktree-shared-repo

Your own site · 80×15
<a href="https://agentmods.dev/rules/shapediver/appbuildersdk/worktree-shared-repo"><img src="https://agentmods.dev/badge/rules/shapediver/appbuildersdk/worktree-shared-repo.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 480 This file is loaded in full into every session.
When invoked 480 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.00480 $0.00480
Opus 5.5 $0.00192 $0.00192
Sonnet 5.5 $0.00096 $0.00096
Haiku 4.5 $0.00048 $0.00048

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

Security

Grade A, and why

worktree-shared-repo 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 1mo 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/worktree-shared-repo.mdc · 42 lines

What it actually says

Worktree + AppBuilderShared

New Cursor worktrees often have an empty src/shared and hide Shared diffs in Changes (nested repo / Cursor git.autoRepositoryDetection default). Do not rely on hooks alone.

Every agent MUST proactively perform these setup checks at the start of any task or when working in a worktree:

  1. Verify and initialize submodule:
    • Check if src/shared has .git. If not or if submodule is uninitialized, run:
      git submodule init
      git submodule update
      
      (or git submodule update --init -- src/shared).
  2. Ensure .vscode/settings.json is created:
    • .vscode/settings.json is gitignored and is frequently missing in newly created worktrees.
    • Agents MUST check if .vscode/settings.json exists. If missing or incomplete, immediately create/write it:
      {
      	"git.autoRepositoryDetection": true,
      	"git.detectSubmodules": true,
      	"git.repositoryScanMaxDepth": 2,
      	"git.scanRepositories": [
      		"src/shared"
      	]
      }
      
  3. Branch synchronization:
    • Ensure task/JIRA-ISSUE-ID is checked out in both the root repo and src/shared (git -C src/shared checkout ...).
  4. Source Control / Changes visibility in the IDE:
    • If changes in src/shared do not appear in the Source Control panel: a. Instruct/perform Source Control tab refresh (refresh icon in Source Control view). b. If still not visible, reload the window (Developer: Reload Window via Ctrl+Shift+P / F1). c. Or add src/shared as a multi-root workspace folder (File > Add Folder to Workspace...).
  5. Git workflow for shared:
    • Shared git operations: git -C src/shared ....
    • The root repo only updates its submodule pointer (src/shared) after src/shared has been committed.
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. 1mo ago Changed · +24 lines · +218 tokens per session bd5b306ac731
  2. 1mo ago First seen · 18 lines · 262 tokens per session scan A f71ef477b122

Subscribe to this mod's changes

worktree-shared-repo is a cursor rule published in the GitHub repository shapediver/AppBuilderSdk (15 stars, last pushed yesterday), licensed MIT. It adds 480 tokens to every session, about $0.0019 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-09-10.