What problem does it solve? Building a real-time chat streaming endpoint requires coordinating typed SSE events, real client-disconnect cancellation, mid-stream error recovery, and latency instrumentation, which is easy to get wrong without a defined contract. ## Core Features & Use Cases - Typed SSE Event Contract: Streams exactly four event types (tool_call, token, error, done) from a FastAPI async generator via StreamingResponse, with tool_call cards announced before tool execution. - Real Stop via Disconnect Detection: Detects client disconnects with request.is_disconnected(), cancels the in-flight LLM call to save tokens, and verifies generator cleanup with an asyncio task test. - Mid-Stream Error Recovery: Emits contextual error events with a retryable flag so the UI shows a Reintentar button without clearing conversation history, plus TTFT instrumentation as an OTel span attribute. - Use Case: When adding a chat endpoint to a FastAPI portal with a Nuxt frontend, use this Skill to scaffold the backend event generator, the useChatStream composable with AbortController, and the cancellation cleanup test. ## Quick Start Implement the /api/chat SSE streaming endpoint with typed events, Stop-button cancellation, and the useChatStream client composable.