agentleFS
Alexander-TyagunovAlexander-Tyagunov/magician/skills/portal/SKILL.md

portal

Skill14 starsChanged 50 days agoMITView on GitHub

Creates a git worktree for isolated feature work; respects disableGit. Use to isolate a feature on its own branch.

10 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create an isolated git worktree for feature development.

    line 10
  2. Very specific:

    Read .workspace/local/prefs.md for disableGit: true.

    line 14
  3. Very specific:

    claude --worktree <name>: Use it when claude --help lists --worktree.

    line 31
  4. Very specific:

    Agent isolation: worktree: Use it for a dispatched subagent that edits files in parallel with others.

    line 32
  5. Very specific:

    git sparse-checkout in a monorepo: Use it when the repository has more than about 10,000 tracked files and the feature touches one or two …

    line 33
  6. Distinctive:

    Plain git worktree add: Use it in every other case (the process above).

    line 34
  7. Distinctive:

    Keep each change small and state its intent in the branch name and the first commit (lore/git.md).

    line 36
  8. Very specific:

    Create a feature directory: mkdir -p .features/<name>

    line 40
  9. Distinctive:

    After /seal completes and the PR merges:

    line 52

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

/portal — Git Worktree Isolation

Create an isolated git worktree for feature development.

Check disableGit Mode

Read .workspace/local/prefs.md for disableGit: true. If set, skip all git operations and work in the current directory.

Process (git mode)

  1. Get branch name — if $ARGUMENTS is non-empty, use it as the feature name directly. Otherwise ask: "What's this feature called? (I'll use it as the branch/worktree name.)" End your turn. Wait for their answer before creating anything.
  2. Create worktree (one plain command, so it matches this skill's pre-approval):
    git worktree add ../<repo-name>-<name> -b feature/<name>
  3. Workspace files — tracked files (.workspace/shared/) come with the branch; gitignored ones such as .workspace/local/prefs.md don't. Worktrees that Claude Code creates itself (claude --worktree, subagent worktree isolation) copy the gitignored files listed in a .worktreeinclude file at the repo root, so listing .workspace/local/prefs.md there is a useful tip for the user. For this plain git worktree add, copy any local file the new worktree needs (that copy goes through the normal permission prompt).
  4. Confirm the new worktree path to the user
  5. Say: "Worktree created at ../<path>. Work there for isolation. Run /seal when ready to merge."

Alternatives at agent scale

Pick the lightest isolation that fits. Feature-detect each one. Do not ask the user to check a version.

  • claude --worktree <name>. Use it when claude --help lists --worktree. It starts a new session in its own worktree and copies the files listed in .worktreeinclude. Tell the user the command. Do not run it from this session.
  • Agent isolation: worktree. Use it for a dispatched subagent that edits files in parallel with others. Set it in the agent's frontmatter or in the Agent call when the tool accepts it. Claude Code removes the worktree when the agent made no change.
  • git sparse-checkout in a monorepo. Use it when the repository has more than about 10,000 tracked files and the feature touches one or two packages. After step 2, run git -C ../<repo-name>-<name> sparse-checkout set --cone <package-dirs>. That command is not pre-approved, so it prompts. Add the shared config folders the build needs.
  • Plain git worktree add. Use it in every other case (the process above).

Keep each change small and state its intent in the branch name and the first commit (lore/git.md).

Process (disableGit mode)

  1. Create a feature directory: mkdir -p .features/<name>
  2. Note: no git isolation — be careful about conflicts with other in-progress work
  3. Say: "Working in .features/<name>/ (disableGit mode — no worktree created)."

Keep sibling worktrees in the loop

Worktrees isolate the files, not the consequences: a rename, a signature change, or a shared-dependency bump made here breaks whatever a sibling session is building on. When Claude Code's cross-session messaging is available, tell the affected session yourself instead of letting it discover the breakage — ListAgents finds the sessions working the other worktrees, SendMessage delivers one self-contained sentence about what landed.

Feature-detect it: no ListAgents, or no peer listed, means carry on exactly as before and note the change in your own summary. It isn't available in every environment, and a session inside a container can't see one on the host. See lore/cross-session.md.

Cleanup After Merge

After /seal completes and the PR merges:

git worktree remove ../<repo-name>-<name>
git branch -d feature/<name>

Obstacles

This is a thin git-worktree utility. If a worktree cannot be created (branch already exists, dirty tree), report it in prose to the caller and stop; it emits no structured upward Obstacles block.

See lore/obstacles.md.

Completion Signal

"Portal open. Worktree at <path>, branch <branch>. Start implementation or run /orchestrate."

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.