serverpod/relic/relic-shelf-migration
Claude Code and agent skill by serverpod/relic
- community
Checking that the SKILL.md file is still in the repository.
Migrate a Dart web server from Shelf to Relic. Side-by-side reference for every API change. Use when converting Shelf code to Relic, replacing shelf/shelf_router/shelf_web_socket imports, or upgrading an existing server.
Install
npx vskill@latest install serverpod/relic/relic-shelf-migrationSKILL.md
The same SKILL.md was published earlier as serverpod/relic/relic-shelf-migration.
Shelf to Relic Migration
Relic replaces shelf, shelf_router, and shelf_web_socket with a single package. Core concepts (handlers, middleware, requests, responses) carry over with improved type safety.
1. Dependencies
Remove Shelf packages, add Relic:
2. Server bootstrap
Shelf:
Relic:
3. Handlers
Shelf:
Relic: Handler returns Result (usually Response). Body requires explicit Body object:
4. Routing
Shelf: Path params use <id> and are passed as handler arguments:
Relic: Path params use :id and are read from request.pathParameters:
5. Responses with Body
Shelf: Accepts plain strings, sets Content-Type via headers map:
Relic: Requires Body object. Content-Length is automatic. MIME type is auto-detected or explicit:
6. Headers
Shelf: String-based, manual parsing:
Relic: Type-safe accessors with automatic parsing:
7. Middleware
Shelf: Pipeline applies middleware to all requests including 404s:
Relic: router.use() scopes middleware by path and only runs on matched routes:
Unmatched requests (404s) bypass middleware and go directly to the fallback handler.
8. Context
Shelf: Dynamic map with manual casting:
Relic: Type-safe ContextProperty with extension methods:
9. WebSockets
Shelf: Requires separate shelf_web_socket package:
Relic: Built-in, return WebSocketUpgrade from any handler:
Complete side-by-side example
Shelf
Relic
Quick reference
| Shelf | Relic | |
|---|---|---|
import 'package:shelf/shelf.dart' | import 'package:relic/relic.dart' | |
shelf_io.serve(handler, host, port) | RelicApp().serve(address: addr, port: port) | |
Response.ok('text') | Response.ok(body: Body.fromString('text')) | |
Router()..get('/path/<id>', (req, id) {...}) | RelicApp()..get('/path/:id', (req) {...}) | |
request.headers['name'] | request.headers.name (typed) | |
Pipeline().addMiddleware(mw).addHandler(h) | app.use('/', mw) | |
request.change(context: {...}) | ContextProperty<T>()[req] = value | |
shelf_web_socket package | Built-in WebSocketUpgrade |
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/relic/skills/relic-shelf-migration/SKILL.md
Popularity
- Repository stars
- 126
- Repository forks
- 14
- 7-day trend score
- 24
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 20 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/serverpod/relic/relic-shelf-migration)