What problem does it solve?
Adding or changing endpoints on AT Protocol services like the PDS or bsky appview requires knowing the exact conventions of @atproto/xrpc-server — how to wire createServer into Express, register handlers with server.add(), read params and auth, return JSON or streamed responses, and throw protocol-correct errors. This Skill encodes those conventions so route work is done correctly the first time.
Core Features & Use Cases
- Route Registration: Register query, procedure, and subscription handlers via
server.add() with generated lexicon schemas, including auth verifiers, per-route rate limits, and body size limits.
- Response Handling: Return JSON bodies, binary streams, empty responses, and custom headers, with guidance on TypeScript
as const narrowing pitfalls and schema output validation.
- Protocol Errors & Subscriptions: Throw the correct
XRPCError subclass for each HTTP status, and implement WebSocket subscriptions as async generators with abort-signal handling.
- Use Case: When adding a new endpoint like
app.bsky.draft.createDraft to the bsky service, use this Skill to scaffold the handler file under src/api/, wire auth and rate limits, and return a schema-valid response.
Quick Start
Add a new XRPC endpoint to the PDS that resolves a handle to a DID using @atproto/xrpc-server conventions.