orval
Generate type-safe API clients, TanStack Query/SWR hooks, Zod schemas, MSW mocks, Hono server handlers, MCP servers, and…
Go best practices for performance, modern syntax, generics, patterns, testing, error handling, and concurrency. Use when writing or reviewing Go code.
Claude Code
$ npx -y skills add mhmtszr/go-guidelines --skill go-guidelines --agent claude-code
Codex
$ npx skills add mhmtszr/go-guidelines --skill go-guidelines -a codex -y
Cursor
$ npx skills add mhmtszr/go-guidelines --skill go-guidelines -a cursor -y
Gemini CLI
$ npx skills add mhmtszr/go-guidelines --skill go-guidelines -a gemini-cli -y
GitHub Copilot
$ npx skills add mhmtszr/go-guidelines --skill go-guidelines -a github-copilot -y
OpenCode
$ npx skills add mhmtszr/go-guidelines --skill go-guidelines -a opencode -y
Windsurf
$ npx skills add mhmtszr/go-guidelines --skill go-guidelines -a windsurf -y
name: go-guidelines description: Go best practices for performance, modern syntax, generics, patterns, testing, error handling, and concurrency. Use when writing or reviewing Go code.
!`grep -rh "^go " --include="go.mod" . 2>/dev/null | cut -d' ' -f2 | sort | uniq -c | sort -nr | head -1 | xargs | cut -d' ' -f2 | grep . || echo unknown`
DO NOT search for go.mod files or try to detect the version yourself. Use ONLY the version shown above.
**If version detected (not "unknown"):**
**If version is "unknown":**
**Read ONLY the reference file(s) relevant to your current task. Do NOT load all files at once.**
When reading reference files, **stop at the detected Go version boundary** — ignore features from newer versions.
| When you are... | Read this reference | |---|---| | Using version-specific Go syntax or idioms | [references/modern-syntax.md](references/modern-syntax.md) | | Optimizing performance, struct layout, escape analysis | [references/performance.md](references/performance.md) | | Working with goroutines, channels, sync, select, false sharing | [references/concurrency.md](references/concurrency.md) | | Writing HTTP servers, shutdown, health checks, middleware, interfaces, io.Reader | [references/patterns.md](references/patterns.md) | | Writing tests, mocks, benchmarks, fuzz tests | [references/testing.md](references/testing.md) | | Handling errors, wrapping, custom error types | [references/error-handling.md](references/error-handling.md) | | Working with slices, maps, append, memory leaks | [references/slices-and-maps.md](references/slices-and-maps.md) | | Using context.Context, values, cancellation, timeouts | [references/context-patterns.md](references/context-patterns.md) | | Using generics, type parameters, constraints | [references/generics.md](references/generics.md) | | Debugging subtle bugs, nil traps, shadowing, sync copying, defer, time | [references/pitfalls.md](references/pitfalls.md) |
**Multiple topics may apply.** For example, writing a concurrent function with tests: load `modern-syntax.md` + `concurrency.md` + `testing.md`.
---
After making Go code changes, run static analysis and tests on the changed packages:
which golangci-lint >/dev/null 2>&1 && golangci-lint run ./path/to/changed/package/... || go vet ./path/to/changed/package/... go test ./path/to/changed/package/... -race
**If the detected Go version is 1.26 or newer**, also run `go fix` on the changed packages ([Using go fix to modernize Go code](https://go.dev/blog/gofix)):
go fix ./path/to/changed/package/...
Make your AI code agent write production-grade Go instead of tutorial-grade Go.
Generate type-safe API clients, TanStack Query/SWR hooks, Zod schemas, MSW mocks, Hono server handlers, MCP servers, and…
Use the Modern Go Guidelines CLI whenever writing, modifying, fixing, or refactoring Go code. Apply its version-specific guidance…
Use this skill when the user is building against Anthropic APIs or SDKs, including `@anthropic-ai/sdk`, `anthropic`, or Agent SDK…
Writing or converting formatted output in ripwire's C++ source — std::print/std::format via rw::emitTo, emitRaw and formatTo,…