Agent skill

Merge Strategy

by marcus in marcus/sidecar

Git merge strategies, conflict resolution approaches, merge vs rebase recommendations, and branch integration patterns in sidecar.

MITAuto-check passedDevelopment

Install Merge Strategy

skills CLI
$ npx skills add marcus/sidecar --skill merge-strategy -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install marcus/sidecar merge-strategy --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/marcus/sidecar.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/merge-strategy .claude/skills/merge-strategy && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
merge-strategy
GitHub stars
1.1k
Token cost
~2.1k tokens
SKILL.md length
507 words
Files
1
Skills in repo
19
Repo updated
First seen
Licence
MIT

At a glance

Git merge strategies, conflict resolution approaches, merge vs rebase recommendations, and branch integration patterns in sidecar.

  • Works in 4 steps: Push branch to remote → Create PR via gh pr create → Wait for PR merge (polling) → …
  • Working on git merge features
  • SKILL.md covers Current Implementation, Known Issues and Gaps, Recommended Configuration Schema and Implementation Priorities, plus 3 more sections
  • Calls git and gh

What it does

Merge Strategy is an agent skill from marcus/sidecar. Git merge strategies, conflict resolution approaches, merge vs rebase recommendations, and branch integration patterns in sidecar. Covers pull strategy menu, direct merge workflow, squash merge, commit message templates, configurable defaults, and protected branches. Use when working on git merge features or making decisions about merge strategies.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Git workflow, Commit messages and Third-party API integration. It works with Git. The repository describes itself as: Use sidecar next to CLI agents for diffs, file trees, conversation history, and task management with td. The licence is MIT.

When your agent uses it

  • Working on git merge features
  • Making decisions about merge strategies

Example prompts

  • “/merge-strategy”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Push branch to remote
  2. Create PR via gh pr create
  3. Wait for PR merge (polling)
  4. Cleanup: delete worktree, branches, pull base

What it can do on your machine

Read from SKILL.md and the folder at commit 3792a4e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Merge Strategy loads about 2.1k tokens when it runs. Until then it costs about 91 tokens; SKILL.md has 507 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~91
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from marcus/sidecar at commit 3792a4e, republished under its MIT licence (© marcus). 507 words, ~2,088 tokens.

