Skip to content

Commit 91bc77d

Browse files
authored
Add review agent style guidelines to .gemini/styleguide.md (flutter#174000)
A copy of @stuartmorgan-g change at flutter/packages#9805 > Initial attempt at adding guidance for GCAfGH to try cut down on the behavior observed so far that it: > - Almost always includes generic praise for the PR, which is unhelpful since the agent has no context for evaluating what PRs we actually want (see [this particularly problematic example](flutter/packages#9795 (review))) > - Appears to trust PR descriptions. E.g., recently praising a PR that was missing tests of most of the PR, but had a PR description saying it included extensive testing, as being extremely well tested. Here are examples of summaries from the packages repo before and after this change: Before (praise like "great refactoring effort", "significantly improves the modularity and maintainability", "extensive documentation updates are also a major improvement"): > This pull request is a great refactoring effort. Moving the ProxyAPI generation logic into a dedicated helper file (`proxy_api_generator_helper.dart`) significantly improves the modularity and maintainability of the Dart generator. The extensive documentation updates are also a major improvement, making the concepts around ProxyAPIs much clearer for developers. flutter/packages#9756 After (drier, describing the actual change without making normative evaluation): > This pull request introduces a new `clearAuthorizationToken` method across all layers of the `google_sign_in` plugin. This allows developers to manually clear a cached authorization token if it becomes invalid. The implementation is handled natively on Android, is a no-op on iOS (as the SDK handles it), and clears a local cache on the web. The changes include updates to the platform interface, implementations for each platform, and corresponding tests and documentation. flutter/packages#9846 (review) ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent e757a22 commit 91bc77d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.gemini/styleguide.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ flutter/flutter repository. It is based on the more comprehensive official
5050
- **Provide illustrations or screenshots** for widgets.
5151
- Use `///` for public-quality documentation, even on private members.
5252

53+
## Review Agent Guidelines
54+
55+
When providing a summary, the review agent must adhere to the following principles:
56+
- **Be Objective:** Focus on a neutral, descriptive summary of the changes. Avoid subjective value judgments
57+
like "good," "bad," "positive," or "negative." The goal is to report what the code does, not to evaluate it.
58+
- **Use Code as the Source of Truth:** Base all summaries on the code diff. Do not trust or rephrase the PR
59+
description, which may be outdated or inaccurate. A summary must reflect the actual changes in the code.
60+
- **Be Concise:** Generate summaries that are brief and to the point. Focus on the most significant changes,
61+
and avoid unnecessary details or verbose explanations. This ensures the feedback is easy to scan and understand.
62+
5363
## Further Reading
5464

5565
For more detailed guidance, refer to the following documents:

0 commit comments

Comments
 (0)