/echonext:echonext-handlersfrom echonext
Write and register type-safe EchoNext HTTP handlers, request structs, and routes. Covers handler shapes, query/body/path binding, validation tags, and automatic response wrapping.
Ships in echonext. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
EchoNext wraps Echo with type-safe handlers. You write a plain function with
typed input/output; the framework uses reflection to parse the request,
validate it, call your function, and serialize the result. There is no
manual c.Bind, c.Validate, or c.JSON in your handler.
// 1. No typed input — read params off the context yourself, return a value.
func(c *echo.Context) (T, error)
// 2. Typed input — req is parsed + validated for you.
func(c *echo.Context, req R) (T, error)
// 3. No response body (side effects only).
func(c *echo.Context) error
T and R are any of your structs. Returning (T, error) is the common case.
The framework picks binding based on the HTTP method (see
echonext.go createEchoHandler):
query:"...") and path values
(param:"...").json:"...") and path
values (param:"...").After binding, the struct is validated with go-playground/validator using its
validate:"..." tags. A validation failure returns 400 automatically — you
never see the handler called.
// Body (POST/PUT/PATCH)
type CreateTodoRequest struct {
Title string `json:"title" validate:"required,min=3,max=200"`
Description string `json:"description" validate:"max=1000"`
}
// Query (GET/DELETE)
type ListTodosRequest struct {
Page int `query:"page" validate:"min=1"`
Limit int `query:"limit" validate:"min=1,max=100"`
Sort string `query:"sort" validate:"omitempty,oneof=created_at title"`
}
// Path value: route "/todos/:id" → field tagged param:"id"
type GetTodoRequest struct {
ID string `param:"id" validate:"required"`
}
Common validator tags: required, min=, max=, email, oneof=a b c,
omitempty, uuid, gt=, lte=. Use a pointer (*bool, *int) for
optional fields that must distinguish "absent" from "zero".
Whatever you return is wrapped in Response[T] (echonext.go:131):
type Response[T any] struct {
Data T `json:"data,omitempty"`
Error string `json:"error,omitempty"`
Success bool `json:"success"`
}
(value, nil) →
{"data": value, "success": true} with the route's success status.(zero, err) → an error response. Use
echo.NewHTTPError(status, msg) to control the status code:func getTodo(c *echo.Context, req GetTodoRequest) (Todo, error) {
todo, ok := store[req.ID]
if !ok {
return Todo{}, echo.NewHTTPError(http.StatusNotFound, "todo not found")
}
return *todo, nil
}
Helpers exist (echonext.go:1487): echonext.Success[T](data),
echonext.Error[T](msg), echonext.NoContent() — but for the common
(T, error) shape you just return the value and let the wrapper do the work.
Methods exist on both *App and *Group with the same signature
(path string, handler interface{}, opts ...Route):
app := echonext.New()
app.GET("/todos", listTodos)
app.GET("/todos/:id", getTodo)
app.POST("/todos", createTodo, echonext.Route{
Summary: "Create a todo",
Tags: []string{"Todos"},
SuccessStatus: http.StatusCreated, // default is 200
})
app.PUT("/todos/:id", updateTodo)
app.PATCH("/todos/:id", patchTodo)
app.DELETE("/todos/:id", deleteTodo)
// Groups share a prefix and middleware
v1 := app.Group("/api/v1")
v1.GET("/users", listUsers)
The optional Route{} carries OpenAPI metadata (summary, description, tags,
success status, headers, examples) and security — see the
echonext-openapi-security skill for auth and Route.Security.
func(c *echo.Context[, req R]) (T, error) or
func(c *echo.Context) error.json: for bodies, query: for GET/DELETE query,
param: for path values.validate: tags, not in the handler body.echo.NewHTTPError(...) for non-2xx; return the value for success.c.JSON/c.Bind — the wrapper handles serialization.See references/handler-patterns.md for
fuller end-to-end examples (CRUD set, pagination, mixing raw Echo handlers).
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub abdussamadbello/echonext --plugin echonext9 skills in this plugin
/echonext-cliUse the EchoNext CLI to scaffold projects and code, run the dev loop, build, test, and manage the database. Use when creating a new echonext project, generating code (domain/handler/service/model/dto/middleware/openapi/graphql/ websocket/upload), or running dev/build/test/db commands./echonext-databaseWork with EchoNext's database layer: GORM models, the generic Repository[T] pattern from pkg/contrib/database, and Atlas migrations/seeds via the CLI. Use when defining models, querying/persisting data, or creating and applying migrations in an echonext project./echonext-domainScaffold and wire up a complete EchoNext domain (model + service + handler + DTO) following the framework's conventional layout. Use when adding a new resource, feature, or entity to an echonext project (e.g. "add a users endpoint", "create a products domain")./echonext-integrationsAdd WebSocket, GraphQL, or file-upload endpoints to an EchoNext app. Use when building real-time/WebSocket handlers (Hub pattern), wiring a gqlgen GraphQL schema, or accepting multipart file uploads with validation./echonext-middleware-configRegister, order and write EchoNext middleware, and load application configuration. Use when adding middleware (auth, CORS, logging, request IDs, metrics, tracing) to an echonext app or group, writing a custom echo.MiddlewareFunc, or loading config from YAML/env with the contrib config package./echonext-openapi-securityConfigure EchoNext's auto-generated OpenAPI spec and authentication. Use when setting API metadata (title/servers/contact), serving the OpenAPI JSON or Swagger UI, or adding auth (bearer/JWT, API key, OAuth2, OpenID Connect) via security schemes and per-route or global security requirements.Other plugins' skills for the same job