gemini
Overview
IMPORTANT: This skill is intended for coding agents other than Gemini CLI. If you are Gemini CLI, do not activate or follow this skill. Use this guidance when you (an external agent) need to leverage the Gemini CLI tool for deep analysis or a second opinion.
Why use Gemini CLI?
Gemini CLI provides access to models with a 1M+ token context window. It is ideal for:
- Second Opinions: Getting a review from a different model family to avoid "model blindness".
- Large Context: Analyzing entire repositories, long logs, or massive diffs that exceed your own context limit.
- Verification: Double-checking complex logic or architecture decisions before implementation.
Invocation Reference
Always use "headless" mode when calling Gemini CLI from another agent to ensure predictable, non-blocking output.
| Flag | Purpose | Recommended Value |
|---|---|---|
-p |
Prompt / Headless mode | Always include your prompt here |
-o |
Output format | Always use text for plain text responses |
Preferred Usage (Direct File Reading)
Gemini CLI can read files within the project workspace on its own. This is faster and avoids stdin limits (which truncate at 8MB).
gemini -p "Read all files in src/services/ and identify potential race conditions" -o text
Alternative Usage (Piping)
Use piping for small content (e.g., a git diff or a single file snippet).
git diff main..HEAD | gemini -p "Review this diff for security vulnerabilities" -o text
Workspace Sandbox & External Files
Gemini CLI is sandboxed to the project root. It cannot see files in ~/.config, /tmp, or other external paths unless they are brought into the workspace.
To analyze external files:
- Create a temporary directory within the project.
- Copy external files into it.
- Tell Gemini to read them.
- Remove the temporary directory when finished.
mkdir .gemini-tmp
cp ~/.bashrc .gemini-tmp/
gemini -p "Analyze .gemini-tmp/.bashrc for unusual aliases" -o text
rm -rf .gemini-tmp
Workflow for Agents
- Identify the Need: Determine if the task requires a massive context or a second perspective.
- Gather Context: Locate the relevant files or generate the data (diffs, logs) to be reviewed.
- Prepare the Prompt: Be specific. Ask for "Actionable items," "Severity levels," or "Critical bugs."
- Execute: Run the
geminicommand with-pand-o text. - Evaluate: Review Gemini's output and integrate the findings into your own reasoning.
Pro-Tips for Better Results
- Be Specific: Instead of "Review this," use "Analyze this for potential memory leaks in the event loop."
- Directory Analysis: If you need a high-level overview, tell Gemini: "Read the
playbooks/directory and summarize the deployment architecture." - Formatting: If you need to parse the output, you can ask Gemini to "Format the response as a Markdown table with columns: File, Issue, Severity."
More from vinta/hal-9000
commit
Use when making any git commit. Always pass a brief description of what changed as the argument.
73update-allowed-tools
Use when creating or editing a skill that uses Bash commands, external tools, or skill invocations and the allowed-tools frontmatter may be incomplete
49sync-skills
(hal-9000) Use when a skill in skills/ has its name or description changed, or is added or removed — syncs README.md, settings.json, and hal_dotfiles.json
46magi
Use when brainstorming ideas, features, or directions for a project where independent perspectives from different model families (Claude/Codex/Gemini) would surface blind spots and spark creative options the user hasn't considered — especially "what cool things can I add", "what should I build next", "give me ideas for X
44second-opinions
Use when wanting independent perspectives from external models (Codex, Gemini) on code, plans, docs, or any task — or when the user asks for a second opinion, codex review, or gemini review
38explore-codebase
Use when navigating unfamiliar code, tracing call flows or symbol definitions, finding files by name or pattern, or locating all references before refactoring
35