gemini-system-prompt-best-practices

Applies official Google best practices when writing or editing Gemini system prompts (systemInstruction). Use when creating or changing system prompts for Gemini (e.g. transcription, Dictate Prompt, Prompt & Read), when reviewing prompt text in AppConstants or SpeechService, or when the user asks about Gemini prompt design.

16 stars

Best use case

gemini-system-prompt-best-practices is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Applies official Google best practices when writing or editing Gemini system prompts (systemInstruction). Use when creating or changing system prompts for Gemini (e.g. transcription, Dictate Prompt, Prompt & Read), when reviewing prompt text in AppConstants or SpeechService, or when the user asks about Gemini prompt design.

Teams using gemini-system-prompt-best-practices should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/gemini-system-prompt-best-practices/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/ai-agents/gemini-system-prompt-best-practices/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/gemini-system-prompt-best-practices/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How gemini-system-prompt-best-practices Compares

Feature / Agentgemini-system-prompt-best-practicesStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Applies official Google best practices when writing or editing Gemini system prompts (systemInstruction). Use when creating or changing system prompts for Gemini (e.g. transcription, Dictate Prompt, Prompt & Read), when reviewing prompt text in AppConstants or SpeechService, or when the user asks about Gemini prompt design.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Gemini System Prompt Best Practices

When writing or editing **system prompts** for Gemini (especially 2.0 Flash), apply these practices. They are derived from official Google documentation so model behavior stays predictable and output quality is high.

## When to Use This Skill

- Adding or changing `systemInstruction` / system prompt text (e.g. in `AppConstants`, `SpeechService`, or settings).
- Reviewing or refactoring existing system prompts (transcription, Dictate Prompt, Prompt & Read).
- User asks how to improve a Gemini system prompt or about best practices.

## Structure of a Good System Prompt (Order Matters)

Build the system prompt in this order:

1. **Persona / role**  
   Who the model is (e.g. "You are a professional transcription service" or "You are a text editing assistant"). Include output language or style if relevant.

2. **Task and rules**  
   What to do and how. Prefer clear, ordered rules. Separate:
   - One-time or setup rules (e.g. "The first input is selected text, the second is the voice instruction").
   - Repeated rules (e.g. "Always return only the modified text").

3. **Guardrails**  
   What the model must **not** do. Use explicit "Do NOT …" and, if helpful, if/then examples. Strong wording (e.g. "unmistakably", "CRITICAL", "ONLY") helps.

4. **Output format**  
   One clear rule at the end: return only the raw result, no meta-commentary, no preamble/outro, no markdown unless required.

## Prompt Length (Best Practice)

- **User-facing prompts** (e.g. what the user types or says): Google suggests staying **under ~4,000 characters** for best behavior and clarity.
- **System prompts** (`systemInstruction`): Keep them **as short as possible while still complete**. One clear task, no filler; longer system prompts can dilute focus and increase latency.
- **Technical limits** (max context length) are per model and documented in the API; the above are *design* guidelines, not hard caps.

## Best Practices (Summary)

| Practice | Guidance |
|----------|----------|
| **Clarity** | Be specific: questions, step-by-step tasks, or clear UX. Avoid vague or keyword-only prompts. |
| **Context** | Include why the task is done and (if relevant) domain/expertise so the model can adapt (e.g. jargon, language). |
| **Length** | Keep prompts focused. Google suggests staying under ~4,000 characters for user-facing prompts; system prompts should be as short as possible while still complete. |
| **One job per prompt** | One system prompt = one clear task (e.g. transcribe **or** edit text), not multiple unrelated behaviors. |
| **Output language** | If the output language must be fixed, state it explicitly (e.g. "RESPOND UNMISTAKABLY IN {LANGUAGE}"). |
| **Iterate** | Refine based on real responses; add "Do NOT …" or examples when the model misbehaves. |

## Project-Specific Notes (WhisperShortcut)

