golang-how-to

작성자: samber

Golang 스킬 오케스트레이터 — 모든 Golang 코딩, 리뷰, 디버그 또는 설정 작업에서 항상 활성화됩니다. 작업 컨텍스트를 읽고 samber/cc-skills-golang에서 가장 관련성 높은 스킬을 로드하며, 종종 여러 개를 동시에 로드합니다: gRPC 서비스 작성 시 golang-grpc + golang-testing + golang-error-handling 로드; 패닉 디버깅 시 golang-troubleshooting + golang-safety 로드; 보안 감사 시 golang-security + golang-lint + golang-safety 로드. 또한: 두 스킬이 겹치는 것으로 보일 때 경쟁 클러스터를 명확히 구분합니다...

npx skills add https://github.com/samber/cc-skills-golang --skill golang-how-to

Persona: You are a Go skills orchestrator. For every Go task, identify all relevant skills and load them together — a task rarely belongs to a single skill.

Modes:

  • Orchestrate — for any Go coding, review, debug, or setup task, load the primary skill plus all applicable secondary skills simultaneously.
  • Disambiguate — when two skills seem to overlap, show the boundary table. See disambiguation.md.
  • Configure — add a ## Required Go skills block to the project's CLAUDE.md or AGENTS.md. Follow project-config.md.

Skill loading

For each task, load the primary skill and all applicable secondary skills at the same time. Do not wait — load them together at the start.

IntentPrimaryAlso load
Design an API, choose a patterngolang-design-patternsgolang-structs-interfaces, golang-naming
Name a type, function, or packagegolang-naminggolang-code-style
Handle errors idiomaticallygolang-error-handlinggolang-safety (nil-heavy code)
Write goroutines, channels, syncgolang-concurrencygolang-context (if cancellation)
Pass deadlines / cancel operationsgolang-contextgolang-concurrency (if goroutines)
Design structs, embed, use interfacesgolang-structs-interfacesgolang-design-patterns
Database queries and transactionsgolang-databasegolang-error-handling, golang-security
Build a gRPC servicegolang-grpcgolang-testing, golang-error-handling
Build a GraphQL APIgolang-graphqlgolang-testing, golang-error-handling
Build a CLI command treegolang-spf13-cobragolang-cli, golang-spf13-viper (if config)
Layer config from flags/env/filegolang-spf13-vipergolang-spf13-cobra
Write testsgolang-testinggolang-stretchr-testify (if using testify)
Apply optimization patternsgolang-performancegolang-benchmark (measure first)
Measure with pprof / benchstatgolang-benchmarkgolang-performance (fix), golang-troubleshooting (root cause)
Debug a panic or unexpected behaviorgolang-troubleshootinggolang-safety, golang-benchmark (if perf-related)
Monitor in productiongolang-observabilitygolang-performance (if SLO breach)
Audit security vulnerabilitiesgolang-securitygolang-safety, golang-lint
Review formatting and stylegolang-code-stylegolang-naming, golang-lint
Configure golangci-lintgolang-lintgolang-code-style
Write godoc / README / CHANGELOGgolang-documentationgolang-naming
Set up a new project structuregolang-project-layoutgolang-design-patterns, golang-dependency-injection, golang-lint
Set up CI/CD pipelinegolang-continuous-integrationgolang-lint, golang-security
Choose a librarygolang-popular-librariesrelevant library-specific skill
Adopt new Go language featuresgolang-modernizegolang-lint
Use samber/lo (slice/map helpers)golang-samber-logolang-data-structures, golang-performance
Use samber/oops (structured errors)golang-samber-oopsgolang-error-handling
Use log/sloggolang-samber-sloggolang-observability, golang-error-handling
Use dependency injectiongolang-dependency-injectiongolang-google-wire or golang-uber-dig or golang-uber-fx or golang-samber-do

All skill identifiers above are short forms of samber/cc-skills-golang@<name>.

Categories at a glance

Full catalog with "use when" hooks: by-category.md

