.fyi
SkillsMCPPluginsSubagents

Browse by category

DevOps & CI/CD SkillsProductivity & Workflow SkillsOther SkillsProduct & Project Management SkillsDocumentation & Knowledge SkillsCode Review & Refactor SkillsBackend & APIs SkillsAgent Meta & Communication SkillsResearch SkillsSecurity SkillsUX UI & Design SkillsTesting & QA SkillsSee all →

Every Claude Code skill, MCP server, plugin and subagent in one directory. Searchable, comparable, and one command from installed. Live stats from GitHub, npm and PyPI.

We're on Product HuntYour agent's app storeCheck it out →
Agent SkillsMCP ServersPluginsSubagentsCoding Agents
CollectionsOfficial publishersGlossaryFAQBlogSearchSavedFeedback
PrivacyTermsllms.txtSitemap

made with ♥ · © 2026 aaaa.fyi

Independent project · real data from public registries

…/superpowers/finishing-a-development-branch
home/skills/obra/superpowers/finishing-a-development-branch
obra avatar

finishing-a-development-branch

byobra· 95 skills

Installs

146k

Stars

261k

Forks

23k

Category

DevOps & CI/CD

View on GitHub

TL;DR

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work

How to install finishing-a-development-branch?

obra/superpowers/finishing-a-development-branch
$npx -y skills add obra/superpowers --skill finishing-a-development-branch

Installs into the current project.

›Prefer a prompt? Paste this to your agent

Use this skill

Run `npx skills use "https://github.com/obra/superpowers" --skill "obra/superpowers/finishing-a-development-branch"` and follow the generated skill instructions now. Read its complete output, redirecting it to a temporary file first if necessary. Resolve relative paths from the supporting-files directory it provides.

Use the whole pack

Use the skills in "https://github.com/obra/superpowers" that are relevant to the current task. Run `npx skills add "https://github.com/obra/superpowers"` and select the relevant skills, then follow their instructions.

Files · 1

