frontend-requirements
生成前端串接需求書(FastAPI → frontend.md)
目標
根據「目前既有的 FastAPI 後端 API 服務程式碼」,撰寫一份給前端工程師使用的串接需求與流程說明文件,輸出檔名固定為 frontend.md,並以 Markdown 撰寫、結構清楚、可直接交付前端實作。
核心原則(非常重要)
- 以「前端要怎麼串、怎麼做 UI/UX、怎麼處理錯誤與狀態」為主,而不是後端實作細節。
- 必須從程式碼中整理出事實:路由、request/response schema、認證方式、狀態值、錯誤碼。
- 不要憑空編造 API。若程式碼找不到,就在文件中標注「未在目前程式碼中發現」並給出前端建議的問項(最多 3 個關鍵問題)。
- 文件讀者假設:從未看過後端程式碼的前端工程師。
工作流程(你必須照做)
- 先掃描專案中的 FastAPI 入口與路由定義:
- 常見位置:
main.py、app/main.py、app/api/*、routers/*、api.py - FastAPI 註冊方式:
include_router()、APIRouter()、prefix/tags
- 常見位置:
- 收集所有 endpoint 與其方法、路徑參數、query/body、回傳格式:
- 以 Pydantic model / response_model / typing 註記為準
- 解析認證/授權機制(若有):
- JWT / OAuth2PasswordBearer / API key / session cookie
More from gemini960114/skills
uv-environment
Use when the user asks about uv, Python virtual environments, pyproject.toml, dependency management, or shows uv/venv output. Assume uv is already installed and prefer using the existing setup instead of reinstalling.
12dockerize-project
Use this skill when the user wants to dockerize the current project and generate a Dockerfile and docker-compose.yml based on the existing codebase. This skill inspects the repository structure, avoids unsafe assumptions, and produces a minimal, runnable Docker setup for local development.
12fastapi-templates
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.
11frontend-development
Generic frontend development skill for HTML, CSS, JavaScript, and modern frontend frameworks. Covers code patterns, best practices, debugging, and common patterns for building responsive web applications.
10uv-python-manager
Use this skill when the user wants to manage Python projects, virtual environments, or dependencies using uv, including creating venvs, installing packages, syncing environments, or running Python tools.
8backend-development
Generic backend development skill for building REST APIs, working with databases, authentication, and server-side logic. Covers patterns, best practices, and common patterns for backend applications.
6