feat(antigravity): add recall skill, optional rule, shared protocol - #1771
Conversation
Adds the recall layer to the Antigravity plugin, mirroring the three- layer wiring from feat/cursor-hooks-support, adapted for Antigravity's native plugin and hook surfaces. The wake hook (PreInvocation, invocationNum==1) was already the eager layer — it injects verbatim palace content via injectSteps[]. ephemeralMessage before the first model call, which is strictly better than Cursor's static directive. This commit adds the on-demand layers: - integrations/shared/recall-protocol.md: single canonical source of truth for "search before answering", shared across Cursor, Antigravity, Claude Code, Codex, OpenClaw. Ported from feat/cursor-hooks-support with the wake-up step de-coupled from any IDE-specific hook name. - .antigravity-plugin/skills/mempalace-recall/SKILL.md: recall-only skill with Protocol, Tool selection, Unhappy paths, and Anti-patterns sections. Tailored to Antigravity: references injectSteps injection, not Cursor's additional_context; links to shared protocol via GitHub URL (relative file paths break in the installed copy at ~/.gemini/config/plugins/mempalace/). - .antigravity-plugin/rules/mempalace-recall.md: plain .md recall rule (no .mdc extension, no YAML frontmatter — per Antigravity's plugin docs which specify rules/<name>.md). Body mirrors Cursor's rule; references the shared protocol via absolute GitHub URL. - hooks/antigravity/install.sh: creates skills/mempalace-recall/ and rules/ in the install dir, copies both new files (cmp-gated, idempotent). Verified: first run writes both, second run is silent. - .antigravity-plugin/README.md: updated layout tree + "Three recall layers" section documenting wake hook (eager), recall skill (on-demand), and optional rule. - 11 new tests in tests/test_antigravity_plugin_manifest.py covering: shared protocol presence, recall skill structure (frontmatter, required sections, GitHub URL reference), rule format (plain .md, no frontmatter), and installer (mkdir + copy_file lines present). Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a three-layer recall system for the MemPalace Antigravity plugin, which includes a wake hook, a recall-only skill, and an optional recall rule, all anchored to a new canonical recall protocol (integrations/shared/recall-protocol.md). It also updates the installer script and adds comprehensive manifest tests to validate these new files. The review feedback correctly notes that the protocol steps in the newly added SKILL.md have already slightly drifted from the canonical protocol definition, and recommends keeping them synchronized to ensure consistent agent behavior.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| ## Protocol | ||
|
|
||
| 1. On wake-up, the MemPalace PreInvocation hook injects verbatim palace | ||
| content via `injectSteps[].ephemeralMessage` on the first model call | ||
| of a conversation. If memory was injected, start from it before | ||
| searching further. | ||
| 2. Before responding about people / projects / past events / prior | ||
| decisions: call `mempalace_search` first. Use `mempalace_kg_query` | ||
| for relational or time-bound facts. | ||
| 3. If unsure about a fact: say "let me check the palace" and query. | ||
| 4. Return the drawer's **verbatim** text. Never summarize or paraphrase | ||
| stored content — quoting the exact words is the point of the system. | ||
| 5. After a substantive session, record continuity with | ||
| `mempalace_diary_write` (skip if a background hook already saved). | ||
| 6. When a fact changes: `mempalace_kg_invalidate` the old fact, then | ||
| `mempalace_kg_add` the new one. | ||
|
|
There was a problem hiding this comment.
The protocol steps described here have already drifted from the canonical protocol defined in integrations/shared/recall-protocol.md. For example:
- Step 3: The canonical protocol includes specific examples
(name, age, relationship, preference)and the phrase"Wrong is worse than slow."which are missing here. - Step 4: The canonical protocol uses
"Return verbatim. Quote the drawer's exact stored words. Never summarize, paraphrase, or lossy-compress..."whereas this skill uses"Return the drawer's verbatim text. Never summarize or paraphrase...". - Step 5: The canonical protocol has different phrasing regarding background hooks and double-filing.
While some platform-specific details (like Antigravity's PreInvocation hook in Step 1) are appropriate here, the core instructions, unhappy paths, and anti-patterns should be kept synchronized with the canonical source of truth to ensure consistent agent behavior across all integrations.
…urce Steps 2-6, unhappy paths, and anti-patterns now match integrations/shared/recall-protocol.md verbatim. Step 1 remains Antigravity-specific (PreInvocation injectSteps injection). Flagged by gemini-code-assist on PR MemPalace#1771. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Adds the recall layer to the Antigravity plugin, mirroring the three-layer wiring from
feat/cursor-hooks-support, adapted for Antigravity's native plugin and hook surfaces. Follows on from #1633.integrations/shared/recall-protocol.md— canonical "search before answering" protocol, single source of truth shared across Cursor, Antigravity, Claude Code, Codex, OpenClaw. Skills and rules link here rather than restating the protocol, so they can never drift from each other..antigravity-plugin/skills/mempalace-recall/SKILL.md— recall-only skill (Protocol, Tool selection, Unhappy paths, Anti-patterns). Complements the opsmempalaceskill. Protocol cross-reference uses a GitHub URL rather than a relative file path, so the link works in the installed copy at~/.gemini/config/plugins/mempalace/as well as in the repo..antigravity-plugin/rules/mempalace-recall.md— plain.mdrecall rule (no.mdc, no YAML frontmatter per Antigravity'srules/<name>.mdformat). Body mirrors the Cursor rule.hooks/antigravity/install.sh— createsskills/mempalace-recall/andrules/in the install directory; copies both new files (cmp-gated, idempotent). Verified: first run writes, second run is silent..antigravity-plugin/README.md— updated layout tree + "Three recall layers" section (wake hook eager layer → recall skill on-demand layer → optional rule).tests/test_antigravity_plugin_manifest.pycovering: shared protocol presence, recall skill structure (YAML frontmatter, required sections, GitHub URL reference), rule format (plain.md, no frontmatter), and installer lines.Why the wake hook is unchanged
The Antigravity wake hook (
PreInvocation,invocationNum==1) already injects actual palace content viainjectSteps[].ephemeralMessage. This is strictly better than Cursor'ssessionStartapproach of emitting a static "please call these tools" directive — it delivers the memory itself rather than asking the agent to go fetch it. No change needed.Test plan
uv run pytest tests/test_antigravity_plugin_manifest.py— 22 tests (11 new), all passuv run pytest tests/ --ignore=tests/benchmarks— 2349 passed, 3 skippedbash hooks/antigravity/install.sh --dry-run— shows correctmkdir+copy_fileentries for recall skill and rulebash hooks/antigravity/install.shthen re-run — idempotent (no second-run writes)uv run ruff check .— cleanMade with Cursor