branch-promotion-model
БесплатноБез исполняемых скриптовНе проверенUse when bootstrapping a new repo's CI, setting up deploy workflows, deciding what branch a feature PR should target, or whenever someone proposes…
от schuettc★ 15 звёзд на GitHubОб этом скилле
Branch promotion model
The rule
Adopt a real promotion flow across every deploying repo:
feature/<id> → PR into dev → merge fires Deploy Dev
↓
soak / validate
↓
PR `dev` into `main` → merge fires Deploy Prod
devis the integration branch. Feature PRs targetdev, notmain.mainis production. The only PRs tomainaredev → mainpromotion PRs. After each promotion merges, back-mergemainintodev(git merge --ff-only origin/main) so the two never drift — see "When promotingdev → main" below.Deploy Devworkflow trigger:on: push: branches: [dev].Deploy Prodworkflow trigger:on: push: branches: [main].- Keep
workflow_dispatchon both as a manual escape hatch, not as the normal trigger.
For non-deploying repos in the same org (docs, templates, plugin bundles) — still create a dev branch and route feature PRs through it, even if no workflow fires. Uniform process across repos prevents "wait, where do I PR this?" friction.
Why
Real incident (2026-05-29, learning-with-court/platform). The repo's initial setup had Deploy Dev AND Deploy Prod both triggering on push to main. A single feature merge auto-deployed to dev and prod in lockstep — no soak gate. The pattern looked safe until it wasn't:
- A correctness-fine feature (walker-post-lesson-summary) was promoted under that model.
- An unrelated CI/quota issue (workshop fetch hammering GitHub REST per file) surfaced mid-burst because cumulative PR + deploy activity exhausted the GitHub App installation's 15000/hr rate limit.
- Under the lockstep model, that would have failed in prod. Under the promotion model, it failed at the
dev → mainpromotion PR — visible, recoverable, not a prod incident.
The promotion model didn't catch the API quota issue per se — but it gave a clean place to ship the fix for that issue (workshop-fetch-rate-limit-fix) onto dev, observe the deploy succeed in 1m13s with the new code, then deliberately promote to prod with confidence. That's the structural payoff: every fix gets a soak before prod, every prod deploy is a chosen moment, not a side effect.
The cost is one extra PR cycle per feature. Worth it.
How to apply
When bootstrapping a fresh repo
- Create
main(usual) anddevoffmain. Push both. - Drop in the workflows from
templates/github-workflows/:deploy-dev.ymltriggers onpush: branches: [dev].deploy-prod.ymltriggers onpush: branches: [main].ci.ymltriggers onpull_request: [dev, main]— the server-side gate. The promotion soak only catches what's deployed;ci.ymlis what blocks a red PR from merging in the first place. It's the enforceable third leg alongside the lefthook commit/push hooks (which have an escape path —--no-verify, or not runninglefthook install— seequality-stack-setup).- All keep
workflow_dispatchfor manual reruns.
- Enforce it server-side — this is what separates the promotion model from a naming convention. See the
github-repo-setupskill for the exactghcommands: branch protection onmain(PR required,cia required status check, no direct push),dev/proddeploy environments, and required reviewers onprod— the literal mechanism behind "every prod deploy is a chosen moment." Without protection, nothing stops a direct push tomainthat skips the soak entirely.
When promoting dev → main (every promotion)
Open the promotion PR (dev base main), let CI + required reviewers gate it, and merge. Then immediately back-merge main into dev — this is not optional cleanup, it's the closing half of the promotion:
git checkout dev
git fetch origin
git merge --ff-only origin/main # always a clean fast-forward — see below
git push origin dev
Why this step exists. GitHub's "Create a merge commit" (the default, --no-ff) writes a merge commit onto main whose parents are (old main tip, dev tip). That merge commit lives on main and never on dev, so it accumulates — one bubble per promotion:
git log origin/dev..origin/main → N merge bubbles (grows every promotion)
git log origin/main..origin/dev → 0
git diff origin/dev origin/main → empty (trees are identical)
Content is always in sync; the commit graph drifts, and dev is N behind main is a recurring, confusing-but-cosmetic readout. The back-merge drives it permanently to zero.
Why the --ff-only always succeeds. The promotion merge commit's second parent is dev's tip, so dev is already an ancestor of main. dev can only move forward to that merge commit — no new merge commit, no conflict possible. After the push, git rev-parse dev main are identical and dev..main is 0 until the next feature lands. If --ff-only ever refuses, that's a real signal (a d
Установить branch-promotion-model в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл branch-promotion-model?
Use when bootstrapping a new repo's CI, setting up deploy workflows, deciding what branch a feature PR should target, or whenever someone proposes "auto-deploy prod on every main merge". Captures the feat → dev → main promotion model with separate Deploy Dev (push to dev) and Deploy Prod (push to main), and links the templates that implement it.
Как установить скилл branch-promotion-model?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл branch-promotion-model запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
ci-review
The scan that the plugin's GitHub Action runs.
от Anthropicazure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
от GitHubai-ready
Make any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
от GitHubaws-cdk-python-setup
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…
от GitHub