View on GitHub
SKILL.md
1# Finishing a Development Branch
2 
3## Overview
4 
5**Core principle:** Verify tests → Detect environment → Present options → Execute choice → Clean up.
6 
7**Announce at start:** "I'm using the finishing-a-development-branch skill to complete this work."
8 
9## Step 1: Verify Tests
10 
11Run the project's full test suite (`npm test` / `cargo test` / `pytest` / `go test ./...`).
12 
13**If tests fail**, report the failures and stop — the menu comes after a green suite:
14 
15```
16Tests failing (<N> failures). Must fix before completing:
17 
18[Show failures]
19```
20 
21**If tests pass:** continue to Step 2.
22 
23## Step 2: Detect Environment
24 
25```bash
26GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
27GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
28# Capture now, while still inside the workspace — Step 5 changes directory
29# before cleanup (Step 6) needs this value
30WORKTREE_PATH=$(git rev-parse --show-toplevel)
31```
32 
33This determines which menu to show and how cleanup works:
34 
35| State | Menu | Cleanup |
36|-------|------|---------|
37| `GIT_DIR == GIT_COMMON` (normal repo) | Standard 3 options | No worktree to clean up |
38| `GIT_DIR != GIT_COMMON`, named branch | Standard 3 options | Provenance-based (see Step 6) |
39| `GIT_DIR != GIT_COMMON`, detached HEAD | Reduced 2 options (no merge) | Externally managed — leave in place |
40 
41## Step 3: Determine Base Branch
42 
43The base branch is whatever this work forked from — usually named in the
44plan, the conversation, or the branch's upstream. If it is not already
45known, ask: "This branch split from <your best guess> - is that correct?"
46Confirm before merging: merging into the wrong base is expensive to undo.
47 
48## Step 4: Present Options
49 
50**Normal repo and named-branch worktree — present exactly these 3 options:**
51 
52```
53Implementation complete. What would you like to do?
54 
551. Merge back to <base-branch> locally
562. Push and create a Pull Request
573. Keep the branch as-is (I'll handle it later)
58 
59Which option?
60```
61 
62**Detached HEAD — present exactly these 2 options:**
63 
64```
65Implementation complete. You're on a detached HEAD (externally managed workspace).
66 
671. Push as new branch and create a Pull Request
682. Keep as-is (I'll handle it later)
69 
70Which option?
71```
72 
73Present the menu exactly as written — concise, with every option coming
74from the list above. Discarding the work happens only in response to your
75human partner explicitly asking for it (see "If your human partner asks to
76discard the work" below). Wait for their answer; the integration decision
77is theirs.
78 
79## Step 5: Execute Choice
80 
81### Option 1: Merge Locally
82 
83```bash
84# Get main repo root for CWD safety
85MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
86cd "$MAIN_ROOT"
87 
88# Merge first — verify success before removing anything
89git checkout <base-branch>
90git pull
91git merge <feature-branch>
92 
93# Verify tests on merged result
94<test command>
95```
96 
97If tests fail on the merged result: stop, leave the worktree and branch in
98place, and investigate — nothing has been pushed, so the merge is local
99and recoverable.
100 
101Once the merged result is green: clean up the worktree (Step 6), then
102delete the branch:
103 
104```bash
105git branch -d <feature-branch>
106```
107 
108### Option 2: Push and Create PR
109 
110```bash
111git push -u origin <feature-branch>
112# From a detached HEAD, name the new branch on the remote:
113# git push origin HEAD:refs/heads/<new-branch>
114```
115 
116Then create the pull/merge request against <base-branch> with the forge's
117tooling — its CLI if one is available, or the creation URL most forges
118print when you push — following the repo's PR template and conventions if
119present, and report the URL to your human partner.
120 
121Keep the worktree — your human partner iterates on PR feedback there.
122 
123### Option 3: Keep As-Is
124 
125Report: "Keeping branch <name>. Worktree preserved at <path>."
126 
127### If your human partner asks to discard the work
128 
129This path exists only as a response to an explicit request to throw the
130work away. Confirm first:
131 
132```
133This will permanently delete:
134- Branch <name>
135- All commits: <commit-list>
136- Worktree at <path>
137 
138Type 'discard' to confirm.
139```
140 
141Wait for that exact confirmation. When it arrives:
142 
143```bash
144MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
145cd "$MAIN_ROOT"
146```
147 
148Then clean up the worktree (Step 6) and force-delete the branch:
149 
150```bash
151git branch -D <feature-branch>
152```
153 
154## Step 6: Cleanup Workspace
155 
156**Runs for Option 1 and confirmed discards.** Options 2 and 3 always
157preserve the worktree. Both callers have already changed directory to the
158main repo root — worktree removal must run from outside the worktree —
159and use the `GIT_DIR`/`GIT_COMMON`/`WORKTREE_PATH` values captured in
160Step 2, from before that directory change.
161 
162**If `GIT_DIR == GIT_COMMON`:** Normal repo, no worktree to clean up. Done.
163 
164**If `WORKTREE_PATH` is under `.worktrees/` or `worktrees/`:** Superpowers
165created this worktree — we own cleanup:
166 
167```bash
168git worktree remove "$WORKTREE_PATH"
169git worktree prune # Self-healing: clean up any stale registrations
170```
171 
172**Otherwise:** The host environment owns this workspace — leave it in
173place. If your platform provides a workspace-exit tool, use it.
174 
175## Quick Reference
176 
177| Option | Merge | Push | Keep Worktree | Cleanup Branch |
178|--------|-------|------|---------------|----------------|
179| 1. Merge locally | yes | - | - | yes |
180| 2. Create PR | - | yes | yes | - |
181| 3. Keep as-is | - | - | yes | - |
182| Discard (explicit request only) | - | - | - | yes (force) |
183 
184## Common Rationalizations
185 
186| Excuse | Reality |
187|--------|---------|
188| "Tests passed earlier this session" | Run the suite on the tree you are about to integrate. A green run only proves the tree it ran on. |
189| "They obviously want it merged" | Integration is your human partner's decision. Present the menu and wait. |
190| "They seem done with this feature — I'll offer to discard it" | The menu is complete as written. Discard happens only when your human partner asks for it in so many words. |
191| "'Yeah, get rid of it' counts as confirmation" | Only the typed word `discard` authorizes deletion. |
192| "The PR is up, so the worktree is clutter now" | PR feedback gets fixed in that worktree. It stays until the work lands. |
193| "This other worktree looks stale — I'll clean it too" | Clean up only worktrees under `.worktrees/` or `worktrees/`. Everything else belongs to the host. |
194| "The merged-result failure is probably flaky" | A failing merged result stops everything. Branch and worktree stay put while you investigate. |
195| "The base branch is obviously main" | Confirm the fork point or ask. Merging into the wrong base is expensive to undo. |
196| "The push was rejected — force-push will fix it" | A rejected push means the remote moved. Investigate; force-push only on your human partner's explicit request. |

Security

Passed

  • Gen Agent Trust Hubpass
  • Socketpass
  • Snykpass
  • Runlayerpass
  • ZeroLeakspass

Preview

obra/superpowersobra/superpowers

$ npx -y skills add obra/superpowers --skill finishing-a-development-branch

▸ installing to .claude/skills…

✓ finishing-a-development-branch ready

Repoobra/superpowers
TypeSkills
CategoryDevOps & CI/CD
ForDeveloperArchitect
UpdatedJul 2026
License—
First seenJul 26, 2026

Tags

Skill

Related

6 picks
Type
  1. mattpocock avatarsetup-matt-pocock-skillsConfigure this repo for the engineering skills — set up its issue tracker, triage label vocabulary, and domain doc layout.SkillsJul 2026495k189k
  2. microsoft avatarmicrosoft-foundryDeploy, evaluate, fine-tune, and manage Foundry agents end-to-end with azd: hosted agent scaffold/run/deploy, prompt agent create, batch eval, continuous eval,…SkillsJul 2026490k1.3k
  3. microsoft avatarazure-deployExecute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files.SkillsJul 2026485k1.3k
  4. microsoft avatarazure-preparePrepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd)…SkillsJul 2026485k1.3k
  5. microsoft avatarazure-validatePre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity…SkillsJul 2026484k1.3k
  6. microsoft avatarazure-aigatewayConfigure Azure API Management as an AI Gateway for AI models, MCP tools, and agents.SkillsJul 2026484k1.3k