skills/codingcossack/finishing-a-development-branch/SKILL.md
Git branch completion workflow. Use when implementation is complete, tests pass, and a feature branch needs to be integrated via merge, pull request, or cleanup.
npx skillsauth add aiskillstore/marketplace finishing-a-development-branchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Determine test runner from project structure:
package.json → npm test or yarn testCargo.toml → cargo testpyproject.toml / setup.py → pytestgo.mod → go test ./...Makefile with test target → make testRun tests. If any fail, report ⊘ BLOCKED:TESTS with failure count and stop. Do not proceed to Step 2.
Find the branch this feature diverged from:
# Check which branch has the closest merge-base
for candidate in main master develop; do
if git rev-parse --verify "$candidate" >/dev/null 2>&1; then
MERGE_BASE=$(git merge-base HEAD "$candidate" 2>/dev/null)
if [ -n "$MERGE_BASE" ]; then
echo "Candidate: $candidate (merge-base: $MERGE_BASE)"
fi
fi
done
Select the candidate with the most recent merge-base (closest ancestor). If multiple branches share the same merge-base or detection is ambiguous, ask: "This branch could target main or develop. Which should it merge into?"
Store the result - subsequent steps reference <base-branch> meaning this determined value.
Present exactly these 4 options:
Implementation complete. What would you like to do?
1. Merge back to <base-branch> locally
2. Push and create a Pull Request
3. Keep the branch as-is (I'll handle it later)
4. Discard this work
Which option?
git checkout <base-branch>
git pull
git merge <feature-branch>
If merge conflicts:
⊘ BLOCKED:CONFLICTS
Merge conflicts in:
- <conflicted files>
Cannot auto-resolve. User must:
1. Resolve conflicts manually
2. Run tests
3. Re-run this workflow
Stop. Do not proceed.
If merge succeeds:
# Verify tests on merged result
<test command>
# If tests pass, delete feature branch
git branch -d <feature-branch>
Then: Cleanup worktree (Step 5). Report ✓ MERGED.
Verify gh CLI is available:
if ! command -v gh &>/dev/null; then
echo "gh CLI not installed. Install from https://cli.github.com/ or push manually and create PR via web."
exit 1
fi
gh auth status || echo "gh not authenticated. Run: gh auth login"
Extract title from first commit on branch (original intent):
MERGE_BASE=$(git merge-base HEAD <base-branch>)
TITLE=$(git log --reverse --format=%s "$MERGE_BASE"..HEAD | head -1)
git push -u origin <feature-branch>
gh pr create --title "$TITLE" --body "$(cat <<'EOF'
## Summary
<2-3 bullets of what changed>
## Test Plan
- [ ] <verification steps>
EOF
)"
Report ✓ PR_CREATED with PR URL. Keep worktree intact for continued work during review.
Report ✓ PRESERVED with branch name and worktree path.
Do not cleanup worktree.
Confirm first:
This will permanently delete:
- Branch <name>
- All commits: <commit-list>
- Worktree at <path>
Type 'discard' to confirm.
Wait for exact confirmation. If not received, abort.
If confirmed:
git checkout <base-branch>
git branch -D <feature-branch>
Then: Cleanup worktree (Step 5). Report ✓ DISCARDED.
For Options 1 and 4 only:
# Check if currently in a worktree (not main repo)
if [ "$(git rev-parse --git-common-dir)" != "$(git rev-parse --git-dir)" ]; then
# Get worktree root (handles invocation from subdirectory)
WORKTREE_ROOT=$(git rev-parse --show-toplevel)
cd "$(git rev-parse --git-common-dir)/.."
git worktree remove "$WORKTREE_ROOT"
fi
For Options 2 and 3: Keep worktree intact.
| Option | Merge | Push | Keep Worktree | Cleanup Branch | |--------|-------|------|---------------|----------------| | 1. Merge locally | ✓ | - | - | ✓ | | 2. Create PR | - | ✓ | ✓ | - | | 3. Keep as-is | - | - | ✓ | - | | 4. Discard | - | - | - | ✓ (force) |
On completion, report exactly one:
| State | Output | Meaning |
|-------|--------|---------|
| ✓ MERGED | Branch merged to <base>, worktree cleaned | Option 1 success |
| ✓ PR_CREATED | PR #N at URL | Option 2 success |
| ✓ PRESERVED | Branch kept at path | Option 3 success |
| ✓ DISCARDED | Branch deleted, worktree cleaned | Option 4 success |
| ⊘ BLOCKED:TESTS | N test failures | Cannot proceed |
| ⊘ BLOCKED:CONFLICTS | Merge conflict in files | Cannot proceed |
Blocking conditions (stop immediately):
⊘ BLOCKED:TESTS⊘ BLOCKED:CONFLICTSMandatory confirmations:
Cleanup rules:
Never:
Called by:
Pairs with:
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.