Workflow: main → worktree → PR → prod
Workflow: main → worktree → PR → prod
Section titled “Workflow: main → worktree → PR → prod”All local agent work happens in a worktree from a fresh origin/main. No direct pushes to main. Production changes (Worker, Pages) go through CI.
Before every task
Section titled “Before every task”git fetch origin main --quietgit checkout maingit rebase origin/main # keep local main in syncCreating a worktree for a change
Section titled “Creating a worktree for a change”SLUG=<short-task-slug> # e.g. "fix/cors", "feat/sell-page"WT="$HOME/.local/share/gondolier/worktrees/$SLUG"
git worktree add -b "$SLUG" "$WT" origin/maincd "$WT"Making changes
Section titled “Making changes”- Edit files in
$WTonly. Never edit the shared repo root. - Validate before committing:
go vet ./tests/unit/api/... ./tests/unit/cron/... ./tests/unit/crypto/... ./tests/unit/forge/... ./tests/unit/lease/... ./internal/api/... ./internal/auth/... ./internal/cron/... ./pkg/...go test -race -count=1 ./tests/unit/api/... ./tests/unit/cron/... ./tests/unit/crypto/... ./tests/unit/forge/... ./tests/unit/lease/...go build ./cmd/... ./internal/api/... ./internal/auth/... ./internal/cron/... ./pkg/...wrangler deploy --dry-run # verify Worker deploys cleanlynode scripts/validate-site.cjs site/ # verify Pages site is valid- Commit with the shared
cloudkoopagit identity:
git add -Agit commit -m "scope: description
One-line summary. What changed. Why."- Push and create PR:
git push origin "$SLUG"curl -X POST "https://git.rbtr.dev/api/v1/repos/laputacloudco/gondolier/pulls" \ -H "Authorization: token $GONDOLIER_GITHUB_TOKEN" \ -H "Content-Type: application/json" \ -d "{\"title\":\"$SLUG: description\",\"head\":\"$SLUG\",\"base\":\"main\"}"Production deploys
Section titled “Production deploys”Only main triggers production deploys:
- Worker:
wrangler deployruns on push tomain(via CIdeploy-prodjob) - Pages:
wrangler pages deploy site/ --branch=mainruns on push tomain
CI checks on PRs run on the PR branch — no production impact.
Cleanup
Section titled “Cleanup”After PR is merged:
# Localgit fetch origin maingit checkout maingit branch -D <branch-name>
# Remotegit push origin --delete <branch-name>
# Worktreegit worktree remove "$WT"What NOT to do
Section titled “What NOT to do”- Never push directly to main — use PRs
- Never edit from the shared repo root — use worktrees
- Never touch Pages config directly — use
wrangler pages deploywith--branch=main - Never change Cloudflare DNS/proxy settings — those are infrastructure
- Never bypass shunt — the
mq/**branch is shunt’s merge queue