Skills for Real Engineers. Straight from my .agents directory.
golang-data-structures
Agent skill fromsamber/cc-skills-golang
Golang data structures — slices (internals, capacity growth, preallocation, slices package), maps (internals, hash buckets, maps package), arrays, container/list/heap/ring, strings.Builder vs bytes.Buffer, generic collections, pointers (unsafe.Pointer, weak.Pointer), and copy semantics. Use when choosing or optimizing Go data structures, implementing generic containers, using container/ packages, unsafe or weak pointers, or questioning slice/map internals. Not for applying optimization patterns once profiling has identified a bottleneck (→ See `samber/cc-skills-golang@golang-performance` skill).
How to install golang-data-structures
npx skills add samber/cc-skills-golang# or add only this skill to Claude Code: copy the folder
skills/golang-data-structures/
# into
~/.claude/skills/golang-data-structures/ (all projects)
.claude/skills/golang-data-structures/ (one project)
1**Persona:** You are a Go engineer who understands data structure internals. You choose the right structure for the job — not the most familiar one — by reasoning about memory layout, allocation cost, and access patterns.23# Go Data Structures45Built-in and standard library data structures: internals, correct usage, and selection guidance.67- For safety pitfalls (nil maps, append aliasing, defensive copies) see `samber/cc-skills-golang@golang-safety` skill.8- For channels and sync primitives see `samber/cc-skills-golang@golang-concurrency` skill.9- For string/byte/rune choice see `samber/cc-skills-golang@golang-design-patterns` skill.1011## Best Practices Summary12131. **Preallocate slices and maps** with `make(T, 0, n)` / `make(map[K]V, n)` when size is known or estimable — avoids repeated growth copies and rehashing142. **Arrays** SHOULD be preferred over slices only for fixed, compile-time-known sizes (hash digests, IPv4 addresses, matrix dimensions)153. **NEVER rely on slice capacity growth timing** — the growth algorithm changed between Go versions and may change again; your code should not depend on when a new backing array is allocated164. **Use `container/heap`** for priority queues, **`container/list`** only when frequent middle insertions are needed, **`container/ring`** for fixed-size circular buffers175. **`strings.Builder`** MUST be preferred for building strings; **`bytes.Buffer`** MUST be preferred for bidirectional I/O (implements both `io.Reader` and `io.Writer`)18…
Excerpt shown under the repository's MIT license.
More skills in cc-skills-golang
Similar skill repositories
Public repository for Agent Skills
An AI skill that provides design intelligence for building professional UI/UX across multiple platforms.
Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Production-grade engineering skills for AI coding agents.
The open-source app everyone uses to manage agents at work
