Skip to content
Back to skills

Diff

ASecurity

Analyze branch diff against merge-base — stat overview, full diff, file list, commit list, or branch overlap check. Always uses merge-base to exclude main's forward progress.

  • 11 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 7, 2026
ai-agentsbashgit

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add brain-bootstrap/claude-code-brain-bootstrap --skill diff --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Diff?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Diff
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/brain-bootstrap-diff/badge)](https://www.skillsdirectory.com/skills/brain-bootstrap-diff)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: diff
description: Analyze branch diff against merge-base — stat overview, full diff, file list, commit list, or branch overlap check. Always uses merge-base to exclude main's forward progress.
---

# Diff Skill

Analyze the current branch's diff against its merge-base with main.

## Usage

```
/diff             # Stat overview (default)
/diff full        # Full patch output
/diff files       # List changed files only
/diff commits     # List commits on this branch
/diff overlap feature/other-branch  # Check for file overlap with another branch
```

## ⚠️ Critical: Always Use Merge-Base

```bash
# CORRECT — only shows YOUR changes
git diff $(git merge-base main HEAD)..HEAD

# WRONG — includes main's forward progress as noise
git diff main
```

## Instructions

### Determine action from $ARGUMENTS:

| Argument | Action |
|----------|--------|
| `stat` or (empty) | `git --no-pager diff $(git merge-base main HEAD)..HEAD --stat` |
| `full` | `git --no-pager diff $(git merge-base main HEAD)..HEAD \| head -200` |
| `files` | `git --no-pager diff $(git merge-base main HEAD)..HEAD --name-only` |
| `commits` | `git --no-pager log $(git merge-base main HEAD)..HEAD --oneline` |
| `overlap <branch>` | Cross-branch file overlap check (see below) |

### Cross-Branch Overlap Check:
```bash
BRANCH_A_FILES=$(git --no-pager diff $(git merge-base main HEAD)..HEAD --name-only)
BRANCH_B_FILES=$(git --no-pager diff $(git merge-base main <other-branch>)..<other-branch> --name-only)
# Show files that appear in both
comm -12 <(echo "$BRANCH_A_FILES" | sort) <(echo "$BRANCH_B_FILES" | sort)
```

## Report Format

For stat/default mode, report:
1. Files changed (count)
2. Lines added / removed
3. Any files that look unexpectedly large (>200 lines changed)
4. Any test files missing for changed source files

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.