middleware-design

Installation
SKILL.md

middleware-design Skill

Goal

This skill guides the creation of the request processing pipeline ("The Onion Architecture").

Steps

1. The Standard Pipeline (Order Matters)

  1. Request ID: Generate trace_id immediately. (Before logs).
  2. CORS: Allow/Block origins. (Before processing).
  3. Body Parser: JSON/Form parsing. (Limit size to prevent DoS).
  4. Rate Limiter: Token Bucket algorithm. (Stop abuse cheaply).
  5. Authentication: Verify JWT/Session. (Who is it?).
  6. Authorization: Check Roles/Scopes. (Can they do it?).
  7. Validation: Zod/Pydantic schema check. (Is input valid?).
  8. Controller: Business Logic.
  9. Error Handler: Catch exceptions, format JSON, scrub sensitive data.
Installs
1
GitHub Stars
23
First Seen
Oct 14, 2026