Skip to content
Development
Skill

/writing-go

Idiomatic Go development. Use when writing Go code, designing APIs, reviewing

From plugin
cc-thingz
3828 skills6 agents

Claude Code

$ npx -y skills add alexei-led/cc-thingz --skill writing-go --agent claude-code

SKILL.md

writing-go.SKILL.md
description: Idiomatic Go development. Use when writing Go code, designing APIs, reviewing
  Go implementations, or changing Go tests. Follow the module's target Go version.
  Prefer stdlib, concrete types, explicit errors, goroutine ownership, fast feedback,
  and behavior tests. NOT for Python, Rust, TypeScript, shell scripts, or infra-only
  work.
name: writing-go

Go Development

Check `go.mod` (`go` and `toolchain` lines) and CI before using version-gated APIs. Project conventions win over these defaults.

Defaults

  • Stdlib first: `net/http`, `testing`, `flag`, `log/slog`. Add a module only for a concrete requirement.
  • Concrete types in domain code. Consumers own small private interfaces; producers return concrete types.
  • Keep HTTP, CLI, database, and vendor SDK types out of domain packages. Map errors to status, exit code, or retry at the edge.
  • New binaries: `cmd/<name>` plus `internal/`. Use `pkg/` only for code meant for external import.
  • Avoid package stutter: `user.Store`, not `user.UserStore`.
  • Doc comments on exported names start with the identifier and end with a period.
  • Every goroutine has an owner, a cancellation path, and a completion path. Use `errgroup` for errors or shared cancellation when the module already has it.

Version-Gated

  • 1.24+: `t.Context()`, `t.Chdir()`, and `b.Loop()` in tests.
  • 1.25+: `sync.WaitGroup.Go` when no error propagation is needed.
  • 1.26+: stdlib `crypto/hpke`; `new(expr)` only when clearer than a local variable or composite literal; self-referential generic constraints belong in generic libraries, not business logic.
  • 1.26+: `testing/cryptotest.SetGlobalRandom` swaps process-wide randomness, so never use it in parallel tests.
  • `encoding/json/v2` is experimental and exists only under `GOEXPERIMENT=jsonv2`; use it only when the project already builds that way.

CLIs

  • Use the existing framework. Otherwise `flag` for single-command tools, Cobra for large command trees with completions, urfave/cli for small multi-command tools. Skip Viper unless already used.
  • Keep `main` thin: it calls `run(ctx, args, stdin, stdout, stderr) error` and maps the result to an exit code. Tests call `run`. Avoid `log.Fatal`; it skips deferred cleanup.
  • Config precedence: flag, env, config file, default.

References

  • [testing.md](references/testing.md): read when adding or reshaping tests, or when the test loop is slow.
  • [linting.md](references/linting.md): read when changing lint commands or golangci-lint config.

Done when the relevant build/test/lint checks pass on what you changed, or you name each check that did not run and why.

Read more
@alexei-led
Ships withcc-thingz

Portable skills, agents, hooks, and Pi-native extensions for Claude Code, Codex CLI, GitHub Copilot, Cursor, Grok, and Pi. Gemini is retired.

3828 skills6 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
38
Star history of alexei-led/cc-thingz on GitHub, a chart by star-history.com

Other skills on cc-thingz.

releasing-code

releasing-code

Prepare, publish, or repair a software release and write its release notes. Use for cutting a versioned release or editing…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about writing-go.

Which coding agents can use writing-go?
writing-go installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.