Skip to content

docs: branching/merging guide + branch protection on main#28

Merged
thomaschristory merged 1 commit into
mainfrom
docs/branching-convention
May 6, 2026
Merged

docs: branching/merging guide + branch protection on main#28
thomaschristory merged 1 commit into
mainfrom
docs/branching-convention

Conversation

@thomaschristory
Copy link
Copy Markdown
Owner

Establishes a documented branching convention and protects `main` from
direct pushes.

Why

Until now, work has sometimes landed directly on `main`. We want every
change to go through a PR (CI gate + audit trail), but until this PR
that was a soft convention rather than an enforced rule.

Changes

  • `docs/contributing/branching.md` (new): trunk-based development
    with short-lived `/` feature branches; squash-merge into
    `main`; releases are tags on `main`, not branches; we don't maintain
    long-lived release branches until v2.x ships.
  • `docs/contributing/release-process.md`: cross-link branching doc;
    release prep itself goes through a `chore/release-X.Y.Z` PR before
    tagging.
  • `CLAUDE.md` / `AGENTS.md`: short Branching section so AI agents
    default to feature branches instead of pushing to `main`.
  • `mkdocs.yml`: nav entry for the new page.

Companion (out of band, applied via `gh api`)

Branch protection on `main`:

  • No direct pushes (PR required).
  • Required status checks: `lint`, `test (ubuntu-latest, 3.12)`.
  • No force pushes, no deletions.
  • Administrators not exempt.

The protection is applied once this PR is open, so this very PR
exercises the new policy on its merge.

Test plan

  • CI green on this PR.
  • After protection is enabled, attempt to push directly to `main`
    should be rejected.
  • Squash-merge of this PR via `gh pr merge --squash` succeeds
    (PR-route is allowed; only direct pushes are blocked).

🤖 Generated with Claude Code

- New docs/contributing/branching.md explains trunk-based development:
  one long-lived `main`, short-lived feature branches (`<type>/<slug>`),
  squash-merge PRs, releases as tags on main (no release branches).
- mkdocs.yml: add the new page to the Contributing nav.
- release-process.md: cross-link the branching doc and clarify that
  release prep itself goes through a `chore/release-X.Y.Z` PR before
  the tag is cut.
- CLAUDE.md / AGENTS.md: add a short Branching section so AI agents
  default to feature branches instead of pushing to `main`.

Companion change: enable branch protection on `main` (require PR,
require CI, no direct push, no force-push, no admin bypass) — applied
via `gh api` once this PR is open so the policy can be exercised on
this very merge.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@thomaschristory thomaschristory merged commit 26f9608 into main May 6, 2026
11 checks passed
@thomaschristory thomaschristory deleted the docs/branching-convention branch May 6, 2026 19:18
@thomaschristory thomaschristory mentioned this pull request May 7, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant