1 nodejs rules available
One Gemini rule matches nodejs: a Node.js backend rule using Express. The GEMINI.md section below adds the module-system and runtime checks that a model working from plain context cannot infer without reading package.json. GEMINI.md has no glob scoping, so the section names the files it applies to; a GEMINI.md inside a subfolder is the way to limit it to that folder.
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.
## Node.js development Applies to: **/*.js, **/*.mjs, **/*.cjs, **/*.ts # Node.js instructions for Gemini CLI ## Focus for this project - Read package.json "type" and "engines" before writing imports or using newer APIs, and state what you found. - Use the built-in fetch only if engines allows Node.js 18 or later; otherwise use the project's HTTP client. - Add or update a test for every new route. ## Node.js conventions - Check "type" in package.json and the engines field: write ESM import syntax in "type": "module" packages and CommonJS otherwise, and only use APIs available in the declared Node.js version. - Import built-ins with the node: prefix (node:fs/promises, node:path) and never use synchronous fs calls on a request path. - Validate every request body, query string and environment variable at the boundary and fail fast on missing configuration. - Await or explicitly handle every promise; no floating promises and no unhandled rejections. ## Before you finish - Run the project's test script (node --test if no framework is configured), lint and type check and report the actual output. If you cannot run them, say so and list the exact commands instead of saying they pass. - Summarize which of the rules above affected the change. - If shell commands are not approved in this session, stop after the edit and list the exact commands for the user to run.
Create your own Gemini rules for Node.js and share with the community.
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
Illustrative input and expected result. This example is a verification guide, not a recorded model run.
You use Gemini CLI to add an endpoint to an Express service and want it to respect ESM vs CommonJS and the declared Node.js version.
Add GET /health that reports database connectivity.
A route using the project's module syntax, a short database ping with a timeout, 200 or 503 JSON responses, a test, and the module type and Node.js range it found.
Content reviewed 2026-11-05. Confirm instruction activation in your installed client before relying on it.