subagent-conflict-detection

Solid

Use before dispatching a subagent with `isolation:"worktree"`, or while another subagent is in flight, to avoid three dispatch hazards — file-scope overlap with an in-flight subagent, a stale dispatch base, and collisions with another live agent/session editing the same checkout or git-submodule path. Invoke when about to call the Agent tool with `isolation:"worktree"`; when another subagent is running; right after a merge or branch switch; or when another Claude session is editing a shared repo/submodule path. Does NOT cover PR / merge mechanics (github-contribution-workflow) or post-commit diff sanity (pr-diff-verification).

AI & Automation 19 stars 0 forks Updated today MIT

Install

View on GitHub

Quality Score: 81/100

Stars 20%
43
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Subagent Conflict Detection ## Native mechanism Claude Code's own isolation primitives are the [Subagents](https://code.claude.com/docs/en/subagents) feature ("each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions") and `isolation:"worktree"`'s [base-branch selection](https://code.claude.com/docs/en/worktrees#choose-the-base-branch). Neither one checks whether a NEW dispatch's file scope overlaps an in-flight one, or whether the worktree base is stale — that pre-flight discipline is what this skill adds on top. ## When to invoke Before dispatching a new subagent via the Agent tool — especially with `isolation: "worktree"` — if ANY other subagent is currently running or has an active worktree. Trigger phrases / situations: - "派 subagent" / "dispatch a subagent" / "再派一個" while a prior subagent is in flight - About to call `Agent` tool when `git worktree list` shows non-main worktrees - Multiple `[in_progress]` tasks in TaskList that involve subagent work Skip when: dispatching the first subagent in a session, or all prior subagents have completed AND their worktrees are cleaned/merged. ## The pattern (3-step pre-dispatch check) ### Step 1 — inventory in-flight subagents ```bash git worktree list ``` Skip the entry marked `[main]` (or `[<default-branch>]`) — every other line is an in-flight worktree. For each worktree path, capture (run from inside that path, not via `-C`, so the commands match the...

Details

Author
wei18
Repository
wei18/apple-dev-skills
Created
2 months ago
Last Updated
today
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

concurrent-subagents-share-one-checkout-and-contend-on-head

Two or more subagents dispatched at the same repository by absolute path run in ONE working directory and contend on HEAD, so one agent's commit lands on another's branch and a rebase retargets a branch its author does not own. Use when: (1) about to dispatch more than one agent that will run git in the same repo, whether or not their FILES overlap; (2) a pre-launch check concluded "no collision" on the basis of file-overlap or different-repos reasoning; (3) `git log` on your branch shows a commit you did not author, or `git status -sb` reports ahead/behind counts that make no sense for a branch you just pushed; (4) an agent reports it rebased or committed and the result appears on someone else's ref; (5) `git branch -a --contains <sha>` returns only a branch belonging to different work. File-overlap analysis cannot see this class: the contention is on HEAD and the index, not on paths. The fix is worktree isolation at dispatch, not coordination after the fact.

0 Updated 2 days ago
MrBinnacle
AI & Automation Listed

isolate-parallel-work

Use BEFORE dispatching work that touches files or requires exclusive access to a server/port. Triggered by the need to run multiple agents concurrently or to prevent clobbering. Do NOT use for verifying output, guarding runtime, or composing payloads.

1 Updated today
haiggoh
AI & Automation Listed

isolated-worktree

Implement and review in a sibling git worktree created from the latest default branch. Use when launching subagents, implementing a feature, reviewing a PR, or before any repo edits so agents do not work on main/master or nest worktrees inside a checkout.

0 Updated 2 days ago
singleton-sd