go-conventions
Idiomatic Go conventions — naming, package design, error handling, concurrency, and project layout
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Idiomatic Go conventions — naming, package design, error handling, concurrency, and project layout
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Health check procedures D1–D14 for the Audit agent — structural validation, attention budget, version checks, workspace integrity, and static audit
Configure and manage Model Context Protocol servers for external tool access
Review a UI for accessibility — WCAG 2.1 AA compliance, semantic HTML, ARIA usage, keyboard navigation, focus management, colour contrast, and screen reader compatibility
Design or review a REST or GraphQL API — resource modeling, versioning strategy, error contract, OpenAPI/schema-first workflow, and security baseline
Generate a CHANGELOG.md entry from staged changes, a commit range, or a PR diff — following Keep a Changelog format with conventional commit classification
Set up and audit environment variable management — create .env.example, add startup validation, separate secrets from config, and document every variable
| name | go-conventions |
| description | Idiomatic Go conventions — naming, package design, error handling, concurrency, and project layout |
| compatibility | >=1.4 |
Skill metadata: version "1.0"; license MIT; tags [go, golang, conventions, error-handling]; recommended tools [codebase, editFiles].
Applies to: **/*.go
camelCase for unexported identifiers and PascalCase for exported ones. Acronyms are all-caps (HTTPClient, ID)._ to discard errors.fmt.Errorf("context: %w", err) for debuggable error chains.context.Context as the first parameter for functions that perform I/O or may be cancelled.sync.Mutex only when channels add complexity.defer for cleanup — but be aware of its cost in tight loops.init() functions — prefer explicit initialization in main() or constructors.go vet and golangci-lint in CI. Fix all warnings.cmd/, internal/, pkg/ (if exposing a library).