Token导航 LogoToken导航TokenDH.com
前端设计执行命令github未标认证来源可访问clear审计异常

moai-lang-go摩艾朗戈

Agent Skill

moai-lang-go 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

194

周安装

8

GitHub Stars

61

下载量

63
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:moai-lang-go(摩艾朗戈)
来源仓库:https://github.com/modu-ai/cc-plugins
仓库路径:skills/moai-lang-go
安装命令:
npx skills add https://github.com/modu-ai/cc-plugins --skill moai-lang-go
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/modu-ai/cc-plugins --skill moai-lang-go

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中整理仓库状态和代码变更。
  • 可结合来源仓库和原始 README 核验具体用法。
  • 安装前建议确认权限范围和维护状态,避免触发联网或文件读写。
  • moai-lang-go 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Quick Reference (30 seconds)

Go 1.23+ Development Expert for high-performance backend systems and CLI applications.

Auto-Triggers: Files with.go extension, go.mod, go.sum, goroutines, channels, Fiber, Gin, GORM, Echo, Chi

Core Use Cases:

  • High-performance REST APIs and microservices
  • Concurrent and parallel processing systems
  • CLI tools and system utilities
  • Cloud-native containerized services

Quick Patterns:

Fiber API Pattern:

Create app by calling fiber.New function. Define a get route at api/users/:id with handler function that takes fiber.Ctx and returns error. In the handler, call c.JSON with fiber.Map containing id from c.Params. Call app.Listen on port 3000.

Gin API Pattern:

Create r by calling gin.Default function. Define a GET route at api/users/:id with handler function taking gin.Context pointer. In handler, call c.JSON with status 200 and gin.H containing id from c.Param. Call r.Run on port 3000.

Goroutine with Error Handling:

Create g and ctx by calling errgroup.WithContext with context.Background. Call g.Go with function that returns processUsers with ctx. Call g.Go with function that returns processOrders with ctx. If err from g.Wait is not nil, call log.Fatal with error.


Implementation Guide (5 minutes)

Go 1.23 Language Features

New Features:

  • Range over integers using for i range 10 syntax and print i
  • Profile-Guided Optimization PGO 2.0
  • Improved generics with better type inference

Generics Pattern:

Create generic Map function with type parameters T and U as any. Accept slice of T and function from T to U. Create result slice of U with same length. Iterate range slice setting result elements to function applied to values. Return result.

Web Framework Fiber v3

Create app with fiber.New passing fiber.Config with ErrorHandler and Prefork true. Use recover.New, logger.New, and cors.New middleware. Create api group at api/v1 path. Define routes for listUsers, getUser with id parameter, createUser, updateUser with id, and deleteUser with id. Call app.Listen on port 3000.

Web Framework Gin

Create r with gin.Default. Use cors.Default middleware. Create api group at api/v1 path. Define GET for users calling listUsers, GET for users/:id calling getUser, POST for users calling createUser. Call r.Run on port 3000.

Request Binding Pattern:

Define CreateUserRequest struct with Name and Email fields. Add json tags and binding tags for required, min length 2, and required email validation. In createUser handler, declare req variable, call c.ShouldBindJSON with pointer. If error, call c.JSON with 400 status and error. Otherwise call c.JSON with 201 and response data.

Web Framework Echo

Create e with echo.New. Use middleware.Logger, middleware.Recover, and middleware.CORS. Create api group at api/v1 path. Define GET for users and POST for users. Call e.Logger.Fatal with e.Start on port 3000.

Web Framework Chi

Create r with chi.NewRouter. Use middleware.Logger and middleware.Recoverer. Call r.Route with api/v1 path and function. Inside, call r.Route with users path. Define Get for list, Post for create, Get with id parameter for single user. Call http.ListenAndServe on port 3000 with r.

ORM GORM 1.25

Model Definition:

Define User struct embedding gorm.Model. Add Name with uniqueIndex and not null tags, Email with uniqueIndex and not null, and Posts slice with foreignKey AuthorID tag.

Query Patterns:

Call db.Preload with Posts and function that orders by created_at desc and limits to 10, then First with user and id 1. For transactions, call db.Transaction with function taking tx pointer. Inside, create user and profile, returning any errors.

Type-Safe SQL with sqlc

Create sqlc.yaml with version 2, sql section with postgresql engine, queries and schema paths, and go generation settings for package name, output directory, and pgx v5 sql_package.

In query.sql file, add name GetUser as one returning all columns where id matches parameter. Add name CreateUser as one inserting name and email values and returning all columns.

