shelf
Installation
SKILL.md
Shelf Framework Guide
Applies to: Shelf 1.x, Dart 3.x, REST APIs, Microservices, Backend Services Complements:
.claude/skills/dart-guide/SKILL.md
Core Principles
- Middleware Composition: Everything flows through
Pipeline; compose handlers withaddMiddlewareandaddHandler - Handler Simplicity: A
Handleris justFutureOr<Response> Function(Request)-- keep it functional - Immutable Requests: Use
request.change()to pass data downstream viacontext - Cascade Routing: Use
Cascadeto try multiple handlers in sequence until one succeeds - Separation of Concerns: Handlers call services, services call repositories -- no business logic in middleware
Project Structure
myapp/
├── bin/
│ └── server.dart # Entry point (thin: config, serve, shutdown)
Related skills