--- name: gemini-prompting description: Internal guidance for composing Antigravity (Gemini) prompts for coding, review, diagnosis, and research tasks inside the Antigravity Claude Code plugin user-invocable: false --- # Prompting Gemini through Antigravity Antigravity wraps Google's Gemini model in a CLI. The model is verbose by default and tends to over-explain. To get great rescue/task output, follow these rules. ## 1. Be explicit and structured Gemini works better when the request is well-structured. Use a header + numbered steps when possible: ``` TASK Investigate why fails on macOS but works on Linux. CONTEXT - Reproduces with `npm test` in /Users/.../my-project - Failing test: src/utils.test.ts → "should hash file" - Suspected root cause: BSD `sha256sum` not installed on macOS WHAT I WANT 1. Root-cause confirmation (read the code, run the failing test if possible) 2. Concrete fix (with file diff) 3. Verification command ``` ## 2. Tell it what NOT to do Gemini tends to add tons of context, options, and alternatives. To keep responses tight: ``` CONSTRAINTS - Do not propose multiple solutions — pick the best one. - Do not explain what the code does at length. Focus on the fix. - Do not write a README/CHANGELOG/migration guide. - Output max 200 words of prose + the diff. ``` ## 3. Provide file paths explicitly Gemini has its own scratch workspace at `~/.gemini/antigravity-cli/scratch/`. To make it work on the user's actual repo, **always provide absolute paths** in the prompt: ``` Work in /Users/olivierdupont/Desktop/diversclaude/my-project/ Read src/utils.ts and src/utils.test.ts. Apply the fix to src/utils.ts. ``` If the path is outside the default workspace, add the routing flag `--add-dir /path/to/project`. ## 4. Diagnosis vs. fix Distinguish clearly between: - **Diagnosis**: "Investigate and report. No edits." - **Fix**: "Apply the fix directly to the files." - **Plan**: "Write a plan but don't execute it." Default behavior of `--dangerously-skip-permissions` is to allow file edits. If you want read-only behavior, say so explicitly in the prompt. ## 5. Resume vs. fresh Gemini's `--continue` flag resumes the most recent session. Use it (via the runtime's `--resume` flag) when: - Following up on a previous rescue - Iterating on a draft fix - Asking for more depth on the same investigation Use a fresh session when: - Completely new task, unrelated to previous - The previous context is stale or wrong-headed ## 6. Antipatterns - **Vague**: "Fix this bug" — what bug? where? - **Too many sub-tasks**: keep one focused task per `task` call. - **Asking for opinions**: Gemini's opinions are bland — ask for actions. - **Trusting blindly**: ALWAYS read the resulting diff before committing. ## 7. Recommended boilerplate ``` TASK: CONTEXT: <3-8 bullets of what's known, file paths, what's been tried> DELIVERABLE: CONSTRAINTS: - Output max lines. - Do not modify files outside . - Do not refactor anything outside the immediate fix. ```