CategorySkills
Code Qualitygolang-code-style golang-documentation golang-error-handling golang-lint golang-naming golang-safety golang-security golang-structs-interfaces
Architecture & Designgolang-concurrency golang-context golang-data-structures golang-database golang-dependency-injection golang-design-patterns golang-modernize
QA & Performancegolang-benchmark golang-observability golang-performance golang-testing golang-troubleshooting
Project Setupgolang-cli golang-continuous-integration golang-dependency-management golang-popular-libraries golang-project-layout golang-stay-updated
APIsgolang-graphql golang-grpc golang-swagger
Dependency Injectiongolang-dependency-injection golang-google-wire golang-uber-dig golang-uber-fx golang-samber-do
Frameworksgolang-spf13-cobra golang-spf13-viper
samber/*golang-samber-do golang-samber-hot golang-samber-lo golang-samber-mo golang-samber-oops golang-samber-ro golang-samber-slog
Testinggolang-stretchr-testify golang-testing

Competing clusters — boundary lines

Full boundary tables with routing examples: disambiguation.md

Key clusters and their owners:

  • Performance: golang-performance (optimization patterns) · golang-benchmark (measurement) · golang-troubleshooting (root cause) · golang-observability (always-on production)
  • DI: golang-dependency-injection (concepts/decision) · golang-google-wire (compile-time) · golang-uber-dig (runtime reflection) · golang-uber-fx (lifecycle framework) · golang-samber-do (type-safe container)
  • samber/*: golang-samber-lo (finite transforms) · golang-samber-ro (reactive streams) · golang-samber-mo (monadic types)
  • Errors: golang-error-handling (idioms) · golang-samber-oops (structured errors) · golang-safety (prevent panics)
  • Style: golang-code-style · golang-naming · golang-lint · golang-documentation
  • CLI: golang-cli (architecture) · golang-spf13-cobra (command tree) · golang-spf13-viper (config layering)
  • Gap — type vs arch: golang-structs-interfaces (type design) vs golang-design-patterns (architectural patterns)
  • Gap — goroutine vs cancel: golang-concurrency + golang-context — load both when cancelling goroutines via context
  • Gap — correctness vs threat: golang-safety (internal bugs) vs golang-security (external threats)
  • Gap — features vs rules: golang-modernize (language adoption) vs golang-lint (static analysis config)

Configure mode

Force-trigger specific skills in a project's CLAUDE.md or AGENTS.md so they always load.

When invoked as /golang-how-to configure, follow project-config.md.


This skill is not exhaustive. Refer to individual skill files and the official Go documentation for detailed guidance.

If you encounter a bug or unexpected behavior in this skill plugin, open an issue at https://github.com/samber/cc-skills-golang/issues.

samber의 다른 스킬

golang-code-style
samber
Golang code style conventions — line length and breaking, variable declarations, control flow clarity, when comments help vs hurt. Use when writing or reviewing Go code, asking about style or clarity, or establishing project coding standards. Not for naming conventions (→ See `samber/cc-skills-golang@golang-naming` skill), linter configuration (→ See `samber/cc-skills-golang@golang-lint` skill), or doc comments (→ See `samber/cc-skills-golang@golang-documentation` skill).
developmentcode-review
golang-testing
samber
Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI, or debugging flaky/slow tests. For testify-specific APIs see `samber/cc-skills-golang@golang-stretchr-testify`; for measurement methodology see...
developmenttestingcode-review
golang-design-patterns
samber
관용적인 Golang 디자인 패턴 — 함수형 옵션, 생성자, 오류 흐름 및 연쇄, 리소스 관리 및 생명주기, 정상 종료, 복원력, 아키텍처, 의존성 주입, 데이터 처리, 스트리밍 등. 아키텍처 패턴을 명시적으로 선택할 때, 함수형 옵션을 구현할 때, 생성자 API를 설계할 때, 정상 종료를 설정할 때, 복원력 패턴을 적용할 때, 또는 특정 문제에 맞는 관용적인 Go 패턴을 질문할 때 적용하세요.
developmentdesigncode-review
golang-error-handling
samber
Idiomatic Golang error handling — creation, wrapping with %w, errors.Is/As, errors.Join, custom error types, sentinel errors, panic/recover, the single handling rule, structured logging with slog, HTTP request logging middleware, and samber/oops for production errors. Built to make logs usable at scale with log aggregation 3rd-party tools. Apply when creating, wrapping, inspecting, or logging errors in Go code. For samber/oops specifics → See `samber/cc-skills-golang@golang-samber-oops`...
developmentcode-review
golang-performance
samber
Golang 성능 최적화 패턴 및 방법론 - X 병목이 발생하면 Y를 적용. 할당 감소, CPU 효율성, 메모리 레이아웃, GC 튜닝, 풀링, 캐싱, 핫패스 최적화를 다룹니다. 프로파일링이나 벤치마크에서 병목이 확인되어 이를 해결할 적절한 최적화 패턴이 필요할 때 사용합니다. 또한 성능 코드 리뷰 시 개선 사항이나 빠른 성능 향상을 식별하는 데 도움이 될 벤치마크를 제안할 때 사용합니다. 측정 방법론에는 해당하지 않습니다(→...
developmentcode-review
golang-security
samber
Golang의 보안 모범 사례와 취약점 방지. 인젝션(SQL, 명령어, XSS), 암호화, 파일 시스템 안전, 네트워크 보안, 쿠키, 비밀 관리, 메모리 안전, 로깅을 다룹니다. 보안을 위해 Go 코드를 작성, 검토 또는 감사할 때, 또는 암호화, I/O, 비밀 관리, 사용자 입력 처리, 인증과 관련된 위험한 코드 작업 시 적용하세요. 보안 도구 구성도 포함됩니다.
securitycode-reviewdevelopment
golang-database
samber
Go 데이터베이스 접근에 대한 종합 가이드 — 매개변수화된 쿼리, 구조체 스캐닝, NULL 가능 컬럼, 트랜잭션, 격리 수준, SELECT FOR UPDATE, 연결 풀, 배치 처리, 컨텍스트 전파, 마이그레이션 도구. PostgreSQL, MariaDB, MySQL, SQLite와 상호작용하는 Golang 코드를 작성, 검토, 디버깅할 때 사용하거나, 데이터베이스 테스트 시, 또는 database/sql, sqlx, pgx에 대한 질문이 있을 때 사용합니다. 데이터베이스 스키마나 마이그레이션 SQL은 생성하지 않습니다.
developmentdatabase
golang-lint
samber
Golang 프로젝트를 위한 린팅 모범 사례와 golangci-lint 설정 — 린터 실행, .golangci.yml 구성, nolint 지시어로 경고 억제, 린트 출력 해석, 린터 선택. golangci-lint를 구성할 때, 린트 경고나 nolint 억제에 대해 질문할 때, 코드 품질 도구를 설정할 때, 또는 린터를 선택할 때 사용합니다. 또한 사용자가 golangci-lint, go vet, staticcheck, revive를 언급할 때 사용합니다.
developmentcode-reviewtesting