/echonext:echonext-domainfrom echonext
Scaffolds a complete EchoNext domain (model, service, handler, DTO) using the framework's generator. Use when adding a new resource or feature to an EchoNext project.
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.
None: SKILL.md is the whole skill.
A "domain" is the framework's unit of feature organization: one Go package
under domain/<name>/ containing a GORM model, a service (business logic), an
HTTP handler (type-safe routes), and DTOs (request/response structs). Always
scaffold with the generator, then fill in the TODOs — don't hand-write the
package from scratch.
echonext generate domain user
This creates (package user):
domain/user/
model.go # GORM model: User{ ID, CreatedAt, UpdatedAt, DeletedAt, ... }
service.go # Service{ db *gorm.DB } with Create/GetByID/List/Update/Delete/Count
handler.go # Handler{ service *Service } with RegisterRoutes + typed handlers
dto.go # CreateUserRequest / UpdateUserRequest / ListUsersRequest / UserResponse
To regenerate just one layer, use generate model|service|handler|dto <name>
(see the echonext-cli skill).
Model (model.go) — a GORM struct with a TableName():
type User struct {
ID uint `gorm:"primaryKey"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
// TODO: add fields, e.g.
Email string `gorm:"unique;not null"`
Name string `gorm:"not null"`
}
func (User) TableName() string { return "users" }
Service (service.go) — owns *gorm.DB and the business logic:
type Service struct{ db *gorm.DB }
func NewService(db *gorm.DB) *Service { return &Service{db: db} }
// Create / GetByID(id uint) / List(limit, offset int) / Update / Delete / Count
Handler (handler.go) — type-safe routes that call the service. It exposes
RegisterRoutes(app *echonext.App):
type Handler struct{ service *Service }
func NewHandler(service *Service) *Handler { return &Handler{service: service} }
func (h *Handler) RegisterRoutes(app *echonext.App) {
app.POST("/users", h.Create, echonext.Route{Summary: "Create user", Tags: []string{"Users"}})
app.GET("/users/:id", h.Get, echonext.Route{Summary: "Get user", Tags: []string{"Users"}})
app.GET("/users", h.List, echonext.Route{Summary: "List users", Tags: []string{"Users"}})
app.PUT("/users/:id", h.Update, echonext.Route{Summary: "Update user", Tags: []string{"Users"}})
app.DELETE("/users/:id", h.Delete, echonext.Route{Summary: "Delete user", Tags: []string{"Users"}})
}
func (h *Handler) Create(c *echo.Context, req CreateUserRequest) (UserResponse, error) { /* ... */ }
The handler methods are ordinary echonext handlers — see the
echonext-handlers skill for the signature rules, binding, validation, and
Response[T] wrapping.
DTOs (dto.go) — request structs carry validate: tags; response structs
shape the JSON output. Map model → response in the service or handler.
Construct the layers and register routes in main.go:
app := echonext.New()
userSvc := user.NewService(db)
userHandler := user.NewHandler(userSvc)
userHandler.RegisterRoutes(app)
After editing model.go, regenerate migrations so the database matches:
echonext db migrate:diff add_users
echonext db migrate
echonext generate domain <name> (singular, lowercase).validate: tags on the request DTOs.<name>.NewService(db) → NewHandler(svc) → RegisterRoutes(app).db migrate:diff after model changes.For the GORM Repository[T] alternative to the hand-rolled db *gorm.DB
service, see the echonext-database skill.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
9 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-handlersWrite and register type-safe EchoNext HTTP handlers, request structs, and routes. Use when adding, editing, or debugging an echonext handler function, a request/response struct, validation tags, or a route registration (GET/POST/PUT/PATCH/DELETE)./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.npx claudepluginhub abdussamadbello/echonext --plugin echonextOther plugins' skills for the same job