fastapi-sqlmodel-arq-backend

构建或改造基于 FastAPI + SQLModel(异步 SQLAlchemy) + Arq + Redis 的后端系统。用于新增/重构 RESTful API、实现异步数据库访问、编写服务层与依赖注入、配置 OAuth2 + JWT(Argon2) 认证、生成 Alembic 迁移建议、统一 loguru 日志规范等后端任务;不用于纯前端页面样式开发或仅做 OpenAPI 客户端同步的任务。

16 stars

Best use case

fastapi-sqlmodel-arq-backend is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

构建或改造基于 FastAPI + SQLModel(异步 SQLAlchemy) + Arq + Redis 的后端系统。用于新增/重构 RESTful API、实现异步数据库访问、编写服务层与依赖注入、配置 OAuth2 + JWT(Argon2) 认证、生成 Alembic 迁移建议、统一 loguru 日志规范等后端任务;不用于纯前端页面样式开发或仅做 OpenAPI 客户端同步的任务。

Teams using fastapi-sqlmodel-arq-backend should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/fastapi-sqlmodel-arq-backend/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/development/fastapi-sqlmodel-arq-backend/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/fastapi-sqlmodel-arq-backend/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How fastapi-sqlmodel-arq-backend Compares

Feature / Agentfastapi-sqlmodel-arq-backendStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

构建或改造基于 FastAPI + SQLModel(异步 SQLAlchemy) + Arq + Redis 的后端系统。用于新增/重构 RESTful API、实现异步数据库访问、编写服务层与依赖注入、配置 OAuth2 + JWT(Argon2) 认证、生成 Alembic 迁移建议、统一 loguru 日志规范等后端任务;不用于纯前端页面样式开发或仅做 OpenAPI 客户端同步的任务。

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# FastAPI SQLModel Arq Backend

## Initialization

后端引擎已预热。SQLModel 准备就绪,Arq 队列已连接。请输入你的业务需求。

## Execution Rules

- 使用 `uv` 管理依赖、运行命令与脚本。
- 仅使用异步数据库访问模式(`AsyncEngine`、`AsyncSession`、异步查询/事务)。
- 使用 `pydantic-settings` 的 `Settings` 类从环境变量读取配置。
- 使用 `loguru` 记录日志,禁止使用 `print`。
- 默认按分层结构输出:`models`、`schemas`、`dependencies`、`services`、`api/routes`、`workers`。

## Workflow

1. 定义实体模型与输入输出 Schema。
2. 定义数据库连接与 FastAPI 依赖注入。
3. 编写服务层并保持路由层轻量。
4. 配置 Arq Worker 与任务入队逻辑。
5. 补充认证授权(OAuth2 Password Flow + JWT + Argon2)。
6. 给出 Alembic 迁移提示与 `uv` 命令。

## Implementation Defaults

- API 设计遵循 RESTful 语义、幂等性与正确状态码。
- 为 SQLModel 模型声明清晰类型、索引、唯一约束与关系。
- 路由仅负责参数校验和响应封装,业务规则放入 `services`。
- 所有耗时操作通过 Arq 后台任务处理并返回可追踪任务信息。
- 认证模块包含:密码哈希、token 签发、token 校验、当前用户依赖。

## Output Contract

- 输出带文件路径的完整 Python 代码块。
- 必须附上 `alembic` 迁移提示或 `uv` 命令。
- 需要多文件时按“先核心配置,再模型与服务,再路由与 worker”顺序给出。

Related Skills

fastapi-workflow

16
from diegosouzapw/awesome-omni-skill

Docs-first development workflow for Python + FastAPI + Pydantic v2 projects with async APIs, dependency injection, and SQLAlchemy. Fetches current documentation via MCP before any implementation. Use when building or modifying FastAPI backends, API endpoints, Pydantic models, or database operations. Trigger phrases - "fastapi", "python api", "backend api", "pydantic", "sqlalchemy", "async api", "dependency injection". NOT for frontend work (use frontend-app/frontend-lp) or non-Python backends.

fastapi-templates

16
from diegosouzapw/awesome-omni-skill

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

fastapi-python-expert

16
from diegosouzapw/awesome-omni-skill

Use this agent when you need to design, implement, or optimize FastAPI backend applications. This includes API endpoint creation, database integration, authentication/authorization implementation, cloud deployment strategies, business logic architecture, performance optimization, and following FastAPI best practices.

fastapi-project

16
from diegosouzapw/awesome-omni-skill

Scaffold and evolve FastAPI projects with uv-based tooling, structured settings, and production-ready observability, resilience, availability, and security patterns aligned with python.instructions.md.

fastapi-pro

16
from diegosouzapw/awesome-omni-skill

Build high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2. Master microservices, WebSockets, and modern Python async patterns. Use PROACTIVELY for FastAPI development, async optimization, or API architecture.

fastapi-patterns

16
from diegosouzapw/awesome-omni-skill

FastAPI patterns with Pydantic, async operations, and dependency injection

fastapi

16
from diegosouzapw/awesome-omni-skill

FastAPI Python framework. Covers REST APIs, validation, dependencies, security. Keywords: Pydantic, async, OAuth2, JWT.

fastapi-expert

16
from diegosouzapw/awesome-omni-skill

Use when building high-performance async Python APIs with FastAPI and Pydantic V2. Invoke for async SQLAlchemy, JWT authentication, WebSockets, OpenAPI documentation.

fastapi-development

16
from diegosouzapw/awesome-omni-skill

Modern Python API development with FastAPI covering async patterns, Pydantic validation, dependency injection, and production deployment

fastapi-best-practices

16
from diegosouzapw/awesome-omni-skill

FastAPI best practices e convenções baseadas em produção real. Aplicar em todos os projetos FastAPI.

faion-backend-systems

16
from diegosouzapw/awesome-omni-skill

Systems backends: Go, Rust, databases, caching.

faion-backend-enterprise

16
from diegosouzapw/awesome-omni-skill

Enterprise backends: Java, C#, PHP, Ruby.