maroffo/claude-forge/golang
Claude Code and agent skill by maroffo/claude-forge
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Go development: conventions, architecture, concurrency, performance, and code review. Use when working with .go files, go.mod, or user asks about goroutines, channels, error handling, interfaces.
Install
npx vskill@latest install maroffo/claude-forge/golangSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
ABOUTME: Complete Go development guide - code, design, concurrency, performance, review
ABOUTME: Conventions, error layering, concurrency rules, modern stdlib preferences
Go Development
Quick Reference
See also: _AST_GREP.md, _PATTERNS.md, source-control
Version (determine, don't assume)
See ../_LANG_COMMON.md. Fetch the truth:
Pre-Commit Verification (MANDATORY)
make check && make test-e2e must pass (enforced by the pre-commit-gate hook; see ../_LANG_COMMON.md). What make check expands to for Go:
Why gofmt before build: Code generators (sqlc, protoc) may produce code gofmt disagrees with. Always run gofmt -w after regeneration and before commit.
`go fix` modernizers are version-gated by go.mod. Preview with go fix -diff ./.... List with go tool fix help.
Code Conventions
Formatting: gofmt/goimports on every change (make check fails on unformatted files).
Errors: Always handle (never _). Wrap: fmt.Errorf("decompress %v: %w", name, err). Lowercase, no punctuation, guard clauses. Never wrap io.EOF (callers use ==).
Error layering: Repo wraps infra errors with context. Service translates to domain sentinels (ErrUserNotFound, ErrInsufficientFunds). Handler maps sentinels to HTTP/gRPC codes. Log errors only at system boundaries (handlers, consumers, workers), not at every layer.
Structured errors (APIs only): For HTTP/gRPC APIs needing machine-readable error codes in responses, define an AppError type with Code/Message/wrapped cause. Not needed for CLIs, workers, or internal packages: use sentinels + %w wrapping.
Testing: Table-driven with t.Run(), t.Helper() in helpers, t.Context() for cancellation.
Function literals: Extract complex callbacks into named vars. Nested literals around slices/maps/iterators hurt readability fast.
Build tags for simulation: //go:build simulation in driver_sim.go, //go:build !simulation in driver_real.go. Same type, different impl. Use for hardware, external APIs, infra deps.
Architecture & Design
Project structure:
Organize by feature/domain, not technical layer. Avoid /src, /utils, /common, /helpers.
Functional Options: preferred for optional configuration (WithX(...) Option + NewServer(opts ...Option)).
Constructor Injection: Accept interfaces, return structs. No global mutable state: pass deps explicitly.
Interfaces: Small (1-3 methods).
Concurrency
Golden Rules:
- Always know WHEN and HOW a goroutine terminates
- Libraries are synchronous: never launch goroutines from lib code unless concurrency IS the feature
errgroup (preferred over WaitGroup), context always first param, bounded pools for load, sender closes channels.
Cancellation traps (review these explicitly, they pass tests and hang/panic in prod):
for x := range chover an externally-produced channel (network stream, LLM provider) has noctx.Done()injection point. If the producer hangs, the consumer hangs forever. Useselect { case x, ok := <-ch: ...; case <-ctx.Done(): return }. Barerangeis fine only when you own the channel's lifecycle and it is guaranteed to close.nilpassed as acontext.Contextargument:<-nilin a select never fires, so cancellation silently does nothing (andParseSSE(nil, ...)-style calls panic on first cancel in prod). Grep fornilcontext args.- Unbuffered hub/notify channels that block forever if the receiving goroutine has already exited (shutdown deadlock). Pair every blocking send with a
selectonctx.Done(). - A goroutine writing a shared buffer (
bytes.Buffer) that another path reads: data race in tests, corruption in prod.
For detailed concurrency patterns, performance optimization, profiling, and code review checklists, see references/golang-patterns.md.
Resources
Effective Go | Code Review Comments | Release Notes | goperf.dev | fgprof
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/golang/SKILL.md
Popularity
- Repository stars
- 8
- Repository forks
- 2
- 7-day trend score
- 11
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 23 Mar 2026, 8 months ago.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/maroffo/claude-forge/golang)