--- name: gemini-gorev description: Use when research or visual analysis is needed. version: 1.0.0 author: HamaratLabs license: MIT --- # Gemini Görev Yürütücüsü Use `agy` as the Gemini/Antigravity worker. ## Run - Execute `agy -p "" --model ` (see the model rule below). - `--effort` is rejected by suffixed/thinking model ids; omit it for those, or the run fails before any work starts. - Preserve the task wording and return real stdout. - For research, require sources and mark uncertainty. - Never invoke `agy -p "..."` without an explicit `--model`. Without it, AGY silently defaults to a **Flash** model (e.g. `gemini-3.8-flash-high`) — confirmed live in a log (`model_config_manager.go: Propagating selected model override... label="Gemini 3.8 Flash (High)"`) — which is too weak for real research and produces shallow/low-quality output with no warning. The exact model id list DRIFTS (seen going from `gemini-3.1-pro-high` to no Pro tier at all, only Flash + Claude Opus/Sonnet 5.5) — always run `agy models` fresh and pick an exact id from its output before calling `-p`, rather than trusting any id quoted in this skill, including this one. For deep research pick the strongest Gemini Pro-tier id listed (most recently `gemini-4-argon-high`) — Gemini via agy is the user's chosen research and image route. Model ids with a `-high`/`-medium`/`-low` suffix already encode effort and do NOT take a separate `--effort` flag — passing `--effort` alongside one errors with "invalid model selection". - Never build an `agy -p "..."` shell command with an inline single-quoted Turkish prompt — any apostrophe in the text (`Android'de`, `Agent'a`, `Gemini'nin`) closes the single quote early and the rest parses as shell syntax (`zsh: parse error near ')'`), silently killing the whole background job with no partial output. Write the prompt to a file and invoke as `agy -p "$(cat prompt.md)" ...` (double-quoted command substitution tolerates apostrophes) instead. - AGY's own `write_file` permission (`~/.gemini/antigravity-cli/settings.json`) can be scoped to one research folder: keep a broad deny and a narrow allow, and get the user's approval for any settings change. In AGY's permission engine **deny always wins over a more-specific allow**: an allow for a subfolder stays blocked while a deny on its parent is active, so narrow the deny to the exact folders that must stay protected before the allow can take effect. Verify with two real writes (one inside the opened folder must succeed, one beside it must fail). Outside that folder, do not write unless the parent gives a target path and format. - Never expose credentials, `.env`, refresh tokens, or plugin data. - When the user cites an existing automation as proof a write/permission pattern "already works this way," read that automation's actual source before replicating its design — a script invoking `agy` may run it in an isolated temp directory while a SEPARATE coordinator process does the real file write, which is a materially different (and safer) architecture than granting `agy` itself direct write access. Say so plainly even if the user's decision ends up overriding the correction. - Do not assume agy capacity is scarce or plentiful without checking its logs (see antigravity-cli skill for the exact grep). `agy models` may also list Claude models; using them is a separate route with its own account and terms. Use it only where the provider's terms allow it, not as a way to get around another route's rate limits. ## Routing Use for deep research, current web information, source comparison, visual interpretation, and research-note drafting. Keep final decisions and destructive actions with the parent agent. ## Visual analysis of local images - Copy the image into a narrow readable directory (such as profile scratch) or pass only the image's immediate folder via `--add-dir ` — never widen `--add-dir` to home or private folders. - Pick an exact id from `agy models` and run via a Python script (`subprocess.run([...])`) rather than inline shell quotes or heredocs (avoids apostrophe, backtick, and newline escaping failures): `['agy', '--model', '', '--output-format', 'json', '--print-timeout', '180s', '--add-dir', '', '-p', prompt]`. - Instruct the worker to inspect the image only via `read_file` on the exact path with no shell commands or file edits, and verify `status == 'SUCCESS'`, `denied_actions` is empty, and `response` is non-empty before using the analysis. - If the chosen model family returns `RESOURCE_EXHAUSTED` (429), switch to another available family from `agy models` (for example a Gemini tier when the Claude tier is rate-limited, or vice versa) instead of retrying the same exhausted pool. ## Budget a print timeout above a MEASURED duration, never a guess Measured on this Mac with `gemini-3.8-flash-high`: a trivial no-tool prompt answers in ~3s, a single `search_web` in ~17s, a single `read_url_content` in ~13s — but a real multi-source research task (4+ sites searched and read, 5+ sourced items) took **365.7s in one turn**. The SAME task at `--print-timeout 90s` printed `[agy] print timeout after 1m30s with turn in progress` and returned `status: SUCCESS` with `response: ""` and 3100 output tokens already billed. A tiny smoke test passing therefore proves nothing about a research job's budget: size the timeout from a timed run of the actual workload and allow roughly 2x headroom (900s for a ~6min job). An empty response plus a print-timeout line is a budget bug, not a permission problem — check `denied_actions` to tell the two apart before changing any setting. ## Grounded search can return redirect URLs instead of real sources When the worker reports only `search_web` results it may hand back `vertexaisearch.cloud.google.com/grounding-api-redirect/...` links rather than canonical URLs, which are useless as citations. Require the worker to open the page with `read_url_content` and report the final site URL; in a full research run where pages were actually read, real URLs do come back correctly. ## agy is multi-model, not Gemini-only `agy models` lists the real options and the roster drifts between CLI versions (Pro tiers disappear and return under new names); do not assume from the skill name. It typically carries Gemini Pro and Flash tiers, Claude Opus/Sonnet tiers, and a GPT-OSS model. Pass any suffixed id with `--model` and without `--effort`. These agy Claude models are a third route, distinct from Hermes-native `anthropic` and from the official `claude -p` CLI. Do not treat a success or failure on one route as evidence about another. ## Headless permissions: distinguish policy from capability Start code review and research with a bounded read-only `agy -p` invocation. Check the current permission rules and actual `denied_actions` before claiming which operations are available; a prompt forbidding shell execution is not evidence that the tool cannot execute commands. When the user asks Gemini to run and evaluate its own code, distinguish worker execution from coordinator execution explicitly. Do not silently replace the requested workflow or claim headless execution is impossible from a previous denial. Verify the available narrow permission route first; any settings change still needs approval. If the coordinator runs the test instead, identify that executor and give Gemini the real stdout, exit code, measurements and exact tested code for review. A write attempt is auto-denied with: `a tool required the "write_file" permission that headless mode cannot prompt for, so it was auto-denied`. The denial names the exact fix — an allow-rule under `permissions.allow` in `~/.gemini/antigravity-cli/settings.json`, e.g. `write_file()` — which is narrower than `--dangerously-skip-permissions`. Prefer a scoped allow-rule; adding one is a settings change and needs the user's approval. Read the `permissions` block of `~/.gemini/antigravity-cli/settings.json` before claiming what agy can or cannot touch, and never dump its other keys. A sensible baseline is a broad deny (destructive commands, pushes, private folders) plus narrow, user-approved allows. ## Safe research workers Select the model explicitly from `agy models`; do not infer identity from the worker's self-description. Run bounded read-only jobs as `agy --model --output-format json --print-timeout 600s --add-dir -p `. Leave `--effort` off models which reject it. Read the JSON `status`, `response`, `denied_actions`, and usage; neither exit code 0 nor `status: SUCCESS` proves a report exists. A denied command may produce an empty response or only a preamble while status still says SUCCESS. Reject such output and do not launch reviewers over it. For permission-preserving research explicitly forbid all `RunCommand`/terminal tools, including read-only shell commands, and direct workers to `view_file`/file-listing/search/web tools. Supply exact entry paths and run in the public source workspace; verify this route with a small read-only task before fan-out. Ask the worker to return its report on stdout, then let the coordinator save that response in the task directory. This requires no write permission changes. Avoid `--dangerously-skip-permissions`, broad workspace access, and rollback wrappers marketed as security isolation: denied private files must not be read in the first place. Never expose personal phone/computer backups to any worker. **A prompt-level "don't use RunCommand" instruction is advisory only, not an enforced constraint** — observed twice in a row: a task explicitly told the worker to use only search/read tools and never touch RunCommand, and it still attempted RunCommand both times (denied, empty `response`, `denied_actions: [{"action":"command"}]`). The model's own habits can override in-prompt tool restrictions; only an actual `permissions.deny` rule in settings.json enforces this, and that is a user-approved settings change, not something to request mid-task. For a task that only needs `search_web`/`read_url_content` (no terminal, no file ops), it is faster and more reliable to just run it with the coordinator's own web tools (`web_search`/`web_extract`) instead of re-fighting agy's permission wall with stronger wording — reserve `agy` for tasks that genuinely need its own sandboxed file/code access. ## Never put backticks in a `-p` prompt run through a shell A prompt written inside double quotes with `` `file.md` `` markdown ticks gets command-substituted by the shell: the names vanish from the prompt, stderr shows `command not found: file.md`, and the worker returns a confident `FIX_REQUIRED` complaining that the file paths were empty. Either drop the backticks or — better for long Turkish prompts — hold the prompt in a Python string and call `subprocess.run([...])` with an argument list, which bypasses shell parsing entirely. ## Packaging the user's own instruction files for agy Sending the user's agent profile files out for analysis is allowed only for the instruction layer they name (e.g. role and memory instruction files); private notes stay local unless the user explicitly says otherwise, because uploading them to a third-party service is a privacy decision. Ask before assuming the boundary — "analyse all my MDs" meant the agent instruction files, not the vault. Build the packet mechanically and exclude before the first read: out-of-scope profiles, dotted / `deleted` / `archive` profile dirs, skill bodies, sessions, transcripts, logs. **Regex scrubbing for `api_key=`/token shapes is not enough.** A profile `MEMORY.md` can carry a plain local filesystem path pointing at a credential file: it matches no secret pattern, passes the scan with `redactions: 0`, and the worker's report then quotes it back. Redact absolute local paths too, and skim the memory-layer bodies yourself before packing. Once a path has left the machine you cannot recall it — say exactly that instead of implying the exposure was contained. Verify the packet with a manifest (`label`, char count, sha256, redaction count) and reconcile duplicate hashes in code: many per-profile files can be byte-identical or empty, and a worker routinely guesses those counts wrong. ## Audit the worker's layer-hygiene verdicts, not just its facts On an instruction-layer audit the worker proposed deleting hard safety prohibitions duplicated across profile instruction files as copy-paste bloat, invented a "contradiction" between two instruction files that serve different layers, and miscounted the profiles. Never apply a de-duplication proposal that strips a safety rule, and resolve every claimed contradiction against what each file is FOR before repeating it to the user. ## Headless raster generation writes only to its own artifact dir In headless `agy -p` runs, `generate_image` may be able to save only inside the run's own artifact directory, so a prompt demanding the PNG be written to an external target path can end with `status: SUCCESS`, exit 0, and zero files at the target. Verify the target directory contents yourself (`png_count`) instead of trusting the response text, and treat an empty target as a failed generation test. Do not substitute an older PNG from a previous run as evidence, and do not add permission-bypass flags; ask the user for a narrow artifact-staging decision instead. The artifact dir is `~/.gemini/antigravity-cli/brain//` (id comes from the `--output-format json` result). Verified: a flash-high run took ~74s, the JSON `response` only said "started the image generator subagent" with `denied_actions: [mcp]`, yet a correct 1024x1024 jpg appeared there seconds later. So the coordinator should collect from that folder (poll briefly) and copy the file itself, rather than asking agy to write to a target path. When a product feature generates images, have the server call `agy` directly (argument list, JSON output, collect from the brain dir, register the file itself) instead of spawning a Hermes agent profile that in turn calls agy. Why: the wrapping agent runs on its own provider credentials, so their quota or key failures kill the job with a bare non-zero exit before agy is ever reached. Offer the model as a user choice populated from live `agy models` (Gemini Flash and Pro/Argon tiers), not a hard-coded id. ## Headless web permission failures If the user approves persistent general web-research access for agy, add only `read_url(*)` to `permissions.allow` in `~/.gemini/antigravity-cli/settings.json`, keep existing grants and deny rules, and do NOT enable `execute_url(*)`, `mcp(*)` or permission-bypass flags. Official reference: https://antigravity.google/docs/permissions/ . Note that `read_url` also controls browser page loading and sandbox outbound network domains; it is not restricted to the page-extraction tool. Keep research jobs limited to public sources with no private data, login, terminal tools, or web mutations. After changes, test both `search_web` and `read_url_content` in a fresh bounded headless run; a settings edit alone is not verification. A successful `agy models` lookup does not prove web-research readiness. A headless research run can return exit code 0 and `status: SUCCESS` with an empty response and `denied_actions: [{"action":"read_url"}]`. Treat that as a failed research run, not completed work. Do not widen permissions or use bypass flags; report the blocker and use the coordinator's permitted web tools for a bounded source check, or request a separately approved narrow URL permission. Do not run an auditor over an empty response. A `--print-timeout` expiry produces the SAME misleading shape for a different reason: stdout carries `[agy] print timeout after with turn in progress; returning partial output` and the JSON still reports `status: SUCCESS` with `response: ""` plus nonzero token usage. The turn was working, not denied — so the fix is a print timeout above the real research duration (multi-source web research routinely exceeds two minutes), not a retry at the same budget. Either way an empty `response` is a failed run: never summarize it, and never schedule a recurring job whose per-run timeout is below a duration you have actually observed. ## Batch research through one agy orchestrator When `delegate_task` fan-out hits `HTTP 429`, do not re-dispatch the same batch; wait for the limit window or ask the user. For research batches that are meant to run on agy anyway (within its provider's terms), write one Python orchestrator that calls `agy` with `concurrent.futures` (2 workers is safe; 10 jobs finished in ~10 min). Each job gets its own folder holding `task.json`, `sources.json` and the parent-fetched page text, so the worker needs only `view_file`. Append every job's `{ok, chars, status, denied, seconds, path}` to a manifest and verify the manifest before reading reports. Reuse the orchestrator's own `agy_run` for follow-up passes: `from run import agy_run, ROOT` inside the same directory. Check its real signature first — guessing kwargs like `model=`/`timeout=` raises `TypeError` and wastes a run. Put dependent stages inside that same process as sequential waves, with the concurrency only INSIDE a wave. A later wave that must consume an earlier wave's measurements cannot be a separate fire-and-forget background job: each one-shot job exits at its own end, nothing advances the chain, and the first sign of the stall is the user asking why it stopped. Build the measurement payload for a stage at that stage's start from files on disk, so a restart resumes instead of re-running finished work. ## Make the worker emit machine-checkable lines, then verify them yourself Prose cannot be bulk-verified. When the product of a task is a LIST of URLs, endpoints or identifiers, dictate a strict one-record-per-line contract in the prompt — e.g. `FEED | | | | verified|pattern-guess`, with "every line starts with the prefix, no bullets, no numbering, no shortened URLs" and a separate prefix (`WATCH |`, `MINE |`) for records that fail the main criterion. Parse it with a regex in the coordinator and fetch every single line before anything enters a registry. Count the extracted lines per job in the manifest: a job that returns a long report with zero parsable records ignored the contract and needs re-prompting, not interpretation. Do not let the worker's own confidence label decide what you trust. When rows it marked `verified` were actually fetched, ~81% resolved, against ~65% for rows it had flagged as mere pattern guesses — a spread far too small to justify skipping one test. Still ask for the label: it is a useful ordering hint and it forces the guess to be explicit. Then gate acceptance on your own fetch, and hand the pass/fail counts plus the dead entries back to the worker so it corrects them instead of re-listing them. Bulk-harvesting curated lists (awesome-lists, OPML bundles) is cheap but low-yield: of thousands of addresses extracted, most fetch successfully yet fail a relevance bar. Measure and report the funnel — extracted → fetched OK → passed threshold — before recommending more harvesting, and exclude candidates with a stated reason rather than dropping them silently. ## Always run an auditor pass over Gemini research output A worker that returns `ok:true` with 25k characters still invents prices, version numbers and hardware capacity figures, and states aesthetic judgements as fact. Feed the finished report back to a second `agy` call with explicit violation rules (no unsourced versions/stars/RAM/CPU/prices, no absolute guarantees, aesthetic claims must carry an "(ön değerlendirme)" tag, every product needs the same fixed bullet set) and require a first line of `OK` or `FIX_REQUIRED` plus quoted offending lines. Then send report + audit back for a full rewrite. The auditor also hallucinates. Verify its accusations before applying them: one flagged "PostgreSQL 18 is an imaginary version" when that release exists, and another demanded deleting real measured local test results as "implying installation". Apply the true findings, drop the false ones. ## Verify every "file not found" / "not covered" claim the worker makes An agy worker given `--add-dir` can fail to list files whose names carry non-ASCII characters (Turkish `ğüşıöç`, spaces) and then report them as missing. It also reports a test file as absent when it only read the entry test. Both are false negatives that look like real audit findings. Before writing any worker "X does not exist" or "Y is untested" claim into a note, confirm it in the coordinator with `ls` / `flutter test` / a direct read. When a worker is forbidden from RunCommand, it cannot grep — so global TODO/FIXME sweeps, file counts and test runs stay the coordinator's job. Ask the worker for structure and reasoning, not for exhaustive enumeration. ## Strip the worker's thinking preamble Gemini output often begins with an English `thought` block (`CRITICAL INSTRUCTION`, word-count planning, source notes) before the Markdown. Cut everything before the first real heading before saving to the vault, and grep the final file for leaked planning lines. For broad research, divide topics into independent worker scopes, then run independent reviewers only after reports exist. Give reviewers the saved reports and original public sources, require concrete claim corrections, and keep final synthesis with the coordinator. Use bounded concurrent CLI jobs with completion notification rather than repeatedly polling or re-launching blocked workers. Permanent model/provider settings remain unchanged.