with one click
new-api
在已有 go-zero 服务里新增一个 HTTP 接口。当用户说加接口、新增 api、加路由时触发。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
在已有 go-zero 服务里新增一个 HTTP 接口。当用户说加接口、新增 api、加路由时触发。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
给 web/ 前端组件接入多语言(中英)。当用户说加多语言、国际化、i18n、翻译、某页面没翻译、硬编码中文时触发。
恢复上下文。在 /clear 后或新 session 开始时使用。当用户说恢复上下文、继续之前的工作、catchup 时触发。
审查当前 git diff 中的 Go 代码。当用户说审查 Go 代码、review Go、检查代码时触发。
运行 Go 测试并分析结果。当用户说跑测试、运行测试、go test 时触发。
新增数据库模型/表。当用户说加表、新增 model、加数据库字段时触发。
在已有 go-zero 服务里新增一个 RPC 方法。当用户说加 rpc 方法、新增 grpc、新加 proto 接口时触发。
| name | new-api |
| description | 在已有 go-zero 服务里新增一个 HTTP 接口。当用户说加接口、新增 api、加路由时触发。 |
在 apps/<svc>/api 里新增一个 HTTP 接口,使用 goctl 重新生成。
apps/ 下选一个)POST /v1/im/conversation/mute)xxxclient 已经注入到 svc.ServiceContext).api编辑 apps/<svc>/api/<svc>.api:
type (...) 块里加 XxxReq / XxxResp —— 可选字段加 optional,可选标量在 Go 端用指针 + omitempty@server 块下加路由:@doc "中文描述"
@handler xxxHandler
post /v1/<svc>/path (XxxReq) returns (XxxResp)
goctl api go -api apps/<svc>/api/<svc>.api -dir apps/<svc>/api -style gozero
goctl 只会生成缺失的 handler/logic 骨架,不会覆盖你已有的实现。生成完检查 internal/handler/routes.go 已加路由。
在 apps/<svc>/api/internal/logic/<xxx>logic.go 写业务:
l.svcCtx.UserRpc.GetUser(l.ctx, &user.GetUserReq{...})pkg/xerr 封装,不要返回原始 error 给客户端common.Marshal/Unmarshal(go-backend.md)internal/logic/<xxx>logic_test.go 写 table-driven 测试go run apps/<svc>/api/<svc>.go -f apps/<svc>/api/etc/<svc>-sample.yaml,再 curl跑 /sync-api-docs 更新 docs/api.md。
.api 后必须重跑 goctl,不要手写 handlermicroservice.md)