Skip to main content
Scaffold a new AI middleware class and its matching test file under a module’s ai/middlewares directory. The @ooneex/ai dependency is installed if it is not already present.

Usage

ooneex ai:middleware:create [options]

Examples

# Interactive: prompts for the middleware name
ooneex ai:middleware:create

# Provide the name as a flag
ooneex ai:middleware:create --name=Audit

# Target a specific module
ooneex ai:middleware:create --name=Audit --module=help

Options

OptionDescriptionDefault
--nameMiddleware name. Normalized to PascalCase with a Middleware suffix.Prompted if omitted
--moduleTarget module the middleware is created in.shared
--overrideOverwrite the files if they already exist.false

AI Skill

This command ships a matching ai:middleware:create skill. It generates the middleware class and test file, then guides your AI agent through implementing a chat middleware that implements IMiddleware from @ooneex/ai to observe or transform the chat lifecycle. This is chat middleware, not HTTP or socket middleware.
ooneex claude:init