backend-standards
Hono/Bun patterns and backend best practices for this project. Use when implementing API endpoints, WebSocket handlers, services, or server-side logic in packages/server.
When & Why to Use This Skill
This Claude skill provides a comprehensive framework for backend development using Hono and Bun, focusing on architectural best practices, type safety, and efficient resource management. It streamlines the implementation of API endpoints and WebSocket handlers by enforcing standardized patterns, structured logging with Pino, and strict validation using Valibot.
Use Cases
- Architecting and implementing RESTful API endpoints within a Bun/Hono environment while ensuring strict type safety and boundary validation.
- Designing real-time communication systems using standardized dual WebSocket architectures and message broadcasting protocols.
- Enforcing backend consistency through structured logging and automated resource cleanup for PTY processes and active connections.
| name | backend-standards |
|---|---|
| description | Hono/Bun patterns and backend best practices for this project. Use when implementing API endpoints, WebSocket handlers, services, or server-side logic in packages/server. |
Backend Standards
Key Principles
- Server is the source of truth - Backend manages all session/worker state
- Structured logging - Use Pino with context objects
- Resource cleanup - Always clean up PTY processes and connections
- Type safety - Define types in shared package, validate at boundaries
Tech Stack
- Bun, Hono, bun-pty, Pino, Valibot
Detailed Documentation
- backend-standards.md - Directory structure, Hono, logging, services, testing, security
- websocket-patterns.md - Dual WebSocket architecture, message protocol, broadcasting