用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill golang-echo-zap命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
| Use when this capability is needed.
> Use when this capability is needed.
Review architecture and API design for the vfs-s3 project. Use when the user mentions @architect, asks to review an issue's design, discuss module boundaries, API shape, or architectural decisions for vfs-s3. Also trigger when the user wants to create an ADR (Architecture Decision Record) or evaluate a technical approach for the project. Intended for dispatch from Codex automation or Claude routines; GitHub trigger phrase: @vfs-s3-bot please prepare design doc Use when this capability is needed.
基于 SOC 职业分类
正在显示 SKILL.md
| name | golang-echo-zap |
| description | Use when adding or configuring github.com/adlandh/echo-zap-middleware/v2 in a Go Echo service. |
| metadata | {"author":"adlandh"} |
Use this skill when adding or configuring github.com/adlandh/echo-zap-middleware/v2 in a Go Echo service.
github.com/adlandh/echo-zap-middleware/v2 or needs this middleware configured.ZapConfig, Middleware, MiddlewareWithContextLogger, BodySkipper, request/response body logging, or Echo request IDs.github.com/labstack/echo/v5; do not mix it with Echo v4 imports.*echo.Context, not echo.Context.github.com/adlandh/echo-zap-middleware/v2; package name is echozapmiddleware unless aliased.Middleware(logger, config...) is the normal entrypoint for a *zap.Logger.MiddlewareWithContextLogger(ctxLogger, config...) is for github.com/adlandh/context-logger extractors.ZapConfig fills defaults only for nil Skipper and nil BodySkipper; bool and int zero values are meaningful.LimitHTTPBody: true with LimitSize <= 0 disables body limiting.BodySkipper does not prevent body capture; it replaces non-empty logged bodies with [excluded].X-Request-Id first, then from Echo's response header.import (
echozapmiddleware "github.com/adlandh/echo-zap-middleware/v2"
"github.com/labstack/echo/v5"
"github.com/labstack/echo/v5/middleware"
"go.uber.org/zap"
)
logger, err := zap.NewProduction()
if err != nil {
return err
}
e := echo.New()
e.Use(middleware.RequestID())
e.Use(echozapmiddleware.Middleware(logger))
e.Use(echozapmiddleware.Middleware(logger, echozapmiddleware.ZapConfig{
AreHeadersDump: true,
IsBodyDump: true,
LimitHTTPBody: true,
LimitSize: 500,
Skipper: func(c *echo.Context) bool {
return c.Path() == "/health"
},
BodySkipper: func(c *echo.Context) (skipReqBody, skipRespBody bool) {
if c.Path() == "/upload" {
return true, false
}
if c.Request().Header.Get("Content-Encoding") == "gzip" {
return true, true
}
return false, false
},
}))
import contextlogger "github.com/adlandh/context-logger"
ctxLogger := contextlogger.WithContext(logger)
e.Use(echozapmiddleware.MiddlewareWithContextLogger(ctxLogger))
middleware.RequestID() before this middleware when generated request IDs should appear in logs.IsBodyDump only when the service can afford body capture.BodySkipper for sensitive or binary payloads, but still set LimitHTTPBody and LimitSize for large bodies.go test ./... for a fast check.go test -run TestLimitBody ./... and go test -run 'TestMiddleware/TestBodyLimitApplied' ./....go test -race -coverprofile=coverage.txt -covermode=atomic ./....Source: adlandh/echo-zap-middleware — distributed by TomeVault.