A structured, XML-based instruction template for VS Code and GitHub Copilot to automatically generate clean, single-line Conventional Commits with expressive emoji prefixes in English.
VS Code's automatic commit message generator can produce inconsistent formatting, missing types, or redundant file listings when using free-form prompts.
An XML instruction template enforcing scopeless, emoji-prefixed Conventional Commits 1.0.0 standards.
Create the instruction file inside your project's .github directory:
# Path: .github/commit-message-instructions.mdCopy the contents of commit-message-instructions.md directly into that file.
Link the file inside your project or workspace settings.
Project-Level Settings (.vscode/settings.json):
{
"github.copilot.chat.commitMessageGeneration.instructions": [
{
"file": ".github/commit-message-instructions.md"
}
]
}Workspace Settings (.code-workspace):
{
"folders": [
{
"path": "."
}
],
"settings": {
"github.copilot.chat.commitMessageGeneration.instructions": [
{
"file": ".github/commit-message-instructions.md"
}
]
}
}All generated commits strictly follow the <emoji> <type>: <description> syntax without parentheses or scopes:
| Emoji | Type | Purpose | Example |
|---|---|---|---|
| ✨ | feat |
A new feature | ✨ feat: add OAuth2 login support |
| 🐛 | fix |
A bug fix | 🐛 fix: resolve null pointer exception in user service |
| 📝 | docs |
Documentation only changes | 📝 docs: update installation instructions |
| 🎨 | style |
Formatting, whitespace, or UI styling | 🎨 style: format code with prettier |
| ♻️ | refactor |
Code restructuring without logic changes | ♻️ refactor: extract validation logic to middleware |
| ⚡ | perf |
Performance improvements | ⚡ perf: implement lazy loading for gallery |
| 🧪 | test |
Adding or updating tests | 🧪 test: add unit tests for login validation |
| 📦 | build |
Build system or external dependencies | 📦 build: upgrade React to v19 |
| 🤖 | ci |
CI/CD configuration files and scripts | 🤖 ci: add GitHub Actions workflow for testing |
| 🔧 | chore |
Setup, tooling, configs, or dependencies | 🔧 chore: initialize next.js project with tailwind css |
| ⏪ | revert |
Reverting previous commits | ⏪ revert: revert "feat: add OAuth2 login support" |
| 💥 | feat!/fix! |
Breaking changes | 💥 feat!: change response format for user endpoints |
- English Only: All commit messages are written strictly in English.
- No Scopes: No parentheses or scopes (use
<emoji> <type>: <description>directly). - Imperative Mood: Present-tense action verbs (
addnotaddedoradds). - Casing & Punctuation: Entire subject line is lowercase; no trailing period.
- Length Limits: Subject line limited to 50 characters when possible, max 72.
- Single-Line for Setup & Chores: Initial setup, chores, configuration, and dependencies never generate bodies, file lists, or bullet points.
- Body Constraints: Optional bodies are reserved only for complex features or breaking changes, wrapped at 72 characters and explaining what and why, not how.
This instruction template is inspired by and adapted from:
MIT License. See LICENSE for more information.