Index of every page on this site: llms.txt
All skills
Run it yourself

Git conventions for teams including conventional commits, branching strategies, PR workflows, merge strategies, and commit message formatting. Use when writing commit messages, creating branches, setting up Git workflows, or when the user asks about Git conventions, commit formats, branching strategies, or PR best practices.

Use this Skill: https://skilld.dev/gh/grahamcrackers/skills/git-conventions

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈86 tokens for metadata: the name and description. ≈1.6k when used: this file.

Description uses 4.3% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈344 characters, or 4.3%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Git Conventions

Conventional Commits

Format: <type>(<scope>): <description>

feat(auth): add OAuth2 login with Google
fix(api): handle null response from user endpoint
docs(readme): add deployment instructions
refactor(hooks): extract shared fetch logic into useApi
test(auth): add integration tests for login flow
chore(deps): update react to v19.1

Types

Type When to Use
feat New feature or capability
fix Bug fix
docs Documentation only
style Formatting, whitespace (no logic change)
refactor Code change that neither fixes a bug nor adds a feature
perf Performance improvement
test Adding or updating tests
build Build system or external dependencies
ci CI/CD configuration
chore Maintenance tasks, tooling
revert Reverts a previous commit

Rules

  • Type is required and lowercase.
  • Scope is optional, lowercase, describes the area of change (auth, api, ui, deps).
  • Description is required, imperative mood ("add", not "added" or "adds"), lowercase, no period at the end.
  • Body (optional) explains why, not what. Wrap at 72 characters.
  • Breaking changes: add ! after the type/scope or include BREAKING CHANGE: in the footer.
feat(api)!: change authentication to use JWT tokens

BREAKING CHANGE: The session-based auth endpoints have been removed.
Clients must now use Bearer tokens in the Authorization header.

Multi-Line Commits

fix(payments): prevent duplicate charge on retry

The retry logic was not checking if the original charge succeeded
before attempting a new one. Added idempotency key validation
to the charge endpoint.

Closes #1234

Branching Strategy

Branch Naming

feature/add-user-dashboard
fix/null-pointer-in-checkout
chore/upgrade-dependencies
docs/api-authentication-guide
refactor/extract-payment-service

Pattern: <type>/<short-description> using kebab-case.

Trunk-Based Development (Recommended)

main ─────●────●────●────●────●─────
           \       /      \       /
            ●────●          ●────●
          feature/x       fix/y
  • main is always deployable.
  • Short-lived feature branches (1-3 days).
  • Merge via squash or rebase to keep history linear.
  • Use feature flags for long-running work instead of long-lived branches.

Git Flow (When Required)

main    ─────●──────────────●───────
              \            /
develop ───●───●───●───●───●────●───
            \     /     \     /
             ●───●       ●───●
           feature/x   feature/y
  • main — production releases.
  • develop — integration branch.
  • feature/* — branch from develop, merge back to develop.
  • release/* — stabilization before production.
  • hotfix/* — urgent fixes from main.

Use trunk-based development unless the project specifically requires Git Flow.

Commit Best Practices

  • Atomic commits: Each commit is one logical change that compiles and passes tests.
  • Commit often: Small, frequent commits are easier to review, bisect, and revert.
  • Don't commit generated files: Add build outputs, lock files changes (when unintended), and artifacts to .gitignore.
  • Don't commit secrets: Never commit .env, API keys, credentials, or tokens.
  • Sign commits: Use git commit -S for verified authorship.

Pull Request Conventions

PR Title

Follow the same conventional commit format:

feat(dashboard): add real-time notifications widget
fix(auth): resolve token refresh race condition

PR Description Template

## Summary

Brief description of what this PR does and why.

## Changes

- Added notification WebSocket connection
- Created NotificationBell component
- Updated header layout to include notifications

## Testing

- [ ] Unit tests pass
- [ ] Manual testing in staging
- [ ] Tested on mobile viewport

## Screenshots

(if applicable)

PR Best Practices

  • Keep PRs small (< 400 lines of diff when possible).
  • One concern per PR — don't mix refactoring with feature work.
  • Self-review before requesting reviews.
  • Respond to all review comments, even if just "Done" or "Won't fix because...".
  • Squash merge to keep main history clean.

Merge Strategies

Strategy When to Use Result
Squash merge Feature branches to main One clean commit per feature
Rebase merge When you want linear history with individual commits Flat history, each commit preserved
Merge commit When branch history matters (release branches) Explicit merge point

Default recommendation: Squash merge for feature branches into main. This gives a clean, bisectable history where each commit represents one complete feature or fix.

.gitignore Essentials

# Dependencies
node_modules/

# Build output
dist/
build/
.next/
out/

# Environment
.env
.env.local
.env.*.local

# IDE
.vscode/settings.json
.idea/

# OS
.DS_Store
Thumbs.db

# Debug
*.log
npm-debug.log*

# Test coverage
coverage/

Useful Aliases

git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.cm "commit -m"
git config --global alias.st status
git config --global alias.lg "log --oneline --graph --decorate -20"
git config --global alias.amend "commit --amend --no-edit"
git config --global alias.unstage "reset HEAD --"

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts9mo4 checks · Risk SAFE
  • Gen Agent Trust Hub9mo

    The skill provides documentation and best practices for Git workflows, including commit messaging conventions and branching strategies. It does not contain any executable code, network operations, or security risks.

  • Socket9mo

    No alerts

  • Snyk9mo

    Risk: LOW · No issues

  • Runlayer9mo

    1 file scanned · No issues

Signed by skilld at ca83de4. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 9 months ago

README badge

README badge for grahamcrackers/skills/git-conventions