backend-dev-guidelines

Codify backend development patterns and pre-flight checklists for the Cheerful codebase.

Updated Nov 25, 2025
One-click install
npx skills add https://github.com/nuts-and-bolts-ai/claude-setup --skill backend-dev-guidelines-nuts-and-bolts-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-dev-guidelines
Source: https://github.com/nuts-and-bolts-ai/claude-setup/tree/main/.claude/skills/backend-dev-guidelines
Command: npx skills add https://github.com/nuts-and-bolts-ai/claude-setup --skill backend-dev-guidelines-nuts-and-bolts-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Comprehensive backend development guidance for Cheerful. This Skill consolidates critical gotchas, pre-flight checklists, and quick fixes for backend work, covering Temporal.io workflows, SQLAlchemy 2.0 Core patterns, Gmail/Sheets API integrations, FastAPI, Supabase, and Fly.io deployment. It’s designed to help you debug issues, implement features, write robust queries, build solid API endpoints, and manage durable deployments with confidence.

Core Features & Use Cases

  • Comprehensive Gotchas: Practical warnings and patterns to avoid common backend pitfalls.
  • Technology Coverage: Temporal workflows, SQLAlchemy 2.0 Core, Gmail API, Google Sheets, FastAPI, Supabase, and Fly.io deployment.
  • Best Practices: Pre-flight checklists, idempotent operations, and deployment guidance to reduce surprises in production.

Quick Start

Consult this guide while building Cheerful's backend or debugging backend issues, e.g., when designing a new FastAPI route or configuring deployment to Fly.io.

Frequently Asked Questions about backend-dev-guidelines

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

FAQPage Schema
How do I structure FastAPI endpoints with safe database sessions and idempotent operations?

FastAPI endpoints should use short-lived SQLAlchemy 2.0 Core sessions that close after each request, paired with ON CONFLICT clauses to ensure idempotent writes. This prevents session leaks and guarantees safe retries without duplicate data.

What are the key gotchas when building Temporal workflows with SQLAlchemy?

Temporal workflows must be deterministic: avoid non-deterministic calls, use Pydantic DTOs for all I/O, and keep database operations outside the workflow logic. SQLAlchemy 2.0 Core queries must complete within activity timeouts to prevent workflow hangs.

How do I integrate Gmail and Google Sheets APIs safely into backend services?

Gmail and Sheets API integrations require credential management, retry logic for rate limits, and idempotent operations to handle partial failures. Wrap API calls in try-catch blocks and log failures for debugging without exposing credentials.

What should I check before deploying a FastAPI service to Fly.io?

Pre-flight deployment checks include verifying environment variables, confirming database connection pooling limits match Fly.io constraints, testing Temporal workflow connectivity, and validating API authentication. This reduces production surprises and rollback risk.

Why do pytest tests fail when using SQLAlchemy 2.0 Core with Temporal workflows?

Tests fail when workflows contain non-deterministic code, database sessions persist across test runs, or Pydantic DTOs omit required fields for Temporal serialization. Isolate workflow logic, reset session state between tests, and validate DTO schemas.

Can I use Supabase as the database backend for Temporal activity logging and state storage?

Yes. Supabase PostgreSQL works with SQLAlchemy 2.0 Core and supports the ON CONFLICT syntax needed for idempotent writes. Configure connection pooling carefully and use short-lived sessions to avoid hitting Supabase connection limits.