ngamux
Build and modify web services using ngamux, a simple HTTP router for Go. Define routes, apply middleware, handle requests, and send responses efficiently.
Why use this skill?
Master ngamux for Go with the OpenClaw agent. Efficiently route HTTP requests, manage middleware, and handle complex JSON data for your high-performance web services.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/hadihammurabi/ngamuxWhat This Skill Does
The ngamux skill provides a powerful and lightweight abstraction layer for building high-performance web services in Go using the ngamux routing engine. It acts as a comprehensive toolkit for OpenClaw agents to scaffold, manage, and scale HTTP servers. By abstracting away the complexities of standard library net/http, this skill allows the agent to define sophisticated route trees—including dynamic path segments and wildcards—with minimal boilerplate. It facilitates a modular architecture through route grouping, which is essential for managing versioned APIs (e.g., /api/v1) and applying isolated middleware chains. The skill is deeply integrated with request/response handling, offering intuitive methods to decode incoming JSON payloads, extract URL or query parameters, and parse complex form data. For responses, it provides a fluent API to serialize JSON, render HTML templates, or stream plain text, all while maintaining precise control over HTTP status codes.
Installation
To integrate this skill into your environment, use the OpenClaw CLI:
clawhub install openclaw/skills/skills/hadihammurabi/ngamux
Use Cases
- API Scaffolding: Rapidly set up RESTful endpoints for microservices, complete with JSON validation and automated status code handling.
- Middleware Orchestration: Easily implement global and group-specific middleware to handle authentication, CORS headers, rate limiting, and request logging.
- Web Application Backends: Efficiently render HTML server-side or provide data-only endpoints for frontend frameworks like React or Vue.
- Form Handling: Seamlessly manage file uploads and multi-part form submissions for user profile or media management systems.
Example Prompts
- "Initialize a new ngamux router on port 8080 with a prefix /api/v1 and define a GET route that fetches user data by id."
- "Add a custom authentication middleware to my group of admin routes and ensure that unauthorized requests return a 401 status code."
- "Show me how to parse a multipart form submission to handle image uploads and save them to the local filesystem using ngamux."
Tips & Limitations
- Performance: ngamux is designed for speed. Use path wildcards wisely; deep nesting of groups can make route resolution slightly less performant.
- Validation: While ngamux handles routing, always pair this skill with a validation library for struct tagging to ensure incoming JSON payloads meet your schema requirements.
- Context: Remember that the request context is accessible; use it to propagate values like user IDs from authentication middleware to your final handlers.
- Limitations: This is an HTTP router and helper library. It does not include built-in database ORMs, so you will need to handle database connectivity independently within your handlers.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-hadihammurabi-ngamux": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: network-access, code-execution