From f1d231f08961b04986a2a7ba2cd15f5fd277278a Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Wed, 3 Dec 2025 18:42:40 +0000 Subject: [PATCH] docs(CLAUDE.md): add rules to avoid unnecessary changes Add guidelines to prevent common PR feedback issues: - Don't reword existing comments or code unless directly motivated by the task - Don't delete existing comments that explain non-obvious behavior - Add new test cases instead of modifying existing ones Refs #21073 --- CLAUDE.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index 4b7464f72e507..82888c1dc9fcd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -173,6 +173,23 @@ ctx, cancel := context.WithTimeout(ctx, 5*time.Minute) ctx, cancel := context.WithTimeout(ctx, 5*time.Minute) ``` +### Avoid Unnecessary Changes + +When fixing a bug or adding a feature, don't modify code unrelated to your +task. Unnecessary changes make PRs harder to review and can introduce +regressions. + +**Don't reword existing comments or code** unless the change is directly +motivated by your task. Rewording comments to be shorter or "cleaner" wastes +reviewer time and clutters the diff. + +**Don't delete existing comments** that explain non-obvious behavior. These +comments preserve important context about why code works a certain way. + +**When adding tests for new behavior**, add new test cases instead of modifying +existing ones. This preserves coverage for the original behavior and makes it +clear what the new test covers. + ## Detailed Development Guides @.claude/docs/ARCHITECTURE.md