agy-plugin-cc 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Eakkapoom-Name
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,374 @@
1
+ # Antigravity plugin for Claude Code
2
+
3
+ Use Google's Antigravity CLI (`agy`) from inside Claude Code: delegate tasks to a second model, resume agy conversations, and get independent code reviews.
4
+
5
+ This plugin is for Claude Code users who want an easy way to start using Antigravity from the workflow they already have.
6
+
7
+ ## What You Get
8
+
9
+ - `/agy:review` for standard read-only code review
10
+ - `/agy:adversarial-review` for challenge-based review
11
+ - `/agy:rescue`, `/agy:status`, `/agy:result`, and `/agy:cancel` for task delegation and job management
12
+ - `/agy:continue` to follow up in an existing agy conversation
13
+ - `/agy:quota` to check remaining Antigravity model quota
14
+ - `/agy:transfer` to hand the current session over to a resumable agy conversation
15
+ - `/agy:setup` for installation and authentication checks, and the stop-review gate toggle
16
+ - An optional stop-review gate: a Stop hook that has agy review the previous turn before the session can end
17
+
18
+ ## Requirements
19
+
20
+ - **Google account for Antigravity sign-in.**
21
+ - Delegations contribute to your Antigravity usage limits. Check them anytime with `/agy:quota`.
22
+ - **Node.js 18 or later**
23
+
24
+ ## Install
25
+
26
+ Install the plugin with one command:
27
+
28
+ ```bash
29
+ npx agy-plugin-cc
30
+ ```
31
+
32
+ Or do the same steps manually inside Claude Code. Add the marketplace:
33
+
34
+ ```bash
35
+ /plugin marketplace add Eakkapoom-Name/antigravity-plugin-cc
36
+ ```
37
+
38
+ Install the plugin:
39
+
40
+ ```bash
41
+ /plugin install agy@antigravity-plugin-cc
42
+ ```
43
+
44
+ Reload plugins:
45
+
46
+ ```bash
47
+ /reload-plugins
48
+ ```
49
+
50
+ Then run:
51
+
52
+ ```bash
53
+ /agy:setup
54
+ ```
55
+
56
+ `/agy:setup` will tell you whether agy is ready. If the Antigravity CLI is missing, install it with the official installer (macOS and Linux):
57
+
58
+ ```bash
59
+ curl -fsSL https://antigravity.google/cli/install.sh | bash
60
+ ```
61
+
62
+ On Windows (PowerShell):
63
+
64
+ ```powershell
65
+ irm https://antigravity.google/cli/install.ps1 | iex
66
+ ```
67
+
68
+ If agy is installed but not signed in yet, run it once interactively:
69
+
70
+ ```bash
71
+ !agy
72
+ ```
73
+
74
+ After install, you should see:
75
+
76
+ - the slash commands listed below
77
+ - the `agy:agy-rescue` subagent in `/agents`
78
+
79
+ One simple first run is:
80
+
81
+ ```bash
82
+ /agy:adversarial-review --background
83
+ /agy:status
84
+ /agy:result
85
+ ```
86
+
87
+ ## Usage
88
+
89
+ ### `/agy:review`
90
+
91
+ Runs a read-only agy review of your current git diff.
92
+
93
+ Use it when you want:
94
+
95
+ - a review of your current uncommitted changes
96
+ - a review of your staged changes only
97
+ - a review of your branch compared to a base ref like `main`
98
+
99
+ Findings come back ordered by severity, one per line. You can add focus text after the target.
100
+
101
+ Examples:
102
+
103
+ ```bash
104
+ /agy:review
105
+ /agy:review staged
106
+ /agy:review main
107
+ /agy:review branch pay extra attention to error handling
108
+ ```
109
+
110
+ This command is read-only and will not perform any changes.
111
+
112
+ ### `/agy:adversarial-review`
113
+
114
+ Runs a **steerable** challenge review that questions the chosen implementation and design, with a structured verdict and findings (see `schemas/review-output.schema.json`).
115
+
116
+ Use it when you want:
117
+
118
+ - a review before shipping that challenges the direction, not just the code details
119
+ - review focused on design choices, tradeoffs, and hidden assumptions
120
+ - pressure-testing around specific risk areas like auth, data loss, or race conditions
121
+
122
+ It supports `--wait` and `--background`, and takes extra focus text after the flags.
123
+
124
+ Examples:
125
+
126
+ ```bash
127
+ /agy:adversarial-review
128
+ /agy:adversarial-review --background question whether this caching design is safe
129
+ ```
130
+
131
+ This command is read-only. It does not fix code.
132
+
133
+ ### `/agy:rescue`
134
+
135
+ Hands a task to agy through the `agy:agy-rescue` subagent.
136
+
137
+ Use it when you want agy to:
138
+
139
+ - investigate a bug
140
+ - try a fix
141
+ - continue a previous agy task
142
+ - take an independent second pass on a problem
143
+
144
+ It supports `--background`, `--wait`, `--resume`, and `--fresh`, plus `--model <name>` and `--effort <low|medium|high>` passed through to agy.
145
+
146
+ Examples:
147
+
148
+ ```bash
149
+ /agy:rescue investigate why the tests started failing
150
+ /agy:rescue fix the failing test with the smallest safe patch
151
+ /agy:rescue --resume apply the top fix from the last run
152
+ /agy:rescue --background investigate the regression
153
+ /agy:rescue --effort high dig into the race condition in the job queue
154
+ ```
155
+
156
+ **Notes:**
157
+
158
+ - if you do not pass `--model` or `--effort`, agy chooses its own defaults
159
+ - write-capable runs use `--mode accept-edits` on the agy side; review and diagnosis runs stay read-only
160
+ - follow-up rescue requests can continue the latest agy conversation
161
+
162
+ ### `/agy:continue`
163
+
164
+ Sends a follow-up into an existing agy conversation instead of starting a new one. With no id, continues the most recent conversation from this session. Same `--background`/`--wait`, `--model`, `--effort` flags as `/agy:rescue`.
165
+
166
+ Examples:
167
+
168
+ ```bash
169
+ /agy:continue now apply the fix you proposed
170
+ /agy:continue 4f3062ab-b0d9-4874-b319-e42e9701e643 summarize what you changed
171
+ ```
172
+
173
+ ### `/agy:quota`
174
+
175
+ Shows remaining Antigravity model quota per bucket (Gemini and third-party groups, 5-hour and weekly windows) with reset times. Instant and quota-free.
176
+
177
+ Examples:
178
+
179
+ ```bash
180
+ /agy:quota
181
+ ```
182
+
183
+ ### `/agy:transfer`
184
+
185
+ Seeds a fresh agy conversation with a handoff brief of the current session (goal, state, decisions, open items) and returns the `conversation_id` with both resume paths.
186
+
187
+ Use it when you started a debugging or implementation conversation in Claude Code and want to continue that same context directly in Antigravity.
188
+
189
+ Examples:
190
+
191
+ ```bash
192
+ /agy:transfer
193
+ /agy:transfer --model <model> include the open questions from this session
194
+ ```
195
+
196
+ Afterwards, continue in a terminal with `agy --conversation <id>`, or from Claude Code with `/agy:rescue --resume`.
197
+
198
+ ### `/agy:status`
199
+
200
+ Shows active and recent background agy delegations in this session.
201
+
202
+ Examples:
203
+
204
+ ```bash
205
+ /agy:status
206
+ /agy:status task-abc123
207
+ ```
208
+
209
+ Use it to:
210
+
211
+ - check progress on background work
212
+ - see the latest completed job
213
+ - confirm whether a task is still running
214
+
215
+ ### `/agy:result`
216
+
217
+ Shows the stored final output of a finished background delegation, including the `conversation_id` so you can reopen that run with `/agy:continue` or `agy --conversation <id>`.
218
+
219
+ Examples:
220
+
221
+ ```bash
222
+ /agy:result
223
+ /agy:result task-abc123
224
+ ```
225
+
226
+ ### `/agy:cancel`
227
+
228
+ Stops a running background delegation (the agy conversation stays resumable).
229
+
230
+ Examples:
231
+
232
+ ```bash
233
+ /agy:cancel
234
+ /agy:cancel task-abc123
235
+ ```
236
+
237
+ ### `/agy:setup`
238
+
239
+ Checks agy readiness through a companion script (`scripts/agy-setup.mjs`) that runs every check itself (agy on PATH, auth probe, tool-exercising probe for headless permission denial, stop-review gate state) and prints a single JSON report with `ready`, per-check sections, and `nextSteps`.
240
+
241
+ You can also use `/agy:setup` to manage the optional stop-review gate.
242
+
243
+ #### Enabling the stop-review gate
244
+
245
+ ```bash
246
+ /agy:setup gate on
247
+ /agy:setup gate off
248
+ /agy:setup gate status
249
+ ```
250
+
251
+ When the gate is enabled, the plugin uses a `Stop` hook to run a read-only agy review of the previous Claude turn before the session is allowed to end. If that review finds issues in code changes from that turn, the stop is blocked so Claude can address them first.
252
+
253
+ > [!WARNING]
254
+ > The gate adds an agy review round-trip to ending a turn and spends Antigravity quota. Only enable it when you plan to actively monitor the session.
255
+
256
+ ## Typical Flows
257
+
258
+ ### Review Before Shipping
259
+
260
+ ```bash
261
+ /agy:review
262
+ ```
263
+
264
+ ### Hand A Problem To agy
265
+
266
+ ```bash
267
+ /agy:rescue investigate why the build is failing in CI
268
+ ```
269
+
270
+ ### Start Something Long-Running
271
+
272
+ ```bash
273
+ /agy:adversarial-review --background
274
+ /agy:rescue --background investigate the flaky test
275
+ ```
276
+
277
+ Then check in with:
278
+
279
+ ```bash
280
+ /agy:status
281
+ /agy:result
282
+ ```
283
+
284
+ ### Move The Work Over To Antigravity
285
+
286
+ ```bash
287
+ /agy:transfer
288
+ ```
289
+
290
+ Then continue in a terminal with `agy --conversation <id>`.
291
+
292
+ ## How to Delegate
293
+
294
+ There are two ways to hand work to agy.
295
+
296
+ ### Via command
297
+
298
+ Use `/agy:rescue` for a new task, or `/agy:continue` to follow up in an existing conversation:
299
+
300
+ ```bash
301
+ /agy:rescue investigate why the login endpoint returns 500 under load
302
+ /agy:rescue --background refactor the retry logic to use exponential backoff
303
+ /agy:continue now add tests for the fix
304
+ ```
305
+
306
+ ### Via prompt
307
+
308
+ You can also just ask in plain language. The `agy:agy-rescue` subagent triggers proactively when a task should go to a second model:
309
+
310
+ ```text
311
+ Ask agy to redesign the database connection handling to be more resilient.
312
+ ```
313
+
314
+ ```text
315
+ Hand this bug off to Antigravity and report back what it finds.
316
+ ```
317
+
318
+ ```text
319
+ Get a second opinion from agy on this migration plan.
320
+ ```
321
+
322
+ Either way, the result comes back with a `conversation_id`, so the thread stays resumable from Claude Code (`/agy:continue`) or a terminal (`agy --conversation <id>`).
323
+
324
+ ## Stop-Review Gate
325
+
326
+ Off by default. When enabled, a Stop hook runs a read-only `agy -p` review of the previous Claude turn before the session is allowed to end. The reviewer answers `ALLOW:` or `BLOCK:` on its first line; a block keeps the session open with the reviewer's reason. Turns without code changes are allowed through immediately.
327
+
328
+ - Toggle per project with `/agy:setup gate on` / `gate off`; state lives in `.claude/agy.local.md` (`stop_review_gate: true`).
329
+ - If agy is missing, the gate skips with a note instead of blocking.
330
+ - Review failures and timeouts block with guidance to run `/agy:review` manually or turn the gate off.
331
+
332
+ ## Design
333
+
334
+ Thin by design: no broker process, no job files. Every delegation is one `agy -p … --output-format json` call. Write-capable runs use `--mode accept-edits`; reviews run read-only. Foreground runs are capped near 9 minutes by the Bash tool ceiling; split longer work or use `--background`.
335
+
336
+ Job control stays thin too: `/agy:status`, `/agy:result`, and `/agy:cancel` read Claude Code's own background task tracking instead of a job store, so they cover the current session only. Cross-session continuity lives agy-side via `conversation_id` and `/agy:rescue --resume`.
337
+
338
+ ## Layout
339
+
340
+ ```
341
+ .claude-plugin/plugin.json manifest (plugin name: agy)
342
+ agents/agy-rescue.md forwarding subagent
343
+ commands/ rescue, review, adversarial-review, status, result, cancel, continue, quota, transfer, setup
344
+ hooks/hooks.json Stop hook wiring for the stop-review gate
345
+ scripts/ agy-setup.mjs, stop-review-gate-hook.mjs, npx-install.mjs (dependency-free node)
346
+ schemas/ adversarial review output shape
347
+ skills/agy-cli-runtime/ CLI call contract
348
+ skills/agy-result-handling/ output presentation rules
349
+ package.json npm package (agy-plugin-cc) for the npx installer
350
+ ```
351
+
352
+ ## FAQ
353
+
354
+ ### Do I need a separate Antigravity account for this plugin?
355
+
356
+ If you are already signed into agy on this machine, that account works immediately here too. This plugin uses your local Antigravity CLI authentication.
357
+
358
+ If you have not used Antigravity yet, install the CLI and run `!agy` once to sign in with your Google account, then run `/agy:setup` to confirm everything is ready.
359
+
360
+ ### Does the plugin use a separate Antigravity runtime?
361
+
362
+ No. Every delegation is a call to the same local `agy` binary you would use directly, with the same authentication state, the same repository checkout, and the same machine-local environment.
363
+
364
+ ### Will it use the same agy settings I already have?
365
+
366
+ Yes. The plugin picks up your existing configuration in `~/.gemini/antigravity-cli/settings.json`, including `permissions.allow` rules. Headless runs auto-deny tools not covered by those rules; `/agy:setup` detects this and shows the fix.
367
+
368
+ ### Does it spend my Antigravity quota?
369
+
370
+ Yes. Delegations, reviews, and stop-review gate runs all contribute to your Antigravity usage limits. `/agy:quota` shows what is left per bucket and is itself quota-free.
371
+
372
+ ### What does `npx agy-plugin-cc` actually do?
373
+
374
+ It runs `claude plugin marketplace add Eakkapoom-Name/antigravity-plugin-cc` and `claude plugin install agy@antigravity-plugin-cc` through your local `claude` CLI, then points you at `/agy:setup`. It is safe to rerun.
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "agy-plugin-cc",
3
+ "version": "0.6.0",
4
+ "description": "Installer for the agy Claude Code plugin: use Google's Antigravity CLI (agy) from Claude Code to delegate tasks or review code.",
5
+ "bin": {
6
+ "agy-plugin-cc": "scripts/npx-install.mjs"
7
+ },
8
+ "files": [
9
+ "scripts/npx-install.mjs",
10
+ "README.md",
11
+ "LICENSE"
12
+ ],
13
+ "engines": {
14
+ "node": ">=18"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/Eakkapoom-Name/antigravity-plugin-cc.git"
19
+ },
20
+ "keywords": [
21
+ "claude-code",
22
+ "claude-code-plugin",
23
+ "antigravity",
24
+ "agy"
25
+ ],
26
+ "author": "toaster",
27
+ "license": "MIT"
28
+ }
@@ -0,0 +1,54 @@
1
+ #!/usr/bin/env node
2
+
3
+ // npx installer for the agy Claude Code plugin.
4
+ // `npx agy-plugin-cc` registers the marketplace and installs the plugin
5
+ // through the user's local `claude` CLI. Safe to rerun.
6
+
7
+ import { spawnSync } from "node:child_process";
8
+ import process from "node:process";
9
+
10
+ const MARKETPLACE = "Eakkapoom-Name/antigravity-plugin-cc";
11
+ const PLUGIN = "agy@antigravity-plugin-cc";
12
+
13
+ function run(args) {
14
+ const result = spawnSync("claude", args, { encoding: "utf8" });
15
+ return {
16
+ ok: result.status === 0,
17
+ enoent: result.error?.code === "ENOENT",
18
+ output: `${result.stdout ?? ""}${result.stderr ?? ""}`.trim()
19
+ };
20
+ }
21
+
22
+ function alreadyDone(output) {
23
+ return /already/i.test(output);
24
+ }
25
+
26
+ function fail(message) {
27
+ console.error(message);
28
+ process.exit(1);
29
+ }
30
+
31
+ console.log(`Adding marketplace ${MARKETPLACE} ...`);
32
+ const add = run(["plugin", "marketplace", "add", MARKETPLACE]);
33
+ if (add.enoent) {
34
+ fail(
35
+ "The `claude` CLI was not found on PATH. Install Claude Code first: https://code.claude.com/docs"
36
+ );
37
+ }
38
+ if (!add.ok && !alreadyDone(add.output)) {
39
+ fail(`Could not add the marketplace:\n${add.output}`);
40
+ }
41
+ console.log(add.ok ? "Marketplace added." : "Marketplace already added.");
42
+
43
+ console.log(`Installing ${PLUGIN} ...`);
44
+ const install = run(["plugin", "install", PLUGIN]);
45
+ if (!install.ok && !alreadyDone(install.output)) {
46
+ fail(`Could not install the plugin:\n${install.output}`);
47
+ }
48
+ console.log(install.ok ? "Plugin installed." : "Plugin already installed.");
49
+
50
+ console.log(`
51
+ Done. Next steps:
52
+ 1. Start (or restart) Claude Code.
53
+ 2. Run /agy:setup to check that the Antigravity CLI (agy) is ready.
54
+ If agy is not installed yet, see https://antigravity.google/docs/cli/install/`);