Prime Isolation: Worktree Isolation and Git Ops Orientation
Description
Prime Isolation: Worktree Isolation and Git Ops Orientation skill
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
Repository README
This is the README for coleam00/Archon, shared by 3 entries
in this directory. It describes the repository, not this entry specifically.
description: Prime agent with Archon isolation system and git operations context
Prime Isolation: Worktree Isolation and Git Ops Orientation
Objective
Orient on the isolation system (`packages/isolation/`) and low-level git operations (`packages/git/`) before working on worktree lifecycle, branch management, or error handling.
Process
1. Understand the Package Structures
!`ls packages/isolation/src/` !`ls packages/git/src/`
2. Understand Branded Git Types
Read `packages/git/src/types.ts` in full — branded types (`RepoPath`, `BranchName`, `WorktreePath`) that prevent mix-ups between plain strings and typed git paths.
3. Understand Low-Level Git Operations
Read `packages/git/src/worktree.ts` first 60 lines — `createWorktree`, `removeWorktree`, `listWorktrees`, `worktreeExists`, `toWorktreePath` (hashing strategy for unique paths).
Read `packages/git/src/exec.ts` — `execFileAsync` and `mkdirAsync` wrappers. Note: always use `execFileAsync` (not `exec`) for git commands to avoid shell injection.
Read `packages/git/src/branch.ts` first 40 lines — `checkout`, `getDefaultBranch`, `isBranchMerged`, `findWorktreeByBranch`.
4. Understand the Isolation Resolver
Read `packages/isolation/src/resolver.ts` first 130 lines — `IsolationResolver` class with the 7-step resolution order:
- Existing environment reference (from conversation)
- No codebase → skip isolation
- Workflow reuse (same codebase + workflow identity)
- Linked issue sharing (cross-conversation)
- PR branch adoption (skill symbiosis)
- Limit check with auto-cleanup (default: 25 worktrees per codebase)
- Create new worktree
5. Understand Error Classification
Read `packages/isolation/src/errors.ts` in full — `classifyIsolationError()` maps raw git errors (permission denied, no space left, timeout, not a git repo) to user-friendly messages. `IsolationBlockedError` for limit-exceeded cases. `isKnownIsolationError` for detection.
6. Understand the Worktree Provider
Read `packages/isolation/src/providers/worktree.ts` first 60 lines — `WorktreeProvider` implements `IIsolationProvider`: `createEnvironment`, `removeEnvironment`, `environmentExists`.
7. Understand the Factory
Read `packages/isolation/src/factory.ts` — `getIsolationProvider()` and `configureIsolation()` entry points used by the command handler and orchestrator.
8. Understand the Store Interface
Read `packages/isolation/src/store.ts` — `IIsolationStore` interface (database abstraction for isolation_environments table).
9. Check Recent Isolation/Git Activity
!`git log -8 --oneline -- packages/isolation/ packages/git/`
Output
Summarize (under 250 words):
Resolution Order
- The 7 steps in
IsolationResolver.resolve()and what each returns IsolationResolutiondiscriminated union statuses:resolved,none,stale_cleaned
Worktree Lifecycle
- Creation:
toWorktreePath(hash-based unique path) →createWorktree→ DB record - Reuse: matched b
Related Skills
Epic Sync
Sync epic issue bodies, labels, and local coordination snapshots from GitHub.
Git 使用 Git Worktrees
创建孤立的 Git worktrees,带有智能目录选择与安全验证。
Git Claude skills github
[Building agent skills blog](https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-ag
Git #148
, [#161](https://github.com/affaan-m/everything-claude-code/pull/161))
Git GitHub MCP
| Token | Repos, issues, PRs, workflows |
Git GitHub MCP Server
Official first-party server to read repos, manage issues/PRs, and automate workflows.
Git