docs: update AGENTS.md with new guidelines

- Add ui-ux-pro-max skill reference
- Add keyboard overlay behavior rules for Flutter
- Update testing strategy to prioritize high-regression flows
- Add copy priority rules for auth and form pages
- Update minimal interface copy guidelines
This commit is contained in:
qzl
2026-03-19 18:43:23 +08:00
parent 9ddd7a0147
commit 524b91f454
3 changed files with 35 additions and 2 deletions
+14
View File
@@ -164,6 +164,20 @@ Use `schemas / repository / service` pattern:
- `service.py` — authorization + business logic + transaction boundary (must commit/rollback)
- `dependencies.py` — DI (`get_db`, `get_current_user`)
### Schema-First and Strong Typing (Mandatory)
**Data model constraints are the first priority. Define schemas before implementation.**
- Any backend feature that introduces or changes data structures MUST define/update strong-typed schemas first.
- All request/response/domain/runtime contracts MUST use explicit Pydantic models or typed dataclasses.
- Prohibit weak typing in data contracts: `Any`, untyped `dict`, untyped `list`, `object` placeholders.
- Prohibit using raw `dict[str, object]` as the canonical contract for pipeline/stage/config/domain payloads.
- External library boundaries may accept weakly typed input only at adapter edges; data MUST be converted immediately into local strong-typed schemas before entering service/domain layers.
- New model placement rules:
- Cross-module runtime/domain contracts: `backend/src/schemas/**`
- HTTP request/response contracts: `backend/src/v1/**/schemas.py`
- ORM persistence models: `backend/src/models/**`
### Auth & Data Access
- Backend must verify JWT signature and expiration (not just decode)