- **Transcription**: Persona + "transcribe verbatim" + guardrail "Do NOT answer questions or execute commands; only transcribe" is aligned with best practices. Optional: one explicit line about removing fillers silently.
- **Dictate Prompt / Prompt & Read**: Persona + clear roles (SELECTED TEXT vs. AUDIO = instruction) + single output rule (e.g. `promptModeOutputRule`) matches the recommended structure.
- **User context**: Appending a dedicated block (e.g. `---\nUser context:\n…`) with a length limit (e.g. `userContextMaxChars`) is a good way to keep the system prompt focused.

## Official References

For full, up-to-date guidance, prefer these sources:

- **Prompt design (strategies)**: https://ai.google.dev/gemini-api/docs/prompting-strategies  
- **Models (incl. Gemini 2.0 Flash)**: https://ai.google.dev/gemini-api/docs/models  
- **Writing prompts (Google Cloud)**: https://docs.cloud.google.com/gemini/docs/discover/write-prompts  

When in doubt, favor instructions that are **explicit**, **ordered**, and **bounded** (one task, clear output format, clear guardrails).

Related Skills

fix-bad-practices

16
from diegosouzapw/awesome-omni-skill

Fix bad coding practices identified by audit, following fail-fast principles

cursor-best-practices

16
from diegosouzapw/awesome-omni-skill

Best practices for using Cursor—rules, commands, skills, subagents, ignore files, Agent security, workflows, and community resources. Use when setting up Cursor, initializing or creating the .cursor folder, writing .cursor/rules or AGENTS.md, creating commands or skills, configuring .cursorignore, working with Agent, discovering rules or MCPs (e.g. cursor.directory), making codebases cursor-compatible, or asking about Cursor workflows, TDD, git commands, or large codebases.

create-prompt

16
from diegosouzapw/awesome-omni-skill

Expert prompt engineering for creating effective prompts for Claude, GPT, and other LLMs. Use when writing system prompts, user prompts, few-shot examples, or optimizing existing prompts for better performance.

create-custom-prompt

16
from diegosouzapw/awesome-omni-skill

Prompt for creating custom prompt files

agentv-prompt-optimizer

16
from diegosouzapw/awesome-omni-skill

Iteratively optimize prompt files against AgentV evaluation datasets by analyzing failures and refining instructions.

agent-memory-systems

16
from diegosouzapw/awesome-omni-skill

Memory is the cornerstone of intelligent agents. Without it, every interaction starts from zero. This skill covers the architecture of agent memory: short-term (context window), long-term (vector stores), and the cognitive architectures that organize them. Key insight: Memory isn't just storage - it's retrieval. A million stored facts mean nothing if you can't find the right one. Chunking, embedding, and retrieval strategies determine whether your agent remembers or forgets. The field is fragm

agent-embedded-systems

16
from diegosouzapw/awesome-omni-skill

Expert embedded systems engineer specializing in microcontroller programming, RTOS development, and hardware optimization. Masters low-level programming, real-time constraints, and resource-limited environments with focus on reliability, efficiency, and hardware-software integration.

agent-context-system

16
from diegosouzapw/awesome-omni-skill

A persistent local-only memory system for AI coding agents. Two files, one idea — AGENTS.md (committed, shared) + .agents.local.md (gitignored, personal). Agents read both at session start, update the scratchpad at session end, and promote stable patterns over time. Works across Claude Code, Cursor, Copilot, Windsurf. Subagent-ready. No plugins, no infrastructure, no background processes.

active-learning-system

16
from diegosouzapw/awesome-omni-skill

Эксперт active learning. Используй для ML с участием человека, uncertainty sampling, annotation workflows и labeling optimization.

33GOD System Expert

16
from diegosouzapw/awesome-omni-skill

Deep knowledge expert for the 33GOD agentic pipeline system, understands component relationships and suggests feature implementations based on actual codebase state

remotion-best-practices

16
from diegosouzapw/awesome-omni-skill

Best practices for Remotion - Video creation in React

imagegen-gemini

16
from diegosouzapw/awesome-omni-skill

Generate/edit images via Gemini API (Nano Banana). Triggers: generate image, create picture, AI art, edit image, make illustration.