gemini-prompting
Prompt engineering guidance for Gemini (Google) model. Use when crafting prompts for Gemini to leverage system instructions, multimodal capabilities, ultra-long context, and strong reasoning features.
What this skill does
# Gemini Prompt Engineering
Gemini is Google's multimodal AI model designed from the ground up for text, images, audio, video, and code. It features system instructions, ultra-long context windows (up to 1M+ tokens), and native multimodal understanding.
## When to Invoke This Skill
Use this skill when:
- Crafting prompts specifically for Gemini/Google models
- Using system instructions to guide behavior
- Working with multimodal inputs (text, images, video, audio)
- Leveraging ultra-long context (1M+ tokens)
- Building with Gemini's agent reasoning capabilities
## Gemini's Identity & Characteristics
| Attribute | Description |
|-----------|-------------|
| **Architecture** | Multimodal-first (text, images, audio, video, code) |
| **Context Window** | Up to 1M+ tokens (industry-leading) |
| **System Instructions** | Primary feature for behavior control |
| **Strengths** | Multimodal reasoning, long-context, code generation |
| **Prompt Style** | Flexible with system instruction preference |
| **Models** | Gemini 3 Flash (fast), Gemini 3 Pro (capable), Gemini 2.5 Flash/Pro (legacy) |
## Universal Prompting Techniques (Gemini-Adapted)
### 1. Zero-Shot Prompting with System Instructions
Gemini's system instructions are powerful for zero-shot tasks.
```json
{
"system_instruction": {
"parts": [{"text": "You are a technical writing assistant. Your responses are clear, concise, and use Markdown formatting."}]
},
"contents": [{"parts": [{"text": "Explain how JWT authentication works."}]}]
}
```
### 2. Few-Shot Prompting
```xml
<system_instruction>
You are a sentiment classifier. Categorize text as positive, negative, or neutral.
</system_instruction>
<examples>
<example>
<input>
I absolutely love this product! Best purchase I've made all year.
</input>
<output>
{"sentiment": "positive", "confidence": 0.95}
</output>
</example>
<example>
<input>
This is the worst customer service I've ever experienced.
</input>
<output>
{"sentiment": "negative", "confidence": 0.92}
</output>
</example>
</examples>
<input>
The product is okay, does what it's supposed to do.
</input>
<output>
```
### 3. Chain-of-Thought Prompting
```
<system_instruction>
You are a strong reasoner. Always think through problems step by step before answering.
</system_instruction>
The odd numbers in this group add up to an even number: 4, 8, 9, 15, 12, 2, 1.
Let's think about this systematically:
```
### 4. Zero-Shot CoT
Simply add reasoning instructions:
```
<system_instruction>
Before answering, always think through the problem step by step.
</system_instruction>
What's the capital of the country that has the largest population in South America?
Let's work through this step by step.
```
### 5. Prompt Chaining
Gemini's long context enables extensive chaining:
**Chain 1:**
```
<system_instruction>
You are a research assistant.
</system_instruction>
Extract all research papers related to "transformer architecture" from this document.
<document>
[paste large document]
</document>
```
**Chain 2:**
```
Summarize the key findings from the extracted papers and identify common themes.
<extracted_papers>
[from previous response]
</extracted_papers>
```
### 6. ReAct Prompting
```xml
<system_instruction>
You are a reasoning agent. Before taking any action, analyze logical dependencies, constraints, and risks. Think through the problem methodically.
</system_instruction>
<question>
[research question]
</question>
<thought_1>
[analysis and plan]
</thought_1>
<action_1>
[tool use or information gathering]
</action_1>
<observation_1>
[result]
</observation_1>
<thought_2>
[next steps based on observation]
</thought_2>
<final_answer>
[conclusion]
</final_answer>
```
### 7. Tree of Thoughts
```xml
<system_instruction>
You are an expert planner. Explore multiple solution paths before recommending an approach.
</system_instruction>
<problem>
[complex problem]
</problem>
<thought_paths>
<path_1>
<approach>[strategy 1]</approach>
<reasoning>[step-by-step]</reasoning>
<expected_outcome>[result]</expected_outcome>
</path_1>
<path_2>
[...]
</path_2>
<path_3>
[...]
</path_3>
</thought_paths>
<recommendation>
[best approach with justification]
</recommendation>
```
## Gemini-Specific Best Practices
### 1. Use System Instructions
System instructions are Gemini's primary behavior control mechanism:
```json
{
"system_instruction": {
"parts": [{
"text": "You are a specialized assistant for data science. You are precise, analytical, and always provide code examples in Python."
}]
}
}
```
### 2. Comprehensive System Instruction Template
From official Gemini documentation:
```xml
<role>
You are Gemini, a specialized assistant for [Domain].
You are precise, analytical, and persistent.
</role>
<instructions>
1. **Plan**: Analyze the task and create a step-by-step plan.
2. **Execute**: Carry out the plan.
3. **Validate**: Review your output against the user's task.
4. **Format**: Present the final answer in the requested structure.
</instructions>
<constraints>
- Verbosity: [Low/Medium/High]
- Tone: [Formal/Casual/Technical]
</constraints>
<output_format>
Structure your response as follows:
1. **Executive Summary**: [Short overview]
2. **Detailed Response**: [The main content]
</output_format>
```
### 3. Leverage Multimodal Inputs
Gemini natively processes multiple modalities:
```json
{
"contents": [{
"parts": [
{"text": "Describe what's in this image and suggest a caption for social media."},
{
"inline_data": {
"mime_type": "image/jpeg",
"data": "[base64_encoded_image]"
}
}
]
}]
}
```
### 4. Ultra-Long Context Utilization
Gemini's 1M+ token context enables massive document analysis:
```
<system_instruction>
You are a document analysis specialist.
</system_instruction>
<documents>
[Hundreds of pages of content - up to 1M tokens]
</documents>
<task>
Synthesize key themes across all documents and identify contradictions.
</task>
```
### 5. Code-Specific Prompting
Gemini excels at code generation and analysis:
```
<system_instruction>
You are a senior software engineer. You provide clean, well-documented code with error handling.
</system_instruction>
Write a Python function that:
1. Validates email addresses using regex
2. Returns (is_valid, error_message) tuple
3. Includes comprehensive docstring
4. Handles edge cases
Language: Python
```
## Advanced Features
### Function Calling
Gemini supports native function/tool calling for building agents:
```python
from google import genai
from google.genai import types
client = genai.Client()
get_weather = types.FunctionDeclaration(
name="get_weather",
description="Get current weather for a location",
parameters=types.Schema(
type=types.Type.OBJECT,
properties={
"location": types.Schema(
type=types.Type.STRING,
description="City name, e.g. San Francisco"
),
"unit": types.Schema(
type=types.Type.STRING,
description="Temperature unit (celsius or fahrenheit)",
enum=["celsius", "fahrenheit"]
)
},
required=["location"]
)
)
response = client.models.generate_content(
model="gemini-2.5-flash",
contents="What's the weather in Tokyo and Paris?",
config=types.GenerateContentConfig(
tools=[get_weather]
)
)
```
### Thinking Configuration
Control Gemini's reasoning process with configurable thinking budget:
```python
response = client.models.generate_content(
model="gemini-2.5-flash",
contents="Solve this step-by-step: [complex problem]",
config=types.GenerateContentConfig(
thinking_config=types.ThinkingConfig(
thinking_budget=8192 # tokens for reasoning
)
)
)
```
### Structured Outputs with JSON Schema
Get validated JSON output with schema enforcement:
```python
response = client.models.genRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.