Concurrency Patterns

Errgroup Pattern:

Create g and ctx with errgroup.WithContext. Call g.Go for fetchUsers that assigns to users variable. Call g.Go for fetchOrders that assigns to orders variable. If g.Wait returns error, return nil and error.

Worker Pool Pattern:

Define workerPool function taking jobs receive-only channel, results send-only channel, and n worker count. Create WaitGroup. Loop n times, incrementing WaitGroup and spawning goroutine that defers Done, ranges over jobs, and sends processJob result to results. Wait then close results.

Context with Timeout:

Create ctx and cancel with context.WithTimeout for 5 seconds. Defer cancel call. Call fetchData with ctx. If error is context.DeadlineExceeded, respond with timeout and StatusGatewayTimeout.

Testing Patterns

Table-Driven Tests:

Define tests slice with struct containing name string, input CreateUserInput, and wantErr bool. Add test cases for valid input and empty name. Range over tests calling t.Run with name and test function. Call service Create, check if wantErr is true and require.Error.

HTTP Testing:

Create app with fiber.New. Add GET route for users/:id calling getUser. Create request with httptest.NewRequest for GET at users/1. Call app.Test with request to get response. Assert 200 status code.

CLI Cobra with Viper

Define rootCmd as cobra.Command pointer with Use and Short fields. In init function, add PersistentFlags StringVar for cfgFile. Call viper.BindPFlag with config and lookup. Set viper.SetEnvPrefix to MYAPP and call viper.AutomaticEnv.


Advanced Patterns

For comprehensive coverage including:

  • Advanced concurrency patterns (worker pools, rate limiting, errgroup)
  • Generics and type constraints
  • Interface design and composition
  • Comprehensive testing patterns (TDD, table-driven, benchmarks, fuzzing)
  • Performance optimization and profiling

See: reference/advanced.md for advanced patterns, reference/testing.md for testing patterns

Performance Optimization

PGO Build:

Run application with GODEBUG pgo enabled and cpuprofile output. Build with go build using pgo flag pointing to profile file.

Object Pooling:

Create bufferPool as sync.Pool with New function returning 4096 byte slice. Get buffer with type assertion, defer Put to return to pool.

Container Deployment 10-20MB

Multi-stage Dockerfile: First stage uses golang:1.23-alpine as builder, sets WORKDIR, copies go.mod and go.sum, runs go mod download, copies source, builds with CGO_ENABLED 0 and ldflags for stripped binary. Second stage uses scratch, copies binary, sets ENTRYPOINT.

Graceful Shutdown

Spawn goroutine calling app.Listen. Create quit channel for os.Signal with buffer 1. Call signal.Notify for SIGINT and SIGTERM. Receive from quit then call app.Shutdown.


Context7 Libraries

  • golang/go for Go language and stdlib
  • gofiber/fiber for Fiber web framework
  • gin-gonic/gin for Gin web framework
  • labstack/echo for Echo web framework
  • go-chi/chi for Chi router
  • go-gorm/gorm for GORM ORM
  • sqlc-dev/sqlc for type-safe SQL
  • jackc/pgx for PostgreSQL driver
  • spf13/cobra for CLI framework
  • spf13/viper for configuration
  • stretchr/testify for testing toolkit

Works Well With

  • moai-domain-backend for REST API architecture and microservices
  • moai-lang-rust for systems programming companion
  • moai-quality-security for security hardening
  • moai-essentials-debug for performance profiling
  • moai-workflow-ddd for domain-driven development

Troubleshooting

Common Issues:

  • Module errors: Run go mod tidy and go mod verify
  • Version check: Run go version and go env GOVERSION
  • Build issues: Run go clean -cache and go build -v

Performance Diagnostics:

  • CPU profiling: Run go test -cpuprofile cpu.prof -bench.
  • Memory profiling: Run go test -memprofile mem.prof -bench.
  • Race detection: Run go test -race./...

Additional Resources

See reference/advanced.md for advanced concurrency patterns, generics, and interface design.

See reference/testing.md for comprehensive testing patterns including TDD, benchmarks, and fuzzing.


Last Updated: 2026-01-11 Version: 1.1.0

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

32.44%
按下载量换算20

windsurf

23.37%
按下载量换算15

trae

16.66%
按下载量换算10

OpenCode

12.46%
按下载量换算8

Codex

7.93%
按下载量换算5

Antigravity

3.91%
按下载量换算2

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/modu-ai/cc-plugins --skill moai-lang-go;npx skills add modu-ai/cc-plugins --skill "moai-lang-go" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills