agentleFS
rafidonerafidone/agent-skills/skills/git-workflow-and-versioning/SKILL.md

git-workflow-and-versioning

Skill1 starsChanged 22 days agoMITView on GitHub

Creates small, reviewable commits and a clear branch and version history. Use when staging changes, writing commit messages, splitting work into commits, preparing a release tag, or repairing a messy history before review.

78 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use accessibility-engineering, observability-and-instrumentation and 8 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.
  • steven123397Skill

    accessibility-engineering

    Audits existing interfaces for WCAG 2.2 AA conformance and remediates the violations found. Use when auditing a page or component for accessibility, running axe-core or pa11y, triaging a11y violations, or checking screen reader and contrast issues before shipping.

    Also in 4 projects that use this

  • jaydubya818Skill

    observability-and-instrumentation

    Add or review logs, metrics, traces, and actionable alerts.

    Also in 40 projects that use this

  • jaydubya818Skill

    deprecation-and-migration

    Retire APIs or migrate consumers and persistent data across releases.

    Also in 42 projects that use this

  • HK-hubSkill

    source-driven-development

    Grounds every implementation decision in official documentation. Use when you want authoritative, source-cited code free from outdated patterns. Use when building with any framework or library where correctness matters.

    Also in 43 projects that use this

  • seikaikyoSkill

    doubt-driven-development

    對非平凡決策啟動新鮮 context 對抗審查(找碴不背書),在修正還便宜的時候抓出錯誤方向。適用:高風險改動(production、資安敏感邏輯、不可逆操作)、不熟的程式碼、要宣稱「這樣是安全的 / 可行的」之前。機械性操作與一行修改不適用。

    Also in 41 projects that use this

  • seikaikyoSkill

    interview-me

    需求不明時的意圖萃取訪談:一次一題、每題附上自己的猜測、聽出「真正想要 vs 覺得應該要」,直到能預測使用者反應(約 95% 信心)才動工。適用:需求缺少對象 / 動機 / 成功標準 / 約束,或使用者點名「訪談我」「先確認一下」「我們確定嗎」。明確自足的指示、純資訊查詢、機械性操作不適用。

    Also in 42 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 74 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 1

    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:

    Use this skill when:

    line 29
  2. Distinctive:

    Do not use it for:

    line 38
  3. Distinctive:

    Run the relevant tests before staging.

    line 50
  4. Distinctive:

    If the message needs "and", consider splitting.

    line 65
  5. Distinctive:

    Use git add -p or explicit paths.

    line 69
  6. Distinctive:

    Check for secrets, large binaries, editor files, and debug output before the commit, not after the push.

    line 73
  7. Very specific:

    Do not bypass hooks with --no-verify.

    line 99
  8. Distinctive:

    Keep branches short-lived.

    line 110
  9. Distinctive:

    Use semantic versioning for anything with consumers:

    line 115
  10. Distinctive:

    Exit condition: every commit is independently understandable and green, the tag matches the manifest, and shared history is intact.

    line 130

“Common” is measured: kept by at least 6 in 10 of the 74 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 and Versioning

Overview

Git history is the record of why the code looks the way it does. A good history lets a future engineer find the change that introduced a bug, understand the tradeoff, and revert one decision without reverting five others.

A commit is a logical change with its tests, not a save point. "WIP", "fixes", and a 60-file diff are not history; they are a backup that happens to be stored in Git.

Tags and versions are part of the same contract. A version number tells consumers what to expect. A tag that does not match the manifest is a broken promise.

When to Use

Use this skill when:

  • Staging or committing any change.
  • Deciding where one commit ends and the next begins.
  • Writing a commit message or a pull request description.
  • Preparing a release tag or a changelog.
  • Cleaning up a branch before review.
  • Recovering from a merge, rebase, or accidental commit.

Do not use it for:

  • Reading history to understand code; that is ordinary repository use.
  • A detached scratch checkout where nothing will be committed.

Related: use the code-review-and-quality skill before committing, and the shipping-and-launch skill after the tag.

Core Process

1. Establish a clean baseline

Run the relevant tests before staging. Never commit a known-red change as a checkpoint unless the commit message says so explicitly and the branch is private.

