current-branch-diff

Compare current branch changes against parent merge-base while excluding artifacts and lockfiles.

Updated Jan 1, 2026
One-click install
npx skills add https://github.com/greenhat/agent-skills --skill current-branch-diff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: current-branch-diff
Source: https://github.com/greenhat/agent-skills/tree/main/current-branch-diff
Command: npx skills add https://github.com/greenhat/agent-skills --skill current-branch-diff

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers quickly review code changes in the current branch against its parent, while filtering out generated artifacts (.wat, .hir, .masm) and lockfiles (.lock) to reduce noise.

Core Features & Use Cases

  • Ignore generated artifacts (.wat, .hir, .masm) and lockfiles (.lock) when diffing.
  • Print the parent branch with git parent-branch and compare against HEAD.
  • Provide a quick file list option to quickly assess changed files.

Quick Start

Print the parent branch:

  • git parent-branch Review the diff (merge-base comparison) while ignoring artifacts:
  • parent="$(git parent-branch)"
  • git diff --stat "$parent"...HEAD -- . ':(exclude).wat' ':(exclude).hir' ':(exclude).masm' ':(exclude).lock'
  • git diff "$parent"...HEAD -- . ':(exclude).wat' ':(exclude).hir' ':(exclude).masm' ':(exclude).lock'

Frequently Asked Questions about current-branch-diff

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

FAQPage Schema
How do I exclude generated artifacts and lockfiles from a git diff?

To exclude generated artifacts and lockfiles from a git diff, use pathspec exclude rules like ':(exclude)*.wat' and ':(exclude)*.lock' when running the git diff command against your merge-base.

What is a merge-base comparison when reviewing branch changes?

A merge-base comparison reviews current branch changes against the common ancestor commit of two branches, ensuring you only see new work without unrelated historical changes from the parent branch.

How do I find the parent branch for a git diff comparison?

You can find the parent branch for a git diff comparison by running the git parent-branch command, which identifies the target baseline to compare your current HEAD against.

Can I get a quick file list of changed files in my current branch?

Yes, you can get a quick file list of changed files by appending the --stat option to your git diff command, providing a summary of modifications without the full code diff.

Does this diff approach work for CI workflows and code reviews?

Yes, this diff approach works for CI workflows and code reviews by providing precise merge-base comparison and artifact filtering, which reduces noise so automated systems and reviewers focus only on relevant code.