Command Palette

Search for a command to run...

Назад к скиллам
скилл № 86060

agentic-patterns

Patterns from "Agentic Design Patterns" (Gulli & Sauco, 2025) applied to async Python API development, MongoDB/Beanie data modeling, and production-ready…

БесплатноБез исполняемых скриптов
TheLobbiот TheLobbi★ 22 звезды на GitHub

Установить agentic-patterns в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Agentic Design Patterns — FastAPI Backend

Patterns from "Agentic Design Patterns" (Gulli & Sauco, 2025) applied to async Python API development, MongoDB/Beanie data modeling, and production-ready backend services

Applied Patterns

Prompt Chaining

Relevance: HTTP request processing in FastAPI is inherently a chain — middleware → auth → validation → business logic → response serialization — each step consuming the output of the previous. Current Implementation: FastAPI's dependency injection system implements implicit chaining through Depends() chains; the endpoint command scaffolds these chains. Enhancement: Model the request pipeline explicitly as a prompt chain where each stage has a declared input schema, output schema, and failure mode. Document the chain topology in endpoint scaffolding so that each dependency layer knows what structured context it receives and produces. This makes the chain auditable, testable at each link, and easier to extend without breaking downstream stages.

Tool Use

Relevance: In an agentic context, every API endpoint is a tool — a callable with a name, description, input schema, and output schema. FastAPI's OpenAPI spec is already a tool manifest. Current Implementation: The endpoint command generates FastAPI routes with Pydantic models; the OpenAPI spec is auto-generated. Enhancement: Treat the generated OpenAPI spec as a first-class tool registry. Add an /agent/tools meta-endpoint that returns a structured tool manifest compatible with LLM function-calling formats (OpenAI, Anthropic). Each endpoint decorated with @tool_enabled is automatically registered. This allows the backend to serve as an MCP-compatible tool server without additional infrastructure.

Exception Handling

Relevance: Async Python introduces subtle error propagation challenges — exceptions in background tasks, timeout cascades, and partial failures in concurrent operations require structured handling beyond standard try/except. Current Implementation: The task command scaffolds background tasks with ARQ/Celery; error handling is left to the developer. Enhancement: Implement a layered exception taxonomy: ValidationError (400), AuthorizationError (403), ResourceNotFoundError (404), ExternalServiceError (502), TaskTimeoutError (504). Each exception type has a structured handler that: logs with trace context, returns a machine-readable error body (RFC 7807 Problem Details), triggers appropriate retry or dead-letter logic for async tasks, and emits an observability event. The endpoint scaffolder includes exception handler registration by default.

Guardrails

Relevance: Production APIs must enforce input validity, authentication, rate limiting, and content safety before business logic executes — these are non-negotiable constraints, not optional middleware. Current Implementation: Keycloak auth is scaffolded via the scaffold command; input validation uses Pydantic models. Enhancement: Formalize guardrails as a declarative middleware stack applied at the router level: (1) Authentication — Keycloak JWT validation with role extraction, (2) Authorization — RBAC/ABAC policy evaluation, (3) Input validation — Pydantic with custom validators and business rules, (4) Rate limiting — Redis-backed sliding window per user/IP/endpoint, (5) Content safety — field-level sanitization for user-supplied strings. The endpoint scaffolder prompts for which guardrails to enable and generates the appropriate middleware chain.

Memory

Relevance: Stateless HTTP APIs need external memory for session state, user preferences, conversation context (for AI-adjacent endpoints), and cache of expensive computations. Current Implementation: Redis integration is included in the plugin stack; the scaffold command can generate caching middleware. Enhancement: Implement a three-tier memory system: (1) Request-scoped memory — FastAPI request state for within-request context sharing, (2) Session memory — Redis TTL keys for user session data, structured as typed Pydantic models, (3) Persistent memory — MongoDB documents for long-lived state. The model command generates data models with explicit memory-tier annotations. Provide a MemoryClient abstraction that transparently routes reads/writes to the correct tier based on declared scope.

RAG (Retrieval-Augmented Generation)

Relevance: Backend APIs increasingly need to retrieve and surface relevant knowledge — product documentation, policy text, historical records — as part of request processing for AI-augmented features. Current Implementation: MongoDB/Beanie is the data layer; no vector search or retrieval scaffolding exists. Enhancement: Add a retrieval module scaffold (via endpoint --type retrieval) that wires: MongoDB Atlas Vector Search (or a configurable vector store), a chunking/embedding pipeline for document ingestion, a retrieval endpoint that accepts a qu

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл agentic-patterns?

Patterns from "Agentic Design Patterns" (Gulli & Sauco, 2025) applied to async Python API development, MongoDB/Beanie data modeling, and production-ready backend services

Как установить скилл agentic-patterns?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл agentic-patterns запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить agentic-patterns с