agentsclimarketplace

Gemini delegator

Skill nexus-substrate/nexus-agents/skills/gemini-delegator

Delegate large context and multimodal tasks to Gemini CLI. Use when context exceeds 100K tokens, analyzing images/screenshots, processing large codebases, or for speed/cost-sensitive operations. Triggers on "delegate to gemini", "route to gemini", "use gemini", "large context", "analyze image", "screenshot analysis".From its SKILL.md

Install
npx -y skills add nexus-substrate/nexus-agents --skill gemini-delegator

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 23 stars23 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

7.1 KB, as published. Nobody here has run it

Gemini Delegator Skill

<!-- CANONICAL SOURCES: - docs/architecture/ROUTING_SYSTEM.md - packages/nexus-agents/src/mcp/tools/delegate-to-model.ts - skills/references/orchestration-patterns.md (multi-agent coordination, retry policies, deadline propagation) -->

Full documentation:

Real-World Performance (Tested 2026-01-18)

MetricValueNotes
Max files analyzed978 files in single query~280k LOC processed successfully
Latency (simple)10-15 secondsSingle directory analysis
Latency (complex)58-73 secondsFull codebase analysis
Cache efficiency94k tokens cachedSignificant cost savings
Tool calls/sessionUp to 20File reads auto-executed
Model routingflash-lite → proTwo-model approach for optimization

When to Delegate to Gemini

ConditionThreshold/CriteriaReason
Context size> 100K tokensGemini: 1M context window
Large codebase analysisMultiple files, > 50 filesFast bulk processing
Image/screenshot analysisAny visual contentNative multimodal support
Video/audio processingAny A/V contentNative multimodal support
Speed-critical tasksLatency sensitiveFlash models optimized
Cost-sensitive operationsBudget constraintsGenerous free tier (1K/day)
Google Cloud integrationBigQuery, Cloud FunctionsNative integration

When NOT to Delegate

  • Complex reasoning requiring deep analysis
  • Security-critical implementations
  • Production code generation needing high quality
  • Tasks requiring careful planning and architecture

Methods

Method 1: delegate_to_model MCP Tool

Use the nexus-agents MCP tool for intelligent routing:

# The tool analyzes task and recommends optimal model
nexus-agents delegate_to_model --task "Analyze this 500K token codebase"

Method 2: Direct Gemini CLI

# Basic delegation (human-readable output)
gemini -p "Analyze this codebase"

# JSON output for parsing (note: response may contain markdown fences)
gemini -p "Analyze this codebase" --output-format json

# With auto-approve for autonomous operation
gemini --yolo -p "Review all files in src/" --output-format json

# Specify model
gemini -m gemini-2.5-flash -p "Quick analysis task"
gemini -m gemini-3-pro-preview -p "Complex reasoning task"

JSON Output Parsing Note: The response field in JSON output may contain markdown code fences. Parse accordingly:

const result = JSON.parse(output);
const response = result.response.replace(/```\w*\n?/g, '').trim();

Multimodal Examples

Image Analysis

# Analyze screenshot
gemini -p "Describe this UI and identify usability issues" < screenshot.png

# Analyze architecture diagram
gemini -p "Extract components and relationships from this diagram" < diagram.png

# Code screenshot OCR
gemini -p "Extract the code from this screenshot" < code-image.png

Video Analysis

# Analyze video content (uses File API for > 1 minute)
gemini -p "Summarize the key points from this demo video" < demo.mp4

Batch Processing

# Process multiple images
for img in screenshots/*.png; do
  gemini -p "Analyze this UI screenshot" < "$img" --output-format json >> results.json
done

Context Advantage

ModelContext WindowBest For
Claude~200K tokensQuality reasoning
Gemini Pro1M tokensLarge context, multimodal
Gemini Flash200K-1M tokensSpeed, high volume

The 1M token context window enables:

  • Entire codebase analysis in single context
  • Full documentation sets without chunking
  • Complete git history review
  • Large data file processing

Output Formats

# Human readable (default)
gemini -p "task"

# JSON for parsing
gemini -p "task" --output-format json

# Streaming JSON for real-time
gemini -p "task" --output-format stream-json

Process

  1. Evaluate task requirements:

    • Estimate context size
    • Check for multimodal content
    • Assess speed/cost sensitivity
  2. Choose delegation method:

    • Use delegate_to_model for intelligent routing
    • Use direct Gemini CLI for explicit control
  3. Configure execution:

    • Select appropriate model (Pro vs Flash)
    • Set output format for parsing
    • Use --yolo for autonomous tasks
  4. Process results:

    • Parse JSON output
    • Integrate findings into workflow

Quick Reference

# Large context analysis
gemini -p "Analyze this entire codebase structure" --yolo

# Screenshot analysis
gemini -p "What does this UI show?" < screenshot.png

# Fast iteration
gemini -m gemini-2.5-flash -p "Quick review" --output-format json

# Cost-sensitive batch
for f in *.ts; do gemini -p "Review: $(cat $f)" >> reviews.txt; done

Anti-rationalization — Gemini delegation

ExcuseCounter
"Gemini for everything, it has a big context"Big context isn't free — output quality varies by task. Use Gemini for >100k context, multimodal, or research-shaped tasks.
"Skip the multimodal check"If the task includes images, Gemini is the canonical CLI. Other CLIs may text-summarize via OCR but lose information.
"I'll use Gemini even for short code-gen"Codex is faster on code. Use Gemini when context size or multimodal forces the choice.

Red flags

  • Gemini used for short single-file code-gen (Codex is faster)
  • Multimodal task routed to a non-Gemini CLI without explicit reason
  • Context exceeded 1M without verification of token budget

Verification checklist

  • Task category matches Gemini's strengths (large context, research, multimodal)
  • Token estimate confirmed within Gemini's context window before dispatch
  • Outcome recorded for adaptive routing

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.