git-merge

Merge feature branches with pre-flight checks and post-merge validation.

3|1|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill git-merge-cogni-ai-ou
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-merge
Source: https://github.com/Cogni-AI-OU/cogni-ai-agent-skills/tree/main/git-merge
Command: npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill git-merge-cogni-ai-ou

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents broken merges by enforcing a clean, non-shallow pre-merge state, explicit conflict resolution, and strict validation that no conflict markers or duplicate lines remain after the merge.

Core Features & Use Cases

  • Pre-flight safety checks: Verifies a clean working directory and confirms the repository is not shallow before attempting the merge.
  • Deterministic merge workflow: Uses a non-interactive merge approach and requires file-by-file conflict resolution when conflicts occur.
  • Post-merge validation: Searches for Git conflict markers and performs deduplication checks to avoid duplicate imports, definitions, or repeated lines that can silently break builds.
  • Use case: You’re integrating a feature branch into main and need a reliable, auditable process that avoids leaving <<<<<<< markers and avoids accidentally duplicating code sections.

Quick Start

Load this skill and follow its steps to merge a branch while ensuring the working tree is clean, the repo is not shallow, and validation finds no conflict markers or duplicate lines.

Frequently Asked Questions about git-merge

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

FAQPage Schema
How do I safely merge a git branch without leaving conflict markers?

To safely merge a git branch without leaving conflict markers, use a deterministic workflow requiring explicit file-by-file conflict resolution and grep-based marker detection to verify a clean state before committing.

Why does git merge accidentally duplicate code sections and how do I prevent it?

Git merge can accidentally duplicate code sections when conflicts are resolved manually. Prevent this by running post-merge deduplication verification checks to detect and remove duplicate imports, definitions, or repeated lines before finalizing the commit.

What pre-flight checks are needed before running a git merge integration?

Pre-flight checks for a git merge integration require verifying a clean working directory and confirming the repository history is not shallow, ensuring a stable baseline before attempting deterministic non-interactive merge execution.

How do I audit a git merge for CI readiness before pushing to a target branch?

Audit a git merge for CI readiness by performing thorough post-merge validation, using grep to search for leftover conflict markers and executing deduplication checks to ensure no duplicate lines will silently break the build.

Can I use a non-interactive git merge workflow to resolve conflicts file by file?

Yes, a deterministic non-interactive git merge workflow supports file-by-file conflict resolution, requiring explicit conflict handling while enforcing strict validation that no markers or duplicated code remain before committing.

What happens if I merge into a shallow clone repository?

Merging into a shallow clone repository is blocked by pre-flight state verification, which requires a clean working directory and confirms the repository is not shallow before attempting any merge operations to ensure release safety.