Skip to content
gemini-llm logo

Gemini LLM Skill

gemini-llm

Invoke Google Gemini 3 Pro for text generation, reasoning, and code tasks using the Python google-genai SDK. Supports gemini-3-pro-preview (best multimodal), gemini-2.5-pro (reasoning), and gemini-2.5-flash (fast).

SKILL.md

Full skill instructions

Gemini LLM Skill

Invoke Google Gemini models for text generation, reasoning, code analysis, and complex tasks using the Python google-genai SDK.

Available Models

Model IDDescriptionBest For
gemini-3-pro-previewBest multimodal understandingComplex reasoning, analysis
gemini-2.5-proAdvanced thinking modelDeep reasoning, planning
gemini-2.5-flashFast and capableQuick tasks, high throughput
gemini-2.5-flash-liteFastest, cost-efficientSimple tasks, bulk processing

Configuration

API Key Location: C:\Users\USERNAME\env (GEMINI_API_KEY)

Default API Key: ${GEMINI_API_KEY}

Usage

Basic Text Generation

python -c "
from google import genai
client = genai.Client(api_key=os.environ.get("GEMINI_API_KEY"))
response = client.models.generate_content(
    model='gemini-3-pro-preview',
    contents='YOUR_PROMPT_HERE'
)
print(response.text)
"

With System Instructions

python -c "
from google import genai
from google.genai import types

client = genai.Client(api_key=os.environ.get("GEMINI_API_KEY"))
response = client.models.generate_content(
    model='gemini-3-pro-preview',
    contents='YOUR_PROMPT_HERE',
    config=types.GenerateContentConfig(
        system_instruction='You are a helpful coding assistant.',
        temperature=0.7,
        max_output_tokens=8192
    )
)
print(response.text)
"

Streaming Response

python -c "
from google import genai
client = genai.Client(api_key=os.environ.get("GEMINI_API_KEY"))
for chunk in client.models.generate_content_stream(
    model='gemini-3-pro-preview',
    contents='YOUR_PROMPT_HERE'
):
    print(chunk.text, end='', flush=True)
print()
"

Workflow

When this skill is invoked:

  1. Parse the user request to determine:

    • The prompt/​task to send to Gemini
    • Which model to use (default: gemini-3-pro-preview)
    • Any configuration options (temperature, max tokens, system instruction)
  2. Select the appropriate model:

    • Complex reasoning/​analysis → gemini-3-pro-preview
    • Deep planning/​thinking → gemini-2.5-pro
    • Quick responses → gemini-2.5-flash
    • Bulk/​simple tasks → gemini-2.5-flash-lite
  3. Execute the Python command using Bash tool:

    python -c "
    from google import genai
    client = genai.Client(api_key=os.environ.get("GEMINI_API_KEY"))
    response = client.models.generate_content(
        model='MODEL_ID',
        contents='''PROMPT'''
    )
    print(response.text)
    "
    
  4. Return the response to the user

Example Invocations

Code Review

python -c "
from google import genai
client = genai.Client(api_key=os.environ.get("GEMINI_API_KEY"))
response = client.models.generate_content(
    model='gemini-3-pro-preview',
    contents='''Review this Python code for bugs and improvements:

def calculate_total(items):
    total = 0
    for item in items:
        total += item.price * item.quantity
    return total
'''
)
print(response.text)
"

Explain Concept

python -c "
from google import genai
client = genai.Client(api_key=os.environ.get("GEMINI_API_KEY"))
response = client.models.generate_content(
    model='gemini-2.5-flash',
    contents='Explain async/​await in Python in simple terms'
)
print(response.text)
"

Generate Code

python -c "
from google import genai
from google.genai import types

client = genai.Client(api_key=os.environ.get("GEMINI_API_KEY"))
response = client.models.generate_content(
    model='gemini-3-pro-preview',
    contents='Write a Python function to merge two sorted lists',
    config=types.GenerateContentConfig(
        system_instruction='You are an expert Python developer. Write clean, efficient, well-documented code.',
        temperature=0.3
    )
)
print(response.text)
"

Multi-turn Conversations

For conversations with history:

python -c "
from google import genai
from google.genai import types

client = genai.Client(api_key=os.environ.get("GEMINI_API_KEY"))

history = [
    types.Content(role='user', parts=[types.Part(text='What is Python?')]),
    types.Content(role='model', parts=[types.Part(text='Python is a high-level programming language...')]),
    types.Content(role='user', parts=[types.Part(text='How do I install it?')])
]

response = client.models.generate_content(
    model='gemini-3-pro-preview',
    contents=history
)
print(response.text)
"

Error Handling

The skill handles common errors:

  • 404 Not Found: Model not available - fall back to gemini-2.5-pro
  • Rate Limiting: Wait and retry with exponential backoff
  • Token Limits: Truncate input or use streaming for large outputs

Notes

  • Gemini 3 Pro is NOT available via the Gemini CLI (v0.17.1) - must use Python SDK
  • The thought_signature warning can be ignored - it's internal model metadata
  • For long prompts, use triple quotes and escape special characters
  • Maximum context: varies by model (check documentation)

Tools to Use

  • Bash: Execute Python commands
  • Read: Load files to include in prompts
  • Write: Save Gemini responses to files

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

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...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

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...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

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.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View