2. Decide the commit boundary

One commit should represent one logical change that a reviewer can understand and revert independently:

  • A behavior change plus its test.
  • A refactor with no behavior change.
  • A dependency bump with its lockfile.
  • A documentation correction.
  • A formatting pass, separate from everything else.

If the message needs "and", consider splitting.

3. Stage selectively

Use git add -p or explicit paths. Review the staged diff with git diff --cached before committing. Do not use git add . in a repository where unrelated files may be present.

Check for secrets, large binaries, editor files, and debug output before the commit, not after the push.

4. Write the message

<type>(<scope>): <imperative summary, 72 characters or fewer>

Why the change is needed. What was wrong, what the user saw, or what the
requirement is. Link the issue or spec.

How the change addresses it, including any tradeoff or rejected alternative.

Evidence: the commands run and their results.

Conventional Commits types are a useful default: feat, fix, refactor, test, docs, build, ci, perf, chore. Use them only if the project already does; consistency beats novelty.

The subject is imperative and describes the result: "reject overdrafts", not "rejected overdrafts" or "fixing bug". The body explains why, which the diff cannot.

5. Commit and let hooks run

Do not bypass hooks with --no-verify. If a hook fails, fix the cause. If the hook is wrong, fix the hook in a separate commit.

6. Choose a branch strategy

  • Trunk-based is the default for small teams and frequent releases. Short branches, merged within days.
  • Feature branches are fine when a change must be reviewed as a unit.
  • Release branches are for maintaining older versions, not for hiding unstable work.

Keep branches short-lived. A branch open for weeks accumulates conflicts and loses the benefit of continuous integration.

7. Version deliberately

Use semantic versioning for anything with consumers:

  • MAJOR for a breaking change.
  • MINOR for backward-compatible behavior.
  • PATCH for backward-compatible fixes.

Annotate release tags: git tag -a v1.4.0 -m "v1.4.0". Keep the manifest version, the changelog, and the tag in sync in the same commit.

8. Do not rewrite shared history

Rebase and amend are fine on a private branch. Once a branch is shared and reviewed, prefer merge or revert over force-push. If a secret was committed, rotate it; rewriting history is not sufficient.

Exit condition: every commit is independently understandable and green, the tag matches the manifest, and shared history is intact.

Common Rationalizations

RationalizationWhy it is wrongRequired action
"WIP commits are fine; I will squash later."Squashing is often skipped, and the intermediate history is unreadable meanwhile.Commit logical changes as you go.
"The message does not matter."It is the only explanation a future reader has.Write the why in the body.
"One big commit is simpler."It cannot be reviewed, bisected, or reverted cleanly.Split by logical change.
"I will force-push to tidy up."It rewrites shared history and breaks other clones.Force-push only on a private branch.
"Tags are optional."Consumers and releases depend on them being accurate.Tag releases and keep the manifest in sync.
"git add . is faster."It stages secrets, binaries, and unrelated work.Stage explicit paths and review the diff.
"I will skip the hook this once."The hook exists because the check matters.Fix the cause or the hook.
"The version bump is a formality."A wrong version breaks installs and rollbacks.Bump semver according to the actual change.

Red Flags

  • The commit subject is "wip", "fixes", "updates", or empty.
  • One commit mixes refactoring, behavior, and formatting.
  • Tests and implementation are in separate commits with a red commit between.
  • A secret or large binary appears in the diff.
  • The staged diff was never reviewed.
  • Hooks are bypassed.
  • The tag and the manifest version disagree.
  • A shared branch was force-pushed.
  • History was rewritten to hide a leaked credential.
  • A release tag has no changelog entry.

Verification

  • The baseline test suite was green before committing.
  • Each commit represents one logical change.
  • Tests and their behavior change are in the same commit.
  • The staged diff was reviewed for secrets and unrelated files.
  • Every commit subject is imperative and under 72 characters.
  • Every commit body explains why, not just what.
  • Hooks ran and passed.
  • The branch is short-lived and up to date.
  • The version follows semantic versioning for the actual change.
  • The tag, manifest, and changelog agree.
  • Shared history was not rewritten.

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.