commit-standards
Format commit messages following conventional commits standard. Use when: writing commit messages, git commit, reviewing commit history. Keywords: commit, git, message, conventional, 提交, 訊息, feat, fix, refactor.
Packaged view
This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.
Install command
npx @skill-hub/cli install asiaostrich-universal-dev-skills-commit-standards
Repository
Skill path: skills/commit-standards
Format commit messages following conventional commits standard. Use when: writing commit messages, git commit, reviewing commit history. Keywords: commit, git, message, conventional, 提交, 訊息, feat, fix, refactor.
Open repositoryBest for
Primary workflow: Write Technical Docs.
Technical facets: Full Stack, Tech Writer.
Target audience: everyone.
License: Unknown.
Original source
Catalog source: SkillHub Club.
Repository owner: AsiaOstrich.
This is still a mirrored public skill entry. Review the repository before installing into production workflows.
What it helps with
- Install commit-standards into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
- Review https://github.com/AsiaOstrich/universal-dev-skills before adding commit-standards to shared team environments
- Use commit-standards for development workflows
Works across
Favorites: 0.
Sub-skills: 0.
Aggregator: No.
Original source / Raw SKILL.md
---
name: commit-standards
description: |
Format commit messages following conventional commits standard.
Use when: writing commit messages, git commit, reviewing commit history.
Keywords: commit, git, message, conventional, 提交, 訊息, feat, fix, refactor.
---
# Commit Message Standards
This skill ensures consistent, meaningful commit messages following conventional commits.
## Quick Reference
### Basic Format
```
<type>(<scope>): <subject>
<body>
<footer>
```
### Commit Types
| English | 中文 | When to Use |
|---------|------|-------------|
| `feat` | `新增` | New feature |
| `fix` | `修正` | Bug fix |
| `refactor` | `重構` | Code refactoring (no functional change) |
| `docs` | `文件` | Documentation only |
| `style` | `樣式` | Formatting (no code logic change) |
| `test` | `測試` | Adding or updating tests |
| `perf` | `效能` | Performance improvement |
| `build` | `建置` | Build system or dependencies |
| `ci` | `整合` | CI/CD pipeline changes |
| `chore` | `維護` | Maintenance tasks |
| `revert` | `回退` | Revert previous commit |
| `security` | `安全` | Security vulnerability fix |
### Subject Line Rules
1. **Length**: ≤72 characters (50 ideal)
2. **Tense**: Imperative mood ("Add feature" not "Added feature")
3. **Capitalization**: First letter capitalized
4. **No period**: Don't end with a period
## Detailed Guidelines
For complete standards, see:
- [Conventional Commits Guide](./conventional-commits.md)
- [Language Options](./language-options.md)
## Examples
### ✅ Good Examples (English)
```
feat(auth): Add OAuth2 Google login support
fix(api): Resolve memory leak in user session cache
refactor(database): Extract query builder to separate class
docs(readme): Update installation instructions for Node 20
```
### ✅ Good Examples (中文)
```
新增(認證): 實作 OAuth2 Google 登入支援
修正(API): 解決使用者 session 快取記憶體洩漏
重構(資料庫): 提取查詢建構器為獨立類別
```
### ✅ Good Example (Bilingual)
```
feat(auth): Add OAuth2 Google login support. 新增 OAuth2 Google 登入支援。
Implement Google OAuth2 authentication flow for user login.
實作 Google OAuth2 認證流程供使用者登入。
Closes #123
```
### ❌ Bad Examples
```
fixed bug # Too vague, no scope
feat(auth): added google login # Past tense
Update stuff. # Period, vague
WIP # Not descriptive
```
## Body Guidelines
Use the body to explain **WHY** the change was made:
```
fix(api): Resolve race condition in concurrent user updates
Why this occurred:
- Two simultaneous PUT requests could overwrite each other
- No optimistic locking implemented
What this fix does:
- Add version field to User model
- Return 409 Conflict if version mismatch
Fixes #789
```
## Breaking Changes
Always document breaking changes in footer:
```
feat(api): Change user endpoint response format
BREAKING CHANGE: User API response format changed
Migration guide:
1. Update API clients to remove .data wrapper
2. Use created_at instead of createdAt
```
## Issue References
```
Closes #123 # Automatically closes issue
Fixes #456 # Automatically closes issue
Refs #789 # Links without closing
```
---
## Configuration Detection
This skill supports project-specific language configuration.
### Detection Order
1. Check `CONTRIBUTING.md` for "Commit Message Language" section
2. If found, use the specified option (English / Traditional Chinese / Bilingual)
3. If not found, **default to English** for maximum tool compatibility
### First-Time Setup
If no configuration found and context is unclear:
1. Ask the user: "This project hasn't configured commit message language preference. Which option would you like to use? (English / 中文 / Bilingual)"
2. After user selection, suggest documenting in `CONTRIBUTING.md`:
```markdown
## Commit Message Language
This project uses **[chosen option]** commit types.
<!-- Options: English | Traditional Chinese | Bilingual -->
```
### Configuration Example
In project's `CONTRIBUTING.md`:
```markdown
## Commit Message Language
This project uses **English** commit types.
### Allowed Types
feat, fix, refactor, docs, style, test, perf, build, ci, chore, revert, security
```
---
**License**: CC BY 4.0 | **Source**: [universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
---
## Referenced Files
> The following files are referenced in this skill and included for context.
### conventional-commits.md
```markdown
# Conventional Commits Guide
## Format Structure
```
<type>(<scope>): <subject>
<body>
<footer>
```
### Components
| Component | Required | Description |
|-----------|----------|-------------|
| `type` | ✅ Yes | Type of change |
| `scope` | Optional | Module/component affected |
| `subject` | ✅ Yes | Brief description (≤72 chars) |
| `body` | Recommended | Detailed explanation |
| `footer` | Optional | Issue references, breaking changes |
---
## Commit Types
### Primary Types
| Type | When to Use | Example |
|------|-------------|----------|
| `feat` | New feature for the user | `feat(cart): Add quantity selector` |
| `fix` | Bug fix for the user | `fix(login): Resolve password reset loop` |
| `docs` | Documentation only | `docs(api): Add authentication examples` |
| `refactor` | Code change without feature/fix | `refactor(utils): Simplify date formatting` |
### Secondary Types
| Type | When to Use | Example |
|------|-------------|----------|
| `style` | Formatting, whitespace | `style: Apply prettier formatting` |
| `test` | Adding/updating tests | `test(auth): Add login integration tests` |
| `perf` | Performance improvement | `perf(query): Add database index` |
| `build` | Build system, dependencies | `build(deps): Upgrade React to v18` |
| `ci` | CI/CD pipeline | `ci: Add deploy workflow` |
| `chore` | Maintenance tasks | `chore: Update .gitignore` |
| `revert` | Revert commit | `revert: Revert "feat(auth): Add SSO"` |
| `security` | Security fix | `security(auth): Fix XSS vulnerability` |
---
## Scope Guidelines
### Naming Rules
1. **Use lowercase**: `auth`, not `Auth`
2. **Use hyphen for multi-word**: `user-profile`, not `userProfile`
3. **Keep it short**: 1-2 words maximum
### Common Scopes
**By Layer**:
- `api`, `ui`, `database`, `config`, `middleware`
**By Feature**:
- `auth`, `login`, `payment`, `notification`, `search`
**By File Type**:
- `tests`, `docs`, `build`, `deps`
**Special**:
- `*`: Multiple scopes affected
- (no scope): Global changes
---
## Subject Line Rules
1. **Length**: ≤72 characters (50 ideal)
2. **Tense**: Imperative mood
- ✅ "Add feature"
- ❌ "Added feature"
3. **Capitalization**: First letter capitalized
4. **No period**: Don't end with period
5. **Be specific**: Describe what changed
### Examples
```
✅ feat(auth): Add OAuth2 Google login support
✅ fix(api): Resolve memory leak in session cache
✅ refactor(database): Extract query builder class
❌ fixed bug # Vague, past tense
❌ feat(auth): added login. # Past tense, period
❌ Update stuff # Too vague
```
---
## Body Guidelines
Explain **WHY**, not **WHAT** (code shows what).
### Templates
**For Features**:
```
Why this feature is needed:
- Reason 1
- Reason 2
What this implements:
- Implementation detail 1
- Implementation detail 2
```
**For Bug Fixes**:
```
Why this occurred:
- Root cause explanation
What this fix does:
- Solution description
Testing:
- How it was tested
```
**For Refactoring**:
```
Why this refactoring:
- Motivation
What this changes:
- Changes description
Migration:
- Migration steps if needed
```
---
## Footer Guidelines
### Issue References
```
Closes #123 # Automatically closes issue
Fixes #456 # Automatically closes issue
Resolves #789 # Automatically closes issue
Refs #101 # Links without closing
See also #999 # Related reference
```
### Breaking Changes
```
BREAKING CHANGE: <description>
Migration guide:
- Step 1
- Step 2
```
---
## Complete Example
```
feat(export): Add CSV export functionality for user data
Why this feature is needed:
- Admins need to export user lists for compliance audits
- Manual copy-paste from UI is error-prone
- Requested by legal and compliance teams
What this implements:
- New /api/users/export endpoint
- CSV generation using csv-writer library
- Streaming response for large datasets
- Date range filtering options
Technical notes:
- Streaming prevents memory issues with 100k+ users
- Export limited to admin role only
- Rate limited to prevent abuse
Closes #567
Refs #234 (related compliance requirement)
```
---
## Anti-Patterns
### ❌ Vague Messages
```
fix: bug fix
refactor: code improvements
update: changes
```
### ❌ Mixing Multiple Concerns
```
feat: add login, fix bugs, refactor database
```
**Fix**: Split into separate commits.
### ❌ Implementation Details in Subject
```
fix: change line 45 from getUserById to getUserByEmail
```
**Fix**: Focus on purpose, not implementation.
---
**License**: CC BY 4.0 | **Source**: [universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
```
### language-options.md
```markdown
# Commit Message Language Options
## Option A: English (International)
Use for international teams and maximum tool compatibility.
| Type | When to Use |
|------|-------------|
| `feat` | New feature |
| `fix` | Bug fix |
| `refactor` | Code refactoring |
| `docs` | Documentation |
| `style` | Formatting |
| `test` | Tests |
| `perf` | Performance |
| `build` | Build system |
| `ci` | CI/CD changes |
| `chore` | Maintenance |
| `revert` | Revert commit |
| `security` | Security fix |
**Example**:
```
feat(auth): Add OAuth2 Google login support
```
---
## Option B: Traditional Chinese (台灣團隊)
Use for local teams preferring native language.
| 類型 | 使用時機 | English |
|------|----------|----------|
| `新增` | 新功能 | feat |
| `修正` | Bug 修復 | fix |
| `重構` | 重構 | refactor |
| `文件` | 文件更新 | docs |
| `樣式` | 格式化 | style |
| `測試` | 測試 | test |
| `效能` | 效能改進 | perf |
| `建置` | 建置系統 | build |
| `整合` | CI/CD | ci |
| `維護` | 維護任務 | chore |
| `回退` | 回退提交 | revert |
| `安全` | 安全修復 | security |
**Example**:
```
新增(認證): 實作 OAuth2 Google 登入支援
```
---
## Option C: Bilingual Mode (雙語對照)
Use English `type`/`scope` for tool compatibility, with bilingual subject/body.
**Format**:
```
<type>(<scope>): <English subject>. <中文主旨>。
<English body>
<中文主體>
<footer>
```
**Example**:
```
feat(auth): Add OAuth2 Google login support. 新增 OAuth2 Google 登入支援。
Implement Google OAuth2 authentication flow for user login.
- Add Google OAuth2 SDK integration
- Create callback endpoint for OAuth flow
- Store refresh tokens securely
實作 Google OAuth2 認證流程供使用者登入。
- 整合 Google OAuth2 SDK
- 建立 OAuth 流程回呼端點
- 安全儲存更新權杖
Closes #123
```
---
## Language Selection Guide
| Factor | English | 中文 | Bilingual |
|--------|---------|------|----------|
| **Team** | International | Local | Mixed |
| **Tool compatibility** | ✅ Best | ⚠️ Limited | ✅ Good |
| **Changelog automation** | ✅ Full | ⚠️ Custom | ✅ Supported |
| **Open source** | ✅ Recommended | ❌ Not recommended | ✅ Good |
### Quick Selection
- **Open source project** → English (Option A)
- **Local team, internal project** → 中文 (Option B)
- **Local team with international collaboration** → Bilingual (Option C)
**Important**: Once chosen, use consistently. Do not mix languages.
---
## Project Configuration
Document your choice in `CONTRIBUTING.md`:
```markdown
## Commit Message Language
This project uses **[English / Traditional Chinese / Bilingual]** commit types.
### Allowed Types
[List types based on your choice]
### Allowed Scopes
- auth: Authentication module
- api: API layer
- ui: User interface
[Add project-specific scopes]
```
---
**License**: CC BY 4.0 | **Source**: [universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
```