integrate-gemini
Installation
SKILL.md
integrate-gemini
Use this skill when the user wants to "connect to Gemini", "add AI features", or "fix API generation".
Requirements (from rules/gemini.md)
- Safety: NEVER hardcode API keys. Use
import.meta.envor similar. - UX: Always show Loading / Streaming states.
- Reliability: Handle errors gracefully (network, blocking, rate limits).
- Attribution: AI content must be labeled.
Usage
- Check for Client Library: Ensure
@google/generative-aiis installed. If not, install it. - Create the Hook: Create
hooks/useGemini.ts(or similar). - Implement Logic: Use the pattern below to handle the complexities of streaming.