SY

sync-production

Automates the merge of main to production with conflict pre-checks.

Install

mkdir -p .claude/skills/sync-production && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14682" && unzip -o skill.zip -d .claude/skills/sync-production && rm skill.zip

Installs to .claude/skills/sync-production

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Sync the main branch into production via the GitHub merges API. Pre-checks for merge conflicts and bails out with a clear reason if the merge isn't clean. Use when asked to merge main into production, deploy main to production, or sync production.
247 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Fetch `origin/main` and `origin/production` branches
  • List commits that would be merged
  • Pre-check for merge conflicts with `git merge-tree`
  • Create a merge commit on `production` server-side via GitHub API
  • Report conflicting paths if a merge would conflict

How it works

The skill fetches the latest `main` and `production` branches, then uses `git merge-tree` to pre-check for conflicts. If clean, it calls the GitHub merges API to create the merge commit server-side.

Inputs & outputs

You give it
A request to sync the main branch into production, e.g., "Sync production with main."
You get back
A successful merge of `main` into `production` or a report of merge conflicts with conflicting paths.

When to use sync-production

  • Deploy main to production
  • Sync production with main branch
  • Check merge conflicts for production

About this skill

Sync Production

Server-side merge of mainproduction using the GitHub merges API. No local checkout, no working tree changes.

Quick Usage

.claude/skills/sync-production/scripts/sync-production.sh

What It Does

  1. Fetches origin/main and origin/production
  2. Lists the commits that would be merged
  3. Pre-checks for conflicts with git merge-tree (no working tree touched)
  4. If conflicts → stops with the conflicting paths and exits non-zero. Resolve manually, then re-run.
  5. If clean → calls POST /repos/pollinations/pollinations/merges to create the merge commit on production server-side

Exit Codes

  • 0 — merge succeeded, or nothing to merge
  • 2 — merge would conflict (paths printed)
  • 3 — GitHub merges API rejected the request (branch protection, missing branches, etc.)

On Conflict

The skill stops and reports the conflicting files. Don't try to force it — surface the reason in chat and resolve manually:

git checkout production && git pull
git merge main           # resolve conflicts in editor
git push origin production

Overrides

SYNC_REPO=owner/repo SYNC_BASE=staging SYNC_HEAD=main \
  .claude/skills/sync-production/scripts/sync-production.sh

Notes

  • Run from repo root
  • Requires gh (authenticated, push access to production) and jq
  • Branch protection on production that requires PRs will cause exit code 3 — open a PR manually with gh pr create --base production --head main in that case

When not to use it

  • When `production` branch has protection that requires PRs
  • When the user wants to merge branches other than `main` into `production`
  • When the user wants to perform a local merge with working tree changes

Prerequisites

`gh` (authenticated, push access to `production`)`jq`

Limitations

  • Requires `gh` and `jq` to be installed.
  • Branch protection on `production` that requires PRs will cause the skill to exit.
  • The skill does not perform local checkouts or working tree changes.

How it compares

This skill performs a server-side merge of `main` to `production` via the GitHub API with pre-conflict checks, avoiding local working tree changes and providing a more automated and controlled deployment process than manual git operations.

Compared to similar skills

sync-production side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
sync-production (this skill)03moReviewIntermediate
github-workflow-automation112moReviewAdvanced
testing-workflow169moReviewIntermediate
github-actions-templates74moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

Search skills

Search the agent skills registry