merge
Merge all open pull requests, close linked issues, delete feature branches, and clean up local and remote refs. Use when completing features, merging PRs after review, or finalizing a release cycle.
What this skill does
# Merge - Merge PRs, Close Issues, Clean Up Branches
Merge all open PRs and close related issues. Requires GitHub MCP to be configured.
## Phase 0: Get Repository Info
0. **Get GitHub owner/repo** (prefer cached from SessionStart):
- First check SessionStart hook output for cached `github.owner` and `github.repo`
- If cached values available, use them (faster, already parsed)
- If not cached, parse from git remote:
```bash
REMOTE_URL=$(git remote get-url origin 2>/dev/null)
# SSH: [email protected]:owner/repo.git -> owner, repo
# HTTPS: https://github.com/owner/repo.git -> owner, repo
```
Use the owner/repo for ALL GitHub API calls in this command.
## Phase 1: Gather State
1. Gather state (using parsed owner/repo):
- List all open PRs for this repository (includes both feature and fix PRs)
- List all open issues with "feature" or "bugfix" labels
- Read `.claude-harness/features/active.json`:
- Check `features` array for linked issue/PR numbers
- Check `fixes` array for linked issue/PR numbers
## Phase 2: Build Dependency Graph
2. Build dependency graph:
- For each PR, check if its base branch is another feature branch (not main/master)
- Order PRs so that dependent PRs are merged after their base PRs
- If PR A base is PR B head branch, merge B first
## Phase 3: Pre-merge Validation
3. Pre-merge validation for each PR:
- CI status passes
- No merge conflicts
- Has required approvals (if any)
- Report any PRs that cannot be merged and why
## Phase 4: Execute Merges
4. Execute merges in dependency order:
- Merge the PR (squash merge preferred)
- Wait for merge to complete
- Find and close any linked issues:
- Check PR body for "Closes #XX" or "Fixes #XX"
- Check `.claude-harness/features/active.json` for linked issues
- For fix PRs:
- Close the fix issue
- Add comment to original feature issue: "Related fix merged: #{fix-issue} - {description}"
- Delete the source branch (both remote and local):
- Remote: `git push origin --delete {branch}`
- Local: `git branch -D {branch}` (if exists)
- Update `.claude-harness/features/active.json`:
- For features: Set status="passing" in features array
- For fixes: Set status="passing" in fixes array
## Phase 5: Cleanup
5. Cleanup:
- Prune local branches: `git fetch --prune`
- Delete local feature branches that were merged
- Verify remote branches were deleted (list any that remain)
- Switch to main/master branch
- Pull latest: `git pull`
## Phase 6: Report Summary
6. Report summary:
- PRs merged (with commit hashes)
- Issues closed
- Branches deleted (local and remote)
- Any failures or skipped items
**Note**: Version tagging and GitHub releases should be managed separately using git commands or GitHub's release UI directly.
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.