--- name: commit-message-storyteller description: 'Analyzes git diffs or staged changes and generates narrative commit messages that explain WHY a change was made, not just what changed — following Conventional Commits format. Use when asked to "write a commit message", "generate a commit", "describe my changes", "what should I commit this as", "commit this", "summarize my diff", or "help me commit". Works with git diff output, staged files, or plain descriptions of changes.' --- # Commit Message Storyteller Transforms raw git diffs and change descriptions into clear, story-driven commit messages that follow the [Conventional Commits](https://www.conventionalcommits.org/) specification. Instead of "update file.js", you get messages that communicate intent, context, and impact. ## When to Use This Skill - User says "write a commit message", "help me commit", or "generate a commit" - User pastes a git diff or describes code changes - User says "what should I commit this as?" or "summarize my diff" - User wants better commit history for their team or open-source project - User is preparing a pull request and wants meaningful commit messages ## Prerequisites Have at least one of the following ready: - Output from `git diff` or `git diff --staged` - A description of what you changed and why - A list of modified files ## How It Works ### Step 1: Gather the Change Context Ask the user (or infer from the diff) for: 1. **What changed** — files, functions, logic affected 2. **Why it changed** — bug fix, new feature, refactor, performance, etc. 3. **Who/what triggered it** — issue number, user request, tech debt, etc. If the user provides a raw `git diff`, extract this context automatically from the diff. ### Step 2: Identify the Commit Type Map the change to a Conventional Commits type using this guide: | Type | Use When | |------|----------| | `feat` | A new feature or capability is added | | `fix` | A bug or incorrect behavior is corrected | | `refactor` | Code restructured without changing behavior | | `perf` | A change that improves performance | | `docs` | Documentation only changes | | `style` | Formatting, whitespace, missing semicolons (no logic change) | | `test` | Adding or updating tests | | `chore` | Build process, dependency updates, config changes | | `ci` | CI/CD pipeline changes | | `revert` | Reverting a previous commit | See `references/conventional-commits-guide.md` for detailed examples. ### Step 3: Write the Commit Message Follow this structure: ``` ():