home / skills / openclaw / skills / ai-diff-summary

ai-diff-summary skill

/skills/lxgicstudios/ai-diff-summary

This skill summarizes git diffs into clear, human-friendly descriptions to accelerate code reviews and PR descriptions.

This is most likely a fork of the ai-diff-summary skill from lxgicstudios
npx playbooks add skill openclaw/skills --skill ai-diff-summary

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.2 KB
---
name: diff-summary
description: Summarize git diffs in plain English
---

# Diff Summary

Turn messy git diffs into human-readable summaries. Perfect for PR descriptions and code reviews.

## Quick Start

```bash
npx ai-diff-summary
```

## What It Does

- Summarizes staged changes
- Explains what code does, not just what changed
- Groups related changes
- Identifies breaking changes

## Usage Examples

```bash
# Summarize staged changes
npx ai-diff-summary

# Summarize specific commit
npx ai-diff-summary --commit abc123

# Compare branches
npx ai-diff-summary --from main --to feature/auth

# Output as PR description
npx ai-diff-summary --format pr
```

## Output Example

```markdown
## Summary
Added user authentication with JWT tokens

## Changes
- New login/logout endpoints in auth.ts
- JWT middleware for protected routes
- User model with password hashing
- Updated API docs

## Breaking Changes
- /api/users now requires authentication
```

## Requirements

Node.js 18+. OPENAI_API_KEY required. Must be in a git repo.

## License

MIT. Free forever.

---

**Built by LXGIC Studios**

- GitHub: [github.com/lxgicstudios/ai-diff-summary](https://github.com/lxgicstudios/ai-diff-summary)
- Twitter: [@lxgicstudios](https://x.com/lxgicstudios)

Overview

This skill turns raw git diffs into concise, plain-English summaries suitable for PR descriptions and code review notes. It highlights what changed, groups related edits, and flags potential breaking changes so reviewers can quickly understand impact. Designed for use in local git repositories with Node.js and an OpenAI API key.

How this skill works

The tool reads staged changes, a specific commit, or a branch range and parses the diff into logical sections. It generates human-readable explanations of intent (what the code does) rather than only listing line-by-line edits, groups related changes together, and calls out breaking changes or API updates. Output formats include a short summary, detailed change list, and PR-ready markdown.

When to use it

  • Preparing a pull request description that explains intent and impact
  • Speeding up code review by summarizing large diffs
  • Documenting changes for release notes or changelogs
  • Comparing two branches to assess feature scope or regressions
  • Reviewing a specific commit to understand rationale quickly

Best practices

  • Run against staged changes or a single commit for the most focused summaries
  • Provide clear commit messages and small, focused commits to improve summary quality
  • Use the PR output format when pasting into review platforms to save time
  • Double-check flagged breaking changes in context before merging
  • Ensure OPENAI_API_KEY is set and Node.js 18+ is installed

Example use cases

  • Generate a PR description automatically after finishing a feature branch
  • Compare main and feature branches to summarize what the feature adds
  • Summarize a legacy commit when onboarding a new team member
  • Create release notes by summarizing grouped changes across multiple commits
  • Quickly identify API changes that require updates to documentation or clients

FAQ

What inputs can it summarize?

It can summarize staged changes, a specific commit, or diffs between two branches or commits.

What output formats are available?

Outputs include a short summary, grouped change list, breaking changes section, and a PR-friendly markdown format.