Backend Patterns

Provide patterns for market data APIs with retry, caching, and pydantic schemas.

1|Updated Apr 4, 2026
One-click install
npx skills add https://github.com/lagarcess/argus --skill backend-patterns-lagarcess
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Backend Patterns
Source: https://github.com/lagarcess/argus/tree/main/.agent/skills/backend-patterns
Command: npx skills add https://github.com/lagarcess/argus --skill backend-patterns-lagarcess

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides patterns and conventions to eliminate brittle market data ingestion, inconsistent caching, and schema errors that break trading backtests and backend APIs.

Core Features & Use Cases

  • Reliable Data Retrieval: Guidance for applying retry with backoff to external API calls and logging failures consistently.
  • Safe Caching & Configuration: Recommendations for disk caching during development, centralized pydantic-settings configuration, and fail-fast validation on startup.
  • Schema and Error Discipline: Advice to use pydantic models for API schemas, string enums for serialization, and explicit domain exceptions for clear error handling.
  • Use Case: Adopt these patterns when building market data providers, backtesting pipelines, or FastAPI endpoints to ensure consistent data, clear errors, and maintainable APIs.

Quick Start

Audit the market data ingestion code and produce a prioritized checklist to add retry/backoff, development-only caching, centralized pydantic settings, explicit exceptions, and API route conventions.

Frequently Asked Questions about Backend Patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build resilient market data APIs that handle failures consistently?

Building resilient market data APIs requires applying retry with backoff to external calls and logging failures consistently to ensure reliable ingestion and prevent brittle backend services from breaking.

What's the best way to validate API schemas and settings in a FastAPI backend?

The best way to validate API schemas and settings in a FastAPI backend is using pydantic models for schemas and centralized pydantic-settings for fail-fast validation on startup to maintain data consistency.

How do I implement disk caching for market data during development?

Implement disk caching for market data during development by applying development-only caching patterns to safely store retrieved data, reducing redundant external API calls while iterating on trading engine backends.

Why does my backtesting pipeline fail due to schema errors and inconsistent data?

Backtesting pipelines fail due to schema errors when market data ingestion lacks explicit domain exceptions and pydantic-based schemas. Using string enums for serialization ensures consistent data and clear error handling.

Can I use these backend patterns for existing FastAPI route conventions?

Yes, you can use these backend patterns for existing FastAPI route conventions. The guidance provides FastAPI-compatible conventions to ensure maintainable API endpoints and explicit domain error handling.