Geminimap
Antigravity · Rules

Windsurf/Antigravity Rules v5

Six-file guardrail pack, en+ja

Verified 2026-11-12RulesMITbeginner

1What it does

A maintained rules pack (version v5) that ships six guardrail files for both Windsurf (.windsurf/rules/) and Antigravity (.agent/rules/), in English and Japanese variants. The pack's scope is broader than a single-purpose guard: commit-message-format.md and pr-message-format.md enforce Conventional-Commit-style messages with structured PR sections; test-strategy.md requires automated tests with meaningful production-code changes; prompt-injection-guard.md adds defenses against context-injection from external sources (an instruction-quarantine layer plus a SECURITY_ALERT output format); and planning-mode-guard.md — Antigravity-only — stops the agent from leaving Planning Mode and editing files without explicit approval, while also keeping replies in the user's language. The author iterated the pack across model generations, and the v5 focus is disciplined execution: checklist-style plans verified item by item, task tiers (lightweight/standard/critical) that scale the ceremony to the task, and parallel execution of independent work.

2When to use it

Reach for it when you want one maintained pack instead of assembling six separate guards — it is the broadest single-repo coverage in the rules ecosystem, and the injection guard alone covers a threat most packs ignore entirely. It is a strong default for team repositories where commit and PR conventions matter, and for solo projects where the agent runs semi-autonomously and a Planning-Mode escape would be costly. Skip it (or cherry-pick individual files) if you only want a thin diff-size guard — six always-on rule files is real context, and the README itself warns that conflicting rules from other sources (User Rules, Memories) can confuse the model rather than stack.

3How to get started

For Antigravity, create .agent/rules/ at your workspace root and copy the rule files you want from en/.agent/rules/ (or the ja/ tree for Japanese). The files carry trigger: always_on metadata, so they apply to every subsequent chat once in place. Start with three — the commit/PR format pair and the injection guard — then add test-strategy and planning-mode-guard once the baseline feels stable; the README's division-of-responsibility doc (doc/rules-and-workflows.md) explains which concerns belong in rules versus the pack's workflow files. If you keep Windsurf and Antigravity on the same project, the mirrored .windsurf/rules/ tree keeps both agents under one policy.

4Configuration

There is no build step — configuration means file selection and the editor-side trigger settings. The prompt-injection-guard ships always_on but the README notes the editor UI can still gate when it applies, and it documents a false-positive handling path in the operational guide — worth reading before enabling on a repo that ingests external content. Language selection lives inside the commit rule's language directive (messages generate from diffs in the chosen language). The pack's own doc recommends having your agent evaluate the rules against your codebase before adopting them wholesale; conflicts with pre-existing User Rules or Memories are the known failure mode, so audit those first.

5Things to know

  • The pack predates the Antigravity rename — planning-mode-guard exists only in .agent/rules/ and is deliberately absent from the Windsurf tree, so do not mirror the folders blindly.
  • prompt-injection-guard neutralizes commands arriving through external content (RAG results, web pages, API responses) but explicitly does not restrict your direct instructions — that boundary is designed, not a gap.
  • Workflows ship in the same repo under .agent/workflows/ and .windsurf/workflows/ — note Antigravity has deprecated workflows in favor of skills, so treat those files as legacy templates to port rather than install.
  • MIT-licensed; the repo itself models the behavior it teaches — commit and PR message rules are exercised on the pack's own history. - The repo treats rules as versioned software — v5 is a release with a changelog, not a static dump; when a model generation shifts behavior, the pack's response lands as a tracked diff you can diff against your own customizations. Watch the changelog before upgrading an adopted ruleset — a rule that tightened autonomy may relax, and vice versa.
  • The pack documents its own evolution — the CHANGELOG records which rules changed per model generation, which is unusual diligence for a rules repo and useful when a previously-stable behavior shifts after an upgrade.

6Related on the map

References