Gemini Skills
repository·main·Indexed 26 days ago
https://github.com/google-gemini/gemini-skillsA library of specialized context 'skills' for the Gemini API designed to improve the accuracy and best-practice adherence of AI agents and coding assistants. It includes skills for general development (gemini-api-dev), real-time streaming (gemini-live-api-dev), the Interactions API (gemini-interactions-api), and generative AI video (gemini-omni-flash-api). The repository provides guidance on using current models like gemini-3.6-flash and migrating from legacy SDKs to google-genai.
What's inside gemini-skills
- This repository provides a library of 'skills' designed to bridge the knowledge gap for LLMs when interacting with the Gemini API, SDKs, and models. Skills add relevant context to agents to ensure they follow the latest best practices, such as thought circulation or recent SDK changes. Using these skills has been shown to improve an agent's ability to generate correct API code to 87% with Gemini 3 Flash and 96% with Gemini 3.1 Pro.
Use Gemini Live API for real-time streaming
mainFor real-time, bidirectional audio/video/text streaming (including WebSocket streaming, voice activity detection, and session management), use thegoogle-gemini/gemini-live-api-devskill.Install the Gemini Interactions API SDKs
mainTo use the Gemini Interactions API, install the appropriate SDK for your language. Note that legacy SDKs (
google-generativeaifor Python and@google/generative-aifor JS) are deprecated. Use the following versions:- Python: Install
google-genaiversion2.3.0or higher. - JavaScript/TypeScript: Install
@google/genaiversion2.3.0or higher.
# Python pip install -U google-genai # JavaScript/TypeScript npm install @google/genai- Python: Install
Prepare and trim videos with prep_video.py
mainTheprep_video.pyscript normalizes, trims, and formats videos to meet Gemini Omni Flash limits (e.g., max 10s duration, specific resolutions). It can handle timecode-based trimming, frame rate conversion, and audio stripping.Render text in Gemini Omni Flash videos
mainGemini Omni Flash supports high-quality text rendering. You can define text that appears on screen or naturally occurring text in the environment.
Examples:
One word on the screen at a time: "did, you, know, that, Omni, can, do, awesome, text?" Each word appears for 1s with a different animated style. No dialogue.There is a street sign that says: "This is an AI generation by Omni", there is a storefront that says: "All you need AI", there's a car with the number plate: "OMN111"
Set image roles in prompts using tags
mainTo guide Gemini Omni Flash on how to use uploaded media, use specific tags in your prompt to define whether an image is a starting frame or a reference.
Simple Tags
<FIRST_FRAME>: Sets the image as the starting frame of the video.<IMAGE_REF_N>: Sets the image as a reference (whereNis the index starting from 0).
Explicit Declaration
For complex prompts, use prefix tags to map images to roles:
[# Sources <FIRST_FRAME>@Image1][# References <IMAGE_REF_0>@Image1]
Example:
[# Sources <FIRST_FRAME>@Image1] [# References <IMAGE_REF_0>@Image2] a woman <IMAGE_REF_0> is walking. Use Image1 as the starting frame. Use Image2 as a reference for the video generation.Prompt audio and music for Gemini Omni Flash
mainThe model generates an appropriate audio track by default. To control the audio or include specific music, describe the desired sound in your prompt using formats like:
Include calm background musicThe video has a high energy techno beatThe audio is a low tinny radio broadcast in the background, playing a songAudio design: [a description of the audio you want]
Use the Antigravity Managed Agent
mainThe Antigravity agent (
antigravity-preview-05-2026) is a general-purpose managed agent that can execute code (Bash, Python, Node.js), manage files, and browse the web. To use it, you must setenvironment="remote"to provision a sandboxed Linux environment.Python Example:
from google import genai client = genai.Client() interaction = client.interactions.create( agent="antigravity-preview-05-2026", input="Write a Python script that generates the first 20 Fibonacci numbers and saves them to fibonacci.txt. Then read the file and print its contents.", environment="remote", ) print(f"Environment ID: {interaction.environment_id}") print(interaction.output_text)Upload media to the Files API
mainUse
upload_file.pyto upload local images or videos to the Files API. The script polls the API until the file status isACTIVE. For videos larger than 25MB, it is recommended to useprep_video.pyfirst to optimize the file for Gemini Omni Flash (which is optimized for 10s videos at 720p/24fps)../scripts/upload_file.py path/to/image.pngInstall skills using Vercel skills CLI
mainYou can use the Vercel skills CLI (
skills.sh) to browse or install specific skills from this repository.To interactively browse and list available skills:
npx skills add google-gemini/gemini-skills --listTo install a specific skill (for example,
gemini-interactions-api):npx skills add google-gemini/gemini-skills --skill gemini-interactions-apiInstall Gemini Live API SDKs
mainTo use the Gemini Live API, install the modern SDKs. Note that legacy SDKs (
google-generativeaifor Python and@google/generative-aifor JS) are deprecated.Python: Install
google-genaivia pip.JavaScript/TypeScript: Install
@google/genaivia npm.# Python pip install google-genai # JavaScript/TypeScript npm install @google/genaiRemove unwanted elements from video generations
mainTo avoid specific elements in your video, you can include simple negative prompts in your request, such as:
No dialogueNo embellishmentsNo extra sound effects