xiaohongshu
xiaohongshu
gemini-delegation-patterns
Strategic patterns for Claude-to-Gemini delegation. Covers decision criteria, execution patterns, result parsing, and error handling. Use when determining if a task should be delegated to Gemini CLI.
Full skill instructions
STOP - Before providing ANY response about Gemini CLI capabilities:
- INVOKE
gemini-cli-docsskill- QUERY for the specific feature topic
- BASE all responses EXCLUSIVELY on official documentation loaded
Meta-skill for determining when and how Claude should delegate to Gemini CLI. Documents decision criteria, execution patterns, and result handling.
Keywords: delegate to gemini, use gemini, gemini vs claude, which agent, hand off, gemini better, claude or gemini, second brain
Use this skill when:
| Scenario | Delegate to Gemini? | Rationale |
|---|---|---|
| Interactive TUI needed (vim, git rebase -i) | YES | Claude cannot handle PTY |
| Risky shell command | YES | Gemini sandbox isolation |
| Large codebase analysis (100K+ tokens) | YES | Gemini 1M+ context window |
| GCP/Firebase/Vertex auth required | YES | Native Google integration |
| Need instant rollback capability | YES | Gemini checkpointing |
| Quick code edit | NO | Claude is faster |
| Multi-turn conversation | NO | Claude maintains context better |
| Complex reasoning with files | NO | Claude's Edit tool is superior |
| Need persistent session | NO | Claude Code has better UX |
| Security-sensitive analysis | MAYBE | Gemini sandbox + Claude reasoning |
Best for: Quick queries, analysis, code generation
gemini "{prompt}" --output-format json
When to use:
Best for: Risky commands, untrusted code
gemini -s "Execute: {command}" --output-format json --yolo
When to use:
Best for: Risky refactors, migrations
/restore if failed, keep if passedWhen to use:
Best for: TUI commands (vim, rebase, htop)
When to use:
git rebase -ivim / nano / emacshtop / topBest for: Large codebases exceeding Claude's context
cat $(find src -name "*.ts") | gemini "Analyze architecture" --output-format json -m gemini-2.5-flash
When to use:
Best for: Validation and alternative perspectives
gemini "REVIEW MODE (read-only): Analyze this independently: {content}" --output-format json
When to use:
| Model | Context | Cost | Best For |
|---|---|---|---|
| gemini-2.5-flash | Large | Lower | Bulk analysis, simple tasks |
| gemini-2.5-pro | Very large | Higher | Complex reasoning, quality critical |
Use Flash when:
Use Pro when:
START
|
v
Does it need a TUI? ─────────────> YES ─> gemini-interactive-shell agent
|
NO
|
v
Is it risky/destructive? ────────> YES ─> gemini-sandboxed-executor agent
|
NO
|
v
Is it a large file/codebase? ────> YES ─> gemini-bulk-analyzer agent
|
NO
|
v
Need safety net for experiments? ─> YES ─> gemini-checkpoint-experimenter agent
|
NO
|
v
Want validation/second opinion? ──> YES ─> gemini-second-opinion agent
|
NO
|
v
Simple query? ───────────────────> YES ─> /gemini-query command
|
NO
|
v
Keep in Claude ─────────────────────────> Use Claude's native tools
| Topic | Query Keywords |
|---|---|
| Headless mode | headless json output, output format, -p flag |
| Sandboxing | sandbox docker podman, seatbelt, -s flag |
| Checkpointing | checkpoint restore, rollback, /restore command |
| Interactive | interactive shell, enableInteractiveShell, PTY |
| Model selection | model routing, flash vs pro, -m flag |
| Auto-approve | yolo mode, --yolo, auto approve |
| Error | Cause | Recovery |
|---|---|---|
| JSON parse error | Malformed output | Retry with --output-format json |
| Timeout | Long-running task | Increase timeout, use streaming |
| Auth error | Missing credentials | Check gemini auth status |
| Sandbox error | Missing container | Build sandbox image first |
# Retry with exponential backoff
for i in 1 2 4; do
result=$(gemini "query" --output-format json 2>&1) && break
sleep $i
done
Query gemini-cli-docs for official documentation on:
Query: "Should I delegate this task to Gemini?" Expected Behavior:
Query: "I need to run git rebase -i, can Claude do this?" Expected Behavior:
Query: "I have a 100K+ token codebase to analyze" Expected Behavior:
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience