From 6f90c59db9554b59764b975184ff4cf7569da257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ullrich=20Sch=C3=A4fer?= Date: Sun, 22 Mar 2026 13:18:58 +0100 Subject: [PATCH] Add PR-based git workflow to CLAUDE.md All changes go through PRs from now on. Documents: - Pre-PR checklist (typecheck, lint, test, e2e) - Auto-merge with squash - PR stacking for fast local iteration - Emergency override for admins This is the last direct push to main. Co-Authored-By: Claude Opus 4.6 (1M context) --- CLAUDE.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index 9c656b1..2e3090e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -94,6 +94,39 @@ pnpm test:e2e:ui # Run E2E tests with Playwright UI - **Single domain**: Each instance uses one domain for both web UI and ActivityPub handles. - **Simple permissions**: View + Edit only. No fine-grained permissions. +## Git Workflow + +**All changes go through pull requests.** Do not push directly to main. + +### Before opening a PR +1. Run `pnpm typecheck && pnpm lint && pnpm test && pnpm test:e2e` — all must pass +2. Check for open PRs: `gh pr list` — avoid conflicts with in-flight work +3. Pull latest main: `git pull origin main --rebase` + +### Opening a PR +- Create a feature branch: `git checkout -b ` +- Keep PRs focused — one logical change per PR +- PRs auto-merge when CI is green (use `gh pr merge --auto --squash`) +- Use squash merges to keep main history clean + +### Stacking PRs (for fast local iteration) +When working on sequential tasks, stack branches locally: +``` +main → feature-a → feature-b → feature-c +``` +- Each branch gets its own PR +- Set the base branch correctly: `gh pr create --base feature-a` +- When feature-a merges, rebase feature-b onto main +- This keeps you unblocked while PRs are in CI + +### After merging +- Update main: `git checkout main && git pull` +- Delete merged branches: `git branch -d ` +- Check if stacked PRs need rebasing + +### Emergency override +Admins can bypass the PR workflow when necessary (e.g., CI is broken and needs a hotfix). Document the reason in the commit message. + ## OpenSpec Workflow Specs live in `openspec/`. Use these slash commands: