sync-main

Merge the repository default branch into the current feature branch without rebasing or pushing.

Updated Jul 17, 2026
One-click install
npx skills add https://github.com/guneysol/agent-configs --skill sync-main-guneysol
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sync-main
Source: https://github.com/guneysol/agent-configs/tree/main/agents/skills/sync-main
Command: npx skills add https://github.com/guneysol/agent-configs --skill sync-main-guneysol

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Keeping a long-lived feature branch up to date with the repository's default branch is error-prone: developers often assume the branch is named main or master, merge from the wrong remote, or accidentally rebase, push, or leave conflict markers behind. This Skill performs a controlled, validated merge of the actual default branch into the current branch with strict safety boundaries. ## Core Features & Use Cases - Default branch resolution: Detects the remote's real default branch via symbolic HEAD or GitHub metadata instead of assuming main or master, and selects the correct remote (PR head remote or configured upstream). - Two merge modes: A complete mode that finishes the merge commit with a clean validated tree, and a prepare-only mode that leaves a staged, uncommitted merge for explicit handoff workflows. - Conflict handling and validation: Resolves conflicts by inspecting surrounding code and tests, removes all conflict markers, stages only resolved files, and runs the smallest relevant validation. - Use Case: While working on a feature branch in a pull request, ask the agent to sync from the default branch; it fetches only the relevant remote, merges, resolves conflicts, validates, and reports the result without ever pushing. ## Quick Start Use the sync-main skill to merge the repository's default branch into my current feature branch and resolve any conflicts.

Frequently Asked Questions about sync-main

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I merge the default branch into my feature branch safely?▼

Invoke the skill on your feature branch and it fetches only the relevant remote, resolves the actual default branch, performs a normal merge, resolves conflicts, and runs minimal validation. It never rebases, force-pushes, or pushes the result.

How does the skill know whether the default branch is main or master?▼

It resolves the remote's actual default branch from the symbolic HEAD reference or GitHub metadata rather than assuming a name. If the target branch is ambiguous, it stops instead of guessing.

What is the difference between complete and prepare-only merge modes?▼

Complete mode finishes the merge commit and leaves a clean validated working tree. Prepare-only mode, allowed only when explicitly requested, runs a no-commit merge and leaves the resolved changes staged with MERGE_HEAD present for the caller to inspect and commit.

What happens when merge conflicts occur during the sync?▼

The skill inspects surrounding code, tests, and repository guidance to preserve both upstream fixes and feature intent. It removes every conflict marker, stages only resolved files, and if intent is ambiguous it aborts or leaves the merge inspectable and reports blocked.

Will this skill push my branch or rebase my commits?▼

No. The mutation boundary explicitly forbids rebasing, force-pushing, pushing, stashing, resetting, or switching the PR base. Any eventual push is owned by the caller or an outer workflow.