@sabaiway/agent-workflow-kit 1.5.2 → 1.7.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/README.md +12 -5
  3. package/SKILL.md +48 -20
  4. package/bin/install.mjs +33 -50
  5. package/bin/install.test.mjs +30 -1
  6. package/bridges/antigravity-cli-bridge/SKILL.md +178 -0
  7. package/bridges/antigravity-cli-bridge/bin/agy.sh +133 -0
  8. package/bridges/antigravity-cli-bridge/bin/agy.test.mjs +59 -0
  9. package/bridges/antigravity-cli-bridge/capability.json +22 -0
  10. package/bridges/antigravity-cli-bridge/references/driving-agy.md +108 -0
  11. package/bridges/antigravity-cli-bridge/references/models-and-flags.md +93 -0
  12. package/bridges/antigravity-cli-bridge/references/review-prompt.md +51 -0
  13. package/bridges/antigravity-cli-bridge/setup/README.md +65 -0
  14. package/bridges/codex-cli-bridge/SKILL.md +148 -0
  15. package/bridges/codex-cli-bridge/bin/codex-exec.sh +143 -0
  16. package/bridges/codex-cli-bridge/bin/codex-review.sh +84 -0
  17. package/bridges/codex-cli-bridge/capability.json +22 -0
  18. package/bridges/codex-cli-bridge/references/driving-codex.md +97 -0
  19. package/bridges/codex-cli-bridge/references/sandbox-and-flags.md +105 -0
  20. package/bridges/codex-cli-bridge/setup/README.md +78 -0
  21. package/capability.json +1 -1
  22. package/migrations/README.md +1 -1
  23. package/package.json +3 -2
  24. package/references/templates/AGENTS.md +2 -1
  25. package/tools/delegation.mjs +4 -4
  26. package/tools/delegation.test.mjs +4 -3
  27. package/tools/detect-backends.mjs +36 -0
  28. package/tools/detect-backends.test.mjs +102 -0
  29. package/tools/fs-safe.mjs +129 -0
  30. package/tools/fs-safe.test.mjs +200 -0
  31. package/tools/inject-methodology.mjs +131 -23
  32. package/tools/inject-methodology.test.mjs +232 -1
  33. package/tools/setup-backends.mjs +468 -0
  34. package/tools/setup-backends.test.mjs +500 -0
