agentleFS
slowdinislowdini/slow-powers/skills/working-in-isolation/SKILL.md

working-in-isolation

Skill2 starsChanged 50 days agoMITView on GitHub

Use when you're about to start changing files in a repository — code, docs, config, or content, whether a feature, bugfix, refactor, or docs/config update — to establish an isolated workspace so your work doesn't collide with existing or in-progress work.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before changing anything in a repository — code, docs, config, or other files — make sure your work lands somewhere it won't collide with …

    line 8
  2. Distinctive:

    Check the current state, then take the first matching rule:

    line 15
  3. Distinctive:

    Prefer your harness's native Git worktree capability if it exists.

    line 39
  4. Very specific:

    Keep the worktree out of version control: if .worktrees/ isn't already ignored by Git, add it to .gitignore and commit that first.

    line 46
  5. Very specific:

    After syncing the base branch with origin, create the new branch from the current HEAD with no upstream tracking:

    line 53
  6. Very specific:

    Do not create the branch from origin/dev, origin/main, or origin/master.

    line 60
  7. Distinctive:

    Use the project-appropriate commands to verify the baseline is clean — lint, test, and build.

    line 69
  8. Distinctive:

    If the baseline is already failing, report it before starting — you need to know which failures you introduced.

    line 71

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Working in isolation

Before changing anything in a repository — code, docs, config, or other files — make sure your work lands somewhere it won't collide with existing or in-progress work. Decide the workspace based on the git state. When in doubt, pause and ask the user.

Decision: where does this work go?

Check the current state, then take the first matching rule:

git branch --show-current      # current branch
git status --porcelain         # empty = clean tree
git worktree list              # >1 entry = worktrees already exist
  1. The user named a workspace (explicit command, or a configured preference) → follow it.
  2. Dirty tree (staged or unstaged changes) OR worktrees already exist → a human or another agent is mid-work here. Use a new worktree so your changes can't collide with theirs.
  3. On dev / main / master → sync with origin and create a new branch using the rule 3 command below. Keeps the base clean and makes the work easy to review.
  4. On any other branch → work in place. The user already isolated this workspace; adding a worktree is needless ceremony.

Hard rule: never make changes while on dev / main / master. If you find yourself on a base branch, branch (rule 3) or worktree (rule 2) first.

Create a worktree (rule 2)

Prefer your harness's native Git worktree capability if it exists. The capability may be deferred or lazily loaded. Otherwise, fall back to a Git worktree:

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

Keep the worktree out of version control: if .worktrees/ isn't already ignored by Git, add it to .gitignore and commit that first. If worktree creation fails (sandbox or permission limits), say so and fall back to checking out a branch in place (rule 3).

Create a branch (rule 3)

After syncing the base branch with origin, create the new branch from the current HEAD with no upstream tracking:

git switch --no-track --create <branch-name>

Do not create the branch from origin/dev, origin/main, or origin/master. --no-track keeps the new branch without an upstream until the user pushes it explicitly.

Set up the workspace

Install dependencies and run the existing test suite once, to confirm a clean baseline before you write anything.

Use the project-appropriate commands to verify the baseline is clean — lint, test, and build.

If the baseline is already failing, report it before starting — you need to know which failures you introduced.

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.