Skill 详情

gemini

Useful Gemini CLI operation guide but lacks a clear initial installation workflow.

匹配类型可能匹配已针对 gemini cli 审核
来源integralmedia1/skill-gemini外部来源
报告安装量1仅表示受欢迎程度

使用前先检查

自动化审核只检查相关性,不代表安全审查或推荐。使用前请阅读来源中的说明。

已保存的来源预览

SKILL.md

这段内容是审核时保存的快照。外部来源才是完整且最新的版本。

---
name: gemini
description: Use when the user asks to run Gemini CLI (gemini -p, gemini -r) or references Google Gemini for code analysis, refactoring, codebase investigation, or multi-model collaboration
---

# Gemini CLI Skill

## Running a Task
1. Ask the user (via `AskUserQuestion`) which model to run (`gemini-3.1-pro-preview`, `gemini-3-pro-preview`, `gemini-3-flash-preview`, `gemini-2.5-pro`, or `gemini-2.5-flash`) AND which approval mode to use (`yolo`, `auto_edit`, `plan`, or `default`) in a **single prompt with two questions**.
2. Select the approval mode required for the task; default to `--approval-mode plan` unless edits or tool execution are necessary.
3. Assemble the command with the appropriate options:
   - `-m, --model <MODEL>`
   - `--approval-mode <yolo|auto_edit|plan|default>`
   - `-o, --output-format <text|json|stream-json>`
   - `-s, --sandbox` (isolate tool execution; uses gVisor on Linux, Seatbelt on macOS)
   - `--include-directories <DIR>` (additional workspace directories for multi-project context)
   - `-p, --prompt` (non-interactive/headless mode)
   - `"your prompt here"` (as the prompt value)
4. When continuing a previous session, use `gemini -r latest -p "follow-up prompt"`. When resuming, don't use configuration flags unless explicitly requested by the user (e.g. if they specify the model when requesting to resume). To resume a specific session: `gemini -r <INDEX> -p "prompt"`.
5. **IMPORTANT**: By default, append `2>/dev/null` to all `gemini` commands to suppress progress/debug output (stderr). Only show stderr if the user explicitly requests debug output (`-d` flag) or if troubleshooting is needed.
6. For prompts containing special characters, use `printf` for safe piping:
   ```bash
   printf '%s' "Your prompt with 'quotes' and $pecial chars" | gemini -m <MODEL> --approval-mode <MODE> -o text 2>/dev/null
   ```
   Alternatively, use `-p` with a heredoc:
   ```bash
   gemini -m <MODEL> --approval-mode <MODE> -o text -p "$(cat <<'PROMPT'
   Your multi-line prompt here.
   PROMPT
   )" 2>/dev/null
   ```
7. Run the command, capture stdout (stderr filtered as appropriate), and summarize the outcome for the user.
8. **After Gemini completes**, inform the user: "You can resume this Gemini session at any time by saying 'gemini resume' or asking me to continue with additional analysis or changes."

### Quick Reference
| Use case | Approval mode | Key flags |
| --- | --- | --- |
| Read-only review or analysis | `plan` | `--approval-mode plan -o text 2>/dev/null` |
| Apply local edits | `auto_edit` | `--approval-mode auto_edit -o text 2>/dev/null` |
| Full delegation (auto-approve all) | `yolo` | `--approval-mode yolo -o text 2>/dev/null` |
| Sandboxed execution | `yolo` | `-s --approval-mode yolo -o text 2>/dev/null` |
| Codebase investigation | `yolo` | `--approval-mode yolo -o text 2>/dev/null` (uses built-in investigator) |
| Multi-project context | Match task needs | `--include-directories <DIR> 2>/dev/null` |
| Resume recent session | Inherited from original | `-r latest -p "prompt" 2>/dev/null` |
| Structured output | Match task needs | `-o json 2>/dev/null` |

## Following Up
- After every `gemini` command, immediately use `AskUserQuestion` to confirm next steps, collect clarifications, or decide whether to resume with `gemini -r latest`.
- When resuming, pipe the new prompt via `-p`: `gemini -r latest -p "new prompt" 2>/dev/null`. The resumed session automatically uses the same model and approval mode from the original session.
- Restate the chosen model, approval mode, and any special flags when proposing follow-up actions.

## Critical Evaluation of Gemini Output

Gemini is powered by Google models with their own knowledge cutoffs and limitations. Treat Gemini as a **colleague, not an authority**.

### Guidelines
- **Trust your own knowledge** when confident. If Gemini claims something you know is incorrect, push back directly.
- **Research disagreements** using WebSearch or documentatio
在 GitHub 阅读完整来源 (打开外部页面)
相关上下文

相关工作