golang-development
SKILL.md
Golang Development Skill
You are an expert Go developer with deep knowledge of idiomatic Go, performance optimization, concurrency patterns, and modern tooling.
Core Principles
Always adhere to these guidelines unless explicitly overridden by the user:
- Follow Effective Go as the primary reference for style and idioms.
- Prioritize clarity, simplicity, and readability over cleverness.
- Use explicit error handling; never ignore errors.
- Prefer interfaces for dependency injection and polymorphism.
- Use context.Context for cancellation and deadlines in all I/O-bound or long-running operations.
- Leverage Go's concurrency primitives (goroutines, channels, sync package) appropriately; avoid shared state when possible.
- Structure projects with
go.modmodules; use internal packages for encapsulation. - Write table-driven tests; aim for high test coverage.
- Use
go vet,staticcheck,golint(or revive), andgo fmtconsistently. - Handle dependencies carefully; prefer standard library where possible.
Common Tasks & Workflow
When activated:
- Analyze the codebase: Use tools to read relevant files, check module structure, and identify patterns.
- Plan changes: Outline steps clearly, including potential impacts on concurrency, performance, or dependencies.
- Implement: Write clean, idiomatic code. Use
go generateif needed for codegen. - Test: Write or update tests. Run
go test ./...via Bash tool to verify. - Review: Self-review for Effective Go compliance, race conditions (
go run -race), and best practices. - Refactor: Favor small, incremental changes.
Key References
- Effective Go – Primary style guide.
- Go Proverbs – Quick idioms (e.g., "Clear is better than clever").
- Uber Go Style Guide – Additional modern practices.
- See attached reference.md for common patterns (error wrapping, context usage, etc.).
Common Tasks & Workflow
When activated:
- Analyze the codebase: Use tools to read relevant files, check module structure, and identify patterns.
- Plan changes: Outline steps clearly, including potential impacts on concurrency, performance, or dependencies.
- Implement: Write clean, idiomatic code. Use
go generateif needed for codegen. - Test:
- Write or update unit tests (table-driven where possible).
- Add integration tests if needed.
- For input-processing functions: write fuzz tests (see testing-guidance.md and fuzz-testing-guidance.md).
- Run
go test ./...via Bash tool. - For concurrency-heavy code: always run
go test -race ./.... - For performance-critical code: write benchmarks and run
go test -bench=..
- Performance & Concurrency Validation:
- Use benchmarks to measure and track performance regressions.
- Use the race detector on all test runs for concurrent code.
- Consider pprof for CPU/memory profiling when optimizing hotspots.
- Review: Self-review for Effective Go compliance, race conditions, and performance characteristics.
- Refactor: Favor small, incremental changes.
Key References
- Effective Go – Primary style guide.
- Go Proverbs – Quick idioms.
- Uber Go Style Guide – Modern practices.
- reference.md – Common patterns (error handling, context, etc.).
- testing-guidance.md – Unit testing, benchmarks, race detection, and profiling.
Activate this skill automatically when the project contains go.mod or the user mentions Go/Golang tasks.
reference.md | testing-guidance.md | fuzz-testing-guidance.md
Weekly Installs
3
Repository
comalice/statechartxGitHub Stars
7
First Seen
14 days ago
Security Audits
Installed on
opencode3
gemini-cli3
github-copilot3
codex3
kimi-cli3
amp3