# gemini-write: Delegate drafting, rewriting, or proofreading to Gemini through authenticated Antigravity CLI (agy). Use when the user requests Gemini writing or a comparison against Gemini output.

> Source: <https://gist.github.com/laiso/06f57b212db3a96bc57bfe8c4816e3c1>
> Published: 2026-09-13 09:46:16+00:00

| name | gemini-write | 
|---|---|
| description | Delegate drafting, rewriting, or proofreading to Gemini through authenticated Antigravity CLI (agy). Use when the user requests Gemini writing or a comparison against Gemini output. | 

Requires an installed, authenticated `agy`. This file is the complete skill; no helper scripts are needed.

1. Prepare a UTF-8 prompt containing the user's writing instructions and source text in separate sections. Preserve explicit instructions verbatim. Do not add a tone, structure, or permission to change meaning that the user did not request.
2. Run `agy` directly from a fresh temporary directory to avoid loading the current project's instructions. Use`gemini-3.8-flash-medium` unless the user specifies a model. If availability is uncertain, check`agy models` ; do not silently substitute.

Example for Bash, with an absolute path to the prepared prompt:

```
prompt_file=/absolute/path/to/prompt.txt
run_dir=$(mktemp -d)
(
  cd "$run_dir" || exit 1
  agy --model gemini-3.8-flash-medium \
    --disable-slash-commands --output-format text \
    --print-timeout 180s --print "$(cat "$prompt_file")" \
    > output.md 2> stderr.txt
)
```

Keep the prompt as data: use a file-writing tool or quoted heredoc to prepare it, and quote its expansion as shown. Bash command substitution removes trailing newlines; use an argument-preserving process API if those bytes matter.

1. Check the exit status before treating the output as a completed response. Return Gemini's output without polishing it yourself. Identify any model-generated preface as part of the response, not the input prompt. For comparisons, use the same prompt and source; put your commentary outside the generated text.
2. When the user requests records, keep the exact prepared prompt, output, diagnostics, and model name in a new local directory and provide links. Otherwise, temporary files are sufficient. Do not publish records without a request to share them.

On authentication failure, ask the user to sign in with `agy`. On model, timeout, or output errors, report the error without silently retrying or changing the prompt.

AGY may use its normal tools and global configuration, send the prompt to its service, and consume account quota. A fresh directory and `--disable-slash-commands` do not disable those tools or settings. Do not pass permission-bypass flags or ask Gemini to edit files, publish, or access services unless requested. Local records do not capture AGY's internal system prompt or guarantee identical outputs.
