Agent skill
Language
Core idioms, style guides, and best practices for writing idiomatic Go code.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/language-hoangnguyen0403-agent-skills-standar-3
Metadata
Additional technical details for this skill
- labels
-
golang style idioms best-practices
- triggers
-
{ "files": [ "**/*.go", "go.mod" ], "keywords": [ "golang", "go code", "style", "idiomatic" ] }
SKILL.md
Golang Language Standards
Priority: P0 (CRITICAL)
Guidelines
- Fmt: Run
gofmtorgoimportson save. - Naming: Use
camelCasefor internal,PascalCasefor exported. - Packages: Short, lowercase, singular, no underscores (e.g.,
net/httpnotnet_http). - Interfaces: Define where used, not where implemented. Small interfaces (1-2 methods).
- Errors: Return error as last return value. Handle immediately.
- Variables: Short names for small scope (
i,ctx), descriptive for large scope. - Slices: Prefer slices over arrays. Use
make()for capacity. - Const: Use
iotafor enums.
Anti-Patterns
- No
init: Use constructors, notinit(). - No Globals: Use DI, not global mutable state.
- No
panic: Return errors, don't panic. - No
_ignored errors: Always check and handle errors. - No stutter:
log.Error, notlog.LogError.
references
- Idioms
- Effective Go Summary
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?