1
---
2
name: gitmoji
3
description: 'Generates commit messages following the gitmoji convention (https://gitmoji.dev) — picks the right emoji for the intent of the change and writes a well-formed message. Use when asked to "write a gitmoji commit", "add an emoji to my commit message", "which gitmoji should I use", "gitmoji this change", or when a project uses gitmoji-style commit messages. Works from a git diff, staged changes, or a plain description of the change. Generates the message only — does not run git commands.'
4
license: MIT
5
---
6
7
# Gitmoji
8
9
Generates commit messages that follow the [gitmoji](https://gitmoji.dev/) convention: every commit starts with an emoji that identifies the intent of the change at a glance. Given a diff, a list of staged files, or a plain description of a change, this skill picks the single most appropriate gitmoji and writes a concise, well-formed commit message around it.
10
11
This skill **only generates the message** — it never runs `git commit` or any other git command. The output is a copyable message for the user to use.
12
13
## When to Use This Skill
14
15
- User says "write a gitmoji commit", "gitmoji this change", or "add an emoji to my commit message"
16
- User asks "which gitmoji should I use for this?"
17
- User pastes a git diff or describes a change in a project that uses gitmoji-style commit history
18
- User wants an expressive, scannable commit history using emojis
19
20
**When not to use:** if the project follows plain [Conventional Commits](https://www.conventionalcommits.org/) (`feat:`, `fix:`, ...) without emojis, use the `conventional-commit` or `commit-message-storyteller` skill instead. If unsure which convention the project uses, ask the user to provide recent commit history (for example, the output of `git log --oneline -10`).
21
22
## Message Format
23
24
The gitmoji specification:
25
26
```
27
<intention> [scope?][:?] <message>
28
```
29
30
- **intention** — exactly one gitmoji expressing the goal of the commit
31
- **scope** *(optional)* — the section of the codebase affected, in parentheses
32
- **message** — a brief imperative explanation of the change
33
34
Examples:
35
36
```
37
✨ add multi-tenant support to the billing service
38
🐛 (auth) prevent token refresh loop on expired sessions
39
♻️ (api): extract pagination logic into shared helper
40
```
41
42
### Emoji Style: Unicode vs Shortcode
43
44
Gitmoji supports two equivalent notations:
45
46
| Style | Example | When to prefer |
47
|-------|---------|----------------|
48
| Unicode | `✨ add dark mode` | Default — renders everywhere, shorter subject line |
49
| Shortcode | `:sparkles: add dark mode` | Platforms that render shortcodes (GitHub, GitLab) or teams that grep commit logs by code |
50
51
**Match the repository's existing history.** If recent commits use `:sparkles:`-style shortcodes, generate shortcodes; otherwise default to unicode emojis.
52
53
## How It Works
54
55
### Step 1: Understand the Change
56
57
Work from whatever the user provides:
58
59
1. **A git diff** — read it and identify what changed and why
60
2. **A list of staged/modified files** — infer intent from file names and paths
61
3. **A plain description** — use it directly
62
63
If the intent is genuinely ambiguous (e.g. "updated auth.js" could be a fix, a feature, or a refactor), ask one short clarifying question rather than guessing.
64
65
### Step 2: Identify the Dominant Intent
66
67
Determine the primary purpose of the change. Common intents and their gitmojis:
68
69
| Emoji | Shortcode | Intent |
70
|-------|-----------|--------|
71
| ✨ | `:sparkles:` | Introduce new features |
72
| 🐛 | `:bug:` | Fix a bug |
73
| 🚑️ | `:ambulance:` | Critical hotfix |
74
| 📝 | `:memo:` | Add or update documentation |
75
| ♻️ | `:recycle:` | Refactor code (no behavior change) |
76
| ✅ | `:white_check_mark:` | Add, update, or pass tests |
77
| ⚡️ | `:zap:` | Improve performance |
78
| 🎨 | `:art:` | Improve structure / format of the code |
79
| 🔥 | `:fire:` | Remove code or files |
80
| 🔒️ | `:lock:` | Fix security or privacy issues |
81
| ⬆️ | `:arrow_up:` | Upgrade dependencies |
82
| 🔧 | `:wrench:` | Add or update configuration files |
83
| 💄 | `:lipstick:` | Add or update the UI and style files |
84
| 💥 | `:boom:` | Introduce breaking changes |
85
| 🚨 | `:rotating_light:` | Fix compiler / linter warnings |
86
| 🌐 | `:globe_with_meridians:` | Internationalization and localization |
87
88
This is only the most common subset — **always consult [`references/gitmoji-reference.md`](references/gitmoji-reference.md) for the full official list of 75 gitmojis** before settling on one; a more specific emoji often exists (e.g. 🩹 for a trivial fix, ✏️ for a typo, 🚚 for a file move).
89
90
### Step 3: Pick Exactly One Emoji
91
92
Rules for ambiguous cases:
93
94
- **Specific beats generic** — a typo fix is ✏️, not 🐛; moving files is 🚚, not ♻️; a trivial non-critical fix is 🩹, not 🐛
95
- **Tests:** ✅ for adding/updating passing tests; 🧪 only for intentionally failing tests (e.g. TDD red step)
96
- **Fix vs hotfix:** 🚑️ only for urgent production fixes; everyday bug fixes are 🐛
97
- **Security fix:** 🔒️ wins over 🐛 when the bug is a security issue
98
- **Formatting-only changes:** 🎨 for code structure/formatting; 💄 only for UI/style files (CSS, themes)
99
- **One emoji per commit** — never stack emojis; if two intents feel equally dominant, see mixed changes below
100
101
### Step 4: Write the Message
102
103
- Imperative mood: "add", "fix", "remove" — not "added" or "fixes"
104
- Keep the subject line under 72 characters including the emoji
105
- Lowercase start, no trailing period
106
- Add a scope in parentheses when the project's history uses scopes
107
- Add a body (separated by a blank line) only when the *why* is not obvious from the subject
108
109
### Step 5: Output
110
111
Produce the commit message in a copyable code block, followed by one line explaining why that gitmoji was chosen. Do **not** execute `git commit`.
112
113
**Example output:**
114
115
```
116
🐛 (auth) prevent token refresh loop on expired sessions
117
118
Expired sessions triggered a refresh that failed validation and
119
re-triggered itself, crashing the app. A recursion guard now aborts
120
the cycle and returns a clean 401.
121
```
122
123
> **Why 🐛:** the change corrects incorrect runtime behavior — a bug fix, not urgent enough for 🚑️.
124
125
## Edge Cases
126
127
| Situation | How to Handle |
128
|-----------|---------------|
129
| Mixed changes (e.g. feature + refactor in one diff) | Pick the emoji for the *dominant* intent, and suggest splitting into separate commits if the concerns are unrelated |
130
| Breaking change | Use 💥 as the intention and describe the break in the body |
131
| Revert | ⏪️ with a subject referencing the reverted commit |
132
| Merge commit | 🔀 `merge branch '<name>' into <target>` |
133
| Initial commit | 🎉 `begin project` |
134
| Work in progress | 🚧 with a clear note of what remains |
135
| No matching emoji feels right | Re-scan the [full reference](references/gitmoji-reference.md); if still nothing fits, fall back to the closest generic intent (✨, 🐛, or ♻️) |
136
137
## Quick Reference
138
139
```bash
140
# Get your staged diff to paste into Copilot
141
git diff --staged
142
143
# Check which emoji style the repo already uses
144
git log --oneline -10
145
```
146
147
See [`references/gitmoji-reference.md`](references/gitmoji-reference.md) for the complete official gitmoji list.
148