Skip to content

gemini: add code review style guide - #890

Open
Aditya Shantanu (aditya-shantanu) wants to merge 1 commit into
agent-substrate:mainfrom
aditya-shantanu:gemini/styleguide
Open

gemini: add code review style guide#890
Aditya Shantanu (aditya-shantanu) wants to merge 1 commit into
agent-substrate:mainfrom
aditya-shantanu:gemini/styleguide

Conversation

@aditya-shantanu

Copy link
Copy Markdown
Collaborator

Fixes #<issue_number>

Stop: Does this PR reference an open issue above? If not, please open one first.
PRs without a linked issue will not be reviewed.

What changed and why

Adds .gemini/styleguide.md, which Gemini Code Assist picks up automatically to guide its inline PR review comments. Also exempts the file from the .gemini/ gitignore rule (that rule targets personal AI tool configs; the style guide is a repo-level artifact).

The guide establishes:

  • Four-tier severity systemblocking 🔴 / should-fix 🟡 / nit 🟢 / question 🟢, with mandatory named labels (color dots alone aren't a convention PR authors know)
  • Exact comment format — severity tag → one-sentence problem with consequence → one-sentence fix, nothing more
  • Brevity rules — cut content not prose; complete sentences; no preamble, no derivations the author can reconstruct from the claim
  • Scope — what to look for (correctness, races, error handling, context propagation, resource leaks, SSA field-clearing, proto contracts) and what to skip (formatting, summaries, praise, speculative concerns)
  • Higher confidence bar — Gemini posts directly with no human checkpoint, so false positives cost the author time; the guide sets a stricter threshold than a draft-review workflow would require
  • Substrate-specific Go patterns — SSA apply-config field clearing, port-forward teardown in tests, context.Background() in helpers, proto field removals as breaking changes, sync.Mutex copied by value

Derived from the review principles in the post-draft-review skill (#870), adapted for Gemini's direct-post model.

Checklist

  • Issue is linked above
  • Tests pass locally (go test ./...)
  • Root-gated tests pass if applicable (hack/run-root-tests.sh)
  • Documentation updated if behavior changed (N/A — config only)

Adds .gemini/styleguide.md, which Gemini Code Assist picks up automatically
to guide its inline PR review comments.

The guide establishes:
- A four-tier severity system (blocking/should-fix/nit/question) with
  mandatory named labels — color dots alone aren't a convention PR authors
  know, so the name is required alongside the color
- Exact comment format: severity tag → one-sentence problem with
  consequence → one-sentence fix, nothing more
- Brevity rules: cut content not prose, complete sentences, no preamble,
  no derivations the author can reconstruct from the claim
- What to review (correctness, races, error handling, context propagation,
  resource leaks, SSA field-clearing, proto contracts) and what to skip
  (formatting, summaries, praise, speculative concerns)
- A higher confidence bar than a draft-review workflow would require:
  Gemini posts directly, so false positives cost the author time with no
  human checkpoint in between
- Substrate-specific Go patterns: SSA apply-config field clearing,
  port-forward teardown in tests, context.Background() in helpers,
  proto field removals, sync.Mutex copied by value

Also adds !.gemini/styleguide.md to .gitignore: .gemini/ is ignored for
personal AI tool configs, but the style guide is a repo-level artifact.

Derived from the review principles in the post-draft-review skill (agent-substrate#870),
adapted for Gemini's direct-post model.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants