Agent skill

Merge Prep

by sd0xdev in sd0xdev/sd0x-harness

Pre-merge analysis and preparation. An agent skill from sd0xdev/sd0x-harness.

MITAuto-check passedDevelopment

Install Merge Prep

skills CLI
$ npx skills add sd0xdev/sd0x-harness --skill merge-prep -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install sd0xdev/sd0x-harness merge-prep --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/sd0xdev/sd0x-harness.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/merge-prep .claude/skills/merge-prep && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
merge-prep
GitHub stars
192
Token cost
~1.4k tokens
SKILL.md length
326 words
Files
2 (incl. scripts)
Skills in repo
91
Repo updated
First seen
Licence
MIT

At a glance

Pre-merge analysis and preparation. An agent skill from sd0xdev/sd0x-harness.

  • Works in 4 steps: Validate Prerequisites → Pre-merge Analysis → Conflict Analysis (if conflicts detected) → …
  • : user says merge prep
  • SKILL.md covers When NOT to Use, Input, Workflow and Multi-branch Mode, plus 3 more sections
  • Runs Shell scripts from its folder; calls git and bash

What it does

Merge Prep is an agent skill from sd0xdev/sd0x-harness. Pre-merge analysis and preparation. Analyzes source branch vs target branch: commit stats, conflict detection, file impact. Analysis-only v1 — outputs report + suggested commands, does not auto-merge. Use when: user says 'merge prep', 'pre-merge', 'merge analysis', or /merge-prep

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/pre-merge-check.sh`).

It sits in Development. It works with Git. The repository describes itself as: The harness layer for Claude Code — a reference implementation of harness engineering with hook-enforced dual review, state-machine gates that survive context compaction, and… The licence is MIT.

When your agent uses it

  • : user says merge prep

Example prompts

  • “merge prep”
  • “pre-merge”
  • “merge analysis”
  • “/merge-prep”

Requirements

  • A Bash shell
  • Pre-approved tools (allowed-tools): Bash(git:*), Read, Grep, Glob

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Validate Prerequisites
  2. Pre-merge Analysis
  3. Conflict Analysis (if conflicts detected)
  4. Generate Merge Commands

What it can do on your machine

Read from SKILL.md and the folder at commit c9a2036. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(git:*)
    • Read
    • Grep
    • Glob

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • git
    • bash

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Merge Prep loads about 1.4k tokens when it runs. Until then it costs about 73 tokens; SKILL.md has 326 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~73
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from sd0xdev/sd0x-harness at commit c9a2036, republished under its MIT licence (© sd0xdev). 326 words, ~1,369 tokens.

Download SKILL.mdSave it as .claude/skills/merge-prep/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
merge-prep
description
Pre-merge analysis and preparation. Analyzes source branch vs target branch: commit stats, conflict detection, file impact. Analysis-only v1 — outputs report + suggested commands, does not auto-merge. Use when: user says 'merge prep', 'pre-merge', 'merge analysis', or /merge-prep
allowed-tools
Bash(git:*), Read, Grep, Glob

Merge Prep — Pre-merge Analysis and Preparation

Analyze source branch vs target branch, detect conflicts, output analysis report with suggested commands. v1 is analysis-only — does not execute merge/commit/push.

When NOT to Use

ScenarioUse Instead
Commit code (not merge)/smart-commit
Merge to main (production)Manual PR flow
Just view diffgit diff <target>..<branch>
Rebase or squashManual operation

Input

/merge-prep <source-branch> [--target <branch>]

  • <source-branch>: Branch to merge (required)
  • --target: Target branch (default: {TARGET_BRANCH} or main)

Workflow

mermaid
sequenceDiagram
    participant C as Claude
    participant U as User
    C->>C: Step 1: Validate prerequisites
    C->>C: Step 2: Pre-merge analysis
    C->>U: Show analysis report
    U->>C: Acknowledge
    C->>C: Step 3: Conflict analysis (if any)
    C->>U: Show conflict details + resolution suggestions
    C->>C: Step 4: Generate merge commands
    C->>U: Output commands for manual execution
Step 1: Validate Prerequisites
bash
# 1a. Verify source branch exists
git rev-parse --verify <branch>

# 1b. Verify target branch exists
git rev-parse --verify <target>

# 1c. Verify working tree is clean
git status --porcelain
CheckFailure Action
Branch doesn't existHalt, list available branches
Target not foundHalt, suggest creating it
Uncommitted changesHalt, suggest /smart-commit first
Step 2: Pre-merge Analysis

Run the analysis script:

bash
bash skills/merge-prep/scripts/pre-merge-check.sh <branch> [target]

Script outputs JSON containing:

  • merge_base: Common ancestor
  • source_commits: New commits on source branch
  • target_commits: Commits on target that source doesn't have
  • has_conflicts: Whether conflicts exist
  • conflict_files: List of conflict files
  • file_stats: Affected file statistics

Display analysis report:

markdown
## Pre-merge Analysis

| Item | Value |
|------|-------|
| Source branch | feat/new-feature |
| Target branch | main |
| Common ancestor | b03ad72a |
| New commits | 12 |
| Affected files | 46 |
| Predicted conflicts | 9 files |

### Recent Commits

| Hash | Message |
|------|---------|
| abc1234 | feat: Add new API endpoint |
| def5678 | test: Add integration tests |
Step 3: Conflict Analysis (if conflicts detected)

For each conflict file, analyze commit history to determine conflict pattern:

PatternDetectionSuggested Strategy
Iterative (v1→v3)Both sides changed, source is supersetTake source
Parallel modificationDifferent people changed different logicPer-hunk selection
Hotfix conflictTarget has hotfix merge, source doesn'tTake target
Doc add/addBoth sides added same-name fileTake source

Display resolution suggestions:

markdown
### Conflict Files

| # | File | Pattern | Suggestion | Reason |
|---|------|---------|------------|--------|
| 1 | src/xxx.ts | Iterative | Take source | v3 includes all v1 changes |
| 2 | src/yyy.ts | Parallel | Per-hunk | Two sides changed different functions |
| 3 | docs/zzz.md | add/add | Take source | Target version is outdated |
Step 4: Generate Merge Commands

Output commands for manual execution:

markdown
## Suggested Merge Commands

### Option A: Merge commit (recommended)

```bash
git checkout <target>
git pull --ff-only origin <target>
git merge <source> --no-ff
# Resolve conflicts if any
# git add <resolved-files>
# git commit
git push origin <target>
Option B: Squash merge
bash
git checkout <target>
git pull --ff-only origin <target>
git merge --squash <source>
git commit -m "merge: Merge <source> into <target>"
git push origin <target>

