Skip to content

Commit 97d2a86

Browse files
committed
docs(claude): rule — verify PR is still open before committing
Add to operational lesson 1: before committing, confirm the branch's PR is still OPEN (not already merged/closed), because a green PR can be merged at any time and committing onto an already-merged branch orphans the change (it never reaches master). This happened with the English translation committed onto #45's branch after #45 had merged.
1 parent a66e26d commit 97d2a86

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Still require explicit confirmation: **PR merge**, deleting someone else's remot
140140

141141
## Operational lessons (mistakes already made — do not repeat)
142142

143-
1. **Confirm the branch BEFORE committing.** Always `git branch --show-current` before `git add`/`commit`. I have committed straight to `master` by mistake (it only didn't break because I'm admin). All work on its own branch.
143+
1. **Confirm the branch AND that its PR is still open BEFORE committing.** Always `git branch --show-current` before `git add`/`commit` — it must not be `master`/`main`. Also confirm the branch's PR is still **OPEN**, not already merged/closed (`gh pr view <branch> --json state`): a green PR can be merged by the maintainer at any time, and committing onto an already-merged branch orphans the commit (it never reaches master). If the PR is merged, create a NEW branch from updated master. I have committed straight to `master` by mistake (it only didn't break because I'm admin), and I once committed the real English translation onto a branch whose PR (#45) had already merged, so the change landed nowhere. All work goes on its own branch with an open PR.
144144
2. **NEVER commit/push with a red build or test.** Before `git commit`, read the actual `Build succeeded`/`Passed!`/`Failed!` line for the changed scope. If there is `Failed: N>0` or `Build FAILED`, do not commit. I have claimed "green" without checking and merged a red PR — unacceptable.
145145
3. **Local incremental build LIES.** Cached `obj/bin` has masked a real compile error (CS0246) that only showed up in CI. When in doubt, `--no-incremental` or delete `obj/bin` and rebuild from scratch before trusting green.
146146
4. **An Edit that fails with "file modified since read" was NOT applied.** Re-read and redo; never assume it landed. Docs (ADR/plan) have already missed commits because of this.

0 commit comments

Comments
 (0)