production-python-ai

production-python-ai is a skill for Claude Code from skillmds/skillmd. It costs 91 tokens per session (744 once invoked), scanned A, original, MIT.

A set of engineering standards for Python services and AI applications. It covers typed Python code, FastAPI web services, data validation, logging, configuration, language-model calls, document processing, and retrieval-based AI systems.

In plain words
What is it for?
Use it when writing, reviewing, refactoring, or debugging Python APIs, AI agents, retrieval systems, language-model integrations, or data scripts.
Why use it?
It removes uncertainty about common production decisions such as input validation, error handling, retries, secrets, and blocking work in web requests.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the code-security-review-pipeline plugin — 15 skills shipped together

Good fit Use it when writing, reviewing, refactoring, or debugging Python APIs, AI agents, retrieval systems, language-model integrations, or data scripts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/skillmds/skillmd/ai-engineering-standards
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add skillmds/skillmd --skill ai-engineering-standards
Clone the repo
git clone --depth 1 https://github.com/skillmds/skillmd

Made for: Claude Code.

Or install code-security-review-pipeline, the plugin that ships this one along with the rest of its 15 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for production-python-ai

README.md
[![agentmods](https://agentmods.dev/badge/skills/skillmds/skillmd/ai-engineering-standards/github.svg)](https://agentmods.dev/skills/skillmds/skillmd/ai-engineering-standards)
Your own site
<a href="https://agentmods.dev/skills/skillmds/skillmd/ai-engineering-standards"><img src="https://agentmods.dev/badge/skills/skillmds/skillmd/ai-engineering-standards/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for production-python-ai

Your own site · 80×15
<a href="https://agentmods.dev/skills/skillmds/skillmd/ai-engineering-standards"><img src="https://agentmods.dev/badge/skills/skillmds/skillmd/ai-engineering-standards.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 744 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00091 $0.00744
Opus 5.5 $0.00036 $0.00298
Sonnet 5 $0.00018 $0.00149
Haiku 4.5 $0.00009 $0.00074

Measured 4d ago against content hash f40d7ebabea8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-23, from the pricing page.

Security

Grade A, and why

production-python-ai scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/code-security-review-pipeline/skills/ai-engineering-standards/SKILL.md · 38 lines

How it starts

The opening of the file, as written. The whole thing — 38 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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.

Read the full file on GitHub · 38 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 38 lines · 91 tokens per session scan A f40d7ebabea8

Subscribe to this mod's changes

production-python-ai is a skill published in the GitHub repository skillmds/skillmd (1 stars, last pushed yesterday), licensed MIT. It adds 91 tokens to every session and 744 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-19.