Download SKILL.mdSave it as .claude/skills/merge-strategy/SKILL.md (or your agent's skills folder).
name
merge-strategy
description
Git merge strategies, conflict resolution approaches, merge vs rebase recommendations, and branch integration patterns in sidecar. Covers pull strategy menu, direct merge workflow, squash merge, commit message templates, configurable defaults, and protected branches. Use when working on git merge features or making decisions about merge strategies.

Merge Strategy Configuration

This skill covers sidecar's git merge and pull operations, their current implementation, known gaps, and recommended configuration patterns.

Current Implementation

Git Status Plugin Pull Strategies

Location: internal/plugins/gitstatus/pull_menu.go, internal/plugins/gitstatus/remote.go

The git-status plugin offers four pull strategies via a modal menu:

StrategyCommandUse Case
Pull (merge)git pullCreates merge commit, preserves branch topology
Pull (rebase)git pull --rebaseReplays local commits on top of upstream
Pull (fast-forward only)git pull --ff-onlyOnly pulls if fast-forward possible (safest)
Pull (rebase + autostash)git pull --rebase --autostashRebase with automatic stash/unstash
Workspace Plugin Merge Workflows

Location: internal/plugins/workspace/merge.go

PR Workflow:

  1. Push branch to remote
  2. Create PR via gh pr create
  3. Wait for PR merge (polling)
  4. Cleanup: delete worktree, branches, pull base

Direct Merge (No PR) at merge.go:430-498:

1. git fetch origin <baseBranch>
2. git checkout <baseBranch>
3. git pull origin <baseBranch>
4. git merge <branch> --no-ff -m "Merge branch '<branch>'"  // Hardcoded --no-ff
5. git push origin <baseBranch>

Post-Merge Pull at merge.go:500-551:

  • When on base branch: git pull --ff-only origin <branch> (hardcoded)
  • Otherwise: git fetch + git update-ref

Divergence Resolution at merge.go:644-705:

  • Rebase option: git pull --rebase origin <branch>
  • Merge option: git pull origin <branch>

Known Issues and Gaps

  1. No configurable defaults -- users must select strategy every time
  2. Limited merge strategies -- direct merge hardcoded to --no-ff, missing --ff, --ff-only, --squash, rebase-based integration
  3. No squash merge support -- no clean-history option for main branch
  4. Hardcoded commit messages -- fmt.Sprintf("Merge branch '%s'", branch), no templates
  5. Missing safety options -- no GPG signing, no --verify-signatures, no --force-with-lease
  6. Autostash inconsistency -- available for pull-rebase but not post-merge pull or divergence resolution
  7. No upstream tracking config -- remote always origin, no configurable tracking
  8. Limited conflict recovery -- only abort or dismiss, no continue/skip rebase
  9. No interactive rebase -- no squash/reorder/edit before merge

Add to internal/config/config.go:

go
type GitConfig struct {
    DefaultPullStrategy  string   `json:"defaultPullStrategy,omitempty"`  // "merge", "rebase", "ff-only", "autostash"
    DefaultMergeStrategy string   `json:"defaultMergeStrategy,omitempty"` // "no-ff", "ff", "ff-only", "squash", "rebase"
    MergeCommitTemplate  string   `json:"mergeCommitTemplate,omitempty"`  // Go template: .Branch, .BaseBranch, .PRTitle, .PRNumber
    SignCommits          bool     `json:"signCommits,omitempty"`
    SignMerges           bool     `json:"signMerges,omitempty"`
    AutostashOnPull      bool     `json:"autostashOnPull,omitempty"`
    DefaultRemote        string   `json:"defaultRemote,omitempty"`        // Default: "origin"
    SetUpstreamOnPush    bool     `json:"setUpstreamOnPush,omitempty"`
    ProtectedBranches    []string `json:"protectedBranches,omitempty"`    // e.g. ["main", "master", "release/*"]
    PreMergeChecks       []string `json:"preMergeChecks,omitempty"`       // e.g. ["go test ./..."]
}

Add to PluginsConfig:

go
type PluginsConfig struct {
    Git       GitConfig             `json:"git"`
    GitStatus GitStatusPluginConfig `json:"git-status"`
    // ... existing fields
}

Example user config (~/.config/sidecar/config.json):

json
{
  "plugins": {
    "git": {
      "defaultPullStrategy": "rebase",
      "defaultMergeStrategy": "squash",
      "mergeCommitTemplate": "Merge {{.Branch}} into {{.BaseBranch}}",
      "signCommits": true,
      "autostashOnPull": true,
      "protectedBranches": ["main", "production"]
    }
  }
}

Implementation Priorities

Priority 1: Default Pull Strategy

Files: internal/config/config.go, internal/plugins/gitstatus/pull_menu.go, internal/plugins/gitstatus/update_handlers.go

  • If defaultPullStrategy is set, execute directly (skip menu)
  • If unset, show menu as today
  • Consider adding "Always use this" option to menu
Show full SKILL.md (191 more words)Show less
Priority 2: Default Merge Strategy

File: internal/plugins/workspace/merge.go -- performDirectMerge()

go
func (p *Plugin) performDirectMerge(wt *Worktree) tea.Cmd {
    strategy := p.ctx.Config.Plugins.Git.DefaultMergeStrategy
    if strategy == "" {
        strategy = "no-ff" // backward compatible default
    }
    var mergeArgs []string
    switch strategy {
    case "ff":
        mergeArgs = []string{"merge", branch, "-m", mergeMsg}
    case "ff-only":
        mergeArgs = []string{"merge", branch, "--ff-only"}
    case "squash":
        mergeArgs = []string{"merge", branch, "--squash"}
    case "rebase":
        // 1. git rebase baseBranch branch
        // 2. git checkout baseBranch
        // 3. git merge branch --ff-only
    default: // "no-ff"
        mergeArgs = []string{"merge", branch, "--no-ff", "-m", mergeMsg}
    }
}
Priority 3: Squash Merge Support

After git merge --squash, a separate commit is needed:

go
case "squash":
    mergeCmd := exec.Command("git", "merge", branch, "--squash")
    // execute...
    commitMsg := fmt.Sprintf("Squash merge branch '%s'", branch)
    commitCmd := exec.Command("git", "commit", "-m", commitMsg)
Priority 4: Merge Commit Templates
go
type MergeTemplateData struct {
    Branch, BaseBranch, PRTitle, PRNumber string
}

func renderMergeMessage(tmpl string, data MergeTemplateData) (string, error) {
    if tmpl == "" {
        tmpl = "Merge branch '{{.Branch}}'"
    }
    t, err := template.New("merge").Parse(tmpl)
    // ... execute template
}
Priority 5: Protected Branch Warnings
go
func isProtectedBranch(branch string, patterns []string) bool {
    for _, pattern := range patterns {
        if matched, _ := filepath.Match(pattern, branch); matched {
            return true
        }
    }
    return false
}

Show confirmation modal before direct merge to protected branches.

Strategy Comparison

StrategyHistoryCommit CountBest For
No Fast-Forward (--no-ff)Preserves branch topology+1 merge commitFeature branches, audit trails
Fast-Forward (--ff)Linear when possibleNo extra commitsSmall changes, single commits
Fast-Forward Only (--ff-only)Always linearFails if not possibleStrict linear history
SquashLinearSingle commitClean history, large features
RebaseLinear, preserves commitsNo merge commitClean history with detail
Team Recommendations
  • Open source: default squash, PR workflow recommended
  • Internal teams: default no-ff, direct merge acceptable
  • Solo developers: default rebase or ff, direct merge for speed
FilePurpose
internal/config/config.goConfig struct definitions
internal/config/loader.goConfig loading and defaults
internal/plugins/gitstatus/remote.goPull/fetch operations
internal/plugins/gitstatus/pull_menu.goPull strategy UI
internal/plugins/workspace/merge.goMerge workflow
internal/plugins/workspace/diff.goBase branch detection
internal/plugins/workspace/worktree.goBranch operations

Migration Notes

  • Empty config = current behavior -- all new fields default to empty/false
  • Config validation -- warn on invalid strategy names, do not fail
  • Backward compatibility -- if changing defaults, provide migration warnings

© marcus, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/merge-strategy of marcus/sidecar.

Open the folder on GitHubat commit 3792a4e

Compare with similar skills

Merge Strategy next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Merge Strategy compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Merge Strategy this skillmarcus/sidecar1.1k—~2.1kAutomated safety check: PassMIT
ToolJet Multi-Repo CommitToolJet/ToolJet41k—~1.3kAutomated safety check: PassAGPL-3.0
Git Workflow and Versioningaddyosmani/agent-skills103k2 repos~3.5kAutomated safety check: NotesMIT
React Router Pull Request Creatorremix-run/react-router57k—~2.5kAutomated safety check: PassMIT
Saleor Commit Workflowsaleor/saleor23k—~575Automated safety check: PassBSD-3-Clause
Emoji Commit ConventionsbaptisteArno/typebot.io11k—~424Automated safety check: PassCustom licence

Similar skills

  • Commits changes across ToolJet's root repo and its server/ee and frontend/ee submodules, writing messages from the diffs and updating submodule pointers in order.

    41k GitHub stars~1.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Git Workflow and Versioning

    addyosmani/agent-skills

    Sets git habits for every change: short-lived branches, atomic commits with descriptive messages, clean pull requests, plus versioning, tagging and changelogs for releases.

    103k GitHub starsUsed in 2 repos~3.5k tokens
    DevelopmentAuto-check: notes
  • React Router Pull Request Creator

    remix-run/react-router

    Packages finished React Router work into a draft pull request: branch, commit, push, a written PR body and the right GitHub labels.

    57k GitHub stars~2.5k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Commits changes in the Saleor codebase and works through pre-commit hook failures from ruff, mypy, the GraphQL schema check and the migrations check.

    23k GitHub stars~575 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Emoji Commit Conventions

    baptisteArno/typebot.io

    Sets the repository's convention for commit messages and pull request titles: one emoji prefix for the main intent, a concise title and clean follow-up commits.

    11k GitHub stars~424 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Draft Pull Request Creator

    wordpress-mobile/WordPress-Android

    Commits and pushes current changes, writes a pull request title and body from the branch history and template, and opens a draft PR on GitHub after you approve it.

    3.2k GitHub stars~881 tokensUpdated today
    DevelopmentAuto-check: notes

More from marcus/sidecar

All 19 skills in this repo
  • Create Adapter

    marcus/sidecar

    Create conversation adapters for importing AI chat history from different tools (Claude Code, Cursor, Warp, Codex, etc.).

    1.1k GitHub stars~4.8k tokensUpdated 3 days ago
    Auto-check passed
  • Create Modal

    marcus/sidecar

    Create declarative modals using the modal library API. An agent skill from marcus/sidecar.

    1.1k GitHub stars~2.6k tokensUpdated 3 days ago
    Auto-check passed
  • Create Plugin

    marcus/sidecar

    Create new sidecar plugins implementing the plugin.Plugin interface, rendering views with Bubble Tea, handling keyboard input via keymap contexts, and integrating with the app shell (footer hints…

    1.1k GitHub stars~2.3k tokensUpdated 3 days ago
    Auto-check passed
  • Project Switching

    marcus/sidecar

    Project switching implementation in sidecar: project discovery, state management, UI flow, modal rendering, filtering, theme preview, and plugin reinitialization.

    1.1k GitHub stars~1.8k tokensUpdated 3 days ago
    Auto-check passed
  • Shell Integration

    marcus/sidecar

    Interactive shell/TTY integration with tmux session management, shell command execution, control-mode output capture with polling fallback, native cursor rendering, lazy scrollback, selection, paste…

    1.1k GitHub stars~3.6k tokensUpdated 3 days ago
    Auto-check passed
  • Sidecar Website

    marcus/sidecar

    Writing and maintaining the Sidecar Docusaurus documentation site, including page structure, doc authoring, blog posts, styling, images, and deployment workflow.

    1.1k GitHub stars~1.7k tokensUpdated 3 days ago
    Auto-check passed

Works with

Categories

Questions about Merge Strategy

What does Merge Strategy do?

Git merge strategies, conflict resolution approaches, merge vs rebase recommendations, and branch integration patterns in sidecar. Merge Strategy is an agent skill from marcus/sidecar. Git merge strategies, conflict resolution approaches, merge vs rebase recommendations, and branch integration patterns in sidecar.

When should I use Merge Strategy?

Merge Strategy fits situations like: working on git merge features; making decisions about merge strategies.

How do I install Merge Strategy in Claude Code?

Run `npx skills add marcus/sidecar --skill merge-strategy -a claude-code`. Or copy the skill folder (.claude/skills/merge-strategy in marcus/sidecar) into .claude/skills/merge-strategy in your project. Claude Code loads it when a task matches its description.

How do I install Merge Strategy in Codex?

Run `npx skills add marcus/sidecar --skill merge-strategy -a codex`. Or copy the skill folder (.claude/skills/merge-strategy in marcus/sidecar) into .agents/skills/merge-strategy in your project. Codex loads it when a task matches its description.

Can I use Merge Strategy in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add marcus/sidecar --skill merge-strategy -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/merge-strategy, .gemini/skills/merge-strategy, .github/skills/merge-strategy and .opencode/skills/merge-strategy in your project.

What does Merge Strategy need to run?

Going by SKILL.md and its folder, Merge Strategy needs the command-line tools its instructions call (git and gh).

Does Merge Strategy access the network?

SKILL.md contains no URLs. Its commands use git and gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Merge Strategy safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Merge Strategy use?

Merge Strategy is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Merge Strategy use?

About 2.1k tokens (SKILL.md is roughly 8.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Merge Strategy?

Skills that share tags, products or a category with Merge Strategy: ToolJet Multi-Repo Commit (ToolJet/ToolJet, 41k stars), Git Workflow and Versioning (addyosmani/agent-skills, 103k stars), React Router Pull Request Creator (remix-run/react-router, 57k stars) and Saleor Commit Workflow (saleor/saleor, 23k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Merge Strategy?

marcus (a GitHub user) maintains it in marcus/sidecar, which has 1,085 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 5, 2026.

Source: marcus/sidecar on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.