Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计提醒

gemini-promptingGemini prompting 搜索

Agent Skill

用于辅助提示词、系统指令、Agent 行为约束和工作流模板的整理。它适合让 Agent 规范任务边界、统一输出格式、拆分操作步骤或优化提示词可复用性。使用时需要保留真实业务约束,不要把示例当硬规则;涉及自动执行、外部工具或高风险操作时,应在提示词中明确确认步骤、权限边界和失败处理方式。

总安装

563

周安装

23

GitHub Stars

4

下载量

180
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:gemini-prompting(Gemini prompting 搜索)
来源仓库:https://github.com/duyet/claude-plugins
仓库路径:skills/gemini-prompting
安装命令:
npx skills add https://github.com/duyet/claude-plugins --skill gemini-prompting
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/duyet/claude-plugins --skill gemini-prompting

简介

用于辅助提示词和工作流模板的整理优化。gemini-prompting 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

  • 适合规范任务边界、统一输出格式或拆分操作步骤。
  • 需要保留真实业务约束,避免将示例当硬规则。
  • 涉及自动执行时应明确确认步骤和失败处理方式。
  • 适用于 Codex、Claude、Cursor 和 Gemini CLI 提示工程。

SKILL.md

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

AttributeDescription
ArchitectureMultimodal-first (text, images, audio, video, code)
Context WindowUp to 1M+ tokens (industry-leading)
System InstructionsPrimary feature for behavior control
StrengthsMultimodal reasoning, long-context, code generation
Prompt StyleFlexible with system instruction preference
ModelsGemini 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.

{
  "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

<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

<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

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

{
  "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:

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

{
  "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:

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:

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:

response = client.models.generate_content(
    model="gemini-2.5-flash",
    contents="Extract user profile information from this text: [text]",
    config=types.GenerateContentConfig(
        response_mime_type="application/json",
        response_schema=types.Schema(
            type=types.Type.OBJECT,
            properties={
                "name": types.Schema(type=types.Type.STRING),
                "email": types.Schema(type=types.Type.STRING),
                "age": types.Schema(type=types.Type.INTEGER),
                "interests": types.Schema(
                    type=types.Type.ARRAY,
                    items=types.Schema(type=types.Type.STRING)
                )
            },
            required=["name", "email"]
        )
    )
)

Anti-Patterns to Avoid

Anti-PatternWhy It FailsBetter Approach
Ignoring system instructionsWastes Gemini's key featureAlways set system_instruction
Not using multimodalUnderutilizes Gemini's strengthCombine text, images, audio
Small context thinkingWastes 1M+ capabilityProcess large documents
Inconsistent formatsConfuses multimodal processingSpecify output format clearly
Single-shot for complex tasksMisses reasoning depthUse multi-turn conversations
Not using structured outputsManual parsing neededUse JSON schema validation
Disabling thinking when neededMisses reasoning insightsEnable thinking_budget for complex tasks

Quick Reference Templates

Basic System Instruction

{
  "system_instruction": {
    "parts": [{"text": "[Your system instruction here]"}]
  },
  "contents": [{"parts": [{"text": "[Your prompt]"}]}]
}

Multimodal Input

<system_instruction>
You are a visual analysis assistant.
</system_instruction>

Analyze this image and describe:
1. Main subject
2. Mood/atmosphere
3. Suggested use cases

[image]

Long-Context Analysis

<system_instruction>
You are a research analyst specializing in synthesis and pattern recognition.
</system_instruction>

<large_context>
[up to 1M tokens of content]
</large_context>

<task>
[analysis task]
</task>

<output_format>
[structure]
</output_format>

Model Capabilities Reference

FeatureGemini 3 FlashGemini 3 ProGemini 2.5 FlashGemini 2.5 Pro
Context Window1M tokens1M tokens1M tokens1M tokens
System Instructions✅ Yes✅ Yes✅ Yes✅ Yes
Multimodal✅ Native✅ Native✅ Native✅ Native
Code✅ Excellent✅ Excellent✅ Excellent✅ Excellent
Reasoning✅ Strong✅ Excellent✅ Strong✅ Excellent
SpeedVery FastFastVery FastFast
Function Calling✅ Yes✅ Yes✅ Yes✅ Yes
Thinking Config✅ Yes✅ Yes✅ Yes✅ Yes
StatusLatest (2025)Latest (2025)MatureMature

Note: Model names follow gemini-{version}-{variant} pattern. Use gemini-3-flash-preview for the latest features.

System Instruction Patterns

Role Definition

You are a [role] specializing in [domain].
You are [attribute 1], [attribute 2], and [attribute 3].

Task Instructions

When given a task:
1. **Analyze**: Break down requirements
2. **Plan**: Create step-by-step approach
3. **Execute**: Complete the task
4. **Review**: Verify against requirements

Output Formatting

Always structure your responses as:
- **Summary**: Brief overview
- **Details**: Main content
- **Examples**: Concrete illustrations (if applicable)
- **Caveats**: Limitations or considerations

Behavioral Constraints

- Always cite sources when making factual claims
- Indicate confidence levels for uncertain information
- Offer alternative viewpoints on subjective topics
- Flag potential ethical concerns

See Also

  • references/basics.md - Foundational Gemini prompting concepts
  • references/techniques.md - Detailed technique explanations
  • references/system-instructions.md - System instruction patterns
  • references/multimodal.md - Multimodal prompting guide
  • references/patterns.md - Reusable Gemini prompt patterns
  • references/examples.md - Concrete examples and templates
  • grok-prompting skill - For Grok/xAI-specific guidance
  • claude-prompting skill - For Anthropic Claude-specific guidance

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.13%
按下载量换算60

Claude

31.08%
按下载量换算56

Cursor

20.49%
按下载量换算37

Gemini CLI

9.8%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills