用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/agusmdev/burntop --skill fastapi-project-setup命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
OpenProse is a programming language for AI sessions. An AI session is a Turing-complete computer; OpenProse structures English into unambiguous control flow. More pattern than framework—it ships as a skill with no dependencies. Activate when: running .prose files, mentioning OpenProse, or orchestrating multi-agent workflows from a script. Use this skill if you ever want to kick off more than one subagent at a time, or orchestrate anything interesting between more than one subagent. Write a .prose file and save it in the .claude-plugin/ directory. Then embody the OpenProse VM, as described in prose.md, and execute it.
Configure Alembic for async SQLAlchemy migrations with PostgreSQL
Create FastAPI application factory with lifespan, middleware, pagination, and router configuration
正在显示 SKILL.md
基于 SOC 职业分类
| name | fastapi-project-setup |
| description | Initialize FastAPI project with uv, pyproject.toml, ruff configuration, and environment files |
This skill covers initializing a new FastAPI project with uv package manager, proper project configuration, and tooling setup.
uv init
[project]
name = "your-project-name"
version = "0.1.0"
description = "FastAPI backend application"
requires-python = ">=3.12"
dependencies = [
"fastapi>=0.115.0",
"uvicorn[standard]>=0.32.0",
"pydantic>=2.10.0",
"pydantic-settings>=2.7.0",
"sqlalchemy[asyncio]>=2.0.36",
"asyncpg>=0.30.0",
"alembic>=1.14.0",
"fastapi-pagination>=0.12.33",
"fastapi-filter>=2.0.0",
"python-json-logger>=3.2.1",
]
[project.optional-dependencies]
dev = [
"ruff>=0.8.0",
"pytest>=8.3.0",
"pytest-asyncio>=0.25.0",
"httpx>=0.28.0",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/app"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
testpaths = ["tests"]
pythonpath = ["src"]
3.12
# Ruff configuration for FastAPI project
# Target Python 3.12
target-version = "py312"
# Line length
line-length = 100
# Exclude directories
exclude = [
".git",
".ruff_cache",
".venv",
"venv",
"__pycache__",
"alembic/versions",
]
[lint]
# Enable rules
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"PTH", # flake8-use-pathlib
"ERA", # eradicate (commented-out code)
"PL", # Pylint
"RUF", # Ruff-specific rules
]
# Ignore specific rules
ignore = [
"E501", # line too long (handled by formatter)
,
,
,
]
= []
= []
= []
= []
= []
=
=
=
=
=
=
# Application
APP_NAME=FastAPI App
DEBUG=false
# Database
DATABASE_URL=postgresql+asyncpg://user:password@localhost:5432/dbname
DATABASE_ECHO=false
DATABASE_POOL_SIZE=5
DATABASE_MAX_OVERFLOW=10
# Logging
LOG_LEVEL=INFO
LOG_JSON_FORMAT=true
Create src/app/config.py:
from pydantic import PostgresDsn
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
"""Application settings loaded from environment variables."""
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8",
extra="ignore",
case_sensitive=False,
)
# Application
app_name: str = "FastAPI App"
debug: bool = False
# Database
database_url: PostgresDsn
database_echo: bool = False
database_pool_size: int = 5
database_max_overflow: int = 10
# Logging
log_level: str = "INFO"
log_json_format: bool = True
settings = Settings()
mkdir -p src/app/{core,common,middleware,api/v1}
mkdir -p tests/api/v1
mkdir -p alembic/versions
touch src/app/__init__.py
touch src/app/core/__init__.py
touch src/app/common/__init__.py
touch src/app/middleware/__init__.py
touch src/app/api/__init__.py
touch src/app/api/v1/__init__.py
touch tests/__init__.py
touch tests/api/__init__.py
touch tests/api/v1/__init__.py
touch alembic/versions/.gitkeep
uv sync
uv sync --dev
After setup, verify:
uv run python -c "import fastapi; print(fastapi.__version__)" worksuv run ruff check src/ runs without errors.env file is created from .env.example with actual valuesuv run to execute commands within the virtual environment.env file, only .env.exampleuv lock --upgrade