Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
1. treat `stream_step` and `stream_loop` as user code. they are convenience functions that could be reimplemented by the user, they *must* stay clean.
1. use `uv` to manage the project; `uv add` and `uv remove` to manage dependencies, `uv run` to run
2. after making changes run lint and typecheck: `uv run ruff check --fix src tests` and `uv run mypy src tests`
3. import by module (except `typing`) to improve readability via namespacing
4. treat `stream_step` and `stream_loop` as user code. they are convenience functions that could be reimplemented by the user, they *must* stay clean.
5 changes: 2 additions & 3 deletions skills/vercel-python-services/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ Build multi-service projects using Vercel's `experimentalServices` API with a Py
## Setup

1. Create the project files (see references for the minimal working example). Choose frameworks for each service according to user's requests.
2. Ensure backend routes match the prefix specified in `vercel.json` (e.g. for `"routePrefix": "/api"` it is `@app.get("/api/health")`, not `@app.get("/health")`)
2. Define backend routes without the `/api` prefix (e.g. `@app.get("/health")`). Vercel strips the prefix before forwarding to the backend.
3. Validate services in `vercel.json` have `entrypoint` and `routePrefix`, but no extra unknown fields, otherwise that will cause preview to crash

Only `vercel.json` lives at the root. Each service manages its own dependencies independently.

## Usage

- Use `vercel dev -L` from the project root to run all services as one application. The CLI will handle each individual service's routing and dev server and put the application on port 3000.
- Backend routes MUST include the full path with `/api` prefix (e.g. `@app.get("/api/health")`).
- Frontend calls `/api/...` — no localhost URLs, no proxy needed.
- Frontend calls `/api/...` — Vercel routes these to the backend, which sees only the path after the prefix. No localhost URLs, no proxy needed.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
)


@app.get("/api/health")
@app.get("/health")
async def health() -> dict[str, str]:
return {"status": "ok"}