stacks-middleware

Define, register, and apply middleware to Stacks application routes.

2|Updated Jul 8, 2026
One-click install
npx skills add https://github.com/bughq/bughq --skill stacks-middleware-bughq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stacks-middleware
Source: https://github.com/bughq/bughq/tree/main/.claude/skills/stacks-middleware
Command: npx skills add https://github.com/bughq/bughq --skill stacks-middleware-bughq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill simplifies the management of request interception logic, ensuring that authentication, rate limiting, and environment checks are applied consistently across your application routes.

Core Features & Use Cases

  • Middleware Pipeline: Define custom request handlers that execute before route logic, supporting short-circuiting via errors or responses.
  • Alias Registry: Easily map short aliases to specific middleware classes for clean, readable route definitions.
  • Parameterized Control: Apply dynamic middleware like rate limiting or role-based access control using intuitive colon-syntax parameters.

Quick Start

Use the stacks-middleware skill to generate a new custom middleware file in the app/Middleware directory and register it in the alias registry.

Frequently Asked Questions about stacks-middleware

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I apply authentication and rate limiting to routes in a Stacks application?

To apply authentication and rate limiting in Stacks, define custom request handlers as middleware, register them in the app/Middleware.ts alias registry, and map them to your routes using colon-syntax parameters for dynamic control.

What is the middleware alias registry in Stacks for?

The middleware alias registry in Stacks maps short aliases to specific middleware classes, allowing you to define routes with clean, readable syntax while managing the request interception pipeline consistently across your application.

How do I create custom middleware in Stacks for request interception?

Create custom middleware in Stacks by generating a file in the app/Middleware directory, adhering to the Middleware class structure to define pre-route logic, and registering it in the alias registry to apply environment-specific checks or short-circuit responses.

Can I pass parameters to Stacks middleware for role-based access control?

Yes, you can pass dynamic parameters to Stacks middleware using intuitive colon-syntax, enabling flexible application of parameterized controls like role-based access control or variable rate limiting thresholds directly within your route definitions.

How does request short-circuiting work in the Stacks middleware pipeline?

Request short-circuiting in the Stacks middleware pipeline occurs when a custom handler executes before route logic and terminates the cycle by returning a response or throwing an error, halting further processing for cross-cutting concerns.