[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71DVBMSY1JPPB7RJMR13FW9":3,"skill-same:01M71DVBMSY1JPPB7RJMR13FW9":73},{"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":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":29,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":50,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M71DVBMSY1JPPB7RJMR13FW9","clean-worktree",null,"Merge an HQ worktree branch back into local main, then remove the worktree and branch. Local only; never pushes.","indigoai-us\u002Fhq-core","indigoai-us","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F122242446?v=4","01M71DTQ5NGD10GT1Z7E6XKWC5","HQ","01M71DTQ6BKSYYBNC9RAKT3YDK",94,"MIT","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fclean-worktree\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"worktree","clean worktree","clean","reconcile","git","read","scripts","merge","rmdir","Bash","main","only","local","docker","remove","core","never","branch","back","ls","2026-11-10 10:12:30",false,"---\nname: clean-worktree\ndescription: \"Merge an HQ worktree branch back into local main, then remove the worktree and branch. Local only; never pushes.\"\nallowed-tools: Bash(git:*), Bash(docker:*), Bash(ls:*), Bash(rmdir:*), Bash(bash \"${HQ_ROOT}\u002Fcore\u002Fscripts\u002Fclean-worktree-reconcile-handoff.sh:*), Read, AskUserQuestion\n---\n\n# Clean HQ Worktree\n\nUse this when HQ work was done in a separate git worktree and you now need to bring those commits back into the primary HQ tree's `main` branch and remove the leftover worktree. Triggers: \"clean up that worktree\", \"merge the worktree back\", \"fold the agent worktree into main\", \"reclaim the worktree\", or noticing stale entries in `.claude\u002Fworktrees\u002F` or `workspace\u002Fworktrees\u002F`.\n\nThis is HQ-internal builder work. It operates only on the local HQ git repository. HQ is local-only by hard policy (`hq-root-never-push-remote`): nothing in this workflow ever contacts a remote — no `push`, no `fetch`, no `pull`. Cross-machine state moves via `hq-sync`, never git push.\n\n## Recommended After `\u002Fhandoff`\n\nWhen HQ itself is running from a separate worktree (the active session's tree is `.claude\u002Fworktrees\u002F\u003Cname>` or `workspace\u002Fworktrees\u002F\u003Cname>` rather than the primary HQ root), the work and handoff artifacts land on that worktree's branch. Once `\u002Fhandoff` has fully completed — thread file written, `handoff.json` saved, INDEX updated, finalize commit done — run `\u002Fclean-worktree` to merge that branch back into the primary tree's `main` and remove the worktree, so the next session starts from a single clean tree on `main`.\n\nDo this **after** handoff finishes, never **during** it: handoff owns its own commit\u002Ffinalize flow, and merging a worktree mid-handoff corrupts that state. The sequence is always: `\u002Fhandoff` completes → then `\u002Fclean-worktree`.\n\n## Mental Model\n\nThe HQ root (`${HQ_ROOT}`) is itself a git repository, always checked out on `main`. Agent isolation and Codex worktrees create *linked* worktrees of that same repository:\n\n- `.claude\u002Fworktrees\u002F\u003Cname>\u002F` — typically on branch `claude\u002F\u003Cname>`\n- `workspace\u002Fworktrees\u002F\u003Cname>\u002F` — typically on branch `codex\u002F\u003Cname>`\n\nA linked worktree shares the HQ object store. Cleaning it up means: land its branch's commits into `main` in the primary tree, then tear down the worktree and delete its branch so the tree is clean again. You cannot `git checkout \u003Cbranch>` in the primary tree (the worktree holds it checked out, and the primary tree must stay on `main`) — you merge the branch *into* `main` from the primary tree instead.\n\n## Critical Guardrails\n\nThese are non-negotiable. Several are mechanically enforced.\n\n1. **Every git mutation in this workflow carries an explicit absolute `-C` anchor AND the `HQ_ALLOW_HQ_ROOT_GIT=1` prefix, in the same Bash call.** Worktree operations and merges into `main` mutate the shared HQ object store and are HQ-root-class. Bare HQ-root git mutations are mechanically blocked by `.claude\u002Fhooks\u002Fblock-hq-root-git-mutation.sh`. Form: `HQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT} \u003Ccmd>` for primary-tree ops, `HQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT}\u002F.claude\u002Fworktrees\u002F\u003Cname> \u003Ccmd>` for in-worktree ops. Never rely on an earlier `cd` — shell cwd drifts across context compaction and parallel calls.\n2. **Never push, fetch, or pull HQ.** No remote interaction anywhere in this skill. Do not ask \"should I push HQ?\" — the answer is always no.\n3. **Read-only inspection commands** (`git worktree list`, `git status`, `git log`, `git diff`, `git branch --merged`) need neither the anchor-prefix nor confirmation. Run them freely.\n4. **Destructive steps require explicit confirmation in full prose.** `git worktree remove`, `git branch -D`, and any `--force` permanently discard work. Before each, list exactly what will be lost (uncommitted files, unmerged commits) and wait for the user to confirm.\n5. **Resolve conflicts; never discard them.** If the merge conflicts, resolve file-by-file, `git add` the resolution, and commit. Never `git checkout --`\u002F`git restore` a conflicted path to make it go away, and never `--no-verify` on `main`.\n6. **One worktree at a time.** If several are reclaimable, use `AskUserQuestion` to pick one per call — never batch the decision.\n7. **Do not run during `\u002Fhandoff`.** Run it only after handoff has fully completed (see \"Recommended After \u002Fhandoff\" above).\n\n## Process\n\n### 1. Discover candidates\n\n```bash\ngit worktree list --porcelain\n```\n\nThe entry whose `branch` is `refs\u002Fheads\u002Fmain` and whose path is the HQ root is the primary tree — never a cleanup target. Every *other* entry under the HQ root (`.claude\u002Fworktrees\u002F...` or `workspace\u002Fworktrees\u002F...`) is a candidate.\n\nIf the user named a worktree or branch, resolve it to one candidate (match on directory basename or branch name). If not, present the candidates with their state and ask which one (`AskUserQuestion`, one pick). For each candidate gather, read-only:\n\n```bash\ngit -C \u003CWT> status --short | wc -l                 # dirty file count\ngit -C \u003CWT> log main..HEAD --oneline               # commits to bring back\ngit -C \u003CWT> diff --stat main...HEAD                 # change scope\n```\n\nIf a candidate has **zero commits ahead of main and no dirty files**, there is nothing to merge — go straight to step 5 (cleanup only) for that one.\n\n### 2. Capture uncommitted work in the worktree\n\nIf `git -C \u003CWT> status --short` is non-empty, the worktree has uncommitted changes that the merge would otherwise leave behind. Commit them inside the worktree before merging:\n\n```bash\nHQ_ALLOW_HQ_ROOT_GIT=1 git -C \u003CWT> add -A\nHQ_ALLOW_HQ_ROOT_GIT=1 git -C \u003CWT> commit -m \"clean-worktree: capture uncommitted work from \u003Cname>\"\n```\n\nIf `git commit` reports nothing to commit (changes were only ignored\u002Fsession files), note it and continue. Do not force-add ignored paths.\n\n### 3. Pre-merge safety check on the primary tree\n\nBefore checking status, reconcile the handoff mirror left by `\u002Fhandoff` in a\nlinked worktree. This removes `workspace\u002Fthreads\u002Fhandoff.json` and its copied\nthread only when each main-checkout file is byte-identical to the version on\nthe branch being merged. It leaves differing files in place and exits non-zero;\nsurface those files to the user and stop before merging.\n\n```bash\nbash \"${HQ_ROOT}\u002Fcore\u002Fscripts\u002Fclean-worktree-reconcile-handoff.sh\" \\\n  \"${HQ_ROOT}\" \"\u003CBRANCH>\"\n```\n\nReplace `\u003CBRANCH>` with the branch selected in step 1. Continue only after the\nscript exits successfully. It does not stage files or create commits.\n\n```bash\ngit -C ${HQ_ROOT} status --short\n```\n\nUntracked files in the primary tree that collide with incoming paths will abort the merge. HQ autocommit normally keeps the primary tree tidy; if there is unexpected dirty\u002Funtracked state that would collide, surface it to the user and resolve it (commit or move aside) before merging — do not blindly `--force` or clean.\n\n### 4. Merge the branch into main\n\nFrom the primary tree, on `main`:\n\n```bash\nHQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT} merge --no-ff \u003CBRANCH> \\\n  -m \"clean-worktree: merge \u003CBRANCH> into main\"\n```\n\n`--no-ff` keeps a visible reclaim point in history. A fast-forward (`HQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT} merge --ff-only \u003CBRANCH>`) is acceptable when `main` has not advanced and the user prefers linear history — ask only if it matters; otherwise default to `--no-ff`.\n\n**On conflict:** do not abort by default. Inspect with `git -C ${HQ_ROOT} status`, resolve each conflicted file deliberately (these are often skill\u002Fcommand\u002Fpolicy file deletions vs. edits — preserve the intended end state, do not just take one side blindly), then:\n\n```bash\nHQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT} add \u003Cresolved-paths>\nHQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT} commit --no-edit\n```\n\nIf conflicts are too entangled to resolve confidently, `HQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT} merge --abort`, report the conflicting paths to the user, and stop — do not guess.\n\n### 5. Verify the merge landed\n\n```bash\ngit -C ${HQ_ROOT} branch --merged main | grep -F \"\u003CBRANCH>\"\ngit -C ${HQ_ROOT} log --oneline -3\n```\n\n`\u003CBRANCH>` must appear in `--merged`. The reclaimed commits must be visible in `main`'s log. Do not proceed to cleanup until this is confirmed.\n\n### 6. Cleanup — destructive, confirm first\n\nBefore removing the worktree, check whether Docker Compose containers were started from it. Removing the directory out from under a running Compose project leaves orphaned containers and networks behind:\n\n```bash\ndocker ps -a --filter \"label=com.docker.compose.project.working_dir=\u003CWT>\" \\\n  --format '{{.Label \"com.docker.compose.project\"}}' | sort -u\n```\n\nIf a Compose project is clearly worktree-scoped (its project name derives from the worktree directory name), stop it before removing the worktree:\n\n```bash\ndocker compose -p \u003CPROJECT> --project-directory \u003CWT> down --remove-orphans\n```\n\nIf the project name is shared across checkouts (for example `privy`), do **not** stop it automatically. Tell the user the shared project is still running and ask before stopping it — another checkout may be using those containers.\n\nThen state explicitly to the user, in full prose, what is about to be permanently removed: the worktree directory at `\u003CWT>`, the branch `\u003CBRANCH>`, and confirm there is no uncommitted or unmerged work left (steps 2 and 5 should have ensured this). Wait for confirmation, then:\n\n```bash\nHQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT} worktree remove \u003CWT>\nHQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT} branch -d \u003CBRANCH>\nHQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT} worktree prune\n```\n\n- `git worktree remove` (no `--force`) refuses if the worktree is still dirty — that is a safety feature. If it refuses, return to step 2; only use `--force` after the user explicitly confirms the remaining changes are disposable.\n- `git branch -d` (lowercase) refuses to delete an unmerged branch — also a safety feature. If it refuses, the merge in step 4 did not actually land; do not reach for `-D`. Only use `git branch -D` after the user explicitly confirms they intend to discard unmerged commits.\n- If the directory lingers after `worktree remove` (rare), remove the now-empty path with `rmdir \u003CWT>` and re-run `worktree prune`.\n\n### 7. Report\n\nConcise summary: branch cleaned up, number of commits and files merged into `main`, worktree path removed, branch deleted. End with `git worktree list` so the user sees the tree is clean.\n\n## Notes\n\n- HQ non-repo edits autosave via `.claude\u002Fhooks\u002Fhq-autocommit.sh`, so most worktree work is already committed on its branch — step 2 usually finds nothing, but always check.\n- This skill does not touch `repos\u002F` worktrees. Those are normal code repos with their own push\u002FPR discipline; cleaning up an HQ orchestration-layer worktree is a different operation from landing a code branch.\n- If the worktree's branch was already merged in a prior session, steps 4–5 are no-ops and you proceed straight to cleanup — that is the normal \"just clean up the leftover\" path.\n","# Clean HQ Worktree\n\nUse this when HQ work was done in a separate git worktree and you now need to bring those commits back into the primary HQ tree's `main` branch and remove the leftover worktree. Triggers: \"clean up that worktree\", \"merge the worktree back\", \"fold the agent worktree into main\", \"reclaim the worktree\", or noticing stale entries in `.claude\u002Fworktrees\u002F` or `workspace\u002Fworktrees\u002F`.\n\nThis is HQ-internal builder work. It operates only on the local HQ git repository. HQ is local-only by hard policy (`hq-root-never-push-remote`): nothing in this workflow ever contacts a remote — no `push`, no `fetch`, no `pull`. Cross-machine state moves via `hq-sync`, never git push.\n\n## Recommended After `\u002Fhandoff`\n\nWhen HQ itself is running from a separate worktree (the active session's tree is `.claude\u002Fworktrees\u002F\u003Cname>` or `workspace\u002Fworktrees\u002F\u003Cname>` rather than the primary HQ root), the work and handoff artifacts land on that worktree's branch. Once `\u002Fhandoff` has fully completed — thread file written, `handoff.json` saved, INDEX updated, finalize commit done — run `\u002Fclean-worktree` to merge that branch back into the primary tree's `main` and remove the worktree, so the next session starts from a single clean tree on `main`.\n\nDo this **after** handoff finishes, never **during** it: handoff owns its own commit\u002Ffinalize flow, and merging a worktree mid-handoff corrupts that state. The sequence is always: `\u002Fhandoff` completes → then `\u002Fclean-worktree`.\n\n## Mental Model\n\nThe HQ root (`${HQ_ROOT}`) is itself a git repository, always checked out on `main`. Agent isolation and Codex worktrees create *linked* worktrees of that same repository:\n\n- `.claude\u002Fworktrees\u002F\u003Cname>\u002F` — typically on branch `claude\u002F\u003Cname>`\n- `workspace\u002Fworktrees\u002F\u003Cname>\u002F` — typically on branch `codex\u002F\u003Cname>`\n\nA linked worktree shares the HQ object store. Cleaning it up means: land its branch's commits into `main` in the primary tree, then tear down the worktree and delete its branch so the tree is clean again. You cannot `git checkout \u003Cbranch>` in the primary tree (the worktree holds it checked out, and the primary tree must stay on `main`) — you merge the branch *into* `main` from the primary tree instead.\n\n## Critical Guardrails\n\nThese are non-negotiable. Several are mechanically enforced.\n\n1. **Every git mutation in this workflow carries an explicit absolute `-C` anchor AND the `HQ_ALLOW_HQ_ROOT_GIT=1` prefix, in the same Bash call.** Worktree operations and merges into `main` mutate the shared HQ object store and are HQ-root-class. Bare HQ-root git mutations are mechanically blocked by `.claude\u002Fhooks\u002Fblock-hq-root-git-mutation.sh`. Form: `HQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT} \u003Ccmd>` for primary-tree ops, `HQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT}\u002F.claude\u002Fworktrees\u002F\u003Cname> \u003Ccmd>` for in-worktree ops. Never rely on an earlier `cd` — shell cwd drifts across context compaction and parallel calls.\n2. **Never push, fetch, or pull HQ.** No remote interaction anywhere in this skill. Do not ask \"should I push HQ?\" — the answer is always no.\n3. **Read-only inspection commands** (`git worktree list`, `git status`, `git log`, `git diff`, `git branch --merged`) need neither the anchor-prefix nor confirmation. Run them freely.\n4. **Destructive steps require explicit confirmation in full prose.** `git worktree remove`, `git branch -D`, and any `--force` permanently discard work. Before each, list exactly what will be lost (uncommitted files, unmerged commits) and wait for the user to confirm.\n5. **Resolve conflicts; never discard them.** If the merge conflicts, resolve file-by-file, `git add` the resolution, and commit. Never `git checkout --`\u002F`git restore` a conflicted path to make it go away, and never `--no-verify` on `main`.\n6. **One worktree at a time.** If several are reclaimable, use `AskUserQuestion` to pick one per call — never batch the decision.\n7. **Do not run during `\u002Fhandoff`.** Run it only after handoff has fully completed (see \"Recommended After \u002Fhandoff\" above).\n\n## Process\n\n### 1. Discover candidates\n\n```bash\ngit worktree list --porcelain\n```\n\nThe entry whose `branch` is `refs\u002Fheads\u002Fmain` and whose path is the HQ root is the primary tree — never a cleanup target. Every *other* entry under the HQ root (`.claude\u002Fworktrees\u002F...` or `workspace\u002Fworktrees\u002F...`) is a candidate.\n\nIf the user named a worktree or branch, resolve it to one candidate (match on directory basename or branch name). If not, present the candidates with their state and ask which one (`AskUserQuestion`, one pick). For each candidate gather, read-only:\n\n```bash\ngit -C \u003CWT> status --short | wc -l                 # dirty file count\ngit -C \u003CWT> log main..HEAD --oneline               # commits to bring back\ngit -C \u003CWT> diff --stat main...HEAD                 # change scope\n```\n\nIf a candidate has **zero commits ahead of main and no dirty files**, there is nothing to merge — go straight to step 5 (cleanup only) for that one.\n\n### 2. Capture uncommitted work in the worktree\n\nIf `git -C \u003CWT> status --short` is non-empty, the worktree has uncommitted changes that the merge would otherwise leave behind. Commit them inside the worktree before merging:\n\n```bash\nHQ_ALLOW_HQ_ROOT_GIT=1 git -C \u003CWT> add -A\nHQ_ALLOW_HQ_ROOT_GIT=1 git -C \u003CWT> commit -m \"clean-worktree: capture uncommitted work from \u003Cname>\"\n```\n\nIf `git commit` reports nothing to commit (changes were only ignored\u002Fsession files), note it and continue. Do not force-add ignored paths.\n\n### 3. Pre-merge safety check on the primary tree\n\nBefore checking status, reconcile the handoff mirror left by `\u002Fhandoff` in a\nlinked worktree. This removes `workspace\u002Fthreads\u002Fhandoff.json` and its copied\nthread only when each main-checkout file is byte-identical to the version on\nthe branch being merged. It leaves differing files in place and exits non-zero;\nsurface those files to the user and stop before merging.\n\n```bash\nbash \"${HQ_ROOT}\u002Fcore\u002Fscripts\u002Fclean-worktree-reconcile-handoff.sh\" \\\n  \"${HQ_ROOT}\" \"\u003CBRANCH>\"\n```\n\nReplace `\u003CBRANCH>` with the branch selected in step 1. Continue only after the\nscript exits successfully. It does not stage files or create commits.\n\n```bash\ngit -C ${HQ_ROOT} status --short\n```\n\nUntracked files in the primary tree that collide with incoming paths will abort the merge. HQ autocommit normally keeps the primary tree tidy; if there is unexpected dirty\u002Funtracked state that would collide, surface it to the user and resolve it (commit or move aside) before merging — do not blindly `--force` or clean.\n\n### 4. Merge the branch into main\n\nFrom the primary tree, on `main`:\n\n```bash\nHQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT} merge --no-ff \u003CBRANCH> \\\n  -m \"clean-worktree: merge \u003CBRANCH> into main\"\n```\n\n`--no-ff` keeps a visible reclaim point in history. A fast-forward (`HQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT} merge --ff-only \u003CBRANCH>`) is acceptable when `main` has not advanced and the user prefers linear history — ask only if it matters; otherwise default to `--no-ff`.\n\n**On conflict:** do not abort by default. Inspect with `git -C ${HQ_ROOT} status`, resolve each conflicted file deliberately (these are often skill\u002Fcommand\u002Fpolicy file deletions vs. edits — preserve the intended end state, do not just take one side blindly), then:\n\n```bash\nHQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT} add \u003Cresolved-paths>\nHQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT} commit --no-edit\n```\n\nIf conflicts are too entangled to resolve confidently, `HQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT} merge --abort`, report the conflicting paths to the user, and stop — do not guess.\n\n### 5. Verify the merge landed\n\n```bash\ngit -C ${HQ_ROOT} branch --merged main | grep -F \"\u003CBRANCH>\"\ngit -C ${HQ_ROOT} log --oneline -3\n```\n\n`\u003CBRANCH>` must appear in `--merged`. The reclaimed commits must be visible in `main`'s log. Do not proceed to cleanup until this is confirmed.\n\n### 6. Cleanup — destructive, confirm first\n\nBefore removing the worktree, check whether Docker Compose containers were started from it. Removing the directory out from under a running Compose project leaves orphaned containers and networks behind:\n\n```bash\ndocker ps -a --filter \"label=com.docker.compose.project.working_dir=\u003CWT>\" \\\n  --format '{{.Label \"com.docker.compose.project\"}}' | sort -u\n```\n\nIf a Compose project is clearly worktree-scoped (its project name derives from the worktree directory name), stop it before removing the worktree:\n\n```bash\ndocker compose -p \u003CPROJECT> --project-directory \u003CWT> down --remove-orphans\n```\n\nIf the project name is shared across checkouts (for example `privy`), do **not** stop it automatically. Tell the user the shared project is still running and ask before stopping it — another checkout may be using those containers.\n\nThen state explicitly to the user, in full prose, what is about to be permanently removed: the worktree directory at `\u003CWT>`, the branch `\u003CBRANCH>`, and confirm there is no uncommitted or unmerged work left (steps 2 and 5 should have ensured this). Wait for confirmation, then:\n\n```bash\nHQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT} worktree remove \u003CWT>\nHQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT} branch -d \u003CBRANCH>\nHQ_ALLOW_HQ_ROOT_GIT=1 git -C ${HQ_ROOT} worktree prune\n```\n\n- `git worktree remove` (no `--force`) refuses if the worktree is still dirty — that is a safety feature. If it refuses, return to step 2; only use `--force` after the user explicitly confirms the remaining changes are disposable.\n- `git branch -d` (lowercase) refuses to delete an unmerged branch — also a safety feature. If it refuses, the merge in step 4 did not actually land; do not reach for `-D`. Only use `git branch -D` after the user explicitly confirms they intend to discard unmerged commits.\n- If the directory lingers after `worktree remove` (rare), remove the now-empty path with `rmdir \u003CWT>` and re-run `worktree prune`.\n\n### 7. Report\n\nConcise summary: branch cleaned up, number of commits and files merged into `main`, worktree path removed, branch deleted. End with `git worktree list` so the user sees the tree is clean.\n\n## Notes\n\n- HQ non-repo edits autosave via `.claude\u002Fhooks\u002Fhq-autocommit.sh`, so most worktree work is already committed on its branch — step 2 usually finds nothing, but always check.\n- This skill does not touch `repos\u002F` worktrees. Those are normal code repos with their own push\u002FPR discipline; cleaning up an HQ orchestration-layer worktree is a different operation from landing a code branch.\n- If the worktree's branch was already merged in a prior session, steps 4–5 are no-ops and you proceed straight to cleanup — that is the normal \"just clean up the leftover\" path.\n",{"name":5,"description":7,"allowed-tools":44},"Bash(git:*), Bash(docker:*), Bash(ls:*), Bash(rmdir:*), Bash(bash \"${HQ_ROOT}\u002Fcore\u002Fscripts\u002Fclean-worktree-reconcile-handoff.sh:*), Read, AskUserQuestion","205cf61728a27ef15e9153aa38df5856fc8d82f5",".claude\u002Fskills\u002Fclean-worktree",18,"https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core","https:\u002F\u002Fgithub.com\u002Findigoai-us","https:\u002F\u002Fhqforwork.com\u002F","The AI Context Layer for Teams","2026-11-12 06:53:38",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add indigoai-us\u002Fhq-core --skill clean-worktree",{"tool":59,"command":60},"bunx","bunx skills add indigoai-us\u002Fhq-core --skill clean-worktree",{"tool":62,"command":63},"pnpm","pnpm dlx skills add indigoai-us\u002Fhq-core --skill clean-worktree","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fclean-worktree\u002FSKILL.md",true,[67],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"agents\u002Fopenai.yaml","REFERENCE","参考文档",142,"https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fclean-worktree\u002Fagents\u002Fopenai.yaml",[74,94,124,146,157,167],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":39},"01M71E4MQ04WPK1EVDS7VKJ3E8","social-graphic","Generate 1080x1080 HTML social graphics for HQ update posts.","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002Fcore\u002Fworkers\u002Fpublic\u002Fsocial-strategist\u002Fskills\u002Fsocial-graphic\u002FSKILL.md",[],[81,82,28,83,84,85,24,86,87,88,89,90,91,92,93],"social","social graphic","html","edit","write","update","generate","graphics","browser","open","agent-browser","for","posts",{"skillNo":95,"name":91,"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":107,"publishedAt":39},"01M71E4H33K4P5H5M7ENPTMFSC","Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to \"open a website\", \"fill out a form\", \"click a button\", \"take a screenshot\", \"scrape data from a page\", \"test this web app\", \"login to a site\", \"automate browser actions\", or any task requiring programmatic web interaction.","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002Fcore\u002Fworkers\u002Fpublic\u002Fqa-tester\u002Fskills\u002Fagent-browser\u002FSKILL.md",[99,104],{"categoryNo":100,"categoryName":101,"taxonomyType":102,"taxonomyTypeDesc":103},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",{"categoryNo":105,"categoryName":106,"taxonomyType":102,"taxonomyTypeDesc":103},"01JBSEEDCAT000000000000023","Skill与智能体开发",[108,89,109,110,111,112,28,113,114,115,116,117,90,118,91,119,120,121,122,123],"agent browser","click","ai agents","app","scrape","when","apps","actions","extracting","take a screenshot","testing","programmatic","browser automation","website","cli","interaction",{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":39},"01M71E4FDBD7J8Y45JJ9KMMYGN","work-mesh","Work Mesh Live — automatic presence via hq mesh daemon; context reconcile\u002Forganize; manual session task-status, blocked, and note only.","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fwork-mesh\u002FSKILL.md",[],[131,132,133,28,134,135,136,137,138,139,22,30,140,141,24,142,143,144,145],"work mesh","work","mesh","status","context","note","live","presence","automatic","organize","task","session","manual","daemon","via",{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":39},"01M71E4EGHNAAGWAPV6KGBMQ9W","review","Parity worker review skill (materialization fixture).","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002Fcore\u002Fscripts\u002Ftests\u002Ffixtures\u002Fagent-session\u002Fworker-materialization\u002Fparity-worker\u002Fskills\u002Freview\u002FSKILL.md",[],[148,153,154,155,156],"review skill","fixture","parity","worker",{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":39},"01M71E4D1FZDJPDC15DRERKX8Y","run","Run or list HQ workers (parity fixture).","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002Fcore\u002Fscripts\u002Ftests\u002Ffixtures\u002Fagent-session\u002Fskills\u002Frun\u002FSKILL.md",[],[159,164,165,155,166,154],"parity fixture","workers","list",{"skillNo":168,"name":169,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":173,"publishedAt":39},"01M71E4BF4MV5SEWZJZ4T1QPQW","handoff","Preserve session state for a follow-up agent (parity fixture).","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002Fcore\u002Fscripts\u002Ftests\u002Ffixtures\u002Fagent-session\u002Fskills\u002Fhandoff\u002FSKILL.md",[],[169,164,174,175,142,176,92,155,177,178,154],"up","preserve","session state","follow-up","state"]