agentleFS
XData-siXData-si/xdata-agenthub/skills/git-workflow/SKILL.md

git-workflow

Skill1 starsChanged 32 days agoMITView on GitHub

Prepare clean branches, atomic commits and reviewable pull or merge requests without rewriting shared history or leaking secrets. Use when committing, branching, rebasing, resolving conflicts or preparing a change for review.

  • Reads credentials

187 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ci-cd-pipelines, architectural-proposals 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.
  • harrissohail6Skill

    ci-cd-pipelines

    CI/CD pipeline design and implementation. Auto-activates when discussing deployment, automation, or pipelines.

    Also in 6 projects that use this

  • Microsoft AzureSkill

    architectural-proposals

    How to write comprehensive architectural proposals that drive alignment before code is written

    Also in 4 projects that use this

  • Microsoft AzureSkill

    ci-validation-gates

    Defensive CI/CD patterns: semver validation, token checks, retry logic, draft detection — earned from v0.8.22

    Also in 4 projects that use this

  • Galaxy-DawnSkill

    results-report

    This skill should be used when the user asks to "write an experiment report", "summarize experimental results", "do experiment retrospection", "write a results report", "写实验总结报告", "写实验复盘", or mentions turning completed experiment artifacts into a structured, decision-oriented research report. It assumes strict analysis should come from `results-analysis` first.

    Also in 3 projects that use this

  • frostneySkill

    delivery-wait

    Provides deterministic, resumable GitHub transition waits used internally by delivery workflows. Use when another workflow must await CI, merge, tag, or release state without model heartbeats.

    Also in 3 projects that use this

  • frostneySkill

    native-nostalgia-stack

    Applies the user's FreePascal toolchain and its build, formatting, hook, and test contracts while leaving project-specific mechanics local. Use when scaffolding or working in a FreePascal project that follows this toolchain.

    Also in 3 projects that use this

  • +6 more from Azure

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 166 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 2

    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:

    Commit message convention (for example Conventional Commits) and protected branch rules.

    line 14
  2. Very specific:

    No force push to shared or protected branches.

    line 26
  3. Distinctive:

    If a secret was committed: treat it as leaked.

    line 27
  4. Very specific:

    Do not bypass hooks (--no-verify) or protections without explicit authorization.

    line 28
  5. Distinctive:

    No history rewrite on shared branches.

    line 54

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

Goal

A history that reviewers can follow and that can be bisected and reverted safely.

Inputs

  • Repository branching model (trunk-based, GitFlow, release branches) from CONTRIBUTING.md.
  • Commit message convention (for example Conventional Commits) and protected branch rules.

Procedure

  1. Start from an updated base. git fetch and branch from the current target (main). Name branches by intent (fix/invoice-rounding, 123-export-csv).
  2. Stage deliberately. Review git diff and git status; stage by file or hunk (git add -p). Never commit generated artefacts, local configuration, .env files or credentials.
  3. Atomic commits. One logical change per commit, and the tests pass at every commit when practical. Subject in the imperative, ≤ 72 characters; the body explains why and references the issue.
  4. Keep up to date. Rebase your own unpublished branch on the target or merge the target in, per project convention. After a branch is shared, prefer merge or new commits over rewriting.
  5. Resolve conflicts carefully. Understand both sides; rerun tests after resolution; never pick "ours" or "theirs" for whole files without reading them.
  6. Open the review. Description: what, why, how to verify, risks, screenshots or logs. Keep it small (guideline: under ~400 changed lines) or split it.
  7. Respond to review with follow-up commits so reviewers see what changed; squash only if the project wants it, at merge time.

Hard rules

  • No force push to shared or protected branches. On your own unmerged branch, use --force-with-lease only when the project allows it.
  • If a secret was committed: treat it as leaked. Rotate it first; rewriting history does not undo exposure.
  • Do not bypass hooks (--no-verify) or protections without explicit authorization.

Decision points

  • History needs fixing after push → add a corrective commit, or open a new branch and pull request, instead of rewriting.
  • Large binary or generated files → Git LFS or build artefacts, not the repository.

Example fixture

fix: round invoice totals half-up per line item

Totals were rounded once at the end, which differed from the printed lines
by up to 1 cent. Refs #123

Common rationalizations

RationalizationReality
Force-pushing is fine, nobody uses this branch.Reviewers, CI and other agents may have fetched it. Use new commits or a new branch unless the branch is provably yours alone.
I'll clean up the history later.Later rarely comes, and history rewrites after review lose discussion context. Commit cleanly now.
Skipping the hook just this once.Hooks encode checks the project decided on. Bypassing them needs explicit authorization.
The secret was only in one commit, I'll remove it.Assume it is leaked the moment it was pushed. Rotate first; rewriting history does not revoke it.

Acceptance checks

  • git diff --staged reviewed; no secrets, debug output or unrelated files.
  • Each commit message explains the reason for the change.
  • Branch is current with the target and CI is green, or failures are explained.
  • No history rewrite on shared branches.

Output

Branch, commits and a review request with a verification section.

Safety

Destructive commands (reset --hard, clean -fdx, push --force, branch deletion) require checking what will be lost and explicit approval when others may be affected.

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.