From daf0fed8ab1d70a595ab03504498a093451ce3a1 Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Tue, 22 Sep 2026 14:15:54 -0500 Subject: [PATCH] docs(agents): delete a branch when its work lands, on both sides MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cleanup that prompted this removed 36 branches from Gitea and 29 locally, all but one already in develop and some of them three months old. Nothing had gone wrong — each was simply merged and left, and the deletes were never part of anyone's definition of done. The cost lands on whoever cuts the next release, who cannot tell a branch holding unmerged work from one that shipped in July without checking each in turn. Writing the rule here rather than leaving it to habit is the point: the humans and the agents working in this repository read the same file, so the same definition of done applies to both. CLAUDE.md is not touched on purpose — it points here precisely so the two cannot drift. Signed-off-by: Diego Resendez --- AGENTS.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 82bbc1e..03c5ac1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -55,6 +55,14 @@ feature/* → develop → main → [promote.yml] → GitHub main **Only `hotfix/*` can still cause real drift**, since it branches from and returns to `main`. That case genuinely needs a back-merge; nothing else does. +**Delete the branch when the work lands.** Both sides, as the last step of merging rather than a chore left for later: + +```bash +git branch -d && git push origin --delete +``` + +On 2026-09-22 this repository carried 36 branches on Gitea and 29 locally, every one but a single stale docs branch already merged into `develop`, some of them since July. At that size the branch list stops describing the work in flight and becomes something a release has to audit commit by commit — which is both when it costs the most and when nobody has the patience for it. `git branch -r --merged origin/develop` is the check. A branch whose commits were rebased on the way in will not appear there even though its content did land, so confirm that case by content (`git diff develop -- `) rather than by the flag. Never `develop`, `main`, or a `release/*` that has not shipped yet. + **Diagnosing "this branch is ahead of main".** Usually it is pre-rebase duplication, not unmerged work: the same content under different SHAs, because contributions are rebased on their way into `develop`. Confirm before acting: ```bash