### Step 5: Summary

```markdown
## Merge Summary

| Item | Value |
|------|-------|
| Source | feat/new-feature |
| Target | main |
| Commits | 12 |
| Files | 46 |
| Conflicts | 9 (resolution suggestions provided) |
| Tickets | PROJ-520, PROJ-123 |

⚠️ This is an analysis-only report. Execute the commands manually.

Multi-branch Mode

Supports /merge-prep branch1 branch2 branch3 --target develop:

  1. Analyze each branch sequentially
  2. Output combined summary
  3. Suggest merge order (fewest conflicts first)

Prohibited (v1)

  • No auto-merge: Only output commands, never execute git merge
  • No auto-push: Never execute git push
  • No auto-commit: Never execute git commit
  • No rebase: Never suggest or execute rebase operations

References

FilePurposeWhen to Read
pre-merge-check.shPre-merge analysis scriptStep 2

Verification

  • Source branch exists and working tree is clean
  • Pre-merge analysis displayed with user acknowledgment
  • Conflicts analyzed with resolution suggestions
  • Merge commands are output-only (not executed)
  • No secrets in output, no force push suggested

© sd0xdev, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in skills/merge-prep of sd0xdev/sd0x-harness.

  • SKILL.md
  • scripts/pre-merge-check.sh

Open the folder on GitHubat commit c9a2036

Compare with similar skills

Merge Prep next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Merge Prep compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Merge Prep this skillsd0xdev/sd0x-harness192—~1.4kAutomated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT
Codebase Knowledge Graph Q&AEgonex-AI/Understand-Anything85k1 repos~1.2kAutomated safety check: PassMIT
Code Design Rationale Investigatorcursor/plugins10k9 repos~2.6kAutomated safety check: PassNone
Understand Diff AnalysisEgonex-AI/Understand-Anything85k1 repos~1.4kAutomated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Codebase Knowledge Graph Q&A

    Egonex-AI/Understand-Anything

    Answers questions about a codebase by searching a prebuilt knowledge graph of its files, functions, classes and dependencies, not by rereading every source file.

    85k GitHub starsUsed in 1 repo~1.2k tokens
    DevelopmentAuto-check passed
  • Official

    Digs into why code is shaped the way it is by checking git history, pull requests and connected tools in parallel, then reporting a cited read on the tradeoffs.

    10k GitHub starsUsed in 9 repos~2.6k tokens
    DevelopmentAuto-check passed
  • Understand Diff Analysis

    Egonex-AI/Understand-Anything

    Reads your git changes or a pull request against a prebuilt knowledge graph of the project to explain what changed, which components are affected and what is risky.

    85k GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed
  • Understand Explain

    Egonex-AI/Understand-Anything

    Gives an in-depth explanation of one file, function or module by reading the project's knowledge graph and checking that the graph is still fresh.

    85k GitHub starsUsed in 1 repo~1.3k tokens
    DevelopmentAuto-check passed

More from sd0xdev/sd0x-harness

All 91 skills in this repo
  • Adr

    sd0xdev/sd0x-harness

    Write an Architecture Decision Record (ADR) for a feature — Context / Decision / Status / Consequences / Alternatives, filed as docs/features/<feature/adr-<NNN-<title.md with a 3-digit zero-padded…

    192 GitHub stars~4.8k tokensUpdated yesterday
    Auto-check passed
  • Load PR Review

    sd0xdev/sd0x-harness

    Load GitHub PR review comments into AI session — analyze, triage, plan.

    192 GitHub stars~4.4k tokensUpdated yesterday
    Auto-check passed
  • Next Step

    sd0xdev/sd0x-harness

    Change-aware next step advisor. An agent skill from sd0xdev/sd0x-harness.

    192 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Obsidian CLI

    sd0xdev/sd0x-harness

    Obsidian vault integration via official CLI. An agent skill from sd0xdev/sd0x-harness.

    192 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Orchestrate

    sd0xdev/sd0x-harness

    Agent-driven workflow orchestration (v1 report-only). An agent skill from sd0xdev/sd0x-harness.

    192 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • PR Comment

    sd0xdev/sd0x-harness

    Post friendly review comments to a GitHub PR — prepare locally, preview, then submit as atomic review.

    192 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Merge Prep

What does Merge Prep do?

Pre-merge analysis and preparation. An agent skill from sd0xdev/sd0x-harness. Merge Prep is an agent skill from sd0xdev/sd0x-harness. Pre-merge analysis and preparation.

When should I use Merge Prep?

Merge Prep fits situations like: : user says merge prep.

How do I install Merge Prep in Claude Code?

Run `npx skills add sd0xdev/sd0x-harness --skill merge-prep -a claude-code`. Or copy the skill folder (skills/merge-prep in sd0xdev/sd0x-harness) into .claude/skills/merge-prep in your project. Claude Code loads it when a task matches its description.

How do I install Merge Prep in Codex?

Run `npx skills add sd0xdev/sd0x-harness --skill merge-prep -a codex`. Or copy the skill folder (skills/merge-prep in sd0xdev/sd0x-harness) into .agents/skills/merge-prep in your project. Codex loads it when a task matches its description.

Can I use Merge Prep in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add sd0xdev/sd0x-harness --skill merge-prep -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/merge-prep, .gemini/skills/merge-prep, .github/skills/merge-prep and .opencode/skills/merge-prep in your project.

What does Merge Prep need to run?

Going by SKILL.md and its folder, Merge Prep needs a shell for the scripts in its folder and the command-line tools its instructions call (git and bash). Our summary lists: A Bash shell. Its frontmatter pre-approves these tools: Bash(git:*), Read, Grep, Glob.

Does Merge Prep access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Merge Prep safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Merge Prep use?

Merge Prep is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Merge Prep use?

About 1.4k tokens (SKILL.md is roughly 5.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Merge Prep?

Skills that share tags, products or a category with Merge Prep: Finishing a Development Branch (obra/superpowers, 296k stars), Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars), Codebase Knowledge Graph Q&A (Egonex-AI/Understand-Anything, 85k stars) and Code Design Rationale Investigator (cursor/plugins, 10k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Merge Prep?

sd0xdev (a GitHub user) maintains it in sd0xdev/sd0x-harness, which has 192 GitHub stars. The repository holds 91 skills in this directory. The repository was last updated on October 6, 2026.

Source: sd0xdev/sd0x-harness on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.