serverpod/relic/relic-middleware
Claude Code and agent skill by serverpod/relic
- community
Checking that the SKILL.md file is still in the repository.
Create and apply middleware for auth, CORS, logging, and other cross-cutting concerns. Use context properties for type-safe request-scoped data. Use when adding middleware, request/response transformations, or passing data between middleware and handlers.
Install
npx vskill@latest install serverpod/relic/relic-middlewareSKILL.md
The same SKILL.md was published earlier as serverpod/relic/relic-middleware.
Relic Middleware
A Middleware wraps a handler with additional logic. It can inspect/modify requests, transform responses, short-circuit with an early response, or handle errors.
Basic pattern
Applying middleware
Use router.use(path, middleware). Middleware only runs on requests that match a registered route -- unmatched requests (404s) go directly to the fallback.
Execution order
Path hierarchy first, then registration order within the same path scope:
For GET /api/foo, execution order is: middlewareA → middlewareB → middlewareC → fooHandler (and response flows back in reverse).
Example: Auth middleware
Example: CORS middleware
Example: Error handling
Example: Add response header
Context properties
ContextProperty<T> provides type-safe, request-scoped storage. Values exist only for the duration of the request and do not leak between requests.
Extension pattern for clean access
Complete example
Built-in context properties
Relic sets these automatically during routing:
request.pathParameters-- path params from matched routerequest.queryParameters-- typed query param accessorsrequest.router-- theRelicRouterthat routed the requestrequest.matchedPath/request.remainingPath-- consumed and remaining path portions
Pipeline (legacy)
Pipeline is a legacy composition pattern from Shelf. Prefer router.use() for new code. Pipeline runs middleware on all requests including 404s, while router.use() only runs on matched routes.
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-middleware/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-middleware)