start-core/middleware

Coordinate server requests and TanStack Start server functions with modular middleware.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/redacharf/fin-punk --skill start-core-middleware-redacharf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: start-core/middleware
Source: https://github.com/redacharf/fin-punk/tree/main/.agents/skills/start-core/middleware
Command: npx skills add https://github.com/redacharf/fin-punk --skill start-core-middleware-redacharf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Coordinate server requests and server function calls with modular middleware that can be composed and reused across an app.

Core Features & Use Cases

  • Two types of middleware: Request Middleware (applies to all requests) and Server Function Middleware (applies to TanStack Start server functions).
  • Attach to server functions and routes to enforce input validation, pass contextual data, and control data flow.
  • Use cases include securing endpoints, enriching context, and orchestrating cross-cutting concerns in SSR and API layers.
  • Example: Define a global request middleware and function middleware that injects user context into every server function call.

Quick Start

Add a middleware chain to your TanStack Start app to enforce validation and enrich context for server functions.

Frequently Asked Questions about start-core/middleware

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

FAQPage Schema
How do I add middleware to TanStack Start server functions?

To add middleware to TanStack Start server functions, attach a middleware chain to your routes or functions to enforce input validation, inject context, and control data flow. Server function middleware specifically targets and orchestrates these calls.

What is the difference between request middleware and server function middleware?

Request middleware applies to all incoming server requests, while server function middleware applies specifically to TanStack Start server function calls. Both types can be composed together to secure endpoints and enrich context across your app.

Can I use middleware to validate inputs and inject user context in SSR routes?

Yes, you can apply middleware to SSR routes and API endpoints to enforce input validation and inject contextual data. A global middleware setup can securely pass user context into every server function call.

What's the best way to orchestrate cross-cutting concerns in server routes and API endpoints?

The best way to orchestrate cross-cutting concerns is using modular, typed middleware factories. This approach allows you to compose and reuse middleware across SSR routes, API endpoints, and server functions for predictable behavior.

Do I need global configuration to ensure predictable behavior for server requests?

Yes, utilizing global configuration alongside typed middleware factories ensures predictable and secure behavior across your application. It coordinates all server requests and server function calls uniformly.