What problem does it solve?
This Skill captures production-proven Express 5 patterns from the peek-stash-browser backend so developers can implement robust TypeScript route handlers, streaming proxies, authentication middleware, and database access without reimplementing core behavior or introducing subtle bugs.
Core Features & Use Cases
- Async-safe handlers & error middleware: Uses Express 5's automatic promise rejection handling and provides AppError/NotFoundError shapes for consistent JSON error responses.
- HLS proxying & playlist rewriting: Patterns for fetching HLS playlists, stripping apikeys, rewriting segment URLs to route through Peek, and streaming with AbortController and backpressure-aware pipelines.
- Concurrency-limited HTTP proxy & connection pooling: Demonstrates keep-alive agents, queue-based concurrency slots, client-disconnect cleanup, and upstream timeout handling to protect Stash instances.
- Multi-instance routing & Prisma integration: Shows resolving stashInstanceId per entity, safely retrieving instance credentials, and performing Prisma/SQLite queries for entity lookup.
- JWT cookie auth & refresh semantics: Covers HTTP-only token cookies, silent refresh policy, dual cookie/Bearer token support, reverse-proxy header auth, and role-based middleware.
- Use Case: Implement a scene streaming endpoint that proxies Stash HLS, rewrites playlists to remove API keys, enforces authentication and rate/connection limits, and forwards appropriate cache headers.
Quick Start
Generate Express 5 TypeScript route and middleware code to proxy HLS streams with JWT cookie authentication and Prisma-backed multi-instance routing for the peek-stash-browser backend.