# OpenAPI Sync

Use this command when you want the agent to refresh the HTTP and WebSocket OpenAPI specs, update the README references, and record the documentation change in `CHANGELOG.md`.

## What it does

1. Scans `src/api/**/*.rs`, `src/wss/*.rs`, and `src/main.rs` for registered handlers and routes.
2. Adds or corrects HTTP paths in `openapi.yaml` while reusing the shared response envelope.
3. Updates `openapi-wss.yaml` so its `paths` and `components` mirror `GatewayWsRequest`/`GatewayWsResponse` and the `/wss/info` contract.
4. Ensures `README.md` and any other documentation mention the refreshed specs.
5. Prepends a changelog entry at the current version describing the documentation sync.
6. Runs `cargo build` and `cargo test --test openapi` to verify the embedded specs and the server build.

## When to run

- After adding, removing, or changing an HTTP or WSS handler.
- Before publishing a release so the distributed specs match the code.
- If README references explain outdated paths or versions.
