Repository navigation
Conversation
After migrating repository skills to `.agents/skills/` (google#3295), adding scoped `AGENTS.md` guides (google#3311), and adding the on-demand `pr-review` skill (google#3313), a full audit of all agent instructions and skill scripts uncovered remaining duplication, always-on context bloat, mis-routed/stale rules, and four concrete guardrail bugs: `check_diff.py` silently missed Valkey Protostuff fields on `@MappedSuperclass` parents and inline-annotated fields, `core/AGENTS.md` scoped the Netty `retainedDuplicate()` rule away from `proxy/` (its primary caller), `run_rewrite.sh` silently exited `0` on Gradle failure without cleanup traps, and `check_diff_test.py` never ran in presubmits or CI. Centralizing review rules into `pr-review`, moving `core/`-only rules out of root `GEMINI.md`, correcting stale Gradle/Spotless instructions, and fixing the guardrail scripts close these blind spots while cutting always-on `GEMINI.md` by 22%. Specifically, this change: - **Centralizes PR review rules in `.agents/skills/pr-review/SKILL.md`:** - `GEMINI.md` (`18,118 B` -> `14,071 B`): replaces duplicated `Processing PR Feedback` and `PR Description Sync` bullets with a 1-line pointer to `.agents/skills/pr-review/SKILL.md`. - `.agents/skills/pr-polisher/SKILL.md`: removes Step 9 (paginated PR review comment fetch), renumbers Step 10 -> 9, and adds `pr-review` negative routing to frontmatter `description`. - `console-webapp/AGENTS.md`: removes `## Review Calibration`, moving `Shared State` and `Build & Screenshots` into `pr-review` while keeping `Nested @if` as an Angular template authoring rule. - `core/AGENTS.md`: trims the review-only parenthetical from `JPQL Timestamp Ordering`. - `.agents/skills/pr-review/SKILL.md`: adds `### Nomulus Review Calibration` under `Conducting PR Reviews`. - **Re-scopes always-on rules and fixes stale build/formatting docs:** - Moves `Netty Retry Buffers` (`ByteBufHolder.retainedDuplicate()`) out of `core/AGENTS.md` into `GEMINI.md`'s Netty lifecycle bullet so `proxy/`, `networking/`, `prober/`, and `core/` all load it; removes the verbatim duplicated `console-webapp` sentence from `GEMINI.md`. - Moves `core/`-only idioms (CLI/Beam/`TestRegistryToolComponent`, model layering, `@GetterDelegate` sets, partial JSON updates, JAXB optional attributes, allocation tokens, Console actions, CSV output, time-projected entities, Valkey Protostuff compatibility, and async pipeline boundaries) from `GEMINI.md` into `core/AGENTS.md`, fixes exact `monthly_logs.sql` / `monthly_logs_test.sql` paths, and condenses `2-PR Schema Split` in `GEMINI.md`. - Corrects `spotlessApply` (`*.gradle` only) vs. `javaIncrementalFormatApply` (Java formatting & import order) and `checkstyleMain`/`checkstyleTest`, and replaces backend compile commands that triggered Docker `:core:buildToolImage` or `console-webapp` `npmInstallDeps` across `GEMINI.md`, `pr-polisher`, and `java-ast-refactoring`. - **Hardens guardrail scripts and wires unit tests into presubmits:** - `.agents/skills/pr-polisher/scripts/check_diff.py` (+ `SKILL.md` & `check_diff_test.py`): adds the 4 missing Protostuff `@MappedSuperclass` parents (`UpdateAutoTimestampEntity`, `GracePeriodBase`, `DomainDsDataBase`, `BaseTransferObject`), strips leading inline `@Annotation(...)` tokens instead of skipping annotated field lines, skips Java comment lines in anti-pattern checks (while still catching `/* package */`), fixes `fqn_pattern` capturing so full FQNs print, scopes `check_commit_message()` `[OK]` to local errors, and expands internal-leak checks to cover `//depot/configs` and `cl/<digits>` (`15/15` unit tests). - `config/presubmits.py`: adds `verify_agent_scripts()` so `check_diff_test.py` runs automatically on `./gradlew runPresubmits` and CI. - `.agents/skills/java-ast-refactoring/scripts/run_rewrite.sh`: adds `set -euo pipefail`, an `EXIT` cleanup trap for temporary files, and portable top-level `^name:` YAML extraction via `awk`. Verification: - `python3 .agents/skills/pr-polisher/scripts/check_diff_test.py -v`: `15/15` passed. - `python3 .agents/skills/pr-polisher/scripts/check_diff.py`: `0` errors, `0` warnings (`spotlessCheck` and `javaIncrementalFormatCheck` passed). - `./gradlew --no-daemon runPresubmits`: `BUILD SUCCESSFUL` (includes running `check_diff_test.py` via `verify_agent_scripts()`). - Strict `PyYAML` parse OK on all `.agents/skills/*/SKILL.md` files, `bash -n` on `run_rewrite.sh`, and `0` lines > 80 chars in `core/AGENTS.md` and `console-webapp/AGENTS.md`. BUG=http://b/593117423 Signed-off-by: Ben McIlwain <mcilwain@google.com>
CydeWeys
force-pushed
the
centralize-pr-review-rules
branch
from
December 5, 2026 04:30
62f8e09 to
c66643a
Compare
CydeWeys
enabled auto-merge
December 5, 2026 04:40
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After migrating repository skills to
.agents/skills/(#3295), adding scopedAGENTS.mdguides (#3311), and adding the on-demandpr-reviewskill (#3313), a full audit of all agent instructions and skill scripts uncovered remaining duplication, always-on context bloat, mis-routed/stale rules, and four concrete guardrail bugs:check_diff.pysilently missed Valkey Protostuff fields on@MappedSuperclassparents and inline-annotated fields,core/AGENTS.mdscoped the NettyretainedDuplicate()rule away fromproxy/(its primary caller),run_rewrite.shsilently exited0on Gradle failure without cleanup traps, andcheck_diff_test.pynever ran in presubmits or CI. Centralizing review rules intopr-review, movingcore/-only rules out of rootGEMINI.md, correcting stale Gradle/Spotless instructions, and fixing the guardrail scripts close these blind spots while cutting always-onGEMINI.mdby 22%.Summary of Changes
.agents/skills/pr-review/SKILL.md:GEMINI.md(18,118 B->14,071 B): replaces duplicatedProcessing PR FeedbackandPR Description Syncbullets with a 1-line pointer to.agents/skills/pr-review/SKILL.md..agents/skills/pr-polisher/SKILL.md: removes Step 9 (paginated PR review comment fetch), renumbers Step 10 -> 9, and addspr-reviewnegative routing to frontmatterdescription.console-webapp/AGENTS.md: removes## Review Calibration, movingShared StateandBuild & Screenshotsintopr-reviewwhile keepingNested @ifas an Angular template authoring rule.core/AGENTS.md: trims the review-only parenthetical fromJPQL Timestamp Ordering..agents/skills/pr-review/SKILL.md: adds### Nomulus Review CalibrationunderConducting PR Reviews.Netty Retry Buffers(ByteBufHolder.retainedDuplicate()) out ofcore/AGENTS.mdintoGEMINI.md's Netty lifecycle bullet soproxy/,networking/,prober/, andcore/all load it; removes the verbatim duplicatedconsole-webappsentence fromGEMINI.md.core/-only idioms (CLI/Beam/TestRegistryToolComponent, model layering,@GetterDelegatesets, partial JSON updates, JAXB optional attributes, allocation tokens, Console actions, CSV output, time-projected entities, Valkey Protostuff compatibility, and async pipeline boundaries) fromGEMINI.mdintocore/AGENTS.md, fixes exactmonthly_logs.sql/monthly_logs_test.sqlpaths, and condenses2-PR Schema SplitinGEMINI.md.spotlessApply(*.gradleonly) vs.javaIncrementalFormatApply(Java formatting & import order) andcheckstyleMain/checkstyleTest, and replaces backend compile commands that triggered Docker:core:buildToolImageorconsole-webappnpmInstallDepsacrossGEMINI.md,pr-polisher, andjava-ast-refactoring..agents/skills/pr-polisher/scripts/check_diff.py(+SKILL.md&check_diff_test.py): adds the 4 missing Protostuff@MappedSuperclassparents (UpdateAutoTimestampEntity,GracePeriodBase,DomainDsDataBase,BaseTransferObject), strips leading inline@Annotation(...)tokens instead of skipping annotated field lines, skips Java comment lines in anti-pattern checks (while still catching/* package */), fixesfqn_patterncapturing so full FQNs print, scopescheck_commit_message()[OK]to local errors, and expands internal-leak checks to cover//depot/configsandcl/<digits>(15/15unit tests).config/presubmits.py: addsverify_agent_scripts()socheck_diff_test.pyruns automatically on./gradlew runPresubmitsand CI..agents/skills/java-ast-refactoring/scripts/run_rewrite.sh: addsset -euo pipefail, anEXITcleanup trap for temporary files, and portable top-level^name:YAML extraction viaawk.Verification
python3 .agents/skills/pr-polisher/scripts/check_diff_test.py -v:15/15passed.python3 .agents/skills/pr-polisher/scripts/check_diff.py:0errors,0warnings (spotlessCheckandjavaIncrementalFormatCheckpassed)../gradlew --no-daemon runPresubmits:BUILD SUCCESSFUL(includes runningcheck_diff_test.pyviaverify_agent_scripts()).PyYAMLparse OK on all.agents/skills/*/SKILL.mdfiles,bash -nonrun_rewrite.sh, and0lines > 80 chars incore/AGENTS.mdandconsole-webapp/AGENTS.md.BUG=http://b/593117423
This change is