* Refresh examples for modern stack; promote AGENTS.md to canonical agent ruleset
Replaces stale code in README.md (python-jose, async_asgi_testclient,
json_encoders, contradictory `Field(ge=18, default=None)`, unused
`model_validator` import) with current equivalents (PyJWT, httpx +
ASGITransport, `@field_serializer`). Adds a top-of-file pointer to
AGENTS.md, a tested-versions line, and inline notes for `Annotated[T,
Depends(...)]` and SQLAlchemy 2.0 async without rewriting every example.
Adds a `dependency_overrides` testing subsection and a BackgroundTasks
vs. task-queue decision table.
Rewrites AGENTS.md as a terse, machine-readable mirror: compatibility
matrix at the top, Do/Don't blocks throughout, an explicit anti-patterns
table covering common AI-agent mistakes, and a quick-reference table.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Sync code-only fixes into README_ZH.md
Mirrors the safe code-only changes from the parent commit into the
Chinese translation:
- python-jose -> PyJWT (import + exception class) in both dependency examples
- async_asgi_testclient -> httpx.AsyncClient + ASGITransport (and fixes
the previously broken example that mixed both imports)
- Pydantic json_encoders -> @field_serializer for the CustomModel example
- Field(ge=18, default=None) -> Field(ge=18) (the constraint and the
default contradict each other)
- Removes unused `model_validator` import
No prose changes. Existing Chinese descriptions still accurately
describe the new code. Sections newly added in README.md
(BackgroundTasks vs task queue, dependency_overrides, the agent banner,
the version line, and the Annotated/SQLAlchemy 2.0 inline notes) are
not ported here because they require translation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Trim docs/changelog voice from refresh
Pass over the refresh to keep the article in best-practices voice,
not docs or changelog:
- Drop the "Note on syntax" blockquote in README's Dependencies
section. It hedged ("Both styles work. New code should prefer
Annotated.") while every example below kept the default-arg form.
Removing the callout returns the section to its original shape;
a full Annotated migration can be its own PR.
- Remove the "json_encoders is deprecated in Pydantic v2" inline
explainer. The code change already says it.
- Rewrite the databases blockquote into a single in-voice line
("For new projects, reach for SQLAlchemy 2.0's async API...")
instead of an apologetic disclaimer.
- Collapse the "Earlier versions of this article recommended
async_asgi_testclient" blockquote into a direct sentence.
- Drop the "this file wins — README is narrative, this is the spec"
precedence line in AGENTS.md. The two files are peers; neither
outranks the other.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix grammar
* Add FastAPI best practices skill
* Add CLAUDE.md with FastAPI best practices
* Add more tips to CLAUDE.md
---------
Co-authored-by: Claude <noreply@anthropic.com>