一键导入
go-patterns
Go patterns and idioms. Use when writing, reviewing, or refactoring Go code. Covers error handling, concurrency, testing, and project structure.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Go patterns and idioms. Use when writing, reviewing, or refactoring Go code. Covers error handling, concurrency, testing, and project structure.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Identify and remove AI slop from code comments, documentation, and prose. Use when cleaning up AI-generated output, reviewing for AI tells, or improving signal-to-noise ratio in any text.
Design review for front-end code changes using Playwright for live browser testing. Covers visual hierarchy, accessibility (WCAG AA+), responsive design, and interaction patterns. Use when reviewing UI/UX changes before merge.
Adversarial code review that assumes the worst. Finds failure modes, race conditions, blast radius, and edge cases that optimistic reviewers miss. Use when you want brutal honesty about code resilience.
Perform thorough code review on a PR using the Pragmatic Quality framework. Integrates with Jira to validate implementation matches ticket requirements. Use when reviewing pull requests or providing PR feedback.
Validate implementation plans for completeness, specificity, and actionability. Catches vague language, missing sections, and untestable outcomes.
Interactive PRD creation and iteration for non-technical users. Use this skill whenever the user wants to define product requirements, write a PRD, spec out a feature, describe what to build, or says "what should we build", "write requirements", "create a PRD", "define the product". Also use when updating an existing PRD based on stakeholder or engineering feedback. Guides through structured requirement definition using plain-language facilitation prompts with discovery questions upfront. Auto-validates with /prd-validator after completion.
| name | go-patterns |
| description | Go patterns and idioms. Use when writing, reviewing, or refactoring Go code. Covers error handling, concurrency, testing, and project structure. |
| tags | ["go"] |
Authoritative reference for idiomatic Go (1.21+). Each reference file is self-contained and can be loaded independently.
| Topic | Reference File | Contents |
|---|---|---|
| Core idioms | references/idiomatic-go.md | Interfaces, zero values, composition, generics |
| Error handling | references/error-handling.md | Wrapping, sentinel errors, custom types, errors.Is/As |
| Concurrency | references/concurrency.md | Goroutines, channels, errgroup, context, race detection |
| Testing | references/testing.md | Table-driven tests, testify, race detector, mocks |
| Project structure | references/project-structure.md | Module layout, internal/, package naming |
When context is tight, load only what you need:
idiomatic-go.md + error-handling.mdconcurrency.mdtesting.mdproject-structure.md onlyGo prioritizes simplicity, readability, and explicit behavior. The language design discourages clever abstractions and encourages:
gofmt, standard project layout)The compiler and toolchain enforce many conventions. Treat go vet, golangci-lint, and the race detector as authoritative.
| Tool | Command | Purpose |
|---|---|---|
gofmt | gofmt -w . | Format (no configuration) |
goimports | goimports -w . | Format + organize imports |
go vet | go vet ./... | Catch common mistakes |
golangci-lint | golangci-lint run ./... | Aggregated linters |
go test | go test -race -count=1 ./... | Tests with race detection |
go build | go build ./... | Compile-check all packages |
go mod tidy | go mod tidy | Sync go.mod and go.sum |
| Trigger | Example |
|---|---|
| Writing Go code | "implement a worker pool in Go" |
| Reviewing Go PRs | "review this Go handler" |
| Error handling questions | "how should I wrap this error?" |
| Concurrency design | "design a pipeline with context cancellation" |
| Project setup | "structure a new Go service" |
| Term | Definition |
|---|---|
| Interface satisfaction | Implicit in Go — any type with the right methods satisfies an interface |
| Zero value | Default value for a type when declared without initialization |
| Goroutine | Lightweight concurrent execution unit managed by the Go runtime |
| Channel | Typed conduit for communicating between goroutines |
| errgroup | golang.org/x/sync/errgroup — manages a group of goroutines with error propagation |
| Sentinel error | A package-level var ErrX = errors.New("x") used for error identity checks |
%w verb | Wraps an error so errors.Is/errors.As can unwrap the chain |