agentleFS
RealDougEubanksRealDougEubanks/ClaudeMarketplace/skills/git-workflow/SKILL.md

git-workflow

Skill1 starsChanged 3 months agoMITView on GitHub

Enforces the release-branch Git model: scaffold feature branches, open PRs with review checks, cut releases with tags, and view workflow reference.

  • Reads credentials
  • Deletes or force-pushes
  • Commits and pushes

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

Show its rules and text

We split this skill into the rules it gives an agent

40 rules. 0 are common, 29 are distinctive, and 11 are very specific to this project.

  • 0

    Common

    Most of the 101 edited versions we read keep these.

  • 29

    Distinctive

    This author's own choices. Worth a look.

  • 11

    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:

    Never commit or push directly to main: If the current branch is main, stop and create a new branch before making any changes.

    line 14
  2. Distinctive:

    All changes must reach main via a PR from a release branch.

    line 16
  3. Distinctive:

    When invoked, ask the user what they want to do (if not already specified):

    line 20
  4. Distinctive:

    Use Bash to identify the current release branch:

    line 42
  5. Very specific:

    No-release-branch fallback: If the command above returns no output (no release/* branch exists), fall back to branching from main and …

    line 47
  6. Distinctive:

    Use Bash to fetch the latest remote state, then create and check out the branch from the release branch:

    line 57
  7. Distinctive:

    Never commit directly to main or the release branch.

    line 65
  8. Distinctive:

    Use Bash to check the current branch and recent commits:

    line 72
  9. Very specific:

    Use Glob to check if handoffs/reviews/ exists.

    line 78
  10. Distinctive:

    Use Bash to identify the target release branch:

    line 80
  11. Very specific:

    Use Read to check handoffs/plans/ for context to include in the PR description.

    line 85
  12. Very specific:

    If gh is not available, print the PR body for the user to paste manually.

    line 91
  13. Distinctive:

    Use Bash to confirm the current release branch is clean and all PRs are merged:

    line 97
  14. Very specific:

    Ask the user for the version tag (e.g.

    line 103
  15. Very specific:

    If gh is not available, print the PR body and ask the user to open the PR manually.

    line 109
  16. Distinctive:

    After the PR is approved and merged, tag the release on main.

    line 111
  17. Distinctive:

    Use Bash to identify all conflicted files:

    line 125
  18. Distinctive:

    Use Bash to fetch the latest remote state and show how far behind the current branch is:

    line 131
  19. Distinctive:

    Ask the user whether to rebase or merge to incorporate upstream changes, and explain the tradeoffs:

    line 138
  20. Distinctive:

    Wait for the user's choice before proceeding.

    line 142
  21. Very specific:

    After all conflicted files are resolved, use Bash to stage only the resolved files by name (never git add ., which would sweep untracked …

    line 152
  22. Distinctive:

    If rebase was chosen:

    line 153
  23. Distinctive:

    If additional conflict rounds occur, repeat steps 4–5 for each round until the rebase completes.

    line 158
  24. Distinctive:

    If merge was chosen:

    line 159
  25. Distinctive:

    Use Bash to confirm the branch is clean and ready to push:

    line 165
  26. Distinctive:

    Verify there are no remaining conflict markers and the working tree is clean.

    line 170
  27. Very specific:

    If rebase was used, a force-push is required: git push --force-with-lease origin <branch>.

    line 171
  28. Very specific:

    If merge was used, a regular push is safe: git push origin <branch>.

    line 172
  29. Distinctive:

    Use Bash to list all stashes:

    line 178
  30. Distinctive:

    If the list is empty, inform the user and stop.

    line 182
  31. Distinctive:

    Ask the user which stash number (N) to inspect.

    line 195
  32. Distinctive:

    Ask the user which stash number (N) to apply.

    line 203
  33. Distinctive:

    After applying, check for conflicts:

    line 207
  34. Very specific:

    If any conflicts are present (files show both modified or similar), inform the user and run Action (e) to resolve them.

    line 211
  35. Distinctive:

    Ask the user which stash number (N) to pop.

    line 215
  36. Distinctive:

    After popping, check for conflicts the same way as sub-action (ii).

    line 219
  37. Distinctive:

    Ask the user which stash number (N) to drop.

    line 223
  38. Distinctive:

    After any sub-action completes, run git stash list again and show the user the updated stash state.

    line 241
  39. Very specific:

    Document the chosen merge style in docs/assumptions.md at project start.

    line 287
  40. Distinctive:

    After completing any action, confirm:

    line 295

“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 — Release-Branch Model

Enforce the release-branch Git model and help execute the correct git operations for your current context: start new work, open a PR, cut a release, or view the workflow reference.

Hard Rules (always enforced, no exceptions)

  • Never commit or push directly to main. If the current branch is main, stop and create a new branch before making any changes.
  • Never force-push to main.
  • All changes must reach main via a PR from a release branch.

Instructions

When invoked, ask the user what they want to do (if not already specified):

"What would you like to do? (a) View the Git workflow reference (b) Start new work — scaffold a feature or fix branch (c) Open a PR for the current branch (d) Cut a release — merge release branch to main and tag (e) Resolve a merge conflict on the current branch (f) Manage stashes — list, view, apply, or drop stashes"

Then execute the appropriate action below.


Action (a) — View Workflow Reference

Print the full Git Workflow Reference section below.


Action (b) — Start New Work

  1. Use Bash to identify the current release branch:

    git branch -r | grep release | sort -V | tail -1

    No-release-branch fallback: If the command above returns no output (no release/* branch exists), fall back to branching from main and target main for the PR. Inform the user:

    "No release branch found. Branching from main and the PR will target main directly. This is normal for simple repos and early-stage projects that do not yet use the release-branch model." In this case, replace origin/<release-branch> in step 4 with origin/main, and use --base main in the gh pr create call in Action (c).

  2. Ask the user:
    • Is this a new feature or a bug fix? (determines feature/ vs fix/ prefix)
    • What is the task ID or short description? (e.g. task-042, login-crash)
  3. Construct the branch name: feature/task-XXX-short-description or fix/task-XXX-short-description.
  4. Use Bash to fetch the latest remote state, then create and check out the branch from the release branch:
    git fetch origin
    git checkout -b <branch-name> origin/<release-branch>
    Without the fetch, a stale remote-tracking ref would create the branch off an old tip.
  5. Confirm the branch was created and remind the user:
    • Never commit directly to main or the release branch.
    • Open a PR from this branch into the release branch when work is complete.

Action (c) — Open a PR

  1. Use Bash to check the current branch and recent commits:
    git branch --show-current
    git log --oneline -10
  2. Use Glob to check if handoffs/reviews/ exists. If it does, use Read on any open review artifacts to check for unresolved findings with severity: critical | severe | moderate. If any exist, block the PR and inform the user these must be resolved first.
  3. Use Bash to identify the target release branch:
    git branch -r | grep release | sort -V | tail -1
  4. Use Read to check handoffs/plans/ for context to include in the PR description.
  5. Produce a PR description with: summary of changes, related task IDs, testing notes. Then use Bash:
    gh pr create --title "<title>" --body "<description>" --base <release-branch>
    If gh is not available, print the PR body for the user to paste manually.

Action (d) — Cut a Release

  1. Use Bash to confirm the current release branch is clean and all PRs are merged:
    git status
    git log --oneline origin/main..HEAD
  2. Ask the user for the version tag (e.g. 1.0.0).
  3. Open a release PR from the release branch into main — all changes reach main via PR, including releases:
    gh pr create --base main --head release/<version> --title "Release v<version>" --body "<release summary>"
    If gh is not available, print the PR body and ask the user to open the PR manually.
  4. After the PR is approved and merged, tag the release on main. Confirm before pushing the tag:
    git checkout main
    git pull origin main
    git tag v<version>
    git push origin v<version>
  5. Remind the user to invoke /abd-docs (or the Documentation agent) to create the changelog for this release in docs/CHANGELOG.md or docs/changelogs/<version>.md.

Action (e) — Resolve a Merge Conflict

  1. Use Bash to identify all conflicted files:
    git status
    List each file that shows both modified, deleted by us, deleted by them, or any other conflict marker.
  2. Use Bash to fetch the latest remote state and show how far behind the current branch is:
    git fetch origin
    git log --oneline HEAD..origin/$(git branch --show-current)
    Report how many commits the remote is ahead. If the remote branch no longer exists, note that and continue with local conflict resolution.
  3. Ask the user whether to rebase or merge to incorporate upstream changes, and explain the tradeoffs:

    • Rebase (git rebase origin/<branch>): rewrites your local commits on top of the upstream tip, producing a linear history. Best for feature branches that are not shared with others. Avoid rebasing branches that other people have checked out.
    • Merge (git merge origin/<branch>): creates a merge commit that preserves the full history of both sides. Safer for shared or long-lived branches where rewriting history would disrupt collaborators.

    Wait for the user's choice before proceeding.

  4. For each conflicted file identified in step 1: a. Use Read to display the file and locate the conflict markers (<<<<<<<, =======, >>>>>>>). b. Explain to the user what each side of the conflict contains:
    • HEAD (your changes): the lines between <<<<<<< HEAD and =======.
    • Incoming (their changes): the lines between ======= and >>>>>>> <ref>. c. Ask the user which resolution to apply (keep yours, keep theirs, or combine), or propose a resolution if the intent is clear from context. d. Use Edit to apply the agreed resolution, removing all conflict markers so the file is valid.
  5. After all conflicted files are resolved, use Bash to stage only the resolved files by name (never git add ., which would sweep untracked files like build output or .env into the commit) and complete the rebase or merge:
    • If rebase was chosen:
      git add <resolved-file-1> <resolved-file-2> ...
      git rebase --continue
      If additional conflict rounds occur, repeat steps 4–5 for each round until the rebase completes.
    • If merge was chosen:
      git add <resolved-file-1> <resolved-file-2> ...
      git merge --continue
  6. Use Bash to confirm the branch is clean and ready to push:
    git status
    git log --oneline -5
    Verify there are no remaining conflict markers and the working tree is clean. Remind the user:
    • If rebase was used, a force-push is required: git push --force-with-lease origin <branch>. Only do this if the branch is not shared.
    • If merge was used, a regular push is safe: git push origin <branch>.

Action (f) — Manage Stashes

  1. Use Bash to list all stashes:
    git stash list
    If the list is empty, inform the user and stop.
  2. Show the stash list to the user and ask what they want to do:

    "(i) Inspect a stash — show its diff (ii) Apply a stash — apply without dropping (iii) Pop a stash — apply and drop (iv) Drop a stash — delete without applying (v) Drop all stashes — clear the entire stash list (confirm first)"

  3. Execute the chosen sub-action:

    Sub-action (i) — Inspect a stash

    Ask the user which stash number (N) to inspect. Then:

    git stash show -p stash@{N}

    Display the diff and provide a plain-language summary of what changes are stashed (files changed, nature of changes).

    Sub-action (ii) — Apply a stash

    Ask the user which stash number (N) to apply. Then:

    git stash apply stash@{N}

    After applying, check for conflicts:

    git status

    If any conflicts are present (files show both modified or similar), inform the user and run Action (e) to resolve them.

    Sub-action (iii) — Pop a stash

    Ask the user which stash number (N) to pop. Then:

    git stash pop stash@{N}

    After popping, check for conflicts the same way as sub-action (ii). If conflicts are found, run Action (e) to resolve them.

    Sub-action (iv) — Drop a stash

    Ask the user which stash number (N) to drop. Show the stash message and confirm:

    "This will permanently delete stash@{N}: <message>. Confirm? (y/n)"

    If confirmed:

    git stash drop stash@{N}

    Sub-action (v) — Drop all stashes

    Count the total number of stashes and confirm with the user:

    "This will permanently delete ALL X stashes. This cannot be undone. Confirm? (y/n)"

    If confirmed:

    git stash clear
  4. After any sub-action completes, run git stash list again and show the user the updated stash state.

Git Workflow Reference

Branch Model

BranchPurposeRules
mainProduction-ready historyNever commit directly. Only merge from release branches.
release/<version>Integration branch per releaseNever commit directly. All feature/fix PRs target this.
feature/task-XXX-descriptionNew workOne per task. Created from the release branch.
fix/task-XXX-descriptionBug fixesOne per issue. Created from the release branch.

Flow

feature/* or fix/*
       ↓  (PR)
release/<version>
       ↓  (PR when release is ready)
      main  →  tag v<version>

Who Does What

ActionResponsible
Create feature/fix branchPlanning or Dev agent
Open PRDev agent (the one that did the work)
Code reviewTech Review + Security agents
Approve PRTech Review + Security; Planning after triage
Merge to releasePlanning or designated agent
Cut release (release → main + tag)Planning or DevOps
Create changelogDocumentation agent

Naming Conventions

  • Feature branches: feature/task-NNN-short-description
  • Fix branches: fix/issue-NNN-short-description
  • Version tags: vMAJOR.MINOR.PATCH (e.g. v1.0.0)
  • Changelog: docs/CHANGELOG.md or docs/changelogs/<version>.md

Merge Style

Document the chosen merge style in docs/assumptions.md at project start. Default: merge commit (--no-ff) to preserve branch history.

Changelogs

The Documentation agent creates or updates changelogs in docs/ for each release. Format: version, date, sections for Added / Changed / Fixed / Security, links to PRs or handoff artifacts.

Output Format

After completing any action, confirm:

  • What git operations were run (list commands with output).
  • The current state of relevant branches.
  • What the next step is.

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.