[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F2XFCZS43CAV97ZMCASPK8":3,"skill-same:01M7F2XFCZS43CAV97ZMCASPK8":49},{"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":28,"commitSha":29,"skillDirectory":30,"forksCount":31,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":34,"ownerDescription":12,"updatedAt":35,"install":36,"resources":48},"01M7F2XFCZS43CAV97ZMCASPK8","git-worktree-remove",null,"Safely remove a git worktree with branch cleanup and safety checks","313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace","313DEVGRP","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F34762848?v=4","01M7F2M535Z5X8XGHYD8TDVAB3","A-RMS by 313DEVGRP","01M7F2M54CR0P3631F4YM0D014",0,"MIT","https:\u002F\u002Fgithub.com\u002F313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace\u002Fblob\u002Fmain\u002Freference\u002Fclaude-code-ultimate-guide-main\u002Fexamples\u002Fskills\u002Fgit-worktree-remove\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: git-worktree-remove\ndescription: Safely remove a git worktree with branch cleanup and safety checks\nargument-hint: \u003Cworktree_name>\neffort: low\nwhen_to_use: \"Use when removing a specific worktree by name.\"\ndisable-model-invocation: true\n---\n\n# Git worktree remove\n\nSafely remove a single git worktree with branch cleanup, merge verification, and database branch teardown.\n\n**Core principle:** Safety checks first, then clean removal of worktree + branch + DB resources.\n\n**Part of:** [Worktree Lifecycle Suite](..\u002F..\u002Fcommands\u002Fgit-worktree.md) | [`\u002Fgit-worktree`](..\u002F..\u002Fcommands\u002Fgit-worktree.md) | [`\u002Fgit-worktree-status`](..\u002F..\u002Fcommands\u002Fgit-worktree-status.md) | [`\u002Fgit-worktree-clean`](..\u002F..\u002Fcommands\u002Fgit-worktree-clean.md)\n\n## Process\n\n1. **Validate Target**: Identify worktree to remove\n2. **Safety Check**: Protect main\u002Fdevelop branches\n3. **Check Merge Status**: Warn if branch has unmerged changes\n4. **Check Uncommitted Changes**: Warn if worktree has dirty state\n5. **Remove Worktree**: `git worktree remove`\n6. **Delete Local Branch**: `git branch -d` (or `-D` with confirmation)\n7. **Delete Remote Branch**: `git push origin --delete` (with confirmation)\n8. **Database Cleanup Reminder**: Suggest DB branch deletion if applicable\n9. **Prune References**: `git worktree prune`\n\n## Safety checks\n\n### Protected branches\n\n```bash\n# Never remove worktrees for these branches (configurable)\nPROTECTED_BRANCHES=\"main master develop staging production\"\n\nif echo \"$PROTECTED_BRANCHES\" | grep -qw \"$BRANCH\"; then\n  echo \"BLOCKED: Cannot remove worktree for protected branch '$BRANCH'\"\n  echo \"Protected branches: $PROTECTED_BRANCHES\"\n  exit 1\nfi\n```\n\n### Uncommitted changes\n\n```bash\ncd \"$WORKTREE_PATH\"\nif [ -n \"$(git status --porcelain)\" ]; then\n  echo \"WARNING: Worktree has uncommitted changes:\"\n  git status --short\n  echo \"\"\n  echo \"Options:\"\n  echo \"  1. Commit changes first\"\n  echo \"  2. Force remove (--force)\"\n  echo \"  3. Cancel\"\n  # Wait for user decision\nfi\n```\n\n### Merge status\n\n```bash\n# Check if branch is merged into main\nMAIN_BRANCH=$(git symbolic-ref refs\u002Fremotes\u002Forigin\u002FHEAD | sed 's@^refs\u002Fremotes\u002Forigin\u002F@@')\n\nif git merge-base --is-ancestor \"$BRANCH\" \"$MAIN_BRANCH\" 2>\u002Fdev\u002Fnull; then\n  echo \"Branch '$BRANCH' is merged into $MAIN_BRANCH. Safe to delete.\"\n  MERGED=true\nelse\n  echo \"WARNING: Branch '$BRANCH' is NOT merged into $MAIN_BRANCH.\"\n  echo \"You may lose work if you delete this branch.\"\n  MERGED=false\nfi\n```\n\n## Removal steps\n\n```bash\n# 1. Remove the worktree\ngit worktree remove \"$WORKTREE_PATH\"\n# If dirty state and user confirmed force:\n# git worktree remove --force \"$WORKTREE_PATH\"\n\n# 2. Delete local branch\nif [ \"$MERGED\" = true ]; then\n  git branch -d \"$BRANCH\"\nelse\n  echo \"Delete unmerged branch '$BRANCH'? (requires confirmation)\"\n  # On confirmation:\n  git branch -D \"$BRANCH\"\nfi\n\n# 3. Delete remote branch (with confirmation)\nif git ls-remote --heads origin \"$BRANCH\" | grep -q \"$BRANCH\"; then\n  echo \"Delete remote branch 'origin\u002F$BRANCH'?\"\n  # On confirmation:\n  git push origin --delete \"$BRANCH\"\nfi\n\n# 4. Prune stale references\ngit worktree prune\n```\n\n## Database branch cleanup\n\n**After worktree removal, remind about associated database branches:**\n\n```bash\n# Detect database provider (same logic as \u002Fgit-worktree)\nif [ -f \".env\" ] && grep -q \"neon\" \".env\"; then\n  echo \"\"\n  echo \"DB Cleanup: neonctl branches delete $BRANCH_SLUG\"\nelif [ -f \".pscale.yml\" ]; then\n  echo \"\"\n  DB_NAME=$(grep 'database:' .pscale.yml | awk '{print $2}')\n  echo \"DB Cleanup: pscale branch delete $DB_NAME $BRANCH_SLUG\"\nelif [ -f \".env\" ] && grep -q \"postgresql\" \".env\"; then\n  echo \"\"\n  echo \"DB Cleanup: psql \\$DATABASE_URL -c \\\"DROP SCHEMA ${BRANCH_SLUG} CASCADE;\\\"\"\nfi\n```\n\n## Report format\n\n**Successful removal (merged branch):**\n\n```\nRemoved worktree: .worktrees\u002Ffeat\u002Fauth\n  Worktree directory: deleted\n  Local branch feat\u002Fauth: deleted (was merged)\n  Remote branch origin\u002Ffeat\u002Fauth: deleted\n  References: pruned\n\nDB reminder: neonctl branches delete feat-auth\n```\n\n**Removal with warnings (unmerged branch):**\n\n```\nRemoved worktree: .worktrees\u002Ffeat\u002Fexperimental\n  Worktree directory: deleted\n  Local branch feat\u002Fexperimental: deleted (was NOT merged - forced)\n  Remote branch: no remote branch found\n  References: pruned\n\nWARNING: Branch was not merged. Changes may be lost.\nLast commit: a1b2c3d \"WIP: experimental auth flow\"\n```\n\n## Flags\n\n| Flag | Effect |\n|------|--------|\n| `--force` | Skip uncommitted changes warning |\n| `--keep-branch` | Remove worktree but keep the branch |\n| `--keep-remote` | Don't delete remote branch |\n\n## Quick reference\n\n| Situation | Action |\n|-----------|--------|\n| Branch is merged | Safe delete (branch -d) |\n| Branch is unmerged | Warn + require confirmation (branch -D) |\n| Uncommitted changes | Warn + offer force\u002Fcancel |\n| Protected branch (main\u002Fdevelop) | Block removal |\n| Remote branch exists | Ask to delete remote |\n| DB branch detected | Remind with exact command |\n| Stale references | Auto-prune |\n\n## Common mistakes\n\n**Removing worktree for main\u002Fdevelop**\n- Always blocked by safety check. Reconfigure protected branches if needed.\n\n**Deleting unmerged branch without checking**\n- Always verify merge status. Unmerged branches require explicit `--force` or `-D`.\n\n**Forgetting database branch cleanup**\n- Leaves orphaned DB branches consuming resources. Command reminds automatically.\n\n**Using `rm -rf` instead of `git worktree remove`**\n- Leaves stale worktree references in `.git\u002Fworktrees\u002F`. Always use git commands.\n\n## Usage\n\n```\n\u002Fgit-worktree-remove feat\u002Fauth\n\u002Fgit-worktree-remove fix\u002Flogin-bug --force\n\u002Fgit-worktree-remove refactor\u002Fdb --keep-branch\n```\n\nBranch or worktree path: $ARGUMENTS","# Git worktree remove\n\nSafely remove a single git worktree with branch cleanup, merge verification, and database branch teardown.\n\n**Core principle:** Safety checks first, then clean removal of worktree + branch + DB resources.\n\n**Part of:** [Worktree Lifecycle Suite](..\u002F..\u002Fcommands\u002Fgit-worktree.md) | [`\u002Fgit-worktree`](..\u002F..\u002Fcommands\u002Fgit-worktree.md) | [`\u002Fgit-worktree-status`](..\u002F..\u002Fcommands\u002Fgit-worktree-status.md) | [`\u002Fgit-worktree-clean`](..\u002F..\u002Fcommands\u002Fgit-worktree-clean.md)\n\n## Process\n\n1. **Validate Target**: Identify worktree to remove\n2. **Safety Check**: Protect main\u002Fdevelop branches\n3. **Check Merge Status**: Warn if branch has unmerged changes\n4. **Check Uncommitted Changes**: Warn if worktree has dirty state\n5. **Remove Worktree**: `git worktree remove`\n6. **Delete Local Branch**: `git branch -d` (or `-D` with confirmation)\n7. **Delete Remote Branch**: `git push origin --delete` (with confirmation)\n8. **Database Cleanup Reminder**: Suggest DB branch deletion if applicable\n9. **Prune References**: `git worktree prune`\n\n## Safety checks\n\n### Protected branches\n\n```bash\n# Never remove worktrees for these branches (configurable)\nPROTECTED_BRANCHES=\"main master develop staging production\"\n\nif echo \"$PROTECTED_BRANCHES\" | grep -qw \"$BRANCH\"; then\n  echo \"BLOCKED: Cannot remove worktree for protected branch '$BRANCH'\"\n  echo \"Protected branches: $PROTECTED_BRANCHES\"\n  exit 1\nfi\n```\n\n### Uncommitted changes\n\n```bash\ncd \"$WORKTREE_PATH\"\nif [ -n \"$(git status --porcelain)\" ]; then\n  echo \"WARNING: Worktree has uncommitted changes:\"\n  git status --short\n  echo \"\"\n  echo \"Options:\"\n  echo \"  1. Commit changes first\"\n  echo \"  2. Force remove (--force)\"\n  echo \"  3. Cancel\"\n  # Wait for user decision\nfi\n```\n\n### Merge status\n\n```bash\n# Check if branch is merged into main\nMAIN_BRANCH=$(git symbolic-ref refs\u002Fremotes\u002Forigin\u002FHEAD | sed 's@^refs\u002Fremotes\u002Forigin\u002F@@')\n\nif git merge-base --is-ancestor \"$BRANCH\" \"$MAIN_BRANCH\" 2>\u002Fdev\u002Fnull; then\n  echo \"Branch '$BRANCH' is merged into $MAIN_BRANCH. Safe to delete.\"\n  MERGED=true\nelse\n  echo \"WARNING: Branch '$BRANCH' is NOT merged into $MAIN_BRANCH.\"\n  echo \"You may lose work if you delete this branch.\"\n  MERGED=false\nfi\n```\n\n## Removal steps\n\n```bash\n# 1. Remove the worktree\ngit worktree remove \"$WORKTREE_PATH\"\n# If dirty state and user confirmed force:\n# git worktree remove --force \"$WORKTREE_PATH\"\n\n# 2. Delete local branch\nif [ \"$MERGED\" = true ]; then\n  git branch -d \"$BRANCH\"\nelse\n  echo \"Delete unmerged branch '$BRANCH'? (requires confirmation)\"\n  # On confirmation:\n  git branch -D \"$BRANCH\"\nfi\n\n# 3. Delete remote branch (with confirmation)\nif git ls-remote --heads origin \"$BRANCH\" | grep -q \"$BRANCH\"; then\n  echo \"Delete remote branch 'origin\u002F$BRANCH'?\"\n  # On confirmation:\n  git push origin --delete \"$BRANCH\"\nfi\n\n# 4. Prune stale references\ngit worktree prune\n```\n\n## Database branch cleanup\n\n**After worktree removal, remind about associated database branches:**\n\n```bash\n# Detect database provider (same logic as \u002Fgit-worktree)\nif [ -f \".env\" ] && grep -q \"neon\" \".env\"; then\n  echo \"\"\n  echo \"DB Cleanup: neonctl branches delete $BRANCH_SLUG\"\nelif [ -f \".pscale.yml\" ]; then\n  echo \"\"\n  DB_NAME=$(grep 'database:' .pscale.yml | awk '{print $2}')\n  echo \"DB Cleanup: pscale branch delete $DB_NAME $BRANCH_SLUG\"\nelif [ -f \".env\" ] && grep -q \"postgresql\" \".env\"; then\n  echo \"\"\n  echo \"DB Cleanup: psql \\$DATABASE_URL -c \\\"DROP SCHEMA ${BRANCH_SLUG} CASCADE;\\\"\"\nfi\n```\n\n## Report format\n\n**Successful removal (merged branch):**\n\n```\nRemoved worktree: .worktrees\u002Ffeat\u002Fauth\n  Worktree directory: deleted\n  Local branch feat\u002Fauth: deleted (was merged)\n  Remote branch origin\u002Ffeat\u002Fauth: deleted\n  References: pruned\n\nDB reminder: neonctl branches delete feat-auth\n```\n\n**Removal with warnings (unmerged branch):**\n\n```\nRemoved worktree: .worktrees\u002Ffeat\u002Fexperimental\n  Worktree directory: deleted\n  Local branch feat\u002Fexperimental: deleted (was NOT merged - forced)\n  Remote branch: no remote branch found\n  References: pruned\n\nWARNING: Branch was not merged. Changes may be lost.\nLast commit: a1b2c3d \"WIP: experimental auth flow\"\n```\n\n## Flags\n\n| Flag | Effect |\n|------|--------|\n| `--force` | Skip uncommitted changes warning |\n| `--keep-branch` | Remove worktree but keep the branch |\n| `--keep-remote` | Don't delete remote branch |\n\n## Quick reference\n\n| Situation | Action |\n|-----------|--------|\n| Branch is merged | Safe delete (branch -d) |\n| Branch is unmerged | Warn + require confirmation (branch -D) |\n| Uncommitted changes | Warn + offer force\u002Fcancel |\n| Protected branch (main\u002Fdevelop) | Block removal |\n| Remote branch exists | Ask to delete remote |\n| DB branch detected | Remind with exact command |\n| Stale references | Auto-prune |\n\n## Common mistakes\n\n**Removing worktree for main\u002Fdevelop**\n- Always blocked by safety check. Reconfigure protected branches if needed.\n\n**Deleting unmerged branch without checking**\n- Always verify merge status. Unmerged branches require explicit `--force` or `-D`.\n\n**Forgetting database branch cleanup**\n- Leaves orphaned DB branches consuming resources. Command reminds automatically.\n\n**Using `rm -rf` instead of `git worktree remove`**\n- Leaves stale worktree references in `.git\u002Fworktrees\u002F`. Always use git commands.\n\n## Usage\n\n```\n\u002Fgit-worktree-remove feat\u002Fauth\n\u002Fgit-worktree-remove fix\u002Flogin-bug --force\n\u002Fgit-worktree-remove refactor\u002Fdb --keep-branch\n```\n\nBranch or worktree path: $ARGUMENTS",{"name":5,"effort":24,"description":7,"when_to_use":25,"argument-hint":26,"disable-model-invocation":27},"low","Use when removing a specific worktree by name.","\u003Cworktree_name>",true,"main","f2cc95bc769ca4c3a398965b767dfb41cdf8d698","reference\u002Fclaude-code-ultimate-guide-main\u002Fexamples\u002Fskills\u002Fgit-worktree-remove",2,"https:\u002F\u002Fgithub.com\u002F313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace","https:\u002F\u002Fgithub.com\u002F313DEVGRP","https:\u002F\u002Fwww.a-rms.net","2026-10-18 12:48:10",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":27},[38,41,44],{"tool":39,"command":40},"npx","npx skills add 313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace --skill git-worktree-remove",{"tool":42,"command":43},"bunx","bunx skills add 313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace --skill git-worktree-remove",{"tool":45,"command":46},"pnpm","pnpm dlx skills add 313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace --skill git-worktree-remove","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002F313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace\u002Fblob\u002Fmain\u002Freference\u002Fclaude-code-ultimate-guide-main\u002Fexamples\u002Fskills\u002Fgit-worktree-remove\u002FSKILL.md",[],[50,57,64,71,78,85],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M7F343WNVHZWWYJDD77QEJ7J","voice-refine","Transform verbose voice input into structured, token-efficient Claude prompts. Use when cleaning up voice memos, dictation output, or speech-to-text transcriptions that contain filler words, repetitions, and unstructured thoughts.","https:\u002F\u002Fgithub.com\u002F313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace\u002Fblob\u002Fmain\u002Freference\u002Fclaude-code-ultimate-guide-main\u002Fexamples\u002Fskills\u002Fvoice-refine\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M7F3417SNXASFTDA1B2X4XYZ","validate-changes","Evaluate staged changes using LLM-as-a-Judge before committing","https:\u002F\u002Fgithub.com\u002F313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace\u002Fblob\u002Fmain\u002Freference\u002Fclaude-code-ultimate-guide-main\u002Fexamples\u002Fskills\u002Fvalidate-changes\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7F33YN9QK88H2B81PVHMNG1","update-threat-db","Delegate threat-intelligence research and updates to AgentSec, then validate the guide and landing mirrors.","https:\u002F\u002Fgithub.com\u002F313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace\u002Fblob\u002Fmain\u002Freference\u002Fclaude-code-ultimate-guide-main\u002Fexamples\u002Fskills\u002Fupdate-threat-db\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7F33SXQ57G2FVFK094T4584","token-audit","Audit Claude Code configuration to measure fixed-context token overhead and produce a prioritized action plan. Use when hitting rate limits, experiencing early context compression, or after adding significant config files.","https:\u002F\u002Fgithub.com\u002F313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace\u002Fblob\u002Fmain\u002Freference\u002Fclaude-code-ultimate-guide-main\u002Fexamples\u002Fskills\u002Ftoken-audit\u002Fskill.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7F33NAWXFPHW59CF52EAGGK","talk-stage6-revision","Produces revision sheets with quick navigation by act, a master concept-to-URL table, Q&A cheat-sheet with 6-10 anticipated questions, glossary, and external resources list. Use when preparing for a talk with Q&A, creating shareable reference material for attendees, or building a safety-net glossary for live delivery.","https:\u002F\u002Fgithub.com\u002F313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace\u002Fblob\u002Fmain\u002Freference\u002Fclaude-code-ultimate-guide-main\u002Fexamples\u002Fskills\u002Ftalk-pipeline\u002Fstage-6-revision\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7F33G9V96HVZKAGZ84J4EBR","talk-stage5-script","Produces a complete 5-act pitch with speaker notes, a slide-by-slide specification, and a ready-to-paste Kimi prompt for AI slide generation. Requires validated angle and title from Stage 4. Use when you have a confirmed talk angle and need the full script, slide spec, and AI-generated presentation prompt.","https:\u002F\u002Fgithub.com\u002F313DEVGRP\u002FJava-Service-Tree-Framework-Multi-Agent-Workspace\u002Fblob\u002Fmain\u002Freference\u002Fclaude-code-ultimate-guide-main\u002Fexamples\u002Fskills\u002Ftalk-pipeline\u002Fstage-5-script\u002FSKILL.md",[],[]]