plugins/gemini-cli/skills/gemini-cli-agent/SKILL.md
Gemini CLI sub-agent system for persona-based analysis. Use when piping large contexts to Google Gemini models for security audits, architecture reviews, QA analysis, or any specialized analysis requiring a fresh model context.
npx skillsauth add richfrem/agent-plugins-skills gemini-cli-agentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You, the Antigravity agent, dispatch specialized analysis tasks to Gemini CLI sub-agents.
[!IMPORTANT] By default, all Gemini sub-agent orchestration uses the gemini-3-flash-preview model for maximum cost-efficiency. For deep analytical reasoning, structural validation, or multimodal vision tasks, explicitly override the model to gemini-3.1-pro-preview.
To ensure Gemini CLI behaves as a specialized persona rather than a generic responder, always embed the persona and source material directly into the prompt flag (-p).
gemini -m gemini-3-flash-preview -p "$(cat agents/persona.md)
---SOURCE CODE---
$(cat target.py)
---INSTRUCTION---
Perform a full code review. Use severity levels: 🔴 CRITICAL, 🟡 MODERATE, 🟢 MINOR.
You are operating as an isolated sub-agent.
Do NOT use tools. Do NOT access filesystem." > review.md
run_agent.py (Cross-Platform)For reusable sub-agent execution, use the provided Python orchestrator which handles temp file assembly and prompt concatenation reliably across Windows, macOS, and Linux.
# Location: plugins/gemini-cli/scripts/run_agent.py
python ./scripts/run_agent.py <PERSONA_FILE> <INPUT_FILE> <OUTPUT_FILE> "<INSTRUCTION>" [MODEL_NAME]
Before using Gemini in any autonomous Triple-Loop or complex orchestration, you must verify the CLI's and the orchestrator's health:
gemini --yolo -m gemini-3-flash-preview -p "hello"python ./scripts/run_agent.py agents/refactor-expert.md target.py ./HEARTBEAT_MD.md "Verify health"./HEARTBEAT_MD.md is not empty.python ./scripts/run_agent.py agents/security-auditor.md target.py security.md \
"Find vulnerabilities. Use severity levels: 🔴 CRITICAL, 🟡 MODERATE, 🟢 MINOR."
agents/)These personas are mirrored from the Copilot CLI plugin to ensure consistent "Agentic" analysis across the ecosystem.
| Persona | Use For |
|:---|:---|
| security-auditor.md | Red team, vulnerability scanning, threat modeling |
| refactor-expert.md | Optimizing code for readability, performance, and DRY |
| architect-review.md | Assessing system design, modularity, and complexity |
The Gemini CLI (gemini binary) is a text and code assistant only. It cannot generate, render, or save image files regardless of model.
gemini-3.1-pro-preview, gemini-2.5-pro, gemini-3-flash-preview — text onlyimagen-4.0-*, gemini-2.5-flash-image, gemini-3-pro-image-preview) are not accessible via the CLI — they require the Python google-genai SDK with a paid billing account (separate from Gemini Pro subscription)gemini-3.1-pro-preview may hit MODEL_CAPACITY_EXHAUSTED (429) under load — retry or fall back to gemini-2.5-proDo not attempt image generation via this skill. Inform the user immediately.
For analytical sub-agent tasks where cost is prioritized, always specify -m gemini-3-flash-preview. For deep reasoning or validation, use -m gemini-3.1-pro-preview.
Large prompt expansions (e.g., $(cat ...) > 10KB) can silently fail when run in the background.
run_agent.py).wc -l.Always add these instructions to your dispatch prompt to prevent the sub-agent from attempting to use external tools:
"You are operating as an isolated sub-agent. Do NOT use tools. Do NOT access filesystem. Only use the provided input."
--yolo)If you are deploying Gemini CLI as an active orchestrator (e.g., an L1 Evaluator running an improvement loop), pass the --yolo flag. This allows all tool calls (like bash commands or Python execution) to run automatically without manual confirmation, enabling fully headless sub-agent operation.
The gemini CLI inherits strict workspace bounds. If you cd into an external directory (e.g., a test lab repo) and attempt to invoke gemini from there, it will crash with [ERROR] [IDEClient] Directory mismatch.
gemini from your active OS workspace directory. If you need the sub-agent to operate in an external folder, pass instructions in the prompt string telling it to cd into that folder itself (e.g., gemini --yolo -p "Use bash to cd to /external/lab/repo first, then...").When running gemini or copilot in a background shell (e.g. &), it may be stopped by the OS (STP status) if it attempts to interact with the TTY.
nohup and detach from stdin:nohup gemini --yolo -m gemini-3-flash-preview -p "..." >> log.txt 2>&1 < /dev/null &
< /dev/null is critical to prevent SIGTTIN blocks.Tool execution denied by policy, ensure the directory has been added to gemini trust.agy) CLI: Use this for frontier models (such as Gemini 3.5 Flash or higher models).gemini) CLI: Use this for cheaper, older models (such as Gemini 3 Flash / gemini-3-flash-preview and prior releases) to conserve token budgets.agy) CLI (Frontier Models)which agy (commonly installed at /opt/homebrew/bin/agy or on the system PATH).agy -p "your prompt" or agy --prompt "your prompt".agy --sandbox -p "prompt"agy --dangerously-skip-permissions -p "prompt" (used for headless subagent dispatches).gemini) (Cheaper Models)npm install -g @google/gemini-cli@latest.gemini extensions install https://github.com/richfrem/agent-plugins-skills.npx @google/gemini-cli to automatically pull the latest version.# Using agy CLI for frontier models
agy -p "hello"
# Using gemini CLI for cheaper models
gemini -p "hello"
tools
Ingests repository files into the ChromaDB vector store. Builds or updates the vector index from a manifest or directory scan using ingest.py. Use when new files need to be indexed or the vector store is out of date. <example> user: "Index these new plugin files into the vector database" assistant: "I'll use vector-db-ingest to add them to the vector store." </example> <example> user: "The vector store is missing recent files -- update it" assistant: "I'll use vector-db-ingest to re-index the changes." </example>
data-ai
Removes stale and orphaned chunks from the ChromaDB vector store for files that have been deleted or renamed. Use after files are removed or moved to keep the vector index in sync with the filesystem. <example> user: "Clean up the vector store after I deleted some files" assistant: "I'll use vector-db-cleanup to remove orphaned chunks." </example> <example> user: "The vector database has chunks for files that no longer exist" assistant: "I'll run vector-db-cleanup to prune them." </example>
testing
Audit Vector DB coverage -- compares the live filesystem manifest against the ChromaDB index to identify coverage gaps.
development
3-Phase Knowledge Search strategy for the RLM Factory ecosystem. Auto-invoked when tasks involve finding code, documentation, or architecture context in the repository. Enforces the optimal search order: RLM Summary Scan (O(1)) -> Vector DB Semantic Search -> Grep/Exact Match. Never skip phases.