Zillowe FoundationZillowe Documentation

Commits

Structured messages with types (e.g. Feat, Fix).

Commit Message Structure

[Optional Emoji] <Type>([Optional Scope]): <Subject>

# Examples:
✨ Feat(auth): Add password strength meter
🩹 Fix: Resolve infinite loading issue
♻️ Refactor(api): Simplify response handling

Components:

  • Emoji: Optional visual indicator (improves scanability)
  • Type: Required category identifier (e.g. Feat, Fix)
  • Scope: Optional context specifier in parentheses
  • Subject: Concise description in present tense (imperative mood)

Supported Types

EmojiTypeDescriptionExample
🛠️BuildChanges to build system, tools or dependencies🛠️ Build(webpack): Upgrade to version 5
🚀CICI/CD pipeline changes🚀 CI(github): Add linting workflow
📚DocsDocumentation only changes📚 Docs: Update API reference
FeatNew features or enhancements✨ Feat(user): Add profile customization
🩹FixBug fixes🩹 Fix(auth): Resolve session timeout issue
PerfPerformance improvements⚡ Perf(queries): Optimize database lookups
♻️RefactorCode changes that neither fix bugs nor add features♻️ Refactor: Extract reusable components
🎨StyleCode style/formatting changes🎨 Style: Format according to style guide
🧪TestAdding or updating tests🧪 Test(api): Add integration tests
RevertRevert previous changes⏪ Revert: Return to commit abc123
🛡️DepsManage dependencies (e.g. adding/removing libraries)🛡️ Deps: Remove unused Lodash methods
🧹CleanupOrganize or remove unused code/files🧹 Cleanup: Remove unused CSS classes
📦ReleasePrepare for a release (e.g. version bump, changelog updates)📦 Release: Prepare for v1.0.0
🔒SecuritySecurity-related changes🔒 Security(auth): Implement rate limiting
🌐I18nInternationalization/localization🌐 I18n: Add German translations
➡️MigrateMajor migrations or transitions➡️ Migrate: Convert to TypeScript
🔍SEOSearch engine optimization🔍 SEO: Improve meta tags
🧠AIAI/ML model or algorithm changes🧠 AI: Update recommendation algorithm
📊DataData structure or content changes📊 Data: Update seed data
🔧ConfigConfiguration changes🔧 Config: Update environment variables
🎯UXUser experience improvements🎯 UX: Streamline checkout process
🏗️StructProject structure changes🏗️ Struct: Reorganize component hierarchy
🔐AuthAuthentication/authorization🔐 Auth: Add OAuth integration
📈TrackAnalytics or tracking📈 Track: Add conversion events
MergeMerging branches or merge requests🤝 Merge: Branch 'dev' into 'main'
📋APIAPI-related changes📋 API: Add pagination to endpoints
🔀GitGit structure and workflow changes🔀 Git(hooks): Update pre-commit validation

Scopes provide additional context about what part of the codebase is affected. Common scopes include:

  • Component names: header, footer, nav
  • Feature areas: auth, checkout, search
  • Technical domains: api, db, ui, ux
  • File types: css, js, tests

Best Practices

  1. Use the imperative mood for the subject (e.g. "Add feature" not "Added feature")
  2. Keep subjects concise (under 72 characters)
  3. Be specific about what changes were made
  4. No period at the end of the subject line
  5. Use consistent emoji when applicable

Extended Commit Format (Optional)

For complex changes, you can add a body after the subject:

✨ Feat(auth): Add password strength meter

Implement zxcvbn library to provide real-time feedback on password strength.
- Displays color-coded strength indicator
- Shows improvement suggestions
- Prevents submission of weak passwords

Issue: #123

Example Workflow

Scenario: Adding a new feature and fixing related bugs

# Create a feature branch
git checkout -b feat/user-profiles

# Make changes to relevant files
git add src/components/UserProfile.js
git commit -m "✨ Feat(profile): Add user profile editor"

# Fix a bug discovered during implementation
git add src/utils/validation.js
git commit -m "🩹 Fix(validation): Resolve email format validation"

# Update documentation
git add README.md docs/api.md
git commit -m "📚 Docs(profile): Document profile endpoints"

# Push changes
git push origin feat/user-profiles

Automated Tools

Consider these tools to enforce ZFGM format:

  • commitlint: Validate commit messages against rules
  • commitizen: Interactive commit message builder
  • husky: Git hooks to validate before commit
  • gitmoji-cli: Streamline emoji usage

Advanced Tips

  • Co-authored commits: Add Co-authored-by: Name <email> at the end of the commit message body
  • Breaking changes: Mark with BREAKING CHANGE: in the commit body
  • Issue references: Include issue IDs in the commit body or footer

Last updated on