agentleFS
sblueminsbluemin/fleet-harness/.claude/skills/git-worktree/SKILL.md

git-worktree

Skill17 starsChanged 5 days agoMITView on GitHub

Create a canary-based worktree for Fleet changes, a detached read-only baseline for revision comparison or bisect, or remove an owned dedicated checkout. Temporary source edits, such as a measurement string, go in a disposable branch worktree, not a baseline. Use rebase-on-canary to refresh an existing branch; ordinary read-only investigation needs no new worktree.

  • Installs packages

30 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use agent-native-architecture, document-review and 7 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • CodeWithBehnamSkill

    agent-native-architecture

    Build applications where agents are first-class citizens. Use this skill when designing autonomous agents, creating MCP tools, implementing self-modifying systems, or building apps where features are outcomes achieved by agents operating in a loop.

    Also in 3 projects that use this

  • CodeWithBehnamSkill

    document-review

    This skill should be used to refine brainstorm or plan documents before proceeding to the next workflow step. It applies when a brainstorm or plan document exists and the user wants to improve it.

    Also in 3 projects that use this

  • MicrosoftSkill

    git-commit

    Stage user-selected paths, confirm the exact staged set, and create one local Conventional Commit, or generate a commit message for staged changes without committing. Use when you want a guarded commit or a ready-to-paste message.

    Also in 3 projects that use this

  • MicrosoftSkill

    grill-with-docs

    Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when user wants to stress-test a plan against their project's language and documented decisions.

    Also in 3 projects that use this

  • OpenAISkill

    brainstorming

    You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

    Also in 3 projects that use this

  • BlockSkill

    frontend-design

    Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 25 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Never remove the main checkout.

    line 23
  2. Distinctive:

    Never create or preserve a new-worktree symlink targeting main-checkout content.

    line 24
  3. Very specific:

    Never replace colliding paths/branches automatically.

    line 25
  4. Very specific:

    Stop a daemon only through the target worktree's own path (git -C <path> fsmonitor--daemon stop).

    line 26
  5. Distinctive:

    Do not skip path, ownership, or branch-protection checks.

    line 37
  6. Distinctive:

    After creation, every edit/command uses the absolute worktree path.

    line 39

“Common” is measured: kept by at least 6 in 10 of the 25 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Git Worktree

Interpret the request as create or remove. Creation defaults to a branch for repository changes; use the detached baseline route only when the task needs a separate historical revision for comparison or bisect. A baseline is read-only source, not an implementation checkout. Ask only when the intended action or revision is unclear. Never adopt another session's worktree or overwrite an existing path.

Inputs

  • <worktree-name>: the directory under .fleet/worktrees/. Infer a task-specific name when absent; when only a branch is given, use it with / replaced by -.
  • <new-branch>: branch creation only; defaults to <worktree-name>. May carry one Conventional Commits type prefix (fix/<name>, feat/<name>), as on the remote; a flat name is equally valid.
  • <base-branch>: branch creation only; defaults to canary. Reject main/master; ask before using any other base.
  • <revision>: baseline creation only; the task's specific commit or ref, resolved once to a full commit SHA. No implicit canary fallback and no new branch.
  • <delete-remote>: branch removal only; defaults to no. Set yes only for explicit remote-cleanup requests.
  • <force>: branch removal defaults to yes. With explicit no, do not force-remove the worktree or force-delete its branch; report the blocked state. Baseline removal never uses force.

Trim names and replace internal spaces with -, preserving deliberate capitalization. A segment matches [A-Za-z0-9._-]+ without .., a leading ., or a trailing .lock; reject everything else, including backslashes and shell metacharacters. The directory name is exactly one segment. A branch name is one segment or <type>/<segment> with <type> a lowercase Conventional Commits type (fix, feat, …); reject any other /. Neither a new nor deleted branch may be main/master/canary.

Safety boundaries

  • Never remove the main checkout. Stop before removal commands for protected-branch worktrees too.
  • Never create or preserve a new-worktree symlink targeting main-checkout content. pnpm links within the new worktree or to an external package store are allowed.
  • Never replace colliding paths/branches automatically. Do not use reset --hard, forced file restoration, or hook bypasses to clean up.
  • Stop a daemon only through the target worktree's own path (git -C <path> fsmonitor--daemon stop). Never stop other daemons or processes by name or in bulk (pkill, killall, all-daemon shutdown).
  • Removal requires a request targeting the owned dedicated worktree, authorized post-merge cleanup, or an explicitly disposable baseline created for the current task. Inspect and disclose dirty/unpushed/unmerged state first; branch force cleanup stays within that authority. A general task request or reading this skill as a reference does not authorize deletion.

Execution routes

ModeRead before executionCompletion condition
create branchCreateNew checkout from remote base, successful internal pnpm install --frozen-lockfile, subsequent commands fixed to its path
create baselineBaselineDetached checkout at the recorded commit, ownership evidence saved, required preparation completed
removeRemove; it routes baselines separatelyVerified removal, branch/remote outcome or baseline evidence reported

Do not skip path, ownership, or branch-protection checks. Execute this lifecycle directly through Bash rather than creating temporary helper scripts. Stop immediately on installation failure in either creation route; do not call the worktree ready. On removal failure, report exactly what remains.

After creation, every edit/command uses the absolute worktree path. Set the execution root for background commands too; a green check in the main checkout is not evidence. Reading main-checkout status to detect leaked edits is an explicit read-only exception.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.