python-expert

Conventions for clean, idiomatic Python. Load whenever you read, edit, or write Python source files.

npx skills add https://github.com/firebase/genkit --skill python-expert

Python expert

When working with Python in this workspace, follow these conventions:

  • Type-hint everything. Parameters, returns, attributes, locals where the type isn't obvious.
  • Prefer dataclasses for simple data containers over hand-written __init__s.
  • Raise specific exceptions (ValueError, KeyError, LookupError) with informative messages. Avoid bare Exception.
  • Don't swallow errors. Don't except Exception: pass. Let unexpected errors propagate.
  • Match the surrounding style. If the file uses single quotes and 4-space indent, match it. Don't reformat unrelated lines.
  • Comments explain why, not what. Skip narration like # loop over items; only comment non-obvious intent.
  • Small, focused edits. When fixing a bug, change only what's necessary. Leave the rest of the file untouched so the diff stays readable.

More skills from firebase

resolve-docker-vulnerabilities
firebase
Skill to resolve Docker vulnerabilities for the firebase-cli image. Use this skill when you need to check for vulnerabilities in the firebase-cli Docker image…
official
test-writer
firebase
How to write pytest tests for modules in this workspace. Load whenever you are about to write or extend tests.
official
developing-genkit-dart
firebase
Unified AI SDK for Dart enabling code generation, structured outputs, tools, flows, and agents. Provides core APIs for generation, tool definition, flow orchestration, embeddings, and streaming with a single interface Includes 8+ plugins for LLM providers (Google Gemini, Anthropic Claude, OpenAI GPT), Firebase AI, Model Context Protocol, Chrome browser integration, and HTTP server hosting via Shelf Built-in CLI with local development UI for flow execution, tracing, model experimentation, and...
official
developing-genkit-js
firebase
Build AI-powered Node.js/TypeScript applications with Genkit flows, tools, and multi-model support. Genkit is provider-agnostic; supports Google AI, OpenAI, Anthropic, Ollama, and other LLM providers via plugins Define flows with type-safe schemas using Zod, execute generation requests, and compose multi-step AI workflows in TypeScript Requires Genkit CLI v1.29.0+; recent major API changes mean you must consult genkit docs:read and common-errors.md for current patterns, not prior knowledge...
official
developing-genkit-python
firebase
Develop AI-powered applications using Genkit in Python. Use when the user asks about Genkit, AI agents, flows, or tools in Python, or when encountering Genkit…
official
firebase-ai-logic
firebase
Client-side Gemini integration for web apps with multimodal inference, streaming, and on-device hybrid execution. Supports text-only and multimodal inputs (images, audio, video, PDFs); files over 20 MB route through Cloud Storage Includes chat sessions with automatic history, streaming responses for real-time display, and structured JSON output enforcement Offers hybrid on-device inference via Gemini Nano in Chrome, with automatic fallback to cloud execution Requires App Check for production...
official
firebase-ai-logic-basics
firebase
Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security.
official
firebase-app-hosting-basics
firebase
Deploy and manage full-stack web apps with Firebase App Hosting using Next.js, Angular, and other supported frameworks. Requires Firebase project on Blaze pricing plan; supports Server-Side Rendering (SSR) and Incremental Static Regeneration (ISR) workflows Deploy via firebase.json configuration with optional apphosting.yaml for backend setup, or enable automated "git push to deploy" through GitHub integration Includes secret management via CLI commands for secure access to sensitive keys...
official