agentleFS
mauriciovieiramauriciovieira/groundwork/skills/worktree/SKILL.md

worktree

Skill0 starsChanged 4 months agoMITView on GitHub

Internal groundwork technique - create and manage a git worktree for a single slice, isolated branch and directory, cleanly mappable to one PR. Used by build when worktree isolation is requested; not meant to be invoked outside an active groundwork build session.

  • Commits and pushes

59 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use worktree-merge, resolve-conflicts and 8 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.
  • leessjuSkill

    worktree-merge

    Squash-merge the current worktree branch into the main branch (or a specified target). Analyzes git history and source code to craft a comprehensive commit message.

    Also in 3 projects that use this

  • ralphkraussSkill

    resolve-conflicts

    Resolve git merge conflicts or re-apply changes from a stale branch onto current main. Use when user says "resolve conflicts", "merge conflicts", "rebase branch", "branch is behind", "re-apply changes", "port branch", or a branch is too far behind main to merge cleanly.

    Also in 5 projects that use this

  • SentrySkill

    e2e

    Run E2E tests for Sentry JavaScript SDK test applications

    Also in 5 projects that use this

  • hdcolaSkill

    pr-comments

    Fetch unresolved review comments from a GitHub PR or mark comments as resolved. Use this when managing PR review feedback, checking pending comments, or marking review threads as resolved. Supports GitHub URLs or explicit owner/repo/PR-number from anywhere, or PR number auto-detection from within a git repository.

    Also in 3 projects that use this

  • Google CloudSkill

    contributing

    Guides the developer workflow for contributing to Race Condition. Use when setting up pre-commit hooks, running tests before a PR, understanding code style requirements, or preparing a contribution.

    Also in 3 projects that use this

  • PydanticSkill

    coverage

    Fetch coverage diff from Codecov for the current branch or a specific PR. Shows uncovered lines, patch coverage, and overall coverage change.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 47 edited versions we read keep these.

  • 2

    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
  1. Very specific:

    Do all of the slice's work inside .worktrees/<slug>.

    line 22
  2. Very specific:

    If the configured tracker is github, open a PR with gh pr create from inside the worktree, referencing the slice's issue.

    line 29
  3. Distinctive:

    After the branch merges (or is abandoned), remove the worktree and delete the local branch:

    line 34
  4. Distinctive:

    Never force-remove a worktree or force-delete a branch with unmerged, uncommitted work without checking with the user first.

    line 41

“Common” is measured: kept by at least 6 in 10 of the 47 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

groundwork:worktree

One slice, one worktree, one branch, one PR. Keeps parallel or long-running slice work from colliding with whatever else is happening in the main checkout.

Create

From the repository root:

git worktree add -b <branch-name> .worktrees/<slug> <base-branch>

Name the branch after the slice (e.g. feat/0007-thin-slice-title), and derive <slug> from the same name. Base it off the branch the feature is targeting, not necessarily main, if the feature itself is already on a longer-lived branch.

Work

Do all of the slice's work inside .worktrees/<slug>. Don't touch the main checkout while a worktree is active for the same slice - that's the isolation this technique exists for.

Finish

Once the slice's tests pass and TDD is complete:

  1. Push the branch.
  2. If the configured tracker is github, open a PR with gh pr create from inside the worktree, referencing the slice's issue.
  3. Report the branch (and PR link, if opened) back to whatever invoked this technique. Do not merge automatically - that's a human or a separate review step, not this technique's job.

Clean up

After the branch merges (or is abandoned), remove the worktree and delete the local branch:

git worktree remove .worktrees/<slug>
git branch -d <branch-name>

Never force-remove a worktree or force-delete a branch with unmerged, uncommitted work without checking with the user first.

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.