shadow-git
Skill1 starsChanged yesterdayMITView on GitHub
Safe Team Git & Worktree Collaboration. Use when syncing team branches, running git merge-tree dry-run conflict checks, managing parallel multi-agent worktrees, integrating independent feature branches, or resolving merge conflicts safely.
- Reads credentials
- Installs packages
- Commits and pushes
In this repository51 other files it gives its agents.
- antislop-codeSkill
- antislop-copywritingSkill
- antislop-humanSkill
- antislop-layoutmobileSkill
- antislopSkill
- antislop-uiSkill
- context7Skill
- handoffSkill
- shadow-accessibilitySkill
- shadow-apiSkill
- shadow-architectSkill
- shadow-authSkill
- shadow-bootstrapSkill
- shadow-browserSkill
- shadow-cacheSkill
- shadow-compatSkill
- shadow-concurrencySkill
- shadow-dataSkill
- shadow-dbSkill
- shadow-debugSkill
- shadow-designSkill
- shadow-discoverySkill
- shadow-docSkill
- shadow-domainSkill
- shadow-eaSkill
- shadow-evalSkill
- shadow-finopsSkill
- shadow-grcSkill
- shadow-handoverSkill
- shadow-integrateSkill
- shadow-maintainSkill
- shadow-mobileSkill
- shadow-modernizeSkill
- shadow-monarchSkill
- shadow-observeSkill
- shadow-opsSkill
- shadow-perfSkill
- shadow-planSkill
- shadow-pmoSkill
- shadow-presalesSkill
- shadow-privacySkill
- shadow-qualitySkill
- shadow-realtimeSkill
- shadow-refactorSkill
- shadow-releaseSkill
- shadow-resilienceSkill
- shadow-searchSkill
- shadow-secSkill
- shadow-supplychainSkill
- shadow-testSkill
- shadow-uatSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 3 are distinctive, and 15 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
15
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill whenever the Monarch asks to manage branches, create/inspect/clean Git worktrees, run parallel agents across isolated …
- Distinctive: line 10
Conditional Activation & Read-Only Default: Do not execute Git synchronization or branch mutations automatically merely because a session …
- Very specific: line 33
Never assume every project uses Git Flow.
- Very specific: line 37
When multiple agents work in parallel (e.g., Tejas/main, Tejas/feature-rag, Tejas/feature-sitaba, Tejas/feature-export):
- Very specific: line 38
Create an isolated worktree per agent via worktree-create (automatically blocks if the branch is already checked out elsewhere or if the …
- Very specific: line 40
Run check-parallel-scope to detect if two parallel worktrees are modifying the same shared file or violating their allowed path scope.
- Very specific: line 41
When pausing an agent's worktree, save state via /handoff (shadow_handoff MCP).
- Very specific: line 44
When Branch C (feature-export) is completed while Branch A (feature-rag) and Branch B (feature-sitaba) are still in progress:
- Very specific: line 45
Run integrate-feature --branch feature-export --target main (Read-Only Preview) to verify:
- Very specific: line 49
Run /shadow-test and /shadow-sec inside Branch C's worktree.
- Distinctive: line 53
After Branch C merges into main, bring updated main into unfinished branches A and B:
- Very specific: line 54
Default to --strategy merge (git merge --no-ff main) for shared, published, or long-lived branches.
- Very specific: line 72
Not checked out in another active worktree (BRANCH_CHECKED_OUT_IN_WORKTREE).
- Very specific: line 73
No active agent ownership lock unless --release-agent-lock is confirmed (ACTIVE_AGENT_OWNERSHIP), and zero ongoing MERGE/REBASE/CHERRY_PICK …
- Distinctive: line 94
Create an explicit named backup stash (including untracked files) only when authorized:
- Very specific: line 108
Verify resolution: git diff --check + run project typecheck, linter, and unit tests (/shadow-test).
- Very specific: line 124
Deterministic Post-Merge Reconciliation: After integrating worktrees sequentially into an integration branch, run cross-boundary checks …
- Very specific: line 125
Execution Approval Boundary (
L0vsL4): Read-only status/diff/merge-tree diagnostics are L0_READ_ONLY, whereas --approve branch …
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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.
Files
Shadow Git v2.0 (/shadow-git) — Branching, Worktree & Parallel Multi-Agent Orchestrator
Use this skill whenever the Monarch asks to manage branches, create/inspect/clean Git worktrees, run parallel agents across isolated features, integrate completed branches independently into main, sync unfinished branches with main, pull safely, or predict/resolve merge conflicts.
- Conditional Activation & Read-Only Default: Do not execute Git synchronization or branch mutations automatically merely because a session starts. Always run read-only inspection/previews first (
health,predict-conflicts, or commands without--approve) and require explicit Monarch authorization before merge, rebase, force-push, branch deletion, or worktree removal. - Detailed Architectural Reference: Load
references/WORKTREE-AND-PARALLEL-AGENTS.mdfor the branching strategy matrix, worktree ownership manifest, conflict taxonomy, and recovery playbooks.
1. Natural-Language Intent to Command Routing (scripts/git_orchestrator.py)
| Monarch Natural-Language Intent | Orchestrator Command (python ".../shadow-git/scripts/git_orchestrator.py" ...) |
| "Cek strategi branch repo ini" | detect-strategy --repo <path> |
| "Cek semua worktree dan branch aktif" / "Health report" | health --repo <path> --stale-days 14 |
| "Buat worktree baru untuk fitur RAG" | worktree-create --repo <path> --branch feature-rag --path ../feature-rag --base main --agent Agent-RAG --task TASK-01 --allowed-paths rag/ |
| "Kerjakan fitur A dan B secara paralel" | worktree-create for each branch + check-parallel-scope --repo <path> --base main |
| "Prediksi conflict sebelum merge" | predict-conflicts --repo <path> --source <feature-branch> --target main |
| "Branch C sudah selesai, cek apakah aman merge ke main" | integrate-feature --repo <path> --branch <branch-C> --target main (add --approve only after Monarch confirmation) |
| "Sync branch A dan B dengan main terbaru" | sync-from-main --repo <path> --branch <branch-A> --main main --strategy merge (add --approve to execute) |
| "Bersihkan worktree yang sudah selesai" | safe-cleanup --repo <path> --branch <branch-C> --target main --release-agent-lock (add --approve to execute) |
2. Core Workflows (FR-01 .. FR-08)
A. Branching Strategy Detection (FR-01)
Never assume every project uses Git Flow. Run detect-strategy first to identify:
- Trunk-Based (
mainonly), Short-Lived Feature Branches (GitHub Flow), Long-Lived Feature/Research Branches, Release/Hotfix Branches, or Git Flow (main+develop).
B. Git Worktree Lifecycle & Parallel Multi-Agent Isolation (FR-02, FR-03)
When multiple agents work in parallel (e.g., Tejas/main, Tejas/feature-rag, Tejas/feature-sitaba, Tejas/feature-export):
- Create an isolated worktree per agent via
worktree-create(automatically blocks if the branch is already checked out elsewhere or if the target directory is non-empty). - Each worktree registers an ownership & scope manifest (
.git/shadow-worktrees/agents_registry.json) withagent_id,task_id,allowed_paths, anddepends_on_branches. - Run
check-parallel-scopeto detect if two parallel worktrees are modifying the same shared file or violating their allowed path scope. - When pausing an agent's worktree, save state via
/handoff(shadow_handoffMCP).
C. Independent Feature Integration (FR-04)
When Branch C (feature-export) is completed while Branch A (feature-rag) and Branch B (feature-sitaba) are still in progress:
- Run
integrate-feature --branch feature-export --target main(Read-Only Preview) to verify:- Worktrees are clean (
0uncommitted/untracked files). - Required
depends_on_branchesare already merged. - Zero Git conflicts (
git merge-tree --write-tree) and semantic risks are listed.
- Worktrees are clean (
- Run
/shadow-testand/shadow-secinside Branch C's worktree. - Upon explicit Monarch approval, execute
integrate-feature --branch feature-export --target main --approve(or open a PR per repository policy without bypassing protected branch rules).
D. Forward Integration / Sync From Main (FR-05)
After Branch C merges into main, bring updated main into unfinished branches A and B:
- Default to
--strategy merge(git merge --no-ff main) for shared, published, or long-lived branches. - Shared-Branch Rebase Guard:
sync-from-mainautomatically blocks--strategy rebaseif the branch tracks a remote upstream or is marked shared (SHARED_BRANCH_REBASE_BLOCKED). Never force-push without explicit approval and risk disclosure. - Predicts conflicts and blocks if the target worktree has uncommitted/untracked changes (
DIRTY_WORKTREE_PROTECTED).
E. Enhanced Conflict Prediction: Git Conflicts vs Semantic Risks (FR-06)
predict-conflicts distinguishes:
- Hard Git Conflicts: Content conflicts, rename/delete conflicts, file mode changes, and divergent histories.
- Semantic Integration Risks (flagged even when Git merge is clean):
PARALLEL_SCHEMA_MIGRATIONS: Both branches added DB migration files (/shadow-data).API_CONTRACT_MODIFICATION: Changes toopenapi.yaml, routes, controllers,.proto,.graphql(/shadow-api).SHARED_CONFIGURATION_CHANGE: Edits to.env*,package.json,tsconfig.json,docker-compose.yml.LOCKFILE_DIVERGENCE: Concurrent lockfile updates.
F. 6-Point Safe Cleanup Gate (FR-08)
safe-cleanup refuses to remove a worktree or delete a branch unless all 6 checks pass:
- Zero staged or unstaged changes (
UNCOMMITTED_CHANGES). - Zero untracked files (
UNTRACKED_FILES_PRESENT). - Zero unmerged commits relative to target branch (
UNMERGED_COMMITS). - Not checked out in another active worktree (
BRANCH_CHECKED_OUT_IN_WORKTREE). - No active agent ownership lock unless
--release-agent-lockis confirmed (ACTIVE_AGENT_OWNERSHIP), and zero ongoingMERGE/REBASE/CHERRY_PICKoperations. - Explicit
--approveflag provided after Monarch confirmation.
3. Preserved v1.0 Team Branch Sync & Conflict Resolution Protocol
Phase 1: Safe Pre-Pull Reconnaissance (Zero Working-Tree Mutation)
git status -sb
git branch -vv
git fetch --all --prune
git log HEAD..origin/<target-branch> --oneline --stat
git merge-tree --write-tree HEAD origin/<target-branch>Phase 2: Safe Pull Execution Protocol
- Clean working tree &
0conflicts:0ahead commits:git pull --ff-only origin <target-branch>- Diverged (
>0ahead,0conflicts):git pull --no-rebase origin <target-branch>
- Uncommitted local changes exist:
- Create an explicit named backup stash (including untracked files) only when authorized:
git stash push -u -m "shadow-pre-pull-backup-$(Get-Date -Format 'yyyyMMdd-HHmmss')" - Pull safely, then restore with
git stash pop(never run implicitstash drop).
- Create an explicit named backup stash (including untracked files) only when authorized:
Phase 3: Intelligent Collaborative Conflict Resolution
- List conflicted files:
git diff --name-only --diff-filter=U - Inspect both sides' commit intent:
git log -p -n 3 HEAD -- <file>git log -p -n 3 origin/<target-branch> -- <file>
- Never Blindly Apply
--oursor--theirson Source Code:- Combine both contracts cleanly (
0 any,0 as Typecasting, zero dead code). - Regenerate lockfiles via the package manager (
npm install --package-lock-only) after merging manifests.
- Combine both contracts cleanly (
- Verify resolution:
git diff --check+ run project typecheck, linter, and unit tests (/shadow-test).
4. Ecosystem Integration Boundaries (FR-09)
/shadow-monarch: Enforces approval gates, strict typing during conflict resolution, and read-only default behavior./shadow-plan: MapsTASK-*IDs anddepends_on_branchesto isolated worktrees./shadow-test: Runs module & integration regression tests inside each worktree beforeintegrate-featureand aftersync-from-main./shadow-sec: Runs secret scanning and ASVS access-control checks before merging intomain./shadow-release: Verifies release tags, migration backward compatibility, and rollback SHAs aftermainintegration./handoff: Persists worktree path, branch name, and active task state across AI agent sessions (shadow_handoffMCP).
5. Parallel Worktree Path-Ownership & Reconciliation Protocol
- Explicit Path-Ownership Invariant: Before spawning parallel worktrees or swarm workers, partition modified file paths so each worktree owns a disjoint set of directories/files. Shared contracts (
openapi.yaml,schema.prisma,package.json, shared types/router indexes) MUST NOT be edited concurrently by multiple feature branches; assign shared contracts to a serialized coordinator gate or prerequisite base branch first. - Deterministic Post-Merge Reconciliation: After integrating worktrees sequentially into an integration branch, run cross-boundary checks (
typecheck,openapivalidation, integration tests, and/shadow-qualitydrift checks) on the combined tree before cleanup. Conflict resolution MUST merge both worktrees' semantic invariants rather than taking--ours/--theirsblindly. - Execution Approval Boundary (
L0vsL4): Read-onlystatus/diff/merge-treediagnostics areL0_READ_ONLY, whereas--approvebranch integration, rebase, force cleanup, orgit pushareL4: HIGH_IMPACTrequiring explicit Monarch authorization (shadow-monarch/scripts/execution_approval_gate.py).
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
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.

