Skip to content
cccskills
FreePublished on GitHub

production-python-ai

Production-grade Python and AI engineering standards. Use for ANY Python work — FastAPI services, LangChain/LangGraph agents, RAG pipelines, LLM API integrations, document processing, or data scripts — whether writing new code, reviewing, refactoring, or debugging. Enforces typed Pydantic boundaries, structured errors and logging, LLM call timeouts/retries/output validation, secret management, async correctness, and tested code.

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md3.4 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Production Python & AI Engineering Standards

Code quality baseline

  • Type hints on every function signature. Pydantic v2 models at all I/O boundaries (API requests/responses, LLM outputs, file parsing results).
  • Code must pass ruff and mypy. No print() — use the logging module with structured context.
  • Config via pydantic-settings and environment variables. Never hardcode API keys, model names, or URLs. Magic numbers (chunk sizes, top_k, thresholds) live in a config object, not inline.

FastAPI

  • async def for I/O-bound routes; never call blocking/sync I/O inside them.
  • Shared clients (DB, HTTP, LLM SDKs) created once at startup and injected via Depends — never instantiated per request.
  • response_model on every route. Correct status codes. Routes stay thin: validation in, service call, response out — business logic lives in service functions.
  • Raise HTTPException with clear detail; map internal exceptions to safe client messages (never leak stack traces or keys).

LLM calls (any provider)

  • Every call gets: explicit timeout, retry with exponential backoff on transient errors, and a max-retry cap.
  • NEVER trust raw model output. Parse into a Pydantic schema; on validation failure, retry with the error fed back or fall through to an explicit failure path — never .get() blindly on un-validated JSON.
  • Pin model versions in config. Prompts are versioned constants/templates in the repo, not inline f-strings scattered through code.
  • Log per call: model, latency, input/output tokens, and a request/trace ID. Propagate the trace ID through every pipeline stage.

LangChain / LangGraph / RAG

  • Prefer explicit LangGraph state (TypedDict/Pydantic) over implicit chains; every node validates what it reads from state.
  • Handle tool errors inside the graph — a failed tool returns a structured error message to the model, it does not crash the run.
  • RAG: chunking params, embedding model, and top_k come from config; embedding model version is pinned (changing it invalidates the index — say so in code comments).
  • Use asyncio.gather for independent parallel LLM/tool calls; cap concurrency with a semaphore.

Errors & logging

  • Catch specific exceptions only — no bare except. Either handle meaningfully or let it propagate; never swallow silently.
  • Fail loud and early in pipelines: validate inputs at the start, not three stages deep.
  • Logs are structured (key=value or JSON): event, trace_id, duration_ms, and outcome.

Testing

  • pytest. Unit tests NEVER hit live LLM APIs — mock the client and test the parsing/validation/retry logic hard, including malformed model output.
  • Bug fix = first a failing test that reproduces it, then the fix.
  • For prompts: keep golden input/output examples and assert the parser handles them.

Before declaring done

  • Run the code or tests — never claim it works without verification.
  • Check: secrets out of code, types clean, errors handled, LLM outputs validated, logs in place.s

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Use this skill whenever the user wants to create or improve a presentation for an academic context — conference papers, seminar talks, thesis defenses, grant briefings, lab meetings, invited lectures, or any presentation where the audience will evaluate reasoning and evidence. Triggers include: 'conference talk', 'seminar slides', 'thesis defense', 'research presentation', 'academic deck', 'academic presentation'. Also triggers when the user asks to 'make slides' in combination with academic content (e.g., 'make slides for my paper on X', 'create a presentation for my dissertation defense', 'build a deck for my grant proposal'). This skill governs CONTENT and STRUCTURE decisions. For the technical work of creating or editing the .pptx file itself, also read the pptx SKILL.md.

The English summary is being prepared. Showing the original description.

skillmds/skillmd249Updated Oct 14, 2026

adp

Free

Redpanda's Agentic Data Plane: governance infrastructure for building, running, and governing AI agents and MCP servers, plus a proxying AI Gateway for LLM providers, operated via `rpk ai` and the ADP API. Use when creating or managing AI agents (managed or self-managed) via `rpk ai agent` or `AgentRegistryService`; configuring MCP servers (remote or managed catalog, code mode, auth); setting up LLM providers or querying models via `rpk ai llm`/`rpk ai model` or the AI Gateway proxy; or configuring budgets, guardrails, or Cedar access-control policies through the governance APIs. Also covers reading agent transcripts and spending insights, and wiring OAuth clients or providers to the aigw Authorization Server. For the separate rpk cloud mcp control-plane MCP server, see `/redpanda:rpk-cloud`.

The English summary is being prepared. Showing the original description.

skillmds/skillmd249Updated Oct 14, 2026

ads

Free

Operate professional paid advertising across Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, Apple, Amazon, Reddit, Pinterest, Snapchat, and X. Use for account intake, source-grounded audits, strategy, budget and measurement planning, creative production, experiments, reporting, monitoring, and explicitly approved campaign changes. Also trigger on PPC, paid social, retail media, attribution, tracking, landing pages, cross-platform conversion totals, negative keywords or search terms, beta-feature scoring, stale platform claims, API-token or credential setup, campaign deletion, and safe Claude Ads installation or uninstall.

The English summary is being prepared. Showing the original description.

skillmds/skillmd249Updated Oct 14, 2026

Audit Apple Ads measurement, AdServices and AdAttributionKit, campaign and keyword structure, Search Match, App Store placements, custom product pages, bidding, budgets, MMP reconciliation, and policy. Use for Apple Ads, Apple Search Ads, App Store ads, Search Match, custom product pages, AdServices, or Apple app-install campaigns.

The English summary is being prepared. Showing the original description.

skillmds/skillmd249Updated Oct 14, 2026

Research competitor paid-ad presence, messaging, creative, formats, landing pages, keyword and auction signals, transparent ad libraries, and strategic gaps across supported platforms. Use for competitor ads, ad libraries, ad spy, competitive PPC analysis, competitor creative, Google Ads Transparency, Meta Ad Library, or paid-media competitor research.

The English summary is being prepared. Showing the original description.

skillmds/skillmd249Updated Oct 14, 2026

Extract a public-safe brand and offer profile for paid advertising from an authorized website and operator input. Triggers on: brand DNA, brand profile, brand identity, brand style, brand colors, brand voice, visual identity, style guide, website brand analysis.

The English summary is being prepared. Showing the original description.

skillmds/skillmd249Updated Oct 14, 2026

See all skills by skillmds

Report a problem with this skill