go-echo

Act as an Echo framework expert to help developers use this high-performance, minimal Go web framework—its optimized router, middleware chain, data binding, validation, template rendering, and WebSocket support—to build REST APIs and web applications, offering concise API guidance and recommendations for built-in middleware.

Last repository push
GitHub Stars
219
Forks
38
Issues / PRs
1

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "go-echo" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-b95c6d1a73355abcbcd2fbf351c87e8994d6ca4e4784c2dce2d5d9d8c6ce1054. Verify the upstream source and version against https://github.com/TerminalSkills/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Act as an Echo framework expert to help developers use this high-performance, minimal Go web framework—its optimized router, middleware chain, data binding, validation, template rendering, and WebSocket support—to build REST APIs and web applications, offering concise API guidance and recommendations for built-in middleware.

0 Downloads

Introduction source: third_party · TerminalSkills · 1.0.0 Reference

SkillPi interpretation

Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: go-echo
description: >-
  You are an expert in Echo, the high-performance, minimalist Go web
  framework. You help developers build REST APIs and web applications using
  Echo's optimized router, middleware chain, data binding, validation,
  template rendering, and WebSocket support — providing a clean API surface
  with excellent performance and comprehensive built-in middleware.
license: Apache-2.0
compatibility: ''
metadata:
  author: terminal-skills
  version: 1.0.0
  category: Backend Development
  tags:
    - go
    - web-framework
    - api
    - middleware
    - rest
    - high-performance

Echo — High-Performance Go Web Framework

You are an expert in Echo, the high-performance, minimalist Go web framework. You help developers build REST APIs and web applications using Echo's optimized router, middleware chain, data binding, validation, template rendering, and WebSocket support — providing a clean API surface with excellent performance and comprehensive built-in middleware.

Core Capabilities

Application Setup

package main

import (
    "net/http"
    "github.com/labstack/echo/v4"
    "github.com/labstack/echo/v4/middleware"
)

func main() {
    e := echo.New()

    // Middleware
    e.Use(middleware.Logger())
    e.Use(middleware.Recover())
    e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
        AllowOrigins: []string{"https://app.example.com"},
        AllowMethods: []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodDelete},
    }))
    e.Use(middleware.RateLimiter(middleware.NewRateLimiterMemoryStore(20)))

    // Routes
    e.GET("/users", listUsers)
    e.POST("/users", createUser)
    e.GET("/users/:id", getUser)

    // Groups with middleware
    admin := e.Group("/admin", adminAuth)
    admin.GET("/stats", getStats)

    e.Logger.Fatal(e.Start(":3000"))
}

Handlers and Binding

type CreateUserRequest struct {
    Name  string `json:"name" validate:"required,min=2"`
    Email string `json:"email" validate:"required,email"`
    Age   int    `json:"age" validate:"gte=0,lte=130"`
}

func createUser(c echo.Context) error {
    var req CreateUserRequest
    if err := c.Bind(&req); err != nil {
        return echo.NewHTTPError(http.StatusBadRequest, "Invalid request")
    }
    if err := c.Validate(&req); err != nil {
        return err
    }

    user, err := db.CreateUser(req.Name, req.Email, req.Age)
    if err != nil {
        return echo.NewHTTPError(http.StatusInternalServerError, "Failed to create user")
    }

    return c.JSON(http.StatusCreated, user)
}

func getUser(c echo.Context) error {
    id := c.Param("id")                   // Path param
    user, err := db.FindUser(id)
    if err != nil {
        return echo.NewHTTPError(http.StatusNotFound, "User not found")
    }
    return c.JSON(http.StatusOK, user)
}

func listUsers(c echo.Context) error {
    page, _ := strconv.Atoi(c.QueryParam("page"))  // Query param
    if page < 1 { page = 1 }

    users, total := db.ListUsers(page, 20)
    return c.JSON(http.StatusOK, map[string]interface{}{
        "data": users, "total": total, "page": page,
    })
}

JWT Middleware

import "github.com/labstack/echo-jwt/v4"

// Configure JWT
e.Use(echojwt.WithConfig(echojwt.Config{
    SigningKey: []byte(os.Getenv("JWT_SECRET")),
    Skipper: func(c echo.Context) bool {
        return c.Path() == "/health" || c.Path() == "/login"
    },
}))

// Access claims in handler
func getProfile(c echo.Context) error {
    token := c.Get("user").(*jwt.Token)
    claims := token.Claims.(jwt.MapClaims)
    userID := claims["user_id"].(string)
    // ...
}

Installation

go get github.com/labstack/echo/v4
go get github.com/labstack/echo-jwt/v4

Best Practices

  1. Context methods — Use c.Bind() for request parsing, c.JSON() for responses, c.Param() / c.QueryParam() for params
  2. Groups for versioning — e.Group("/api/v1") with per-group middleware (auth, rate limiting)
  3. HTTPError for responses — Return echo.NewHTTPError(status, message) for consistent error responses
  4. Validator — Register a custom validator with e.Validator; Echo calls it automatically after Bind()
  5. Middleware chaining — e.Use() for global, group-level, or per-route; Echo processes in order
  6. Graceful shutdown — Use e.Shutdown(ctx) with signal handling; drains active connections
  7. Custom context — Extend echo.Context for request-scoped data (user, logger, trace ID)
  8. Static files — e.Static("/assets", "public") for serving static files alongside API routes

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供 Echo 框架的完整开发指导,涵盖应用搭建、路由、中间件、数据绑定、JWT 认证等核心能力
  • 面向 Go 开发者构建高性能 Web API 和应用的明确需求,实用价值高
Trigger Precision90/100

Highlights

  • 触发描述精准,明确指出是 Echo 框架专家,涵盖 REST API、Web 应用、中间件等关键词,边界清晰
Structure and Standards95/100

Areas to improve

  • description 内容重复 Reported severity: Minor

    frontmatter 和 skill_body 中均包含相同 description 内容,存在轻微冗余

    Recommendation: 建议移除 skill_body 中的重复 description,保持 frontmatter 中的描述即可

Highlights

  • 文档结构清晰,分 Core Capabilities、Installation、Best Practices 等章节
  • 提供完整可运行的代码示例和最佳实践指导
  • frontmatter 元数据完整,包含作者、版本、分类和标签
Execution Reliability95/100

Highlights

  • Go 代码示例语法正确,依赖包路径准确(github.com/labstack/echo/v4)
  • 错误处理机制完善,使用 Bind/Validate/HTTPError 进行合理的请求验证和错误响应
  • 中间件配置完整,涵盖日志、恢复、CORS、速率限制等常见需求
Evidence Verifiability (mean of the first four)91/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • app.example.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.