agentleFS
a365ngaya365ngay/CogniRouter/skills/senior-git-workflow/SKILL.md

senior-git-workflow

Skill2 starsChanged 5 days agoMITView on GitHub

Use when planning or performing Git work such as branching strategy, commits and messages, rebasing or merging, resolving conflicts, cherry-picking, bisecting, recovering lost work, rewriting history, tagging and releases, monorepo or submodule issues, or repository hygiene (.gitignore, large files, leaked secrets).

  • Deletes or force-pushes
  • Commits and pushes

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    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:

    Keep history clear and recoverable, resolve conflicts without losing work, and never surprise collaborators with destructive changes.

    line 10
  2. Distinctive:

    Check the state: git status, current branch, upstream tracking, unpushed commits, stashes, and whether the branch is shared or protected.

    line 14
  3. Distinctive:

    Read the repository's branching, commit message, and release conventions (contributing guide, PR templates, tag format).

    line 15
  4. Very specific:

    Before any destructive operation (force push, history rewrite, reset --hard, branch or tag deletion), create a backup ref and get explicit …

    line 16
  5. Very specific:

    Prefer git push --force-with-lease over --force, and never force-push shared or protected branches without agreement.

    line 21
  6. Distinctive:

    Use git bisect with a test command to find regressions.

    line 23
  7. Very specific:

    Keep build output, dependencies, and local config out of the repository with .gitignore.

    line 26
  8. Distinctive:

    After the operation, confirm with git log --oneline --graph, git status, and a diff against the expected tree, and run tests after merges, …

    line 30

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “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

Senior Git Workflow

Role

Keep history clear and recoverable, resolve conflicts without losing work, and never surprise collaborators with destructive changes.

Before Acting

  1. Check the state: git status, current branch, upstream tracking, unpushed commits, stashes, and whether the branch is shared or protected.
  2. Read the repository's branching, commit message, and release conventions (contributing guide, PR templates, tag format).
  3. Before any destructive operation (force push, history rewrite, reset --hard, branch or tag deletion), create a backup ref and get explicit authorization.

Workflow Rules

  • Make focused commits with messages that state what and why, following the project's convention (for example Conventional Commits).
  • Prefer git push --force-with-lease over --force, and never force-push shared or protected branches without agreement.
  • Resolve conflicts by understanding both sides: read each change's intent, keep both behaviors where required, then run tests. Never resolve by blindly choosing ours or theirs for whole files.
  • Use git bisect with a test command to find regressions; use git reflog to recover lost commits before assuming work is gone.
  • Rewriting published history changes every downstream hash and tag: update tags and releases and tell collaborators to re-clone or reset.
  • Leaked secrets: rotate the secret first, then remove it from history (git filter-repo or BFG) and force-push with coordination; history rewriting alone is not enough.
  • Keep build output, dependencies, and local config out of the repository with .gitignore; use Git LFS for large binaries if the project allows it.

Verification

After the operation, confirm with git log --oneline --graph, git status, and a diff against the expected tree, and run tests after merges, rebases, or conflict resolutions.

Review Checklist

  • Was a backup ref created before any destructive step?
  • Is the resulting history and tree exactly what was intended?
  • Were collaborators, tags, and releases accounted for after rewrites?
  • Are secrets rotated, not just removed from history?

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.