[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-obra-superpowers-skills-finishing-a-development-branch":3},{"error":4,"detail":5,"metadata":24,"markdownContent":25,"rawMarkdown":21},false,{"repo_full_name":6,"owner":7,"repo_name":8,"repo_forks":9,"skill_path":10,"repo_stars":11,"name":12,"category_id":13,"description":14,"file_tree":15,"skill_md_content":21,"skill_id":22,"skill_key":23},"obra/superpowers","obra","superpowers",7683,"skills/finishing-a-development-branch",96793,"finishing-a-development-branch",1,"Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup",[16],{"name":17,"path":18,"size":19,"type":20},"SKILL.md","skills/finishing-a-development-branch/SKILL.md",4250,"file","---\nname: finishing-a-development-branch\ndescription: Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup\n---\n\n# Finishing a Development Branch\n\n## Overview\n\nGuide completion of development work by presenting clear options and handling chosen workflow.\n\n**Core principle:** Verify tests → Present options → Execute choice → Clean up.\n\n**Announce at start:** \"I'm using the finishing-a-development-branch skill to complete this work.\"\n\n## The Process\n\n### Step 1: Verify Tests\n\n**Before presenting options, verify tests pass:**\n\n```bash\n# Run project's test suite\nnpm test / cargo test / pytest / go test ./...\n```\n\n**If tests fail:**\n```\nTests failing (\u003CN> failures). Must fix before completing:\n\n[Show failures]\n\nCannot proceed with merge/PR until tests pass.\n```\n\nStop. Don't proceed to Step 2.\n\n**If tests pass:** Continue to Step 2.\n\n### Step 2: Determine Base Branch\n\n```bash\n# Try common base branches\ngit merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null\n```\n\nOr ask: \"This branch split from main - is that correct?\"\n\n### Step 3: Present Options\n\nPresent exactly these 4 options:\n\n```\nImplementation complete. What would you like to do?\n\n1. Merge back to \u003Cbase-branch> locally\n2. Push and create a Pull Request\n3. Keep the branch as-is (I'll handle it later)\n4. Discard this work\n\nWhich option?\n```\n\n**Don't add explanation** - keep options concise.\n\n### Step 4: Execute Choice\n\n#### Option 1: Merge Locally\n\n```bash\n# Switch to base branch\ngit checkout \u003Cbase-branch>\n\n# Pull latest\ngit pull\n\n# Merge feature branch\ngit merge \u003Cfeature-branch>\n\n# Verify tests on merged result\n\u003Ctest command>\n\n# If tests pass\ngit branch -d \u003Cfeature-branch>\n```\n\nThen: Cleanup worktree (Step 5)\n\n#### Option 2: Push and Create PR\n\n```bash\n# Push branch\ngit push -u origin \u003Cfeature-branch>\n\n# Create PR\ngh pr create --title \"\u003Ctitle>\" --body \"$(cat \u003C\u003C'EOF'\n## Summary\n\u003C2-3 bullets of what changed>\n\n## Test Plan\n- [ ] \u003Cverification steps>\nEOF\n)\"\n```\n\nThen: Cleanup worktree (Step 5)\n\n#### Option 3: Keep As-Is\n\nReport: \"Keeping branch \u003Cname>. Worktree preserved at \u003Cpath>.\"\n\n**Don't cleanup worktree.**\n\n#### Option 4: Discard\n\n**Confirm first:**\n```\nThis will permanently delete:\n- Branch \u003Cname>\n- All commits: \u003Ccommit-list>\n- Worktree at \u003Cpath>\n\nType 'discard' to confirm.\n```\n\nWait for exact confirmation.\n\nIf confirmed:\n```bash\ngit checkout \u003Cbase-branch>\ngit branch -D \u003Cfeature-branch>\n```\n\nThen: Cleanup worktree (Step 5)\n\n### Step 5: Cleanup Worktree\n\n**For Options 1, 2, 4:**\n\nCheck if in worktree:\n```bash\ngit worktree list | grep $(git branch --show-current)\n```\n\nIf yes:\n```bash\ngit worktree remove \u003Cworktree-path>\n```\n\n**For Option 3:** Keep worktree.\n\n## Quick Reference\n\n| Option | Merge | Push | Keep Worktree | Cleanup Branch |\n|--------|-------|------|---------------|----------------|\n| 1. Merge locally | ✓ | - | - | ✓ |\n| 2. Create PR | - | ✓ | ✓ | - |\n| 3. Keep as-is | - | - | ✓ | - |\n| 4. Discard | - | - | - | ✓ (force) |\n\n## Common Mistakes\n\n**Skipping test verification**\n- **Problem:** Merge broken code, create failing PR\n- **Fix:** Always verify tests before offering options\n\n**Open-ended questions**\n- **Problem:** \"What should I do next?\" → ambiguous\n- **Fix:** Present exactly 4 structured options\n\n**Automatic worktree cleanup**\n- **Problem:** Remove worktree when might need it (Option 2, 3)\n- **Fix:** Only cleanup for Options 1 and 4\n\n**No confirmation for discard**\n- **Problem:** Accidentally delete work\n- **Fix:** Require typed \"discard\" confirmation\n\n## Red Flags\n\n**Never:**\n- Proceed with failing tests\n- Merge without verifying tests on result\n- Delete work without confirmation\n- Force-push without explicit request\n\n**Always:**\n- Verify tests before offering options\n- Present exactly 4 options\n- Get typed confirmation for Option 4\n- Clean up worktree for Options 1 & 4 only\n\n## Integration\n\n**Called by:**\n- **subagent-driven-development** (Step 7) - After all tasks complete\n- **executing-plans** (Step 5) - After all batches complete\n\n**Pairs with:**\n- **using-git-worktrees** - Cleans up worktree created by that skill\n","eb573847-8570-5c49-bd48-40c04e3ec3fa","obra-superpowers-skills-finishing-a-development-branch",{"name":12,"description":14},"\u003Ch1>Finishing a Development Branch\u003C/h1>\n\u003Ch2>Overview\u003C/h2>\n\u003Cp>Guide completion of development work by presenting clear options and handling chosen workflow.\u003C/p>\n\u003Cp>\u003Cstrong>Core principle:\u003C/strong> Verify tests → Present options → Execute choice → Clean up.\u003C/p>\n\u003Cp>\u003Cstrong>Announce at start:\u003C/strong> &quot;I&#39;m using the finishing-a-development-branch skill to complete this work.&quot;\u003C/p>\n\u003Ch2>The Process\u003C/h2>\n\u003Ch3>Step 1: Verify Tests\u003C/h3>\n\u003Cp>\u003Cstrong>Before presenting options, verify tests pass:\u003C/strong>\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-comment\"># Run project&#x27;s test suite\u003C/span>\nnpm \u003Cspan class=\"hljs-built_in\">test\u003C/span> / cargo \u003Cspan class=\"hljs-built_in\">test\u003C/span> / pytest / go \u003Cspan class=\"hljs-built_in\">test\u003C/span> ./...\u003C/code>\u003C/pre>\u003C/div>\u003Cp>\u003Cstrong>If tests fail:\u003C/strong>\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cpre>\u003Ccode class=\"hljs language-plaintext\">Tests failing (&lt;N&gt; failures). Must fix before completing:\n\n[Show failures]\n\nCannot proceed with merge/PR until tests pass.\u003C/code>\u003C/pre>\u003C/div>\u003Cp>Stop. Don&#39;t proceed to Step 2.\u003C/p>\n\u003Cp>\u003Cstrong>If tests pass:\u003C/strong> Continue to Step 2.\u003C/p>\n\u003Ch3>Step 2: Determine Base Branch\u003C/h3>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-comment\"># Try common base branches\u003C/span>\ngit merge-base HEAD main 2&gt;/dev/null || git merge-base HEAD master 2&gt;/dev/null\u003C/code>\u003C/pre>\u003C/div>\u003Cp>Or ask: &quot;This branch split from main - is that correct?&quot;\u003C/p>\n\u003Ch3>Step 3: Present Options\u003C/h3>\n\u003Cp>Present exactly these 4 options:\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cpre>\u003Ccode class=\"hljs language-plaintext\">Implementation complete. What would you like to do?\n\n1. Merge back to &lt;base-branch&gt; locally\n2. Push and create a Pull Request\n3. Keep the branch as-is (I&#x27;ll handle it later)\n4. Discard this work\n\nWhich option?\u003C/code>\u003C/pre>\u003C/div>\u003Cp>\u003Cstrong>Don&#39;t add explanation\u003C/strong> - keep options concise.\u003C/p>\n\u003Ch3>Step 4: Execute Choice\u003C/h3>\n\u003Ch4>Option 1: Merge Locally\u003C/h4>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-comment\"># Switch to base branch\u003C/span>\ngit checkout &lt;base-branch&gt;\n\n\u003Cspan class=\"hljs-comment\"># Pull latest\u003C/span>\ngit pull\n\n\u003Cspan class=\"hljs-comment\"># Merge feature branch\u003C/span>\ngit merge &lt;feature-branch&gt;\n\n\u003Cspan class=\"hljs-comment\"># Verify tests on merged result\u003C/span>\n&lt;\u003Cspan class=\"hljs-built_in\">test\u003C/span> \u003Cspan class=\"hljs-built_in\">command\u003C/span>&gt;\n\n\u003Cspan class=\"hljs-comment\"># If tests pass\u003C/span>\ngit branch -d &lt;feature-branch&gt;\u003C/code>\u003C/pre>\u003C/div>\u003Cp>Then: Cleanup worktree (Step 5)\u003C/p>\n\u003Ch4>Option 2: Push and Create PR\u003C/h4>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-comment\"># Push branch\u003C/span>\ngit push -u origin &lt;feature-branch&gt;\n\n\u003Cspan class=\"hljs-comment\"># Create PR\u003C/span>\ngh \u003Cspan class=\"hljs-built_in\">pr\u003C/span> create --title \u003Cspan class=\"hljs-string\">&quot;&lt;title&gt;&quot;\u003C/span> --body \u003Cspan class=\"hljs-string\">&quot;\u003Cspan class=\"hljs-subst\">$(cat &lt;&lt;&#x27;EOF&#x27;\n## Summary\n&lt;2-3 bullets of what changed&gt;\n\n## Test Plan\n- [ ] &lt;verification steps&gt;\nEOF\n)\u003C/span>&quot;\u003C/span>\u003C/code>\u003C/pre>\u003C/div>\u003Cp>Then: Cleanup worktree (Step 5)\u003C/p>\n\u003Ch4>Option 3: Keep As-Is\u003C/h4>\n\u003Cp>Report: &quot;Keeping branch \u003Cname>. Worktree preserved at \u003Cpath>.&quot;\u003C/p>\n\u003Cp>\u003Cstrong>Don&#39;t cleanup worktree.\u003C/strong>\u003C/p>\n\u003Ch4>Option 4: Discard\u003C/h4>\n\u003Cp>\u003Cstrong>Confirm first:\u003C/strong>\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cpre>\u003Ccode class=\"hljs language-plaintext\">This will permanently delete:\n- Branch &lt;name&gt;\n- All commits: &lt;commit-list&gt;\n- Worktree at &lt;path&gt;\n\nType &#x27;discard&#x27; to confirm.\u003C/code>\u003C/pre>\u003C/div>\u003Cp>Wait for exact confirmation.\u003C/p>\n\u003Cp>If confirmed:\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">git checkout &lt;base-branch&gt;\ngit branch -D &lt;feature-branch&gt;\u003C/code>\u003C/pre>\u003C/div>\u003Cp>Then: Cleanup worktree (Step 5)\u003C/p>\n\u003Ch3>Step 5: Cleanup Worktree\u003C/h3>\n\u003Cp>\u003Cstrong>For Options 1, 2, 4:\u003C/strong>\u003C/p>\n\u003Cp>Check if in worktree:\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">git worktree list | grep $(git branch --show-current)\u003C/code>\u003C/pre>\u003C/div>\u003Cp>If yes:\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">git worktree remove &lt;worktree-path&gt;\u003C/code>\u003C/pre>\u003C/div>\u003Cp>\u003Cstrong>For Option 3:\u003C/strong> Keep worktree.\u003C/p>\n\u003Ch2>Quick Reference\u003C/h2>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Option\u003C/th>\n\u003Cth>Merge\u003C/th>\n\u003Cth>Push\u003C/th>\n\u003Cth>Keep Worktree\u003C/th>\n\u003Cth>Cleanup Branch\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>1. Merge locally\u003C/td>\n\u003Ctd>✓\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>✓\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>2. Create PR\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>✓\u003C/td>\n\u003Ctd>✓\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>3. Keep as-is\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>✓\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>4. Discard\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>-\u003C/td>\n\u003Ctd>✓ (force)\u003C/td>\n\u003C/tr>\n\u003C/tbody>\u003C/table>\n\u003Ch2>Common Mistakes\u003C/h2>\n\u003Cp>\u003Cstrong>Skipping test verification\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>\u003Cstrong>Problem:\u003C/strong> Merge broken code, create failing PR\u003C/li>\n\u003Cli>\u003Cstrong>Fix:\u003C/strong> Always verify tests before offering options\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>Open-ended questions\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>\u003Cstrong>Problem:\u003C/strong> &quot;What should I do next?&quot; → ambiguous\u003C/li>\n\u003Cli>\u003Cstrong>Fix:\u003C/strong> Present exactly 4 structured options\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>Automatic worktree cleanup\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>\u003Cstrong>Problem:\u003C/strong> Remove worktree when might need it (Option 2, 3)\u003C/li>\n\u003Cli>\u003Cstrong>Fix:\u003C/strong> Only cleanup for Options 1 and 4\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>No confirmation for discard\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>\u003Cstrong>Problem:\u003C/strong> Accidentally delete work\u003C/li>\n\u003Cli>\u003Cstrong>Fix:\u003C/strong> Require typed &quot;discard&quot; confirmation\u003C/li>\n\u003C/ul>\n\u003Ch2>Red Flags\u003C/h2>\n\u003Cp>\u003Cstrong>Never:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Proceed with failing tests\u003C/li>\n\u003Cli>Merge without verifying tests on result\u003C/li>\n\u003Cli>Delete work without confirmation\u003C/li>\n\u003Cli>Force-push without explicit request\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>Always:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Verify tests before offering options\u003C/li>\n\u003Cli>Present exactly 4 options\u003C/li>\n\u003Cli>Get typed confirmation for Option 4\u003C/li>\n\u003Cli>Clean up worktree for Options 1 &amp; 4 only\u003C/li>\n\u003C/ul>\n\u003Ch2>Integration\u003C/h2>\n\u003Cp>\u003Cstrong>Called by:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>\u003Cstrong>subagent-driven-development\u003C/strong> (Step 7) - After all tasks complete\u003C/li>\n\u003Cli>\u003Cstrong>executing-plans\u003C/strong> (Step 5) - After all batches complete\u003C/li>\n\u003C/ul>\n\u003Cp>\u003Cstrong>Pairs with:\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>\u003Cstrong>using-git-worktrees\u003C/strong> - Cleans up worktree created by that skill\u003C/li>\n\u003C/ul>\n"]