Use when adding new error messages to React, or seeing "unknown error code" warnings.
npx skills add Nghi-NV/create-agent-skills --skill "git-commit"
Install specific skill from multi-skill repository
# Description
Guide for Git commit messages and pushing code. Use when user says "commit", "push code", "push to git", "save changes to git", "git add and commit", "commit and push", or needs help writing commit messages following Conventional Commits.
# SKILL.md
name: git-commit
description: Guide for Git commit messages and pushing code. Use when user says "commit", "push code", "push to git", "save changes to git", "git add and commit", "commit and push", or needs help writing commit messages following Conventional Commits.
Git Commit Messages
This skill provides guidance for writing clear, consistent commit messages following the Conventional Commits specification.
When to Use This Skill
Use this skill when user requests any of these (in any language):
- "commit", "push code", "push to git", "commit vΓ push"
- "save changes to git", "lΖ°u code lΓͺn git"
- "git add and commit", "commit changes"
- Writing commit messages for any code changes
- Ensuring commit history is clean and readable
- Following team/project commit conventions
- Generating changelogs automatically
- Ensuring documentation is up-to-date with code changes
Pre-commit Checklist
Before committing, ask yourself:
- Documentation: Does this change affect the public API, installation, or usage?
- If YES, update
README.mdor relevant documentation files.
- If YES, update
- Examples: Do any existing examples in the docs need updating?
- Tests: Have tests been updated or added to cover this change?
- Changelog: Does this change warrant a manual entry in
CHANGELOG.md?
[!TIP]
If a commit requires a documentation update, consider including it in the same commit or a subsequentdocscommit. Using a multi-line commit message to cross-reference the doc change is a best practice.
Commit Message Format
(emoji)<type>(<scope>): <subject>
[optional body]
[optional footer(s)]
[!NOTE]
Emoji is required for all commit messages. See the emoji mapping below.
Components
| Part | Required | Description |
|---|---|---|
| type | β Yes | Category of change |
| scope | β No | Component/area affected |
| subject | β Yes | Brief description (imperative mood) |
| body | β No | Detailed explanation |
| footer | β No | Breaking changes, issue refs |
Commit Types
| Type | Description | Example |
|---|---|---|
feat |
β¨ New feature | feat(auth): add OAuth login |
fix |
π Bug fix | fix(api): handle null response |
docs |
π Documentation only | docs: update README |
style |
π¨ Formatting, no code change | style: fix indentation |
refactor |
π§ Code change, no new feature/fix | refactor(utils): simplify logic |
perf |
π Performance improvement | perf(query): add index |
test |
π§ͺ Adding/updating tests | test(auth): add login tests |
build |
π¦ Build system, dependencies | build: upgrade webpack |
ci |
π· CI configuration | ci: add GitHub Actions |
chore |
β»οΈ Other maintenance | chore: update .gitignore |
Emoji Prefix Format (Required)
All commit messages must be prefixed with emojis for better visual scanning and commit categorization:
(emoji)<type>(<scope>): <subject>
Format Examples
π fix(api): handle null response
β¨ feat(auth): add OAuth login
π docs: update installation guide
π§ refactor(utils): simplify validation logic
π perf(query): optimize database queries
Type to Emoji Mapping
| Type | Emoji | Unicode |
|---|---|---|
feat |
β¨ | :sparkles: |
fix |
π | :bug: |
docs |
π | :books: |
style |
π¨ | :art: |
refactor |
π§ | :wrench: |
perf |
π | :rocket: |
test |
π§ͺ | :test_tube: |
build |
π¦ | :package: |
ci |
π· | :construction_worker: |
chore |
β»οΈ | :recycle: |
revert |
βͺ | :rewind: |
hotfix |
π | :ambulance: |
security |
π | :lock: |
wip |
π§ | :construction: |
[!IMPORTANT]
Using emojis is required for all commit messages. This ensures consistent commit history and makes it easier to scan and categorize changes in the git log.
Subject Line Rules
- Must start with emoji: See required emoji mapping below
- Use imperative mood: "add" not "added" or "adds"
- No capitalization: start lowercase
- No period at the end
- Max 50 characters (hard limit: 72)
- Be specific: what changed, not why
- feat: Updated the login page
+ β¨ feat(auth): add password reset form
- fix: bug fix
+ π fix(cart): prevent duplicate items
- added new feature
+ β¨ feat(dashboard): add real-time notifications
Body Guidelines
- Separate from subject with blank line
- Wrap at 72 characters
- Explain what and why, not how
- Use bullet points for multiple changes
β¨ feat(auth): add two-factor authentication
- Add TOTP-based 2FA using authenticator apps
- Store encrypted backup codes in database
- Add SMS fallback for 2FA recovery
This improves account security for enterprise users
who require MFA compliance.
Footer Conventions
Breaking Changes
β¨ feat(api)!: change response format
BREAKING CHANGE: API now returns data in envelope format.
Clients must update to extract data from `response.data`.
Issue References
π fix(login): handle expired tokens
Closes #123
Fixes #456
Refs #789
Decision Tree
What type of change?
βββ Adding new functionality β feat
βββ Fixing a bug β fix
βββ Updating documentation β docs
βββ Formatting/linting only β style
βββ Restructuring code β refactor
βββ Improving performance β perf
βββ Adding/fixing tests β test
βββ Build/dependencies β build
βββ CI/CD changes β ci
βββ Everything else β chore
Examples
Feature
git commit -m "β¨ feat(checkout): add Apple Pay support"
Bug Fix
git commit -m "π fix(auth): prevent session timeout on active users"
With Body
git commit -m "π§ refactor(api): migrate to async/await
Replace callback-based API calls with async/await pattern.
This improves readability and error handling.
Refs #234"
Breaking Change
git commit -m "β¨ feat(api)!: change authentication to JWT
BREAKING CHANGE: Session-based auth is no longer supported.
All clients must use Bearer tokens."
Common Mistakes
| Mistake | Correct |
|---|---|
Fixed bug |
fix(module): handle edge case |
WIP |
feat(feature): add initial implementation |
Update file.js |
refactor(utils): extract helper function |
Changes |
Be specific about what changed |
| Past tense "added" | Imperative "add" |
Tools
Commitlint
Enforce commit conventions:
npm install -D @commitlint/cli @commitlint/config-conventional
// commitlint.config.js
module.exports = {
extends: ['@commitlint/config-conventional']
};
Commitizen
Interactive commit helper:
npm install -D commitizen cz-conventional-changelog
npx cz
Related Resources
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.