merge-to-main

Review and merge a delivery branch into main with local quality gates and exact-SHA protection.

Updated Aug 2, 2026
One-click install
npx skills add https://github.com/leonardoacosta/agents --skill merge-to-main-leonardoacosta
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: merge-to-main
Source: https://github.com/leonardoacosta/agents/tree/main/skills/merge-to-main
Command: npx skills add https://github.com/leonardoacosta/agents --skill merge-to-main-leonardoacosta

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Merging a delivery branch directly into main without a pull request risks shipping unreviewed code, merging a branch that moved after review, or leaving the repository in a broken state. This Skill enforces a disciplined local merge workflow with quality gates, independent reviews, and exact-SHA pinning so direct merges stay safe. ## Core Features & Use Cases - Pinned-SHA review and merge: Resolves immutable source and target SHAs, reviews the exact pinned diff with correctness and architecture lenses, and refuses to merge a source ref that advanced after review. - Local quality gates and merge gate: Runs the repository's existing lint, typecheck, build, and test contract before review, auto-proceeds for batches of 10 commits or fewer, and requires explicit confirmation for larger batches. - Safe completion and recovery: Merges with --no-ff, verifies the remote target contains the merge, restores the starting branch on every exit path, and provides a recovery table for failures like conflicts, dirty trees, and stale reviews. - Use Case: You finished a feature on the dev branch and want it in main without opening a pull request or waiting on remote CI. Invoke the Skill to validate, review, confirm, merge, and push in one audited local workflow. ## Quick Start Use the merge-to-main skill to review and merge my dev branch into main with local quality gates.

Frequently Asked Questions about merge-to-main

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

FAQPage Schema
How do I merge a branch into main without a pull request?

Run this workflow to merge a source branch directly into main locally. It fetches the remote, pins the source SHA, runs quality gates and reviews, merges with --no-ff, pushes the target branch, and verifies the remote contains the merge commit.

How to review a Git diff before merging to main?

The workflow reviews the pinned diff target...PINNED_SOURCE_SHA with a correctness lens and an architecture lens covering every changed file. Proposed blockers get an independent re-check, and confirmed blockers halt the merge with file, location, and impact details.

What happens if the source branch changes after review?

The merge is refused. Before mutating the target, the workflow fetches again and requires the live remote source SHA to equal the pinned reviewed SHA, so a branch that advanced after review is never merged.

Does this workflow wait for CI or monitor deployments after merging?

No. It stops after the target branch is pushed and verified on the remote. It does not wait for remote CI, monitor deployments, run post-merge health polling, or create release tags.

What happens when a merge conflict occurs during the merge?

The merge is aborted on the target branch, any repository lock is released, and the starting branch is restored. Conflicts must be resolved on the source branch before restarting the workflow from preflight.

When does the merge require explicit user confirmation?

Batches of 10 commits or fewer auto-proceed after gates and review pass. Larger batches require an explicit merge decision through the harness's native confirmation primitive before any target-branch mutation.