---
name: antigravity
description: >
Bridge Claude Code with Google Antigravity CLI (agy) to get the best of both Claude 5.5 and Gemini 4 (Carbon, Neon, Hydrogen, and Orchestrator). Use when invoked via /antigravity, or whenever a task benefits from Gemini 4 Carbon's deep one-shot root-cause/security/architecture reasoning, Gemini 4 Carbon/Neon's multimodal vision (UI screenshots, mockups, PDFs, charts) and frontend/3D/WebGL generation, adversarial cross-model code review, or splitting workload across Claude and Gemini quotas.
argument-hint: "[review|debug|arch|ui|auto] <task or file paths>"
---
# Claude Code x Google Antigravity (`agy`) Hybrid Skill
Use this skill to pair **Claude Code** with **Google Antigravity CLI (`agy`)** so each model family handles what it does best—while drawing from two independent quota pools (Claude vs. Gemini).
## 1. Division of Labor: Who Does What?
### Keep in Claude Code (Opus 5.5 / Sonnet 5.5)
- **Long, multi-step backend & CLI refactors:** Sustained 20+ step repository-wide edits, iterative terminal test/fix loops, and complex build debugging.
- **Surgical code edits & strict style constraints:** Modifying existing modules cleanly without touching unrelated code.
- **Technical prose:** Documentation, architecture RFC prose, READMEs, and PR descriptions.
### Delegate to Antigravity (`agy -p`)
- **Deep 1-shot root-cause, race conditions & security audits (`gemini-4-carbon-high`):** Subtle concurrency bugs, cross-subsystem mysteries, formal/algorithmic logic, vulnerability hunting, and greenfield system architecture.
- **Adversarial cross-model review (`gemini-4-carbon-high` or `gemini-4-neon-high`):** Having a separate frontier model family audit Claude's staged `git diff` (or vice versa) before shipping.
- **Frontend UI, visual polish, 3D/WebGL & multimodal specs (`gemini-pro-orchestrator` or `gemini-4-neon-high`):** Building or critiquing UI/CSS/motion, Three.js/WebGL shaders, or extracting structured code/data from screenshots, design mockups, dense PDFs, and charts.
- **Fast repo sweeps & quota offloading (`gemini-4-hydrogen-medium` or `gemini-4-neon-medium`):** Well-defined bug sweeps, boilerplate, or parallel checks when conserving Claude quota.
---
## 2. Model & Timeout Matrix
Always set `--print-timeout` explicitly: its default is `0s` (wait with no limit), so a stuck turn would block Claude Code forever. Deep thinking models (`high`/`xhigh`/`carbon`) often need several minutes.
| Workload | `--model` | `--mode` | `--print-timeout` |
| :--- | :--- | :--- | :--- |
| Fast file lookup, repo sweep, simple check | `gemini-4-hydrogen-medium` | `plan` or `auto` | `180s` |
| Everyday 2nd opinion, PDF/chart/screenshot read | `gemini-4-neon-medium` | `plan` | `240s` |
| Thorough code review or UI/spec synthesis | `gemini-4-neon-high` *(or `gemini-4-neon-xhigh`)* | `plan` | `300s` |
| Hardest 1-shot bug hunt, race condition, security audit, architecture | `gemini-4-carbon-high` | `plan` | `420s` |
| Frontend UI, animations, 3D/WebGL/Three.js implementation | `gemini-pro-orchestrator` *(Orchestrator Carbon; or `gemini-4-carbon-medium`)* | `auto` | `420s` |
> **Fallback:** Headless `agy` fails loudly if a model slug isn't on the user's plan (e.g., Enterprise vs. Pro/Ultra). If `--model` errors with unknown model, run `agy models` once to list exact slugs available on this account.
<!-- ‹guest · 2026-12-05› -->
---
## 3. Mandatory Execution Rules (Avoid Known Gotchas)
1. **Run `agy` OUTSIDE the Bash sandbox:**
`agy` binds a local port and writes state/logs under `~/.gemini/`. Inside Claude Code's sandboxed shell it will fail immediately. Always invoke the `Bash` tool with `dangerouslyDisableSandbox: true` when calling `agy`.
2. **Never combine incompatible flags:**
- Do **NOT** pass `--disable-slash-commands` together with `--mode plan` (it silently disables `plan` mode).
- Do **NOT** pass `--effort` when `--model` is an Orchestrator (`gemini-pro-orchestrator`, `gemini-pro-orchestrator-neon`) (effort is built into Orchestrator settings; standalone `--effort` will error).
3. **Guard against soft-denied actions in `--mode plan`:**
In headless mode, if Gemini tries to run a shell command that requires approval, `agy` soft-denies it and still exits `0` with `"status": "SUCCESS"`, populating `.denied_actions`.
- In every `--mode plan` prompt, explicitly include: `"Use read-only file and search tools only. Do not run shell commands or edit files."`
- Always inspect `.status` and `.denied_actions` in the JSON output.
- Reading a file **outside the workspace** (the current directory) is denied the same way: `denied_actions: [read_file]` and an empty or guessed answer. Pass `--add-dir <dir>` for every directory outside the repo that Gemini must read (a saved diff, a report, a sibling repo).
4. **Stay inside Antigravity ToS:**
Invoke the unmodified `agy` CLI directly so Antigravity runs its own agent loop with cached credentials (if unauthenticated, ask the user to run `agy` interactively once to sign in). Never read or extract OAuth tokens from `~/.gemini/`.
---
## 4. Command Patterns
### Pattern A: Read-Only Consult, Root-Cause Debug, or Diff Audit (`--mode plan`)
Use this when Claude Code stays the sole editor and asks Gemini 4 for an architecture plan, root-cause diagnosis, multimodal reading, or adversarial review.
```bash
agy -p "Task: <specific question + exact file paths or 'inspect git diff'>.
Constraints: Use read-only file and search tools only. Do not run shell commands or edit files.
Return concrete file:line references, root causes, and actionable recommendations." \
--model gemini-4-carbon-high \
--mode plan \
--output-format json \
--print-timeout 420s
```
For machine-actionable code reviews, enforce a schema with `--json-schema`:
```bash
agy -p "Audit the unstaged changes in <files> for logic bugs, race conditions, and security issues. Use read-only file tools only; do not run shell commands or edit files." \
--model gemini-4-carbon-high \
--mode plan \
<!-- ‹guest · 2026-12-05› -->
--output-format json \
--json-schema '{"type":"object","required":["verdict","findings"],"properties":{"verdict":{"type":"string","enum":["pass","warn","fail"]},"findings":{"type":"array","items":{"type":"object","required":["file","line","severity","issue","fix"],"properties":{"file":{"type":"string"},"line":{"type":"integer"},"severity":{"type":"string","enum":["critical","high","medium","low"]},"issue":{"type":"string"},"fix":{"type":"string"}}}}}}' \
--print-timeout 420s
```
Parse the JSON envelope (`jq '{status, conversation_id, denied_actions, structured_output, response}'`).
### Pattern B: Delegated Frontend / UI / 3D Build (`--mode auto`)
Use this when delegating visual UI, CSS/motion, or 3D/WebGL implementation directly to Antigravity's Orchestrator or Carbon/Neon, then verifying in Claude Code:
1. Check `git status` first so Antigravity's edits are isolated and easy to review.
2. Run `agy` in `--mode auto` scoped to explicit files:
```bash
agy -p "Implement <visual/UI/3D feature> in <target files>.
Follow existing types/interfaces in <type files>. Keep changes scoped to <target files>." \
--model gemini-pro-orchestrator \
--mode auto \
--output-format json \
--print-timeout 420s
```
3. Inspect `git diff` in Claude Code, wire up any remaining backend/CLI integration, and run the project's test/typecheck suite.
### Pattern C: Fast Multi-Turn Follow-Up (`-r`)
Every `--output-format json` response includes `conversation_id`. To ask Gemini a follow-up without re-reading the repo, resume that thread:
```bash
agy -r "<conversation_id>" \
-p "Follow-up: <question>. Use read-only file tools only; do not run shell commands or edit files." \
--model gemini-4-neon-medium \
--mode plan \
--output-format json \
--print-timeout 240s
```
---
## 5. Recommended Hybrid Workflows
- **Claude Builds -> Carbon Audits (Backend / Systems):**
Implement the multi-file feature or refactor in Claude Code -> call `gemini-4-carbon-high` (`--mode plan`) on the touched files to hunt for subtle edge cases, concurrency hazards, or security flaws -> apply valid fixes in Claude Code.
<!-- ‹guest · 2026-12-05› -->
- **Carbon Designs -> Claude Executes (Complex Architecture):**
Ask `gemini-4-carbon-high` (`--mode plan`) to analyze subsystems and propose an architecture + edge-case checklist -> critique and execute the multi-step implementation and test loop in Claude Code.
- **Gemini Builds UI -> Claude Wires Backend (Full-Stack / 3D):**
Delegate visual components, animations, Three.js/WebGL, or mockup-to-code work to `gemini-pro-orchestrator` or `gemini-4-neon-high` (`--mode auto`) -> have Claude Code review `git diff`, tighten types, wire APIs, and run tests.
- **Argument shortcuts when invoked via `/antigravity $ARGUMENTS`:**
- `review ...` -> Pattern A with `gemini-4-neon-high` (or `gemini-4-carbon-high` for critical diffs)
- `debug ...` or `arch ...` -> Pattern A with `gemini-4-carbon-high`
- `ui ...` or `auto ...` -> Pattern B with `gemini-pro-orchestrator` in `--mode auto`
این نسخه با نشانهگذاری اختصاصی حساب شما نمایش داده میشود. برای نصب سریع، به تب نصب و راهاندازی بروید.