Git Commit and Version Control Conventions
Commit Message Format
This project follows the Conventional Commits specification for commit messages. This format enables automatic changelog generation, version bumping, and better collaboration.
Structure
<type>(<scope>): <subject>
[optional body]
[optional footer(s)]
Type
The type must be one of the following:
feat- A new feature for the userfix- A bug fixdocs- Documentation only changesstyle- Changes that don't affect the meaning of code (white-space, formatting, etc.)refactor- Code change that neither fixes a bug nor adds a featureperf- Code change that improves performancetest- Adding missing tests or correcting existing testsbuild- Changes that affect the build system or external dependenciesci- Changes to CI configuration files and scriptschore- Other changes that don't modify src or test filesrevert- Reverts a previous commit
Scope
The scope should be the name of the package or area affected. For this monorepo:
Apps:
api- Backend API servicebot- Discord botdesktop- Desktop applicationlockdex- Lockdex servicewww- Web applicationmirror-service- Mirror service
Packages:
common- Common utilitiesdatabase- Database schema and clientlogging- Logging packageshared- Shared utilitiesvpk-parser- VPK parser
Other:
deps- Dependency updatesrepo- Repository-wide changesrelease- Release-related changes
Subject
The subject contains a succinct description of the change:
- Use the imperative, present tense: "change" not "changed" nor "changes"
- Don't capitalize the first letter
- No period (.) at the end
- Keep it under 72 characters
Body (Optional)
The body should include the motivation for the change and contrast this with previous behavior.
- Use the imperative, present tense
- Wrap at 72 characters
- Separate from subject with a blank line
Footer (Optional)
The footer should contain information about Breaking Changes and reference issues that this commit closes.
Breaking Changes should start with BREAKING CHANGE: followed by a description.
Closes references should be on a separate line and use the format: Closes #123, #456
Examples
Feature Addition
feat(desktop): add mod conflict detection
Implement visual indicators for mod conflicts and add conflict
resolution suggestions to the UI.
Closes #142
Bug Fix
fix(api): handle edge case in pagination
Fix incorrect offset calculation when page size exceeds total items.
This prevents API errors when requesting pages beyond available data.
Breaking Change
feat(api)!: remove deprecated v1 endpoints
BREAKING CHANGE: The /v1/mods endpoint has been removed. All clients
must migrate to the /v2/mods endpoint which provides better filtering
and pagination support.
Migration guide available at docs/migration/v1-to-v2.md
Dependency Update
chore(deps): update @tauri-apps/api to v2.1.0
Documentation
docs(readme): add installation instructions for Linux
Multiple Scopes
refactor(desktop,shared): extract mod validation logic to shared package
Simple Fix
fix(www): correct button alignment on mobile
Branch Naming Conventions
Branch Format
<type>/<ticket-or-description>
Types
feature/- New featuresbugfix/- Bug fixeshotfix/- Critical fixes that need immediate deploymentrefactor/- Code refactoringchore/- Maintenance tasksdocs/- Documentation updates
Branch Naming Rules
- Use kebab-case for descriptions
- Include ticket/issue numbers when applicable
- Keep names descriptive but concise
- Use lowercase letters
Branch Examples
# With ticket number
feature/KR-123-add-mod-collections
bugfix/KR-456-fix-download-crash
hotfix/KR-789-security-patch
# Without ticket number
feature/dark-mode-toggle
bugfix/pagination-edge-case
refactor/extract-validation-logic
chore/update-dependencies
docs/add-api-examples
Gathering Git Context
Run this single command to gather all necessary information:
echo "=== BRANCH ===" && git rev-parse --abbrev-ref HEAD && echo "=== STAGED FILES ===" && git diff --staged --stat && echo "=== STAGED CHANGES ===" && git diff --staged
This provides:
- Current branch name
- Staged files summary → determine scope (which workspace/package)
- Actual changes → determine commit type and write description
Changesets Integration
This project uses changesets for version management. See changeset for details on when and how to create changesets alongside commits.
Current branch (agents)
When running /commit or creating commits for the user, use the **checked-out
branch** as-is. Do not create, switch to, or require a feature branch only
because the current branch is main or master, unless the user explicitly
asks for a different branch.
Parallel work and recovery
Separate worktrees are preferred when tasks need independent branches or Git
operations. Shared-checkout parallel work is also supported; follow the user's
preference rather than requiring isolation.
- Assign each writer files or hunks. Coordinate overlapping edits while other
tasks continue. Read-only reviews can share either checkout arrangement.
- In a shared checkout, coordinate operations that change HEAD, the index, or
working files: staging, commits, branch switches, merges, rebases, resets,
restores, cleans, and stash application. Recheck status and HEAD immediately
before acting; a status snapshot is not a lock.
- Stage only the task's files or hunks, inspect the staged diff, and commit only
that scope. Preserve other tasks' staged and unstaged changes. Avoid blanket
staging or whole-file commits when ownership is split within a file.
- Before a branch switch, history rewrite, cleanup, or recovery, preserve all
affected work in scoped commits or a verified backup. Include untracked files
and record the source HEAD and backup identifier. A dirty checkout is not
permission to discard changes or stash another task's work.
- Stashes are shared across worktrees. Identify a stash by its exact commit SHA,
check its contents, and apply that SHA rather than whichever stash is newest.
Verify the restored work before dropping a stash; resolve its current selector
to the recorded SHA immediately before dropping it.
- Resolve conflicts against the current target branch, preserving each change's
intent. Before restoring an older whole file, inspect every newer change it
would remove and carry forward the ones outside the intended recovery.
- Treat commit ancestry and patch equivalence as leads. Before skipping work as
already merged, verify its implementation and intended behavior in the target
tree, including changes that remained uncommitted beside that commit.
- Before integration, review the final diff against the current target, explain
unrelated deletions or reversals, and run the relevant checks. Use the existing
merge queue for PRs; coordinate direct integration into the same branch. A
rejected push calls for inspecting new remote work, not force-pushing over it.
CI's Recent reversion warnings job flags exact reversals of patch hunks from
the previous seven days of base-branch history, capped at 300 commits. Review
warnings for accidental losses; deliberate removals and extractions can also
match. Consumed changeset files are excluded. The job is advisory and does not
gate parallel work or integration. It does not prove that all behavior survived.