Skip to content

docs: refine utility harmonization and comment brevity in GEMINI.md - #11270

Open
ajperel wants to merge 1 commit into
mainfrom
ajp/gemini-md-conventions
Open

ajperel wants to merge 1 commit into
mainfrom
ajp/gemini-md-conventions

Conversation

@ajperel

@ajperel ajperel commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Description

Refines repository authoring and review conventions in GEMINI.md:

  • Clarifies utility harmonization in Architecture & Module Design to cover both reusing/extending existing subsystem helpers and extracting/unifying shared logic across callers.
  • Clarifies Comments guidance to avoid multi-paragraph JSDoc blocks on small helpers, inline comments that restate self-evident code, and repeating the same rationale across functions or tests.

Scenarios Tested

Validated GEMINI.md formatting and markdown structure.

Sample Commands

N/A

### Description
Refines repository authoring and review conventions in `GEMINI.md`:
- Clarifies utility harmonization in `Architecture & Module Design` to cover both reusing/extending existing subsystem helpers and extracting/unifying shared logic across callers.
- Clarifies `Comments` guidance to avoid multi-paragraph JSDoc blocks on small helpers, inline comments that restate self-evident code, and repeating the same rationale across functions or tests.

### Scenarios Tested
Validated `GEMINI.md` formatting and markdown structure.

### Sample Commands
N/A
@ajperel
ajperel requested a review from joehan October 12, 2026 22:24

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates GEMINI.md to refine guidelines for coding agents, including clearer instructions on utility reuse, error handling remediation, writing high-signal comments, testing error recovery mechanisms, and keeping public repository metadata clean. The review feedback suggests minor stylistic improvements for consistency, specifically adding a comma after 'e.g.' in several places and slightly adjusting the phrasing of the error testing guideline for better readability.

Comment thread GEMINI.md
- **Survey prior art & harmonize utilities:** Before writing or adding any method that could be a common, reusable helper (e.g. retries, backoff, string parsing, path containment, domain transformations):
- **Check existing patterns first:** Search the codebase (`src/utils.ts` and relevant subsystems) to see if other code is doing a similar thing and how.
- **Reuse or unify immediately:** Either reuse how existing code does it, or if introducing a new common utility, unify it with existing custom implementations across the codebase immediately rather than creating diverging parallel implementations.
- **Survey prior art & harmonize utilities:** When implementing logic that is or could be shared across callers (e.g. retries, backoff, string parsing, path containment, domain transformations):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with other parts of this document (such as lines 53 and 72), "e.g." should be followed by a comma ("e.g.,").

Suggested change
- **Survey prior art & harmonize utilities:** When implementing logic that is or could be shared across callers (e.g. retries, backoff, string parsing, path containment, domain transformations):
- **Survey prior art & harmonize utilities:** When implementing logic that is or could be shared across callers (e.g., retries, backoff, string parsing, path containment, domain transformations):
References
  1. The repository style guide uses 'e.g.,' with a comma in lines 53 and 72. (link)

Comment thread GEMINI.md
- **Use the central `logger`** (`src/logger.ts`); never use `console.log()` for user-facing output.
- **Throw `FirebaseError`** (`src/error.ts`) for expected, user-facing errors. If the error is due to a violation of a precondition (e.g. something
that is null but should never be), specify a non-zero exit code (`{ exit: 1 }`). Error messages should clearly explain what failed and why; when actionable, provide concrete remediation guidance (e.g. the expected format, a `--force` flag, or a discovery command like `firebase <entity>:list`).
that is null but should never be), specify a non-zero exit code (`{ exit: 1 }`). Error messages should clearly explain what failed and why; when actionable, provide concrete remediation guidance using documented CLI flags, commands, or configuration options (e.g. the expected format, a `--force` flag, or a discovery command like `firebase <entity>:list`—never undocumented or legacy internal fields).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with other parts of this document (such as lines 53 and 72), "e.g." should be followed by a comma ("e.g.,").

References
  1. The repository style guide uses 'e.g.,' with a comma in lines 53 and 72. (link)

Comment thread GEMINI.md
- **Test public interfaces:** Exercise public entry points and exported module functions rather than testing or stubbing private internal helpers.
- **Unit tests (`*.spec.ts`) should be co-located with their source files.**
- Test error cases and edge conditions, not just the "happy path."
- **Test error cases and recovery mechanisms:** Exercise failure paths and edge conditions, asserting both the specific error type/message and the underlying mechanism (e.g. retry attempt counts or state cleanup) rather than bare rejection.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with other parts of this document (such as lines 53 and 72), "e.g." should be followed by a comma ("e.g.,"). Additionally, "rather than bare rejection" can be improved to "rather than a bare rejection" for better readability.

Suggested change
- **Test error cases and recovery mechanisms:** Exercise failure paths and edge conditions, asserting both the specific error type/message and the underlying mechanism (e.g. retry attempt counts or state cleanup) rather than bare rejection.
- **Test error cases and recovery mechanisms:** Exercise failure paths and edge conditions, asserting both the specific error type/message and the underlying mechanism (e.g., retry attempt counts or state cleanup) rather than a bare rejection.
References
  1. The repository style guide uses 'e.g.,' with a comma in lines 53 and 72. (link)

@joehan joehan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good, feel free to ignore the GCA super nits

Comment thread GEMINI.md
- `### Scenarios Tested`
- `### Sample Commands`
- Reference issues with "Fixes #123" in the description.
- **Keep public repository metadata clean:** Because `firebase-tools` is a public open-source repository, do not include internal issue tracker IDs (`b/...`), internal usernames, or automated agent task prefixes in commit messages, PR titles, or PR descriptions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW - i don't actually care if buganizer numbers leak. They are not sensitive by themselves

This branch has not been deployed

No deployments
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