一键导入
go
Guidelines for Go development, testing, and tooling.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guidelines for Go development, testing, and tooling.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Guidelines for creating, reviewing, and improving agent skills.
Guidelines for validation, staging, amending, and commit messages.
Guidelines for dependency injection patterns.
Guidelines for ensuring architectural changes are validated against core use cases.
Orchestrates efficient read and write interactions with the engram unified memory store via MCP tools. Provides deterministic workflows for decomposing observations into atomic memories, composing four-dimensional queries (context, similarity, relationship, time) for maximum retrieval accuracy, managing agent-managed focus context, and linking memories into associative webs at write time. Ensures memories are discoverable, precisely ranked, and structurally connected across sessions.
Guidelines for dual-use architecture (CLI and Go Library), dependency separation, and extensible registry patterns.
| name | go |
| description | Guidelines for Go development, testing, and tooling. |
Follow Effective Go as the baseline.
We follow the standard layout. See Layout Reference for details.
Use for object construction with optional parameters.
type Server struct {
timeout time.Duration
}
type Option func(*Server)
func WithTimeout(t time.Duration) Option {
return func(s *Server) { s.timeout = t }
}
func New(opts ...Option) *Server {
s := &Server{timeout: 30 * time.Second} // Default
for _, opt := range opts {
opt(s)
}
return s
}
The standard for unit testing.
func TestAdd(t *testing.T) {
tests := []struct {
name string
a, b int
want int
}{
{"positive", 1, 2, 3},
{"negative", -1, -1, -2},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := Add(tt.a, tt.b); got != tt.want {
t.Errorf("Add() = %v, want %v", got, tt.want)
}
})
}
}
Wrap upstream errors to provide context.
if err := dest.Do(); err != nil {
return fmt.Errorf("failed to do action: %w", err)
}
Use log/slog with TextHandler.
logger := slog.New(slog.NewTextHandler(os.Stdout, nil))
slog.Info("starting application", "version", version)
golangci-lint.go test -race ./....