2 react rules available
Two Antigravity rules match react: a React development rule and the full-stack TypeScript rule. Antigravity can create and wire several components in one task, so this file focuses on component boundaries and test coverage the agent must produce, scoped to .tsx/.jsx files.
Google describes Antigravity as its agentic development platform. Antigravity reads workspace rules from AGENTS.md or GEMINI.md and from Markdown files in .agents/rules/, with a trigger front matter field that sets when a rule is active. Global rules live under ~/.gemini/.
.agents/rules/react.mdStarting point, not a tested configuration for your repository. Active when files matching globs are involved (trigger: glob). Review the instructions, adapt the file paths and run your project's existing checks.
--- trigger: glob globs: "**/*.tsx,**/*.jsx" --- # React instructions for Antigravity ## Focus for this project - Reuse existing components from the project's UI folder before creating new primitives. - Keep filter state in the nearest common parent or the URL, not duplicated in children. - Each new component ships with a test that interacts through roles and labels. ## React conventions - Write function components and custom hooks; call hooks only at the top level of components or other hooks. - Derive values during render instead of copying props into state, and do not use an effect only to transform data for rendering. - Check the react version in package.json: on React 19, function components receive ref as a regular prop and forwardRef is not needed for new components; on React 18 keep forwardRef. - In tests, query by role and accessible name with Testing Library rather than by class names or test IDs. ## Before you finish - Run the type checker (npx tsc --noEmit for TypeScript projects), the lint script and the component tests 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. - Show your plan, including the commands you will run, before editing any file outside the globs in this rule.
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.
Create your own Antigravity rules for React and share with the community.
Antigravity truncates any single rule file over 24,000 bytes, and global plus always_on rules share a 20,000-token budget, according to the docs. AGENTS.md (or GEMINI.md) in a workspace directory is one of the documented rule locations, and ~/.gemini/AGENTS.md works globally. Use .agents/rules/ when a rule should only apply in some situations.
Documentation checked 2026-11-05: Google Antigravity docs: RulesGoogle Antigravity home page
Illustrative input and expected result. This example is a verification guide, not a recorded model run.
You ask Antigravity to build a filterable list component and want it to reuse existing UI primitives, avoid effect-driven state and add accessible tests.
Add a search box that filters the ProjectList component by name.
A controlled input with a visible label, the filtered list derived during render (no useEffect + setState copy), a Testing Library test typing into the labelled box, and type-check/test output or a note that they were not run.
Content reviewed 2026-11-05. Confirm instruction activation in your installed client before relying on it.
Antigravity workspace rule for focused React 19 changes with typed components, minimal Zustand selectors, effect discipline and Testing Library checks.