[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M753VD2PSTFPDEYYX6FY1XAZ":3,"skill-same:01M753VD2PSTFPDEYYX6FY1XAZ":59},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M753VD2PSTFPDEYYX6FY1XAZ","git-worktree",null,"Use when working with git worktrees — creating an isolated workspace or parallel checkout for a task or agent, listing or switching trees, moving work between them, pruning stale ones, recovering a broken one. Triggers include \"create a worktree\", \"new worktree for this fix\". Native-first — prefer the host's own worktree tooling, fall back to `git worktree` only when there is none. Not for undo\u002Fdiscard\u002Fstash\u002Fmerge\u002Fpush (git-operations). Not for fanning agents across trees (subagent-deployment).","jabworks\u002Fagentic-toolkit","jabworks","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F159094119?v=4","01M753P4JBZBTT7WN1PJBPZJZP","JAB Works","01M753P4K5KDGEWGXWT811BZET",2,"MIT","https:\u002F\u002Fgithub.com\u002Fjabworks\u002Fagentic-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Fgit-worktree\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: git-worktree\ndescription: Use when working with git worktrees — creating an isolated workspace or parallel checkout for a task or agent, listing or switching trees, moving work between them, pruning stale ones, recovering a broken one. Triggers include \"create a worktree\", \"new worktree for this fix\". Native-first — prefer the host's own worktree tooling, fall back to `git worktree` only when there is none. Not for undo\u002Fdiscard\u002Fstash\u002Fmerge\u002Fpush (git-operations). Not for fanning agents across trees (subagent-deployment).\n---\n\n# git-worktree\n\nA **decision router** for worktrees: given a situation, pick the right move, run it safely, and know the undo path. Same shape as `git-operations`, different topology — a worktree changes *where* a checkout lives, never what history says.\n\n## When to use\n\n- You need an isolated workspace for a task, a branch, or an agent.\n- You have worktrees already and need to list, switch, move work, or clean up.\n- A worktree is in a bad state — stale lock, deleted directory, branch stuck as checked-out elsewhere.\n\n## Native first — the rule that matters most\n\n**Prefer your platform's native worktree tooling. Fall back to `git worktree` only when there is none.**\n\nClaude Code has `EnterWorktree` and `isolation: \"worktree\"` agents; other harnesses have their own. When a host manages worktrees for you, running `git worktree add` yourself creates **phantom state the harness cannot see or manage** — it won't clean it up, won't list it, and may collide with its own tree on the same branch.\n\nThe reverse is safe: `git worktree list` always tells the truth about what exists on disk, whoever created it.\n\n## Step 0 — guards, before any command\n\nRun these first. Two of them mean *stop, you're done or you're somewhere else*.\n\n```bash\ngit rev-parse --show-superproject-working-tree   # non-empty → submodule, NOT a worktree\ngit rev-parse --git-dir                          # differs from --git-common-dir → already in a linked worktree\ngit rev-parse --git-common-dir\ngit worktree list                                # what already exists\n```\n\n| Result | What it means | Do |\n|---|---|---|\n| Superproject path returned | You're in a submodule | Treat as a normal repo — this skill does not apply |\n| `--git-dir` ≠ `--git-common-dir` | You're already in a linked worktree | **Skip creation** — you have your isolation |\n| Native tool available | Host manages worktrees | Use it (below); do not `git worktree add` |\n| Neither, no native tool | Plain repo, manual path | Fall back to `git worktree add` |\n\n## Decision map\n\nFull routing table in `references\u002Fworktree-map.md`. The high-value forks:\n\n| Situation | Choose → (not →) | Undo path |\n|---|---|---|\n| **Need isolation** | native host tool → (`git worktree add` only if none) | remove the tree; branch survives |\n| **Where to put it** | `.worktrees\u002F\u003Cname>` inside the repo, **verified gitignored** → (a sibling dir, if you'd rather keep the repo clean) | — |\n| **Existing branch** | `git worktree add \u003Cpath> \u003Cbranch>` → (not `-b`, which fails if it exists) | `git worktree remove \u003Cpath>` |\n| **New branch** | `git worktree add -b \u003Cnew> \u003Cpath>` | remove tree, then `git branch -d \u003Cnew>` |\n| **Switch trees** | `cd \u003Cpath>` — a worktree is a directory → (never `git switch` into a branch checked out elsewhere) | `cd` back |\n| **Move work between trees** | commit + `git switch`\u002Fcherry-pick, or stash (shared across trees) | normal git undo |\n| **Clean up** | `git worktree remove \u003Cpath>` → (`prune` only after manual deletion) | branch survives removal |\n| **Broken tree** | → `references\u002Frecovery.md` | — |\n\n## Operation cards\n\nEach card: when to choose it, the safe sequence, how to undo it.\n\n### Create an isolated workspace\n\n**If a native tool exists, use it and stop reading this card.**\n\nManual fallback — verify the location is ignored **before** creating anything, or the first commit sweeps a whole checkout into the repo:\n\n```bash\ngit check-ignore -q .worktrees || echo \"NOT IGNORED — add .worktrees\u002F to .gitignore first\"\ngit worktree add .worktrees\u002F\u003Cname> -b \u003Cbranch>    # new branch\ngit worktree add .worktrees\u002F\u003Cname> \u003Cbranch>       # existing branch\n```\n\n- **Undo:** `git worktree remove .worktrees\u002F\u003Cname>`. The branch is untouched — removing a tree never deletes work that was committed.\n- A worktree is cheap: it shares the one `.git` object database, so creation costs a checkout, not a clone.\n\n### List and inspect\n\n```bash\ngit worktree list            # path, HEAD, branch for every tree\ngit worktree list --porcelain\n```\n\nThe main worktree is listed first and cannot be removed — only the linked ones.\n\n### Switch between trees\n\nA worktree is just a directory: `cd` to it. There is no `git worktree switch`.\n\n**A branch can only be checked out in one tree at a time.** `git switch \u003Cbranch>` fails with *\"already checked out at …\"* when another tree holds it — that's the feature working, not a bug. Go to that tree, or use a different branch.\n\n### Move work between trees\n\n- **Committed:** commit in the source tree, then `git switch` \u002F `git cherry-pick \u003Csha>` in the target — they share the object database, so nothing needs pushing.\n- **Uncommitted:** `git stash push -m \"\u003Cnote>\"` in one tree, `git stash pop` in the other. **The stash is shared across all worktrees** — the one piece of worktree state that isn't isolated, and a genuine surprise.\n- **Undo:** ordinary git undo; see `git-operations`.\n\n### Remove and prune\n\n```bash\ngit worktree remove \u003Cpath>          # clean removal — refuses if dirty\ngit worktree remove --force \u003Cpath>  # discards uncommitted work. DESTRUCTIVE\ngit worktree prune -n               # dry-run: what stale metadata would go\ngit worktree prune                  # after a tree was deleted manually\n```\n\n- `remove` is the correct verb. `prune` only cleans up *metadata* for trees whose directories already vanished — it is not how you remove a worktree.\n- **Undo:** none for `--force` on uncommitted work; that's why the plain form refuses. A removed tree's *branch* survives — recreate the tree and you're back.\n\n## Common traps\n\n- **`git worktree add` under a harness that manages worktrees** — phantom state, the headline failure.\n- **An un-ignored worktree directory** — `.worktrees\u002F` inside the repo is convenient and invisible until a commit swallows an entire second checkout.\n- **`prune` expecting it to remove a tree** — it only forgets already-deleted ones.\n- **Fighting \"already checked out at …\"** — that guard prevents two trees from diverging on one branch. Don't force past it.\n- **Assuming full isolation** — the stash and the object database are shared. Files and HEAD are per-tree; those two are not.\n\n## Out of scope\n\n- Fanning agents out across parallel trees → `subagent-deployment`.\n- Undo, discard, stash-as-workflow, merge, push → `git-operations`.\n- Committing → `git-commit`.\n- Submodules and bisect — still uncovered by this toolkit.\n\n## ⚙ Adjust these (defaults)\n\n`.worktrees\u002F\u003Cname>` is the assumed location because it keeps trees with their repo and is trivially ignorable. A sibling directory (`..\u002F\u003Crepo>-\u003Cbranch>`) works identically and needs no gitignore entry — pick one and stay consistent.\n","# git-worktree\n\nA **decision router** for worktrees: given a situation, pick the right move, run it safely, and know the undo path. Same shape as `git-operations`, different topology — a worktree changes *where* a checkout lives, never what history says.\n\n## When to use\n\n- You need an isolated workspace for a task, a branch, or an agent.\n- You have worktrees already and need to list, switch, move work, or clean up.\n- A worktree is in a bad state — stale lock, deleted directory, branch stuck as checked-out elsewhere.\n\n## Native first — the rule that matters most\n\n**Prefer your platform's native worktree tooling. Fall back to `git worktree` only when there is none.**\n\nClaude Code has `EnterWorktree` and `isolation: \"worktree\"` agents; other harnesses have their own. When a host manages worktrees for you, running `git worktree add` yourself creates **phantom state the harness cannot see or manage** — it won't clean it up, won't list it, and may collide with its own tree on the same branch.\n\nThe reverse is safe: `git worktree list` always tells the truth about what exists on disk, whoever created it.\n\n## Step 0 — guards, before any command\n\nRun these first. Two of them mean *stop, you're done or you're somewhere else*.\n\n```bash\ngit rev-parse --show-superproject-working-tree   # non-empty → submodule, NOT a worktree\ngit rev-parse --git-dir                          # differs from --git-common-dir → already in a linked worktree\ngit rev-parse --git-common-dir\ngit worktree list                                # what already exists\n```\n\n| Result | What it means | Do |\n|---|---|---|\n| Superproject path returned | You're in a submodule | Treat as a normal repo — this skill does not apply |\n| `--git-dir` ≠ `--git-common-dir` | You're already in a linked worktree | **Skip creation** — you have your isolation |\n| Native tool available | Host manages worktrees | Use it (below); do not `git worktree add` |\n| Neither, no native tool | Plain repo, manual path | Fall back to `git worktree add` |\n\n## Decision map\n\nFull routing table in `references\u002Fworktree-map.md`. The high-value forks:\n\n| Situation | Choose → (not →) | Undo path |\n|---|---|---|\n| **Need isolation** | native host tool → (`git worktree add` only if none) | remove the tree; branch survives |\n| **Where to put it** | `.worktrees\u002F\u003Cname>` inside the repo, **verified gitignored** → (a sibling dir, if you'd rather keep the repo clean) | — |\n| **Existing branch** | `git worktree add \u003Cpath> \u003Cbranch>` → (not `-b`, which fails if it exists) | `git worktree remove \u003Cpath>` |\n| **New branch** | `git worktree add -b \u003Cnew> \u003Cpath>` | remove tree, then `git branch -d \u003Cnew>` |\n| **Switch trees** | `cd \u003Cpath>` — a worktree is a directory → (never `git switch` into a branch checked out elsewhere) | `cd` back |\n| **Move work between trees** | commit + `git switch`\u002Fcherry-pick, or stash (shared across trees) | normal git undo |\n| **Clean up** | `git worktree remove \u003Cpath>` → (`prune` only after manual deletion) | branch survives removal |\n| **Broken tree** | → `references\u002Frecovery.md` | — |\n\n## Operation cards\n\nEach card: when to choose it, the safe sequence, how to undo it.\n\n### Create an isolated workspace\n\n**If a native tool exists, use it and stop reading this card.**\n\nManual fallback — verify the location is ignored **before** creating anything, or the first commit sweeps a whole checkout into the repo:\n\n```bash\ngit check-ignore -q .worktrees || echo \"NOT IGNORED — add .worktrees\u002F to .gitignore first\"\ngit worktree add .worktrees\u002F\u003Cname> -b \u003Cbranch>    # new branch\ngit worktree add .worktrees\u002F\u003Cname> \u003Cbranch>       # existing branch\n```\n\n- **Undo:** `git worktree remove .worktrees\u002F\u003Cname>`. The branch is untouched — removing a tree never deletes work that was committed.\n- A worktree is cheap: it shares the one `.git` object database, so creation costs a checkout, not a clone.\n\n### List and inspect\n\n```bash\ngit worktree list            # path, HEAD, branch for every tree\ngit worktree list --porcelain\n```\n\nThe main worktree is listed first and cannot be removed — only the linked ones.\n\n### Switch between trees\n\nA worktree is just a directory: `cd` to it. There is no `git worktree switch`.\n\n**A branch can only be checked out in one tree at a time.** `git switch \u003Cbranch>` fails with *\"already checked out at …\"* when another tree holds it — that's the feature working, not a bug. Go to that tree, or use a different branch.\n\n### Move work between trees\n\n- **Committed:** commit in the source tree, then `git switch` \u002F `git cherry-pick \u003Csha>` in the target — they share the object database, so nothing needs pushing.\n- **Uncommitted:** `git stash push -m \"\u003Cnote>\"` in one tree, `git stash pop` in the other. **The stash is shared across all worktrees** — the one piece of worktree state that isn't isolated, and a genuine surprise.\n- **Undo:** ordinary git undo; see `git-operations`.\n\n### Remove and prune\n\n```bash\ngit worktree remove \u003Cpath>          # clean removal — refuses if dirty\ngit worktree remove --force \u003Cpath>  # discards uncommitted work. DESTRUCTIVE\ngit worktree prune -n               # dry-run: what stale metadata would go\ngit worktree prune                  # after a tree was deleted manually\n```\n\n- `remove` is the correct verb. `prune` only cleans up *metadata* for trees whose directories already vanished — it is not how you remove a worktree.\n- **Undo:** none for `--force` on uncommitted work; that's why the plain form refuses. A removed tree's *branch* survives — recreate the tree and you're back.\n\n## Common traps\n\n- **`git worktree add` under a harness that manages worktrees** — phantom state, the headline failure.\n- **An un-ignored worktree directory** — `.worktrees\u002F` inside the repo is convenient and invisible until a commit swallows an entire second checkout.\n- **`prune` expecting it to remove a tree** — it only forgets already-deleted ones.\n- **Fighting \"already checked out at …\"** — that guard prevents two trees from diverging on one branch. Don't force past it.\n- **Assuming full isolation** — the stash and the object database are shared. Files and HEAD are per-tree; those two are not.\n\n## Out of scope\n\n- Fanning agents out across parallel trees → `subagent-deployment`.\n- Undo, discard, stash-as-workflow, merge, push → `git-operations`.\n- Committing → `git-commit`.\n- Submodules and bisect — still uncovered by this toolkit.\n\n## ⚙ Adjust these (defaults)\n\n`.worktrees\u002F\u003Cname>` is the assumed location because it keeps trees with their repo and is trivially ignorable. A sibling directory (`..\u002F\u003Crepo>-\u003Cbranch>`) works identically and needs no gitignore entry — pick one and stay consistent.\n",{"name":5,"description":7},"main","5277649b071c1c0cdf4f15eee861b1608fc1bbcb","skills\u002Fgit-worktree",0,"https:\u002F\u002Fgithub.com\u002Fjabworks\u002Fagentic-toolkit","https:\u002F\u002Fgithub.com\u002Fjabworks","2026-11-03 15:03:51",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add jabworks\u002Fagentic-toolkit --skill git-worktree",{"tool":37,"command":38},"bunx","bunx skills add jabworks\u002Fagentic-toolkit --skill git-worktree",{"tool":40,"command":41},"pnpm","pnpm dlx skills add jabworks\u002Fagentic-toolkit --skill git-worktree","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjabworks\u002Fagentic-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Fgit-worktree\u002FSKILL.md",true,[45,51,55],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"evals\u002Ftrigger_eval.json","REFERENCE","参考文档",3682,"https:\u002F\u002Fgithub.com\u002Fjabworks\u002Fagentic-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Fgit-worktree\u002Fevals\u002Ftrigger_eval.json",{"path":52,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":53,"sourceHtmlUrl":54},"references\u002Frecovery.md",3933,"https:\u002F\u002Fgithub.com\u002Fjabworks\u002Fagentic-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Fgit-worktree\u002Freferences\u002Frecovery.md",{"path":56,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fworktree-map.md",3492,"https:\u002F\u002Fgithub.com\u002Fjabworks\u002Fagentic-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Fgit-worktree\u002Freferences\u002Fworktree-map.md",[60,66,72,79,86,93],{"skillNo":61,"name":62,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7540BPNTFZH7V41P5E2S692","orphan","https:\u002F\u002Fgithub.com\u002Fjabworks\u002Fagentic-toolkit\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fcomposition\u002Fbad\u002Fskills\u002Forphan\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7540AG2KFTQ8DJMNV6806MV","no-blurb","https:\u002F\u002Fgithub.com\u002Fjabworks\u002Fagentic-toolkit\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fcomposition\u002Fbad\u002Fskills\u002Fno-blurb\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M75404N306PY1JFPQ0GGNTYB","workflow","Routes any dev task into the right execution tier (Small\u002FMedium\u002FLarge) and carries condux's operating rules — proportional effort, lazy skill loading, soft gates, implement-yourself-by-default.","https:\u002F\u002Fgithub.com\u002Fjabworks\u002Fagentic-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M753ZZ6TTA06GRJAG679BQ2H","usage-trace","Checks and manages durable, local usage capture — ingest, health status, and the opt-in limit snapshot — for Claude Code and Codex. Capture itself runs automatically at session start.","https:\u002F\u002Fgithub.com\u002Fjabworks\u002Fagentic-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Fusage-trace\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M753ZSKJSF8WFS7AXR2N65SE","toolkit-skill-standards","Use when writing or reviewing a SKILL.md for jabworks\u002Fagentic-toolkit — frontmatter budgets, the trigger contract (\"Use when…\" description or when_to_use field), progressive disclosure into references\u002F, and keeping a new description out of existing skills' trigger space. Triggers include \"review this skill description\", \"write the frontmatter\", \"does this collide with an existing skill\", \"where should this content live\". Not for scaffold\u002Fsync mechanics; use toolkit-foundry.","https:\u002F\u002Fgithub.com\u002Fjabworks\u002Fagentic-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Ftoolkit-skill-standards\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M753ZKX3KTVYWX15A9A0WZN0","toolkit-research-frontier","Use when planning improvement work on jabworks\u002Fagentic-toolkit itself — open problems (trigger-collision automation, YAML-strict frontmatter checks, docs-catalog enforcement), existing assets, the next three concrete steps, and the four-front library-health campaign with commands and success criteria. Triggers include \"let's improve our toolkit\", \"let's improve this repo\", \"what should we improve next\", \"toolkit roadmap\", \"open problems\", \"run the health campaign\".","https:\u002F\u002Fgithub.com\u002Fjabworks\u002Fagentic-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Ftoolkit-research-frontier\u002FSKILL.md",[],[]]