Project context for Gemini Code Assist agent mode and Gemini CLI: how to respond, what finished code includes, and how to verify changes before proposing them.
GEMINI.md. Downloaded files need to be placed in that repository path.## Gemini Code Assist Rules Applies to: **/* # Working agreement for this repository ## Responses - Lead with the answer or the change; keep explanations short and specific to this code. - Explain a decision in one or two sentences when it is not obvious (trade-off, alternative rejected). - Use Markdown with fenced code blocks and file paths for every code change. - State assumptions explicitly when the request is ambiguous, and ask before making a change that is hard to undo (deleting files, migrations, dependency upgrades). ## Code changes - Follow the patterns already used in the surrounding code: naming, file layout, error handling, logging and test style. Read neighbouring files before generating new ones. - Handle errors at I/O boundaries (network, file system, database, user input) in the way the project already does; do not add try/catch blocks that only re-throw. - Add comments only where the intent or a constraint is not obvious from the code. - Keep changes focused on the request. Mention, but do not make, unrelated refactors. - Do not add dependencies without saying why and naming the package and version. - Never put secrets, tokens or real customer data in code, tests or examples. ## Verification - Update or add tests that cover the change. - Run the project's checks before presenting a change as done (for example the test, lint and type-check scripts in package.json or Makefile) and report the commands and results. If you cannot run them, say so. ## Help with problems 1. Restate the problem and identify the relevant files. 2. Consider edge cases (empty input, errors, concurrency, permissions) that apply. 3. Provide a working solution and explain how it was checked. 4. Suggest follow-up improvements separately, if relevant.
Cursor rules for strict TypeScript: compiler checks beyond strict, interfaces vs type aliases, real type guards, discriminated unions, utility types and branded IDs.
Stack-neutral CLAUDE.md conventions for Claude Code covering how to read before editing, keep diffs scoped, debug from a reproduction, test and report verification.
Copilot instructions for TypeScript project setup covering strict tsconfig flags and their effects, type-only imports, module hygiene and TSDoc for public APIs.
Gemini
general
Illustrative input and expected result. This example is a verification guide, not a recorded model run.
Content reviewed .
A team uses Gemini Code Assist agent mode in VS Code and Gemini CLI on the same repository and wants consistent, verifiable answers instead of generic 'production-ready' code.
Add pagination to the GET /orders endpoint in src/routes/orders.ts.
A focused diff that follows the existing route and validation patterns, handles invalid page parameters, adds or updates tests, lists the commands run (for example npm test and npm run lint) with their results, and states any assumption such as the default page size.
Gemini CLI loads instructional context from GEMINI.md files: a global ~/.gemini/GEMINI.md, files in your workspace directories and their parents, and files discovered in subfolders as the agent works. The file name is configurable, so a project can tell Gemini CLI to read AGENTS.md instead of, or alongside, GEMINI.md. The rules in this directory are written as plain system instructions, so the same text can also be used as a system instruction in Gemini API or Google AI Studio requests.
GEMINI.mdStarting point, not a tested configuration for your repository. GEMINI.md has no file-scoping front matter; add this as a section, or place a GEMINI.md in the relevant subfolder. Review the instructions, adapt the file paths and run your project's existing checks.
## Gemini Code Assist Rules Applies to: **/* # Working agreement for this repository ## Responses - Lead with the answer or the change; keep explanations short and specific to this code. - Explain a decision in one or two sentences when it is not obvious (trade-off, alternative rejected). - Use Markdown with fenced code blocks and file paths for every code change. - State assumptions explicitly when the request is ambiguous, and ask before making a change that is hard to undo (deleting files, migrations, dependency upgrades). ## Code changes - Follow the patterns already used in the surrounding code: naming, file layout, error handling, logging and test style. Read neighbouring files before generating new ones. - Handle errors at I/O boundaries (network, file system, database, user input) in the way the project already does; do not add try/catch blocks that only re-throw. - Add comments only where the intent or a constraint is not obvious from the code. - Keep changes focused on the request. Mention, but do not make, unrelated refactors. - Do not add dependencies without saying why and naming the package and version. - Never put secrets, tokens or real customer data in code, tests or examples. ## Verification - Update or add tests that cover the change. - Run the project's checks before presenting a change as done (for example the test, lint and type-check scripts in package.json or Makefile) and report the commands and results. If you cannot run them, say so. ## Help with problems 1. Restate the problem and identify the relevant files. 2. Consider edge cases (empty input, errors, concurrency, permissions) that apply. 3. Provide a working solution and explain how it was checked. 4. Suggest follow-up improvements separately, if relevant.
Ask for a small change to one matching file. Check the tool's loaded context or instruction view, inspect the diff for the requested convention, and run the relevant build or test. A well-formatted file does not guarantee the model follows every instruction.
The Gemini CLI documentation states that Gemini CLI was replaced by Antigravity CLI on June 18, 2026 for unpaid-tier and Google One users. Check which CLI your account uses; Antigravity rules are covered on the Antigravity page. Gemini CLI does not need a separate AGENTS.md mechanism: its context file name is configurable through context.fileName in settings.json (the docs show ["AGENTS.md", "CONTEXT.md", "GEMINI.md"]). Without that setting it looks for GEMINI.md.
Documentation checked 2026-11-05: Gemini CLI docs: GEMINI.md context filesGemini CLI docs: System prompt override
Cursor rules for strict TypeScript: compiler checks beyond strict, interfaces vs type aliases, real type guards, discriminated unions, utility types and branded IDs.
Stack-neutral CLAUDE.md conventions for Claude Code covering how to read before editing, keep diffs scoped, debug from a reproduction, test and report verification.
Copilot instructions for TypeScript project setup covering strict tsconfig flags and their effects, type-only imports, module hygiene and TSDoc for public APIs.