explain-changes
Explain git diffs and code changes with educational insights — what changed, why, and what it means. Use this skill whenever a user wants to understand recent modifications to their codebase, whether staged, unstaged, committed, or across branches. This is different from code review — it explains changes rather than judging them. Trigger on phrases like "explain changes", "what did I change", "walk me through the diff", "describe modifications", "summarize what was done", "what happened in this branch". Also trigger when users seem confused about what happened or want to understand someone else's changes.
What this skill does
# Explain Changes Skill Transform git diffs into meaningful explanations covering what changed, why, and what it means. ## Getting the Diff When invoked via the `/explain` command, the command handles argument parsing and git commands. When invoked standalone (e.g., user says "explain what changed" mid-conversation), obtain the diff yourself: 1. Run `git status --short` to see the current state 2. Run the appropriate `git diff` variant — see `references/git-commands.md` for the command table, untracked file handling, and binary file guidance ## Process ### 1. Categorize Changes Group by type: - **Feature** - New functionality - **Bug fix** - Behavior corrections - **Refactor** - Restructuring without behavior change - **Config** - Settings, dependencies, build - **Docs** - Comments, READMEs - **Tests** - Test additions/modifications ### 2. Explain Each Group For each category: - **What changed** - Specific files, functions, logic - **Why** - Inferred motivation and intent (see "Inferring Intent" below) - **Impact** - Effects on codebase behavior ### 3. Add Educational Insights Include `★ Insight` blocks when the change demonstrates a non-obvious pattern, makes an interesting trade-off, or teaches something a mid-level developer might not know. Skip insights for routine changes — not every file rename or version bump needs one. One good insight is better than three filler ones. Good candidates for insights: - Design patterns demonstrated - Best practices followed or violated - Architectural decisions and their trade-offs - Subtle gotchas the change avoids or introduces ## Inferring Intent The "why" is the hardest and most valuable part of an explanation. Use these strategies in order: 1. **Commit messages** - If explaining committed changes, the commit message is the most direct signal of intent 2. **PR/issue references** - Look for issue numbers, ticket IDs, or PR descriptions in commit messages 3. **Code context** - Naming patterns, comments, and surrounding code often reveal purpose (e.g., a function renamed from `getUser` to `getUserOrThrow` signals error-handling intent) 4. **Change shape** - The pattern of modifications hints at goals: adding validation across multiple endpoints suggests a security hardening effort; extracting repeated code into a helper suggests a DRY refactor 5. **Be honest about uncertainty** - When intent is genuinely unclear, say "The motivation isn't obvious from the diff alone" rather than fabricating a plausible-sounding explanation. A wrong "why" is worse than an honest "unclear" ## Handling Large Diffs For diffs spanning 20+ files or 500+ lines: 1. **Start with a high-level summary** - "This changeset touches N files across M areas of the codebase" 2. **Group by area/module** rather than listing every file individually 3. **Prioritize significant changes** - Focus detailed explanation on logic changes; mention config/formatting changes briefly 4. **Call out the core change** - Often a large diff has one or two key changes with many follow-on modifications. Identify and explain the core change first, then explain the ripple effects. ## Output Format ```markdown ## Changes Explanation [1-2 sentence summary] ### [Category]: [Title] **What changed:** - [Specific change with file/function names] **Why:** [Motivation and intent] `★ Insight ─────────────────────────────────────` [Educational points about patterns or practices] `─────────────────────────────────────────────────` ## Summary [Overall summary and important notes] ``` For output quality reference, see `references/examples.md`. ## Guidelines - **Be specific** - Reference exact file names, line numbers, function names - **Infer intent thoughtfully** - Use the strategies above; don't guess - **Stay focused** - Explain actual changes, don't speculate about improvements - **Distinguish staged/unstaged** - When relevant, note what's ready to commit - **Scale your depth** - Small diffs get detailed line-by-line treatment; large diffs (20+ files or 500+ lines) get grouped high-level summaries with deep-dives on the important parts
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.