Setup Git Workflow
ASecurity[Adam''s Skills] Write the repository''s GIT_WORKFLOW.md: the single source of truth for its branching strategy and release process, for people and agents alike. One short file, lists and tables only, covering the branching model, protected branches and why they exist, working-branch naming, commit format, pull request and review rules, who may merge, environments and how each is deployed and verified, releases, hotfixes, rollback, what agents may do, and what "ship it" means here. It reads t...
- 4 stars
- 0 votes
- 0 copies
- 1 view
- Added December 3, 2026
Works with
Security analysis
100/100Pro scans all 2 files and shows the line behind each finding
npx -y skills add adamlinscott/claude-skills --skill setup-git-workflow --agent claude-codeAre you the author of Setup Git Workflow?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/adamlinscott-setup-git-workflow)---
name: setup-git-workflow
description: '[Adam''s Skills] Write the repository''s GIT_WORKFLOW.md: the single source of truth for its branching strategy and release process, for people and agents alike. One short file, lists and tables only, covering the branching model, protected branches and why they exist, working-branch naming, commit format, pull request and review rules, who may merge, environments and how each is deployed and verified, releases, hotfixes, rollback, what agents may do, and what "ship it" means here. It reads the evidence first (branch protection, CI/CD workflows, deploy config, tags, PR and commit history, CONTRIBUTING and CODEOWNERS), then asks the user everything the evidence cannot settle with AskUserQuestion, and writes the file in a fixed format. /ship-it and /ship-it-now run it when the file is missing. Invoke with /setup-git-workflow to create the file, or to review and update one that exists.'
disable-model-invocation: true
allowed-tools: Bash, Read, Grep, Glob, Write, Edit, AskUserQuestion
---
# Setup Git Workflow
Write `GIT_WORKFLOW.md` at the repository root (`git rev-parse --show-toplevel`). It is the one
place a person or an agent goes to learn how work moves through this repo: branches, reviews,
releases, deploys. Skills such as `/ship-it` act on it as written, so a wrong value does real
damage. Ground every value in evidence or in the user's answer, never in habit.
## The format
[TEMPLATE.md](TEMPLATE.md), relative to this file, is the format. Follow it exactly:
- Keep every heading, in order. Add none.
- Lists of `- key: value`, and the tables. No paragraphs.
- Values are short: a name, a number, or a few plain words. Real branch, workflow, environment
and URL names, never placeholders.
- A section that does not apply keeps its heading with `- None`. A table with no rows becomes
`- None`.
- `Ship it ends at` is `pull request` (open and ready for review), `merged`, or the name of an
environment in the Environments table.
- `Model` is a common name if one fits (trunk-based, GitHub flow, git flow, release branches),
otherwise a few words.
- Notes holds only what fits no section, as single-line bullets.
## 1. If the file already exists
Read it, then ask with AskUserQuestion: **review and update** it (recommended: go through steps 2
to 4, ask only where the evidence now disagrees with the file or a value is missing), **rewrite**
it from scratch, or **leave it**. A file that is not in the template's format counts as missing:
say so, and offer to rewrite it.
## 2. Read the evidence
Read before asking anything. Use what exists and skip what does not:
- **Branches and protection.** The default branch, long-lived remote branches (`git branch -r`),
and their rules: `gh api repos/{owner}/{repo}/branches/<b>/protection` and
`gh api repos/{owner}/{repo}/rulesets`. A 403 or 404 means unknown, not unprotected.
- **Merge settings.** `gh api repos/{owner}/{repo}`: allowed merge methods, delete branch on merge.
- **Environments.** `gh api repos/{owner}/{repo}/environments` (required reviewers, branch
policies), `.github/workflows/*` (what each `on:` trigger deploys, and where), and deploy config
such as `vercel.json`, `fly.toml`, `netlify.toml`, `Procfile`, `Dockerfile`, `.circleci/`,
`charts/`, `terraform/`.
- **Releases.** Tag pattern (`git tag --sort=-creatordate | head`), `gh release list`,
`CHANGELOG.md`, release tooling config (release-please, changesets, semantic-release).
- **History.** The last 20 or so merged PRs
(`gh pr list --state merged --limit 20 --json headRefName,baseRefName,mergeCommit,reviewDecision,author`):
branch naming, base, reviews, merge method, who merges. Recent commit subjects for the commit
format. Commits on the default branch with no PR, to see whether direct pushes happen. Reverts
and `hotfix/` branches, for rollback and hotfix practice.
- **Written rules.** `CONTRIBUTING.md`, `CODEOWNERS`, the README's contributing or deploy section,
commitlint or similar config, and `CLAUDE.md` or `AGENTS.md` lines about branches, deploys or
what agents may do.
Draft every value in the template from this, and mark each one for yourself as **seen** (the
evidence settles it) or **guessed**.
## 3. Ask about what the evidence cannot settle
Use the **AskUserQuestion tool** for every question, never a list in prose. At most four questions
per call; split a long round across calls. Put the recommended option first, labelled
"(Recommended)", and give in each option's description the evidence behind it, so the user can
decide without reading anything else.
Always ask these, because they are intent, and config cannot show intent:
1. **Where does "ship it" end?** The stops on this repo's route: a pull request ready for review,
merged into the default branch, and each environment in deploy order.
2. **May an agent merge pull requests?** `yes`, `after approval`, or `no`.
3. **May an agent deploy?** `yes`, `not to production`, or `no`.
Then ask about every value still **guessed**, every place where configuration and history
disagree (for example: no branch protection, but every change goes through a reviewed PR), and
why a protected branch exists whenever its name does not make that obvious. Do not ask about
anything already **seen**. For hotfixes and rollback, offer "None defined" as an option: an
honest `- None` is better than an invented procedure.
If the repo deploys nothing you can see, ask whether deploys happen outside it. If they do, record
each environment with the trigger `outside this repo` and a verify step a person can run.
## 4. Write the file
Fill the template and write `GIT_WORKFLOW.md` at the repository root. Do not commit it. It states
the team's policy, so it lands through the team's normal review like any other change.
## 5. Report
Give the path, the `Ship it means` line, and the values filled in from evidence without asking, so
the user can correct any of them by editing the file. Then remind them the file is uncommitted
and needs review.
If `/ship-it` or `/ship-it-now` sent you here, return to it and carry on with the file you just
wrote.
Files in this skill
- SKILL.md
- TEMPLATE.md
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.