Skip to content

feat: subagents, write checks and a rule for the Antigravity plugin - #1147

Merged
tractorjuice merged 2 commits into
mainfrom
feat/antigravity-agents-hooks
Nov 22, 2026
Merged

tractorjuice merged 2 commits into
mainfrom
feat/antigravity-agents-hooks

Conversation

@tractorjuice

Copy link
Copy Markdown
Owner

Adds the three parts of an Antigravity plugin that ArcKit's did not yet carry: subagents, lifecycle hooks and a rule.

What changes for someone using it

  • Research runs in a subagent. Twelve research commands hand their work over, so the pages they read stay out of the conversation. If a subagent can't be started the command does the work itself. /arckit-evaluate and /arckit-score stay in the conversation.
  • Writes are checked. A wrongly named ARC- document is stopped and told the right path; a write to .env, a lock file or a private key is stopped; so is text that looks like a credential. After a write the project manifest is updated.
  • One rule carries the artefact conventions while an ARC- document is in context.

How

  • scripts/converter.py: generate_antigravity_agents, generate_antigravity_hooks, generate_antigravity_rules.
  • scripts/antigravity/agy-hook.mjs: one adapter that turns Antigravity's hook input and output into the Claude Code shapes, so the four gates are copied unchanged. It always exits 0, because Antigravity ignores a hook that exits non-zero; a gate that cannot run is reported as a deny when the file is an ARC- artefact.

Tested

  • agy plugin validate --strict passes: 194 skills, 12 agents, 1 rule, 2 hook groups, 5 MCP servers.
  • 38 new tests, including the adapter run against allowed, wrongly named, wrong-folder, secret, protected-file, non-write and cannot-run cases. Full suite: 6,691 pass.

Not tested — why this is a draft

None of this has been run in a live Antigravity session. The account's Antigravity quota ran out during testing (resets in about a week). Unknown until then: whether the main agent starts the subagent from the skill's wording, whether the hook payload matches the documented shape exactly, and whether a deny reads well to the agent.

Compared with agy plugin import

Antigravity can import the Claude Code plugin directly. Tried on 22 November 2026 (agy 1.5.13), it brought 81 skills, 38 agents and 7 MCP servers, but: every hook command came out as bare node with no script, so no hook works; 22 skills are over the 24,000-byte limit and would be cut short; agents keep Claude Code's tool names; skills keep ${CLAUDE_PLUGIN_ROOT} paths and /arckit: command names; the two keyed MCP servers are included. So the generated plugin is still needed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Hfsx56kefipenQbkB64qZ1

An Antigravity plugin can hold skills, MCP servers, subagents, rules and
lifecycle hooks. ArcKit's shipped the first two. This adds the other three,
in the formats on antigravity.google/docs/build-plugins and /docs/hooks.

Subagents: twelve research commands hand their work to
agents/arckit-<command>-agent.md and keep the full prompt beside the skill
as instructions.md for a session that cannot start a subagent. evaluate
and score stay in the main conversation.

Hooks: hooks.json runs the file-name, protected-file and secret gates
before a write and the manifest update after. One adapter,
scripts/antigravity/agy-hook.mjs, translates Antigravity's stdin and stdout
to the Claude Code shapes, so the gates are copied unchanged. Antigravity
ignores a hook that exits non-zero, so the adapter always exits 0 and
reports a gate that could not run as a deny when the file is an ARC
artefact.

Rule: one glob-triggered rule with the artefact conventions.

The plugin passes agy plugin validate --strict (12 agents, 1 rule, 2 hook
groups). None of the three has been run in a live Antigravity session: the
account's Antigravity quota ran out during testing. The README says so.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hfsx56kefipenQbkB64qZ1
@tractorjuice tractorjuice added the enhancement New feature or request label Nov 22, 2026
From an independent review of the pull request:

- A workspace given as /tmp/x with a file given as /private/tmp/x/..., or
  either reached through a link, skipped the file-name gate, because the
  gates compare paths as text. The adapter now resolves both to real paths.
- A workspace folder that does not exist made every gate fail to start, so
  a write to a protected file went ahead. The adapter now falls back to the
  nearest folder that exists.
- Run through a linked plugin folder the adapter printed nothing, which
  Antigravity reads as no objection. The main-module check compares real
  paths.
- Three gates at 20 seconds each could outlast Antigravity's 30-second hook
  timeout. The gates now share a budget below it.
- The agent description is read as YAML, and a subagent's prompt no longer
  carries a placeholder nothing fills.
- The test of the hook after a write had no manifest to update, so it
  proved nothing. It now checks the manifest gains the document, and there
  are tests for linked paths, a relative target, a missing workspace and a
  linked plugin folder.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hfsx56kefipenQbkB64qZ1
@tractorjuice
tractorjuice marked this pull request as ready for review November 22, 2026 16:23
@tractorjuice
tractorjuice merged commit 663c8c7 into main Nov 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant