[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6D7DFB51HNYDB8THPCE33G4":3,"skill-same:01M6D7DFB51HNYDB8THPCE33G4":74},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":23,"linkOnly":24,"markdownContent":25,"markdownBody":25,"frontMatter":26,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":33,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M6D7DFB51HNYDB8THPCE33G4","git-worktree-manager",null,"oabdelmaksoud\u002FSuperClaw","oabdelmaksoud","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F50699149?v=4","01M6D5CVVN778ZCDP1WHS816SP","Omar Abdelmaksoud","01M6D5CW1RHNSKCJR85GJACBFT",2,"MIT","https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FSuperClaw\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fclaude-skills\u002Fengineering\u002Fgit-worktree-manager\u002FSKILL.md",[],[18,19,20,21,22],"git","worktree manager","worktree","git worktree","git worktree manager","2026-11-10 10:12:30",false,"# Git Worktree Manager\n\n**Tier:** POWERFUL  \n**Category:** Engineering  \n**Domain:** Parallel Development & Branch Isolation\n\n## Overview\n\nUse this skill to run parallel feature work safely with Git worktrees. It standardizes branch isolation, port allocation, environment sync, and cleanup so each worktree behaves like an independent local app without stepping on another branch.\n\nThis skill is optimized for multi-agent workflows where each agent or terminal session owns one worktree.\n\n## Core Capabilities\n\n- Create worktrees from new or existing branches with deterministic naming\n- Auto-allocate non-conflicting ports per worktree and persist assignments\n- Copy local environment files (`.env*`) from main repo to new worktree\n- Optionally install dependencies based on lockfile detection\n- Detect stale worktrees and uncommitted changes before cleanup\n- Identify merged branches and safely remove outdated worktrees\n\n## When to Use\n\n- You need 2+ concurrent branches open locally\n- You want isolated dev servers for feature, hotfix, and PR validation\n- You are working with multiple agents that must not share a branch\n- Your current branch is blocked but you need to ship a quick fix now\n- You want repeatable cleanup instead of ad-hoc `rm -rf` operations\n\n## Key Workflows\n\n### 1. Create a Fully-Prepared Worktree\n\n1. Pick a branch name and worktree name.\n2. Run the manager script (creates branch if missing).\n3. Review generated port map.\n4. Start app using allocated ports.\n\n```bash\npython scripts\u002Fworktree_manager.py \\\n  --repo . \\\n  --branch feature\u002Fnew-auth \\\n  --name wt-auth \\\n  --base-branch main \\\n  --install-deps \\\n  --format text\n```\n\nIf you use JSON automation input:\n\n```bash\ncat config.json | python scripts\u002Fworktree_manager.py --format json\n# or\npython scripts\u002Fworktree_manager.py --input config.json --format json\n```\n\n### 2. Run Parallel Sessions\n\nRecommended convention:\n\n- Main repo: integration branch (`main`\u002F`develop`) on default port\n- Worktree A: feature branch + offset ports\n- Worktree B: hotfix branch + next offset\n\nEach worktree contains `.worktree-ports.json` with assigned ports.\n\n### 3. Cleanup with Safety Checks\n\n1. Scan all worktrees and stale age.\n2. Inspect dirty trees and branch merge status.\n3. Remove only merged + clean worktrees, or force explicitly.\n\n```bash\npython scripts\u002Fworktree_cleanup.py --repo . --stale-days 14 --format text\npython scripts\u002Fworktree_cleanup.py --repo . --remove-merged --format text\n```\n\n### 4. Docker Compose Pattern\n\nUse per-worktree override files mapped from allocated ports. The script outputs a deterministic port map; apply it to `docker-compose.worktree.yml`.\n\nSee [docker-compose-patterns.md](references\u002Fdocker-compose-patterns.md) for concrete templates.\n\n### 5. Port Allocation Strategy\n\nDefault strategy is `base + (index * stride)` with collision checks:\n\n- App: `3000`\n- Postgres: `5432`\n- Redis: `6379`\n- Stride: `10`\n\nSee [port-allocation-strategy.md](references\u002Fport-allocation-strategy.md) for the full strategy and edge cases.\n\n## Script Interfaces\n\n- `python scripts\u002Fworktree_manager.py --help`\n  - Create\u002Flist worktrees\n  - Allocate\u002Fpersist ports\n  - Copy `.env*` files\n  - Optional dependency installation\n- `python scripts\u002Fworktree_cleanup.py --help`\n  - Stale detection by age\n  - Dirty-state detection\n  - Merged-branch detection\n  - Optional safe removal\n\nBoth tools support stdin JSON and `--input` file mode for automation pipelines.\n\n## Common Pitfalls\n\n1. Creating worktrees inside the main repo directory\n2. Reusing `localhost:3000` across all branches\n3. Sharing one database URL across isolated feature branches\n4. Removing a worktree with uncommitted changes\n5. Forgetting to prune old metadata after branch deletion\n6. Assuming merged status without checking against the target branch\n\n## Best Practices\n\n1. One branch per worktree, one agent per worktree.\n2. Keep worktrees short-lived; remove after merge.\n3. Use a deterministic naming pattern (`wt-\u003Ctopic>`).\n4. Persist port mappings in file, not memory or terminal notes.\n5. Run cleanup scan weekly in active repos.\n6. Use `--format json` for machine flows and `--format text` for human review.\n7. Never force-remove dirty worktrees unless changes are intentionally discarded.\n\n## Validation Checklist\n\nBefore claiming setup complete:\n\n1. `git worktree list` shows expected path + branch.\n2. `.worktree-ports.json` exists and contains unique ports.\n3. `.env` files copied successfully (if present in source repo).\n4. Dependency install command exits with code `0` (if enabled).\n5. Cleanup scan reports no unintended stale dirty trees.\n\n## References\n\n- [port-allocation-strategy.md](references\u002Fport-allocation-strategy.md)\n- [docker-compose-patterns.md](references\u002Fdocker-compose-patterns.md)\n- [README.md](README.md) for quick start and installation details\n\n## Decision Matrix\n\nUse this quick selector before creating a new worktree:\n\n- Need isolated dependencies and server ports -> create a new worktree\n- Need only a quick local diff review -> stay on current tree\n- Need hotfix while feature branch is dirty -> create dedicated hotfix worktree\n- Need ephemeral reproduction branch for bug triage -> create temporary worktree and cleanup same day\n\n## Operational Checklist\n\n### Before Creation\n\n1. Confirm main repo has clean baseline or intentional WIP commits.\n2. Confirm target branch naming convention.\n3. Confirm required base branch exists (`main`\u002F`develop`).\n4. Confirm no reserved local ports are already occupied by non-repo services.\n\n### After Creation\n\n1. Verify `git status` branch matches expected branch.\n2. Verify `.worktree-ports.json` exists.\n3. Verify app boots on allocated app port.\n4. Verify DB and cache endpoints target isolated ports.\n\n### Before Removal\n\n1. Verify branch has upstream and is merged when intended.\n2. Verify no uncommitted files remain.\n3. Verify no running containers\u002Fprocesses depend on this worktree path.\n\n## CI and Team Integration\n\n- Use worktree path naming that maps to task ID (`wt-1234-auth`).\n- Include the worktree path in terminal title to avoid wrong-window commits.\n- In automated setups, persist creation metadata in CI artifacts\u002Flogs.\n- Trigger cleanup report in scheduled jobs and post summary to team channel.\n\n## Failure Recovery\n\n- If `git worktree add` fails due to existing path: inspect path, do not overwrite.\n- If dependency install fails: keep worktree created, mark status and continue manual recovery.\n- If env copy fails: continue with warning and explicit missing file list.\n- If port allocation collides with external service: rerun with adjusted base ports.\n",{},"main","7b610356e36623652299fa2acb477ff821b1d920","upstream-sync\u002Fwork\u002Fclaude-skills\u002Fengineering\u002Fgit-worktree-manager",0,"https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FSuperClaw","https:\u002F\u002Fgithub.com\u002Foabdelmaksoud","https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fo-abdelmaksoud\u002F","Full-Stack Engineer | AI Systems Architect | Building autonomous multi-agent systems","2026-03-08 21:12:53",{"source":7,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add oabdelmaksoud\u002FSuperClaw --skill git-worktree-manager",{"tool":42,"command":43},"bunx","bunx skills add oabdelmaksoud\u002FSuperClaw --skill git-worktree-manager",{"tool":45,"command":46},"pnpm","pnpm dlx skills add oabdelmaksoud\u002FSuperClaw --skill git-worktree-manager","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FSuperClaw\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fclaude-skills\u002Fengineering\u002Fgit-worktree-manager\u002FSKILL.md",true,[50,56,60,64,70],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"README.md","REFERENCE","参考文档",1291,"https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FSuperClaw\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fclaude-skills\u002Fengineering\u002Fgit-worktree-manager\u002FREADME.md",{"path":57,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fdocker-compose-patterns.md",1149,"https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FSuperClaw\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fclaude-skills\u002Fengineering\u002Fgit-worktree-manager\u002Freferences\u002Fdocker-compose-patterns.md",{"path":61,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fport-allocation-strategy.md",1030,"https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FSuperClaw\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fclaude-skills\u002Fengineering\u002Fgit-worktree-manager\u002Freferences\u002Fport-allocation-strategy.md",{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"scripts\u002Fworktree_cleanup.py","SCRIPT","脚本",6620,"https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FSuperClaw\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fclaude-skills\u002Fengineering\u002Fgit-worktree-manager\u002Fscripts\u002Fworktree_cleanup.py",{"path":71,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":72,"sourceHtmlUrl":73},"scripts\u002Fworktree_manager.py",8566,"https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FSuperClaw\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fclaude-skills\u002Fengineering\u002Fgit-worktree-manager\u002Fscripts\u002Fworktree_manager.py",[75,96,110,141,167,186],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":86,"publishedAt":23},"01M6D88QCPTBZVCRED0NZ1Y8K8","visa-doc-translate","Translate visa application documents (images) to English and create a bilingual PDF with original and translation","https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FSuperClaw\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fecc\u002Fskills\u002Fvisa-doc-translate\u002FSKILL.md",[81],{"categoryNo":82,"categoryName":83,"taxonomyType":84,"taxonomyTypeDesc":85},"01JBSEEDCAT000000000000002","文档处理","SCENARIO","使用场景",[87,88,89,90,91,92,93,94,95],"translate","doc","visa doc translate","translation","application","create","images","PDF","documents",{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":23},"01M6D88NBM95T3TFM50CYYAP65","verification-loop","A comprehensive verification system for Claude Code sessions.","https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FSuperClaw\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fecc\u002Fskills\u002Fverification-loop\u002FSKILL.md",[],[103,104,105,106,107,108,109],"verification","loop","verification loop","sessions","code","claude code sessions","system",{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":127,"publishedAt":23},"01M6D88JFZ2P996GVRHJNSZSTM","tdd-workflow","Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.","https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FSuperClaw\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fecc\u002Fskills\u002Ftdd-workflow\u002FSKILL.md",[116,119,122],{"categoryNo":117,"categoryName":118,"taxonomyType":84,"taxonomyTypeDesc":85},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":120,"categoryName":121,"taxonomyType":84,"taxonomyTypeDesc":85},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":123,"categoryName":124,"taxonomyType":125,"taxonomyTypeDesc":126},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[128,129,130,131,132,133,107,134,135,136,137,138,139,140],"tdd","workflow","tdd workflow","e2e tests","e2e","integration","development","use","test","refactoring","coverage","tests","writing",{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":23},"01M6D88FTHRRSVJMXF2G7MQAK3","swiftui-patterns","SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS\u002FmacOS UI best practices.","https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FSuperClaw\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fecc\u002Fskills\u002Fswiftui-patterns\u002FSKILL.md",[],[148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166],"patterns","swiftui","swiftui patterns","architecture","macos","performance","state management","best practices","state","ui","Optimization","ios","architecture patterns","Composition","performance optimization","view","management","swiftui architecture","navigation",{"skillNo":168,"name":169,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":174,"publishedAt":23},"01M6D88D527QTQT9DKHTRFN6EA","swift-protocol-di-testing","Protocol-based dependency injection for testable Swift code — mock file system, network, and external APIs using focused protocols and Swift Testing.","https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FSuperClaw\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fecc\u002Fskills\u002Fswift-protocol-di-testing\u002FSKILL.md",[173],{"categoryNo":117,"categoryName":118,"taxonomyType":84,"taxonomyTypeDesc":85},[175,176,177,178,107,179,180,181,182,109,183,184,185],"swift protocol di testing","protocol","swift","testing","protocols","file","network","injection","dependency","swift testing","dependency injection",{"skillNo":187,"name":188,"nameZh":6,"description":189,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":190,"categories":191,"keywords":192,"publishedAt":23},"01M6D88AJW8H2QNWSW5ZY82R43","swift-concurrency-6-2","Swift 6.2 Approachable Concurrency — single-threaded by default, @concurrent for explicit background offloading, isolated conformances for main actor types.","https:\u002F\u002Fgithub.com\u002Foabdelmaksoud\u002FSuperClaw\u002Fblob\u002Fmain\u002Fupstream-sync\u002Fwork\u002Fecc\u002Fskills\u002Fswift-concurrency-6-2\u002FSKILL.md",[],[193,194,177,195,196,27],"concurrency","swift concurrency","swift concurrency 6 2","default"]