merge
Merge the current feature branch into main and (optionally) clean up the branch and worktree. Prefers fast-forward (--ff-only) for linear history; falls back to a merge commit (--no-ff) when the branch has diverged or the user wants the merge commit preserved. Interactive cleanup at the end. USE WHEN asked to "merge to main", "merge and cleanup", "integrate the feature branch", or "finish this branch" — i.e. a direct local merge with no review gate. For PR-based delivery (push → open a PR → link a work item → clean up after merge), use the `ship` skill instead.
What this skill does
# Merge
Combine `merge-and-cleanup` and `merge-to-main` into one flow. Default to fast-forward; preserve a merge commit when fast-forward isn't possible or the user asks for one. Always interactive about deleting branches and worktrees.
## Flow
1. **Refuse if already on main.** If `git rev-parse --abbrev-ref HEAD` returns `main` (or `master`), stop and report — there's nothing to merge.
2. **Working tree must be clean.** If there are uncommitted changes, ask the user whether to commit, stash, or abort. Do not silently stash.
3. **Capture the feature branch name** — `FEATURE=$(git rev-parse --abbrev-ref HEAD)`.
4. **Sync main.**
- `git checkout main`
- `git pull --ff-only origin main`
5. **Try fast-forward merge first.**
- `git merge --ff-only "$FEATURE"`
- If it succeeds, history is linear — done with the merge step.
- If it fails (branch diverged), proceed to step 6.
6. **Fall back to merge commit** — `git merge --no-ff "$FEATURE"`.
- If there are conflicts, stop and report. Do not auto-resolve.
- Write a meaningful merge-commit message; do not accept the default if it's just "Merge branch …".
7. **Push** — `git push origin main`.
8. **Interactive cleanup.** Ask the user: "Delete `$FEATURE` (local + remote) and any associated worktree?"
- On **yes**:
- If a worktree exists for `$FEATURE` (`git worktree list | grep -F "$FEATURE"`), **`cd` to the main repo dir first**, then `git worktree remove <path>`.
- `git branch -d "$FEATURE"` (use `-D` only if user explicitly confirms — `-d` refuses if branch isn't merged, which is the safety we want).
- `git push origin --delete "$FEATURE"` (ignore failure if branch was never pushed).
- On **no**: leave everything in place.
9. **Report final status** — commit hash on main, whether branch was deleted, whether a worktree was removed.
## Notes
- **Prefer ff-only.** Linear history is easier to reason about. Only fall back to a merge commit when the branch genuinely diverged.
- **Never `--no-verify`.** If a pre-push hook fails, fix the underlying issue; don't bypass.
- **Worktree-first cleanup.** If the feature branch was developed in a worktree, you cannot delete the branch from inside the worktree. Always `cd` to the main repo working directory first.
- **Conflict policy.** This skill does not auto-resolve conflicts. If `git merge` reports a conflict, stop and surface it to the user — they decide.
## Gotchas
- `git pull --ff-only` on main fails if main has diverged locally (e.g., you committed directly to main). That's a different problem — surface it; don't paper over with `--rebase`.
- `git branch -d` refuses on unmerged branches. That refusal is your safety net — never automatically promote to `-D`.
- `git push origin --delete` exits non-zero if the remote branch doesn't exist. That's fine in this flow (branch was local-only) — log and continue.
- macOS case-insensitive filesystems can mask case-only conflicts; if the feature branch differs only in case from another branch, `git checkout` will surprise you.
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.