Git conventions

From deadlock-mod-manager/deadlock-mod-manager · View interactive version

Git conventions is an AI agent skill from the GitHub repository deadlock-mod-manager/deadlock-mod-manager. Repository conventions for commit messages, branch names, and version control. Use when writing a commit message, naming or creating a branch, or deciding which branch to commit on.

How to use this skill

Skill file

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:

Scope

The scope should be the name of the package or area affected. For this monorepo:

Apps:

Packages:

Other:

Subject

The subject contains a succinct description of the change:

Body (Optional)

The body should include the motivation for the change and contrast this with previous behavior.

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

Branch Naming Rules

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:

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.

tasks continue. Read-only reviews can share either checkout arrangement.

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.

that scope. Preserve other tasks' staged and unstaged changes. Avoid blanket

staging or whole-file commits when ownership is split within a file.

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.

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.

intent. Before restoring an older whole file, inspect every newer change it

would remove and carry forward the ones outside the intended recovery.

already merged, verify its implementation and intended behavior in the target

tree, including changes that remained uncommitted beside that commit.

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.

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.