@@ -0,0 +1,133 @@
1
+ #!/usr/bin/env bash
2
+ # Universal, neutral wrapper around Google's Antigravity CLI (`agy`).
3
+ #
4
+ # Antigravity CLI is the successor to Gemini CLI: as of 2026-06-18 the old
5
+ # Gemini CLI stopped serving Google AI Pro / Ultra / free tiers, and access to
6
+ # Google's models from the terminal moved to `agy`. This wrapper is the single
7
+ # entry point so callers never have to remember the flag spelling.
8
+ #
9
+ # Auth: SUBSCRIPTION ONLY. We use the cached OAuth token at
10
+ # ~/.gemini/antigravity-cli/antigravity-oauth-token (Google AI Pro) and the
11
+ # quota that comes with it. To make that guarantee hard, the wrapper unsets any
12
+ # API-key env var so a stray key can never silently switch us to paid
13
+ # pay-as-you-go billing.
14
+ #
15
+ # This is a THIN, FLOW-AGNOSTIC wrapper on purpose: it just runs one headless
16
+ # prompt and prints the text response. It does NOT encode any orchestration
17
+ # policy (no plan contract, no auto-approve, no workspace edits) — that is left
18
+ # to whatever flow we design later, which can opt in via passthrough flags.
19
+ #
20
+ # Models (pass the exact display string from `agy models`, or set AGY_MODEL):
21
+ # Gemini 3.5 Flash (Low|Medium|High), Gemini 3.1 Pro (Low|High),
22
+ # Claude Sonnet 4.6 (Thinking), Claude Opus 4.6 (Thinking), GPT-OSS 120B (Medium)
23
+ #
24
+ # Usage (installed on PATH as `agy-run`):
25
+ # agy-run "your prompt" # prompt as an argument
26
+ # echo "your prompt" | agy-run - # prompt from stdin
27
+ # agy-run @path/to/prompt.md # prompt from a file
28
+ # AGY_MODEL="Claude Opus 4.6 (Thinking)" agy-run "..." # pick a model
29
+ # AGY_TIMEOUT=10m agy-run "..." # override print timeout (agy's soft bound)
30
+ # AGY_HARD_TIMEOUT=8m agy-run "..." # override the hard wall-clock cap (timeout(1))
31
+ # agy-run "..." -- --add-dir . --dangerously-skip-permissions
32
+ # # passthrough agy flags (future flows)
33
+ set -euo pipefail
34
+
35
+ # 1. Make `agy` findable even when ~/.bashrc was not sourced.
36
+ export PATH="$HOME/.local/bin:$PATH"
37
+
38
+ # 2. Force the subscription path: never let an API key hijack billing. Unset EVERY *_API_KEY for the
39
+ # agy subprocess — the explicit Google/Antigravity ones first, then any other *_API_KEY that may
40
+ # have been added later (`compgen` is a bash builtin; the shebang guarantees bash).
41
+ unset ANTIGRAVITY_API_KEY GEMINI_API_KEY GOOGLE_API_KEY GOOGLE_GENAI_API_KEY 2>/dev/null || true
42
+ while IFS= read -r _api_key_var; do
43
+ unset "$_api_key_var" 2>/dev/null || true
44
+ done < <(compgen -v 2>/dev/null | grep '_API_KEY$' || true)
45
+
46
+ if ! command -v agy >/dev/null 2>&1; then
47
+ echo "error: 'agy' (Antigravity CLI) not found on PATH. Install it and run 'agy' once to sign in." >&2
48
+ exit 127
49
+ fi
50
+
51
+ # `-` (empty) => skip --model and let agy use settings.json; default to Pro.
52
+ AGY_MODEL="${AGY_MODEL-Gemini 3.1 Pro (High)}"
53
+ AGY_TIMEOUT="${AGY_TIMEOUT:-5m}"
54
+ # Hard wall-clock cap (defaults to AGY_TIMEOUT). agy's own --print-timeout is NOT a reliable
55
+ # wall-clock kill — a run was observed surviving 32 min past a 10m --print-timeout — so we also wrap
56
+ # agy in timeout(1). A heavy `--add-dir` agentic prompt on the slowest model can otherwise run
57
+ # unbounded, and once a caller backgrounds it nothing kills it. Raise only for a known-healthy run.
58
+ AGY_HARD_TIMEOUT="${AGY_HARD_TIMEOUT:-$AGY_TIMEOUT}"
59
+
60
+ if [[ $# -lt 1 ]]; then
61
+ echo "usage: $0 <prompt | - | @file> [-- extra agy flags...]" >&2
62
+ exit 2
63
+ fi
64
+
65
+ prompt_src="$1"; shift
66
+
67
+ # Split off any passthrough flags after a literal `--`. Extra args WITHOUT the `--` separator are a
68
+ # mistake — they would be silently dropped, so fail loudly instead (no silent failures).
69
+ passthrough=()
70
+ if [[ $# -gt 0 ]]; then
71
+ if [[ "$1" == "--" ]]; then
72
+ shift
73
+ passthrough=("$@")
74
+ else
75
+ echo "error: unexpected argument '$1'. Pass extra agy flags after a literal '--':" >&2
76
+ echo " $0 <prompt | - | @file> -- <agy flags...>" >&2
77
+ exit 2
78
+ fi
79
+ fi
80
+
81
+ if [[ "$prompt_src" == "-" ]]; then
82
+ prompt="$(cat)"
83
+ elif [[ "${prompt_src:0:1}" == "@" ]]; then
84
+ file="${prompt_src:1}"
85
+ if [[ ! -f "$file" ]]; then
86
+ echo "error: prompt file '$file' not found" >&2
87
+ exit 2
88
+ fi
89
+ prompt="$(cat "$file")"
90
+ else
91
+ prompt="$prompt_src"
92
+ fi
93
+
94
+ if [[ -z "${prompt// }" ]]; then
95
+ echo "error: empty prompt" >&2
96
+ exit 2
97
+ fi
98
+
99
+ model_flag=()
100
+ if [[ -n "$AGY_MODEL" ]]; then
101
+ model_flag=(--model "$AGY_MODEL")
102
+ fi
103
+
104
+ agy_cmd=(agy "${model_flag[@]}" --print-timeout "$AGY_TIMEOUT" "${passthrough[@]}" -p "$prompt")
105
+
106
+ # Hard wall-clock cap via timeout(1) (GNU `timeout` on Linux, `gtimeout` from coreutils on macOS).
107
+ # This is the real guard — a backgrounded, hung agy survives its own --print-timeout otherwise.
108
+ timeout_bin=""
109
+ if command -v timeout >/dev/null 2>&1; then
110
+ timeout_bin="timeout"
111
+ elif command -v gtimeout >/dev/null 2>&1; then
112
+ timeout_bin="gtimeout"
113
+ fi
114
+
115
+ if [[ -z "$timeout_bin" ]]; then
116
+ echo "warning: no 'timeout'/'gtimeout' on PATH — running agy WITHOUT a hard wall-clock cap" >&2
117
+ echo " (install coreutils to enable AGY_HARD_TIMEOUT=$AGY_HARD_TIMEOUT)." >&2
118
+ exec "${agy_cmd[@]}"
119
+ fi
120
+
121
+ # --kill-after: if agy ignores the initial TERM, SIGKILL it 10s later. Capture rc (don't `exec`) so
122
+ # we can turn a timeout into an explicit, actionable error instead of a silent non-zero.
123
+ set +e
124
+ "$timeout_bin" --kill-after=10s "$AGY_HARD_TIMEOUT" "${agy_cmd[@]}"
125
+ rc=$?
126
+ set -e
127
+ if [[ $rc -eq 124 || $rc -eq 137 ]]; then
128
+ echo "error: agy exceeded the hard cap AGY_HARD_TIMEOUT=$AGY_HARD_TIMEOUT and was terminated." >&2
129
+ echo " This usually means a heavy '--add-dir' agentic run, or the slowest model looping." >&2
130
+ echo " Retry with a faster model (e.g. AGY_MODEL='Gemini 3.5 Flash (High)') or a" >&2
131
+ echo " self-contained prompt without --add-dir. Raise AGY_HARD_TIMEOUT only if the run is healthy." >&2
132
+ fi
133
+ exit $rc
@@ -0,0 +1,59 @@
1
+ import { describe, it } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { mkdtempSync, mkdirSync, writeFileSync, chmodSync, rmSync } from 'node:fs';
4
+ import { tmpdir } from 'node:os';
5
+ import { join, dirname } from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
7
+ import { spawnSync } from 'node:child_process';
8
+
9
+ const HERE = dirname(fileURLToPath(import.meta.url));
10
+ const WRAPPER = join(HERE, 'agy.sh');
11
+
12
+ // Build a sandbox HOME whose ~/.local/bin holds a STUB `agy`. The wrapper prepends
13
+ // "$HOME/.local/bin" to PATH, so it resolves our stub instead of the real binary — no network,
14
+ // no real subscription CLI, fully hermetic.
15
+ const makeSandbox = (stubBody) => {
16
+ const home = mkdtempSync(join(tmpdir(), 'agy-wrapper-test-'));
17
+ const bin = join(home, '.local', 'bin');
18
+ mkdirSync(bin, { recursive: true });
19
+ const stub = join(bin, 'agy');
20
+ writeFileSync(stub, stubBody, { mode: 0o755 });
21
+ chmodSync(stub, 0o755);
22
+ return home;
23
+ };
24
+
25
+ const runWrapper = (home, env, prompt = 'hello') =>
26
+ spawnSync('bash', [WRAPPER, prompt], {
27
+ env: { HOME: home, PATH: `${join(home, '.local', 'bin')}:${process.env.PATH}`, ...env },
28
+ encoding: 'utf8',
29
+ timeout: 20000,
30
+ });
31
+
32
+ describe('agy.sh — hard wall-clock cap (timeout(1))', () => {
33
+ it('kills a hung agy at AGY_HARD_TIMEOUT and reports it (non-zero + actionable guidance)', () => {
34
+ const home = makeSandbox('#!/usr/bin/env bash\nsleep 30\n');
35
+ const started = Date.now();
36
+ const r = runWrapper(home, { AGY_HARD_TIMEOUT: '2s', AGY_TIMEOUT: '2s', AGY_MODEL: '' });
37
+ const elapsed = Date.now() - started;
38
+ rmSync(home, { recursive: true, force: true });
39
+ assert.ok(elapsed < 13000, `wrapper must return well under the kill-after window, took ${elapsed}ms`);
40
+ assert.notEqual(r.status, 0, 'a timed-out run must exit non-zero');
41
+ assert.match(r.stderr, /exceeded the hard cap/, 'must explain the hard-cap kill');
42
+ });
43
+
44
+ it('passes a fast agy run through unchanged (exit 0, stdout preserved)', () => {
45
+ const home = makeSandbox('#!/usr/bin/env bash\necho "OK reply"\nexit 0\n');
46
+ const r = runWrapper(home, { AGY_HARD_TIMEOUT: '10s', AGY_TIMEOUT: '10s', AGY_MODEL: '' });
47
+ rmSync(home, { recursive: true, force: true });
48
+ assert.equal(r.status, 0, `expected clean exit, got ${r.status}; stderr=${r.stderr}`);
49
+ assert.match(r.stdout, /OK reply/);
50
+ });
51
+
52
+ it('propagates a non-timeout agy failure code verbatim (no false hard-cap message)', () => {
53
+ const home = makeSandbox('#!/usr/bin/env bash\necho "boom" >&2\nexit 3\n');
54
+ const r = runWrapper(home, { AGY_HARD_TIMEOUT: '10s', AGY_TIMEOUT: '10s', AGY_MODEL: '' });
55
+ rmSync(home, { recursive: true, force: true });
56
+ assert.equal(r.status, 3, 'a genuine agy failure code must pass through');
57
+ assert.doesNotMatch(r.stderr, /exceeded the hard cap/, 'must not mislabel a non-timeout failure');
58
+ });
59
+ });
@@ -0,0 +1,22 @@
1
+ {
2
+ "family": "agent-workflow",
3
+ "schema": 1,
4
+ "name": "antigravity-cli-bridge",
5
+ "kind": "execution-backend",
6
+ "version": "1.0.0",
7
+ "provides": ["review", "probe"],
8
+ "roles": {
9
+ "review": { "cmd": "agy-run", "source": "bin/agy.sh", "template": "references/review-prompt.md", "output": "advisory" },
10
+ "probe": { "cmd": "agy-run", "source": "bin/agy.sh", "output": "advisory" }
11
+ },
12
+ "detect": {
13
+ "installed": {
14
+ "env": "ANTIGRAVITY_CLI_BRIDGE_DIR",
15
+ "default": "~/.claude/skills/antigravity-cli-bridge",
16
+ "file": "SKILL.md"
17
+ }
18
+ },
19
+ "cost": "subscription",
20
+ "quota": { "kind": "subscription", "finite": true },
21
+ "provenance": { "author": "sabaiway", "source": "github:sabaiway/agent-workflow" }
22
+ }
@@ -0,0 +1,108 @@
1
+ # How the main agent drives `agy`
2
+
3
+ `agy` is a **delegated-execution backend**: the main agent stays the orchestrator and hands `agy` a
4
+ bounded, self-contained sub-task. `agy` answers from the **subscription** quota, so the goal is
5
+ maximum useful output per token of that quota. Treat its output as **advisory** — the main agent owns
6
+ edits, verification, and final judgment.
7
+
8
+ ## Delegation checklist
9
+
10
+ 1. Pick the narrowest useful question.
11
+ 2. Choose the cheapest model that can answer it.
12
+ 3. Include only the relevant excerpts, paths, constraints, and the expected output shape.
13
+ 4. State permission boundaries in the prompt (no edits, no git writes).
14
+ 5. Run `agy-run` headlessly.
15
+ 6. Treat the response as advisory and verify before acting.
16
+
17
+ ## Model selection
18
+
19
+ | Task | Model |
20
+ |---|---|
21
+ | Reachability / smoke / "is it wired?" | `Gemini 3.5 Flash (Low)` |
22
+ | Cheap probes, summaries | `Gemini 3.5 Flash (Medium)` |
23
+ | Quick review with a little more effort | `Gemini 3.5 Flash (High)` |
24
+ | Reasoning, plan critique, careful drafting | `Gemini 3.1 Pro (High)` (wrapper default) |
25
+ | Same reasoning, lower quota cost | `Gemini 3.1 Pro (Low)` |
26
+ | A different engine's opinion | `Claude Sonnet 4.6 (Thinking)`, `Claude Opus 4.6 (Thinking)`, or `GPT-OSS 120B (Medium)` |
27
+
28
+ Don't reach for Pro by reflex — Flash answers most reachability/probe questions for a fraction of the
29
+ quota.
30
+
31
+ ## Quota economy
32
+
33
+ Subscription quota is finite. Prefer:
34
+
35
+ - A short probe on Flash before a large Pro run.
36
+ - One sharp question over broad "review everything" prompts.
37
+ - Prompt files with trimmed excerpts instead of whole repositories.
38
+ - `AGY_TIMEOUT=2m` for probes, longer timeouts only for deep reviews.
39
+ - Reusing a conversation with `--continue` when the context is already loaded.
40
+
41
+ ## Continue vs. fresh
42
+
43
+ ```bash
44
+ # Continue the most recent conversation (cheaper than re-sending context):
45
+ agy-run "Given your previous review, list only the top three risks." -- --continue
46
+
47
+ # Resume a specific conversation by id:
48
+ agy-run "Continue from the prior architecture critique; focus on test gaps." -- --conversation <id>
49
+ ```
50
+
51
+ Use conversation state only when it saves quota or preserves useful context. For auditable decisions,
52
+ prefer self-contained prompts.
53
+
54
+ ## Escalation policy (edits, network, git)
55
+
56
+ The wrapper passes no `--add-dir`, no `--dangerously-skip-permissions`, and no `--sandbox`. Treat this
57
+ as a **policy boundary you enforce in the prompt, not an enforced sandbox** — so prompt `agy` as a
58
+ read-only reviewer, and reach for `-- --sandbox` for anything that might trigger terminal/tool work:
59
+
60
+ ```text
61
+ Do not edit files. Do not run git write commands. Do not branch, add, commit, stash, reset, or
62
+ rewrite history. Return findings and suggested changes only.
63
+ ```
64
+
65
+ - **Repo edits** stay with the orchestrator. If a flow truly needs `agy` to write files, opt in
66
+ explicitly — `agy-run "..." -- --add-dir . --dangerously-skip-permissions` — and review the diff.
67
+ - **New dependencies / network installs** are done by hand, not by `agy`.
68
+ - **Git writes** (branch/commit) are never delegated — the orchestrator commits after review.
69
+ - Prefer `-- --sandbox` for any prompt that might trigger terminal work.
70
+
71
+ ## Project-context prompts
72
+
73
+ Probe reachability from a project root (cheap model):
74
+
75
+ ```bash
76
+ AGY_MODEL="Gemini 3.5 Flash (Low)" agy-run \
77
+ "Read the cwd context file and report the dialogue language plus one Hard Constraint."
78
+ AGY_MODEL="Gemini 3.5 Flash (Low)" agy-run \
79
+ "Without using a file pointer, is there a project-specific planning skill in this repo? Name it and cite its path."
80
+ ```
81
+
82
+ Plan-review prompt shape:
83
+
84
+ ```text
85
+ You are reviewing the plan below from the current repository root.
86
+ Use the root context file and per-workspace skills if they are reachable.
87
+ Do not edit files. Do not run git write commands.
88
+ Return: 1) blocking issues 2) non-blocking risks 3) missing verification 4) a concise recommendation.
89
+ The implementation plan text follows in this same prompt.
90
+ ```
91
+
92
+ Diff/code-review prompt shape (provide the diff as text):
93
+
94
+ ```text
95
+ Review this diff against the stated constraints.
96
+ Focus on bugs, behavioural regressions, missing tests, and violations of the project rules.
97
+ Cite file paths and line hints from the diff where possible. Do not summarise unless there are no findings.
98
+ The project constraints and diff text follow in this same prompt.
99
+ ```
100
+
101
+ ## Handling output
102
+
103
+ `agy` returns plain text. Do not assume it is complete, current, or machine-valid. Before acting:
104
+
105
+ - Check claims against local files or primary sources available to the main agent.
106
+ - Re-run local tests and linters yourself.
107
+ - Reject advice that conflicts with user instructions, repository rules, or security boundaries.
108
+ - Summarise uncertainty clearly when reporting back to the user.
@@ -0,0 +1,93 @@
1
+ # `agy` models & flags (reference)
2
+
3
+ The source of truth is the live binary: `agy --version`, `agy --help`, `agy models`. The tables below
4
+ were captured from **v1.0.10**; if the binary disagrees, the binary wins. The wrapper command is
5
+ `agy-run`, backed by `bin/agy.sh`.
6
+
7
+ ## Headless behaviour
8
+
9
+ Use `-p`, `--print`, or `--prompt` to run one non-interactive prompt and print the text response. The
10
+ wrapper always uses headless `-p`. **There is no JSON output mode in v1.0.10** — ask for Markdown,
11
+ bullets, tables, or fenced blocks when the caller needs structure, then validate the text yourself.
12
+
13
+ ## Wrapper contract
14
+
15
+ ```bash
16
+ agy-run <prompt | - | @file> [-- extra agy flags...]
17
+ ```
18
+
19
+ Inputs:
20
+
21
+ - Prompt text: `agy-run "say OK"`.
22
+ - Stdin: `echo "say OK" | agy-run -`.
23
+ - Prompt file: `agy-run @prompt.md`.
24
+ - Extra `agy` flags after `--`: `agy-run @prompt.md -- --add-dir . --continue`. Extra args **without**
25
+ the `--` separator are rejected with a usage error (they are never silently dropped).
26
+ - A literal prompt that **begins with `@`** is read as a file path. Pass such prompts via stdin
27
+ instead: `printf '%s' '@handle, review this' | agy-run -`.
28
+
29
+ Environment:
30
+
31
+ | Var | Default | Effect |
32
+ |---|---|---|
33
+ | `AGY_MODEL` | `Gemini 3.1 Pro (High)` | model display string; set empty (`AGY_MODEL=`) to drop `--model` and let `agy` use `settings.json` |
34
+ | `AGY_TIMEOUT` | `5m` | value passed to `--print-timeout` |
35
+
36
+ Subscription invariant: the wrapper prepends `$HOME/.local/bin` to `PATH` and clears
37
+ `ANTIGRAVITY_API_KEY` / `GEMINI_API_KEY` / `GOOGLE_API_KEY` / `GOOGLE_GENAI_API_KEY` before execution.
38
+ Auth comes from the user's cached OAuth token, never from bundled credentials.
39
+
40
+ ## Models
41
+
42
+ Pass the **exact display string** from `agy models`, or set `AGY_MODEL`.
43
+
44
+ | Model string | Practical use |
45
+ |---|---|
46
+ | `Gemini 3.5 Flash (Low)` | lowest-cost smoke tests and simple rewrites |
47
+ | `Gemini 3.5 Flash (Medium)` | cheap probes, fast summaries, context-reachability checks |
48
+ | `Gemini 3.5 Flash (High)` | fast review when a little more reasoning effort is useful |
49
+ | `Gemini 3.1 Pro (Low)` | cheaper Pro pass for medium reasoning |
50
+ | `Gemini 3.1 Pro (High)` | wrapper default; hard reasoning, plan critique, architecture review |
51
+ | `Claude Sonnet 4.6 (Thinking)` | cross-vendor reasoning comparison |
52
+ | `Claude Opus 4.6 (Thinking)` | expensive deep critique when the user wants another high-end pass |
53
+ | `GPT-OSS 120B (Medium)` | open-weights-style comparison / diversity pass |
54
+
55
+ Examples:
56
+
57
+ ```bash
58
+ AGY_MODEL="Gemini 3.5 Flash (Medium)" agy-run "Read AGENTS.md and report one Hard Constraint."
59
+ AGY_MODEL="Claude Sonnet 4.6 (Thinking)" AGY_TIMEOUT=10m agy-run @review-prompt.md
60
+ ```
61
+
62
+ ## Flags (from `agy --help`, v1.0.10)
63
+
64
+ | Flag | Meaning | Notes |
65
+ |---|---|---|
66
+ | `-p`, `--print`, `--prompt` | run one headless prompt and print the text response | the wrapper uses `-p` |
67
+ | `--print-timeout <dur>` | cap headless wait time | CLI default `5m0s`; wrapper default `5m` via `AGY_TIMEOUT` |
68
+ | `--model <string>` | select a model | must match an `agy models` display string exactly |
69
+ | `-i`, `--prompt-interactive` | run an initial prompt, then continue interactively | not used by the wrapper |
70
+ | `-c`, `--continue` | continue the most recent conversation | pass after the wrapper's `--` |
71
+ | `--conversation <id>` | resume a specific conversation by id | use only when the user provides/records the id |
72
+ | `--add-dir <dir>` | add a directory to the workspace | repeatable; for explicit extra context |
73
+ | `--dangerously-skip-permissions` | auto-approve all tool permissions | avoid by default; use only with explicit user approval |
74
+ | `--sandbox` | run with terminal restrictions enabled | prefer when delegating a prompt that might trigger tool/terminal work |
75
+ | `--log-file <path>` | override the CLI log-file path | keep logs secret-free and out of committed artifacts |
76
+
77
+ ## Subcommands (v1.0.10)
78
+
79
+ `changelog`, `help`, `install`, `models`, `plugin` / `plugins`, `update`.
80
+
81
+ **Not available in v1.0.10:** any JSON output mode, and any `agy inspect`. Output is plain text.
82
+
83
+ ## Project-context flags
84
+
85
+ `agy` reads context from its current working directory:
86
+
87
+ ```text
88
+ .antigravity.md > GEMINI.md > AGENTS.md
89
+ .agents/skills/
90
+ ```
91
+
92
+ Use `--add-dir` for extra directories not already reachable from cwd. Subdirectory `CLAUDE.md` files
93
+ are **not** auto-loaded — include those local rules manually in the prompt when they matter.
@@ -0,0 +1,51 @@
1
+ # Review prompt template — `agy-run` (review role)
2
+
3
+ The `review` role of `antigravity-cli-bridge` delegates a **read-only second opinion** to `agy`.
4
+ `agy` cannot see the conversation and (in v1.0.10) has no JSON output, so the prompt must be
5
+ **self-contained** and ask for **plain-Markdown findings only** — no repo edits, no git writes.
6
+ Fill the `{{…}}` slots, pipe it to `agy-run`, then verify every finding locally before acting.
7
+
8
+ ```text
9
+ You are a meticulous staff-level reviewer giving a SECOND OPINION. You are read-only:
10
+ do not propose to edit files, run commands, or make git changes — return findings only.
11
+
12
+ ## What to review
13
+ {{TARGET}} # e.g. "the implementation plan below" or "the working-tree diff below"
14
+
15
+ ## Project rules
16
+ Read the repo's root AGENTS.md (your cwd) and obey its Hard Constraints and conventions.
17
+ If AGENTS.md declares a verification/gate set, judge the change against it; if it declares
18
+ none, say so — do NOT invent checks.
19
+
20
+ ## Material
21
+ {{CONTENT}} # paste the plan text, or the unified diff, or the file excerpts under review
22
+
23
+ ## Focus (optional)
24
+ {{FOCUS}} # e.g. "correctness of the new reducer", "backward-compat of the stamp takeover"
25
+
26
+ ## Output — Markdown, this exact shape, nothing else
27
+ ### Verdict
28
+ One line: SHIP / SHIP WITH NITS / REWORK, plus a one-sentence reason.
29
+ ### Blocking
30
+ Numbered. Correctness bugs, contract violations, data loss, security. Cite file:line.
31
+ Empty? write "none".
32
+ ### Non-blocking
33
+ Numbered. Simplifications, reuse, naming, missing tests. Cite file:line.
34
+ ### Questions
35
+ Anything ambiguous that changes your verdict if answered.
36
+ ```
37
+
38
+ ## Usage
39
+
40
+ ```bash
41
+ # critique a plan
42
+ AGY_MODEL="Gemini 3.1 Pro (High)" agy-run @/tmp/review-prompt.filled.md
43
+
44
+ # critique the current diff (build the prompt with the diff pasted into {{CONTENT}})
45
+ git diff | ... # assemble the filled prompt, then:
46
+ agy-run @/tmp/review-prompt.filled.md
47
+ ```
48
+
49
+ Treat the result as **advisory** — `agy` output may be incomplete or out of date. The orchestrator
50
+ re-runs the project's real gates and owns every accepted change. See
51
+ [`driving-agy.md`](./driving-agy.md).
@@ -0,0 +1,65 @@
1
+ # Setting up Antigravity CLI (`agy`) on a clean machine
2
+
3
+ This setup is **secret-free**. `agy` itself is **not** bundled — it requires a binary install and a
4
+ one-time interactive sign-in with your own subscription. Do this once per machine, then the skill
5
+ works in any project.
6
+
7
+ ## 1. Install the binary
8
+
9
+ ```bash
10
+ curl -fsSL https://antigravity.google/cli/install.sh | bash
11
+ export PATH="$HOME/.local/bin:$PATH" # add to ~/.bashrc / ~/.zshrc to persist
12
+ agy --version # expect 1.0.10 or newer
13
+ ```
14
+
15
+ - The binary is **`agy`** (not `antigravity`); it installs to `~/.local/bin/agy`.
16
+ - Keep `$HOME/.local/bin` on `PATH` (the wrapper also prepends it defensively).
17
+
18
+ ## 2. Sign in once (subscription only)
19
+
20
+ Run `agy` once interactively and complete the **OAuth** sign-in with a **Google AI Pro/Ultra**
21
+ account:
22
+
23
+ ```bash
24
+ agy
25
+ ```
26
+
27
+ This caches an OAuth token under `~/.gemini/antigravity-cli/` (`antigravity-oauth-token`). That token
28
+ is **personal** — never copy, commit, package, print, or share that directory or token. This skill
29
+ needs no API keys and must not be configured with API-key billing; the wrapper unsets every
30
+ `*_API_KEY` so billing can never silently fall back to pay-as-you-go.
31
+
32
+ ## 3. Put the wrapper on `PATH` as `agy-run`
33
+
34
+ The skill ships the wrapper at `bin/agy.sh`. Expose it on `PATH` under the stable name `agy-run`
35
+ (idempotent; refuses to clobber a non-symlink):
36
+
37
+ ```bash
38
+ mkdir -p "$HOME/.local/bin"
39
+ skill_dir="$HOME/.claude/skills/antigravity-cli-bridge" # adjust if installed elsewhere
40
+ dst="$HOME/.local/bin/agy-run"
41
+ if [ -e "$dst" ] && [ ! -L "$dst" ]; then
42
+ echo "STOP: $dst exists and is not a symlink"; exit 1
43
+ fi
44
+ chmod +x "$skill_dir/bin/agy.sh"
45
+ ln -sfn "$skill_dir/bin/agy.sh" "$dst"
46
+ export PATH="$HOME/.local/bin:$PATH"
47
+ command -v agy-run
48
+ ```
49
+
50
+ ## 4. Smoke test
51
+
52
+ ```bash
53
+ agy --version
54
+ echo "say OK" | agy-run -
55
+ ```
56
+
57
+ Expected: the version prints (`1.0.10` or newer), then a short reply containing `OK`. If `agy-run`
58
+ reports `'agy' not found`, fix your `PATH` (step 1). If it asks you to sign in, complete step 2.
59
+
60
+ ## Notes
61
+
62
+ - `agy-run` is headless and plain-text only; there is no JSON output mode.
63
+ - `AGY_MODEL` selects the exact model display string; `AGY_TIMEOUT` controls `--print-timeout`.
64
+ - Extra `agy` flags go after `--`, e.g. `agy-run @prompt.md -- --add-dir .`.
65
+ - Re-run interactive `agy` only when the OAuth token expires or the account changes.