xiaohongshu
xiaohongshu
go-uber-style
Use this skill when writing Go code following the Uber Go Style Guide. Provides comprehensive guidance on idiomatic Go patterns, error handling, concurrency safety, performance optimization, and test-driven development. Covers all critical Uber Go rules including channel sizing, goroutine managem...
Full skill instructions
This skill provides comprehensive guidance for writing idiomatic Go code that strictly follows the Uber Go Style Guide. It emphasizes Test-Driven Development (TDD), proper error handling without exceptions, safe concurrency patterns, and Go's unique language idioms including zero values, composition over inheritance, and interface design.
Use this skill for any Go-related programming task:
1. Test-Driven Development (TDD)
2. Explicit Error Handling
fmt.Errorf with %w3. Single Exit Point Pattern
run() pattern to centralize exit logic in main()main() functions clean and testable4. Go Idioms
var mu sync.Mutex is ready to use)Write the test first (TDD mandatory)
Implement minimal code to pass the test (Green)
Refactor while keeping tests green
Verify quality standards
go fmt to format codego vet to catch common mistakesgo test -race to detect race conditionsCheck TDD compliance
Review Uber Go Style Guide compliance
Validate interface design
Check for Go-specific issues
Ensure tests exist first
Identify anti-patterns
4 parameters (use functional options pattern instead)
Refactor incrementally
For detailed code patterns, examples, and guidelines, consult the reference files:
references/uber-go-patterns.md - Comprehensive Uber Go Style Guide patterns and anti-patterns
references/error-handling.md - Error wrapping, sentinel errors, and error matching patternsreferences/concurrency-safety.md - Safe concurrent programming patterns in Go
references/performance.md - Performance optimization patterns
references/testing-patterns.md - Table-driven testing examples and TDD workflowsUse grep to search these files for specific patterns when needed:
grep -r "functional options" references/
grep -r "channel size" references/concurrency-safety.md
grep -r "strconv" references/performance.md
Pre-built templates are available in assets/templates/ for common Go patterns:
assets/templates/main_single_exit.go - Single exit point pattern for main()assets/templates/table_test.go - Table-driven test templateassets/templates/functional_options.go - Functional options pattern for >4 parametersassets/templates/http_handler.go - HTTP handler with proper error handlingCopy and customize these templates as starting points for new code.
Before delivering Go code, verify:
Critical Uber Go Rules:
*io.Reader is wrong)init()json:"field")init() unless truly necessaryCode Quality:
go buildgo test -racego fmtgo vetgolangci-lint run)Error Handling:
_ discards)%w)Interfaces:
var _ Interface = (*Type)(nil))Performance (when relevant):
strconv for primitive string conversions (not fmt)Time & Enums:
time.Time for instants, time.Duration for periodsWhen providing Go coding assistance:
go vet, golangci-lint, staticcheck)This skill overrides some general coding principles with Go-specific rules:
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience