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.zipInstalls 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.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
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 main → production 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
- Fetches
origin/mainandorigin/production - Lists the commits that would be merged
- Pre-checks for conflicts with
git merge-tree(no working tree touched) - If conflicts → stops with the conflicting paths and exits non-zero. Resolve manually, then re-run.
- If clean → calls
POST /repos/pollinations/pollinations/mergesto create the merge commit onproductionserver-side
Exit Codes
0— merge succeeded, or nothing to merge2— 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 toproduction) andjq - Branch protection on
productionthat requires PRs will cause exit code3— open a PR manually withgh pr create --base production --head mainin 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
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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| sync-production (this skill) | 0 | 3mo | Review | Intermediate |
| github-workflow-automation | 11 | 2mo | Review | Advanced |
| testing-workflow | 16 | 9mo | Review | Intermediate |
| github-actions-templates | 7 | 4mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by pollinations
View all by pollinations →You might also like
github-workflow-automation
ruvnet
Advanced GitHub Actions workflow automation with AI swarm coordination, intelligent CI/CD pipelines, and comprehensive repository management
testing-workflow
amo-tech-ai
Comprehensive testing workflow for E2E, integration, and unit tests. Use when testing applications layer-by-layer, validating user journeys, or running test suites.
github-actions-templates
wshobson
Create production-ready GitHub Actions workflows for automated testing, building, and deploying applications. Use when setting up CI/CD with GitHub Actions, automating development workflows, or creating reusable workflow templates.
glab
NikiforovAll
Expert guidance for using the GitLab CLI (glab) to manage GitLab issues, merge requests, CI/CD pipelines, repositories, and other GitLab operations from the command line. Use this skill when the user needs to interact with GitLab resources or perform GitLab workflows.
create-pr
n8n-io
Creates GitHub pull requests with properly formatted titles that pass the check-pr-title CI validation. Use when creating PRs, submitting changes for review, or when the user says /pr or asks to create a pull request.
gh-fix-ci
openai
Use when a user asks to debug or fix failing GitHub PR checks that run in GitHub Actions; use `gh` to inspect checks and logs, summarize failure context, draft a fix plan, and implement only after explicit approval. Treat external providers (for example Buildkite) as out of scope and report only the details URL.