CLAUDE.md@by-framework/fastapi claudeA
CLAUDE.md@by-framework/fastapi is agent-read markdown (claude) from overseastelegramaliterateperson865/awesome-claude-md.
Indexed from public GitHub and served as immutable, content-addressed versions. Install it pinned to an exact SHA-256 with the mdr CLI, and every file is verified against the hash recorded here before it reaches your agent. The deterministic audit below grades the latest version, and the same file always earns the same grade.
What the file says
# CLAUDE.md - FastAPI 项目规范
## 构建与运行
- 依赖管理:`uv` 或 `poetry`,锁文件必须提交到仓库
- 启动开发服务器:`uvicorn app.main:app --reload --port 8000`
- 运行测试:`pytest -xvs`,Lint 检查:`ruff check . && ruff format --check .`
- Python 版本:3.11+,充分利用类型标注
## 项目结构
- `app/main.py` - 入口,注册 router 和 middleware
- `app/routers/` - 按业务域拆分路由(如 `users.py`、`orders.py`)
- `app/models/` - SQLAlchemy ORM 模型,`app/schemas/` - Pydantic v2 模型
- `app/services/` - 业务逻辑层,`app/dependencies.py` - 公共依赖注入
- `alembic/` - 数据库迁移脚本
## 异步模式
- 路由函数默认 `async def`,仅调用同步阻塞库时用 `def`
- CPU 密集型任务用 `run_in_executor` 推到线程池,不要阻塞事件循环
- 数据库用 `sqlalchemy[asyncio]` + `asyncpg`,禁止 async 中调同步阻塞 I/O
- HTTP 客户端用 `httpx.AsyncClient`,在 lifespan 中创建共享实例:
```python
async def lifespan(app: FastAPI):
app.state.http = httpx.AsyncClient()
yield
await app.state.http.aclose()
```
- 后台任务用 `BackgroundTasks` 或 Celery/ARQ,禁止在请求中做耗时操作
## Pydantic v2 规范
- 请求体和响应体必须定义 Pydantic model,禁止裸 `dict` 返回
- 请求/响应模型分开定义:`UserCreate`(入参)、`UserResponse`(出参)、`UserInDB`(内部)
- 使用 `ConfigDict(from_attributes=True)` 替代旧版 `orm_mode`,入参 model 启用 `ConfigDict(strict=True)`
- 敏感字段(password)只出现在入参 model,响应 model 用 `model_fields` 显式列出
…Read the whole file at its exact version.
How to install
mdr add overseastelegramaliterateperson865/awesome-claude-md/by-framework/fastapi/CLAUDE.md@git:20260320.9b01acamdr add overseastelegramaliterateperson865/awesome-claude-md/by-framework/fastapi/CLAUDE.md@sha256:e256728fda4827e1Pin to a label to follow the author's releases, or to a sha256 to freeze the exact bytes forever. Either way the resolved hash is written to mdr.lock, and mdr install reproduces it on any machine.
[](https://markdownregistry.com/a/art_z5v5xypzokxl3ijh)
1 badge views in 30 days
Versions
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20260320.9b01aca latest | 2026-03-20 | 9b01aca | 3,481 B | A | view · diff |
| git:20260320.fcf2609 | 2026-03-20 | fcf2609 | 2,094 B | A | view |
Audit of the latest version
- pass: Size between 200 bytes and 200 KB (3481 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
overseastelegramaliterateperson865/awesome-claude-md · 3 stars · license MIT · pushed 2026-09-23 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_z5v5xypzokxl3ijh GET https://markdownregistry.com/api/v1/resolve?ref=overseastelegramaliterateperson865/awesome-claude-md/by-framework/fastapi/CLAUDE.md GET https://markdownregistry.com/api/v1/blob/e256728fda4827e12524eaed2677fc0f93a6f29840f0c9a7f9987991f1b817bf
Your agent does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
More from overseastelegramaliterateperson865/awesome-claude-md
Every file in overseastelegramaliterateperson865/awesome-claude-md