agentleFS
timwukptimwukp/agent-skills-best-practice/skills/skills/git-workflow/SKILL.md

git-workflow

Skill12 starsChanged 3 months agoMITView on GitHub

Helps with git workflows including conventional commit messages, branching strategies, merge conflict resolution, and changelog generation. Triggers on: "git commit message", "branching strategy", "resolve conflict", "generate changelog".

118 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use squad-commands, typescript-patterns and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    squad-commands

    Categorized catalog of common Squad operations. Coordinator reads this file and presents it as an interactive menu when the user asks for available commands or help.

    Also in 3 projects that use this

  • cohen-lielSkill

    typescript-patterns

    TypeScript best practices and patterns. Use when writing TypeScript code, defining types, working with generics, or converting JavaScript to TypeScript.

    Also in 4 projects that use this

  • martinholovskySkill

    llm-integration

    Expert skill for integrating local Large Language Models using llama.cpp and Ollama. Covers secure model loading, inference optimization, prompt handling, and protection against LLM-specific vulnerabilities including prompt injection, model theft, and denial of service attacks.

    Also in 4 projects that use this

  • MicrosoftSkill

    cost-optimization

    Optimize existing Azure resources and analyze Reservations or Savings Plans. WHEN: \"optimize Azure costs\", \"reduce cloud spending\", \"rightsize resources\", \"find idle resources\", \"orphaned disk\", \"deleted VM still charged\", \"public IP still charging\", \"reservation utilization\", \"Savings Plan coverage\", \"commitment recommendation\", \"why is pay-as-you-go still charged\". DO NOT USE FOR: cost spikes, forecasts, pricing estimates, budgets, or governance.

    Also in 5 projects that use this

  • YepAPISkill

    background-jobs

    Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

    Also in 3 projects that use this

  • Vimalk0703Skill

    dependency-management

    Vet packages before adoption, audit for vulnerabilities, pin versions, and prevent dependency bloat.

    Also in 3 projects that use this

  • +1 more from microsoft

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 10 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 101 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Ask clarifying questions only if the intent is ambiguous.

    line 26
  2. Distinctive:

    When writing commit messages, follow the Conventional Commits specification:

    line 30
  3. Distinctive:

    Avoid unless you have a specific reason to use it

    line 92
  4. Distinctive:

    When helping resolve conflicts:

    line 98
  5. Distinctive:

    Delete/modify conflict (one branch deleted, other modified)

    line 103
  6. Distinctive:

    Use Keep a Changelog format

    line 151
  7. Distinctive:

    Default to Conventional Commits format unless the project uses a different convention

    line 170
  8. Distinctive:

    Keep commit descriptions under 72 characters

    line 171
  9. Distinctive:

    When resolving conflicts, always explain why the chosen resolution is correct

    line 173
  10. Distinctive:

    Never suggest force-pushing to shared branches without explicit warning

    line 175

“Common” is measured: kept by at least 6 in 10 of the 101 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Git Workflow

Instructions

Step 1: Identify the Task

Determine which workflow the user needs:

  1. Commit message - writing or improving a commit message
  2. Branching strategy - choosing or implementing a branching model
  3. Conflict resolution - resolving merge conflicts
  4. Changelog - generating release notes from commit history

Ask clarifying questions only if the intent is ambiguous.

Step 2: Conventional Commits

When writing commit messages, follow the Conventional Commits specification:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Types (in order of frequency):

  • feat - new feature (correlates with MINOR in semver)
  • fix - bug fix (correlates with PATCH in semver)
  • docs - documentation only
  • style - formatting, no code change
  • refactor - neither fix nor feature
  • perf - performance improvement
  • test - adding or fixing tests
  • chore - build process, tooling, dependencies
  • ci - CI/CD configuration changes

Rules:

  • Description is lowercase, no period at end, max 72 characters
  • Body wraps at 72 characters, explains what and why (not how)
  • Breaking changes: add ! after type or BREAKING CHANGE: in footer

Examples:

feat(auth): add OAuth2 login with Google provider

Implements the OAuth2 authorization code flow for Google.
Stores tokens in encrypted session storage.

Closes #142
fix(api): prevent race condition in concurrent order creation

Added optimistic locking with version column check.
Returns 409 Conflict when version mismatch detected.

Step 3: Branching Strategies

Recommend based on team size and release cadence:

Trunk-Based Development (recommended for most teams):

  • Single main branch, always deployable
  • Short-lived feature branches (max 2 days)
  • Feature flags for incomplete work
  • Best for: CI/CD, small teams, frequent releases

GitHub Flow:

  • main branch + feature branches
  • PR-based review before merge
  • Deploy from main after merge
  • Best for: open source, SaaS with continuous deployment

GitFlow (only for complex release schedules):

  • main, develop, feature/*, release/*, hotfix/*
  • Best for: packaged software, multiple supported versions
  • Avoid unless you have a specific reason to use it

Provide the branching diagram and example commands for the chosen strategy.

Step 4: Conflict Resolution

When helping resolve conflicts:

  1. Identify the conflict type:
    • Content conflict (same lines changed)
    • Rename conflict (file renamed differently)
    • Delete/modify conflict (one branch deleted, other modified)
  2. Show both sides clearly:
    <<<<<<< HEAD (your changes)
    [your code]
    =======
    [their code]
    >>>>>>> feature-branch (incoming changes)
  3. Suggest resolution strategy:
    • Take ours (keep current branch)
    • Take theirs (accept incoming)
    • Merge both (combine changes)
    • Rewrite (neither version is correct)
  4. Provide the resolved code and the commands:
    # After resolving
    git add <resolved-files>
    git commit  # or git rebase --continue

Step 5: Changelog Generation

Generate changelogs from conventional commits:

## [1.2.0] - 2024-01-15

### Added
- OAuth2 login with Google provider (#142)
- Rate limiting on public API endpoints (#156)

### Fixed
- Race condition in concurrent order creation (#163)
- Memory leak in WebSocket connection handler (#158)

### Changed
- Upgraded Node.js requirement to v18+ (BREAKING)

Process:

  1. Parse commits since last tag: git log v1.1.0..HEAD --oneline
  2. Group by type (feat=Added, fix=Fixed, refactor/perf=Changed)
  3. Include PR/issue numbers
  4. Highlight breaking changes prominently
  5. Use Keep a Changelog format

Example

User says: "Write a commit message for adding email validation to the signup form"

Response:

feat(signup): add email validation with DNS MX record check

Validates email format client-side and verifies MX records server-side.
Displays inline error message when validation fails.
Debounces server check by 500ms to reduce API calls.

Closes #89

Guidelines

  • Default to Conventional Commits format unless the project uses a different convention
  • Keep commit descriptions under 72 characters
  • Recommend trunk-based development unless the team has a specific need for GitFlow
  • When resolving conflicts, always explain why the chosen resolution is correct
  • For changelogs, include only user-facing changes unless generating internal release notes
  • Never suggest force-pushing to shared branches without explicit warning

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.