golang-data-structures Skill for Claude Code: Go Slices, Maps and Containers
Makes Claude pick and use Go slices, maps, containers, generics and pointers correctly, and explain the internals behind each choice.
- Installs
- 41.1K
- on skills.sh
- Stars
- 3.7K
- on GitHub
- Files
- 6
- besides SKILL.md
- Updated
- Nov 2026
- last repo commit
golang-data-structures teaches Claude how Go's built-in and standard library data structures work. Ask about slices, maps, arrays, container/list, heap or ring, generic collections, or unsafe and weak pointers, and Claude applies its rules, such as preallocating with make and preferring strings.Builder for building strings.
It is for choosing and optimizing structures. SKILL.md sends the step after profiling, applying optimization patterns to a known bottleneck, to the separate golang-performance skill. It bundles five reference guides and no scripts.
Good for
- Go developers who want the right data structure picked for the job
- Anyone tuning allocations, such as preallocating slices and maps
- Developers puzzled by slice aliasing, map behavior or copy semantics
Install golang-data-structures
Claude Code
- 1
Copy this prompt.
Install the golang-data-structures skill in Claude Code. Run this command: /plugin marketplace add samber/cc /plugin install cc-skills-golang@samber Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Pick one route, not several. The README says the skills cross-reference each other and a subset gives a partial and potentially inconsistent view, so the plugin or the whole-set CLI command is the better choice. The plugin installs the repo's 46 skill folders; its manifest declares no hooks, commands or MCP servers. Claude Code names plugin skills /plugin-name:skill-name, so after the plugin install the full name is /cc-skills-golang:golang-data-structures. The samber/cc marketplace lists seven plugins; the second command installs only cc-skills-golang.
From the project README. Source.
What's in the skill
When it loads
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).
Sections in SKILL.md
- Best Practices Summary
- Slice Internals
- Capacity Growth
- Preallocation
- slices Package (Go 1.21+)
- Map Internals
- Preallocation
- maps Package Quick Reference (Go 1.21+)
- Arrays
- container/ Standard Library
- strings.Builder vs bytes.Buffer
- Generic Collections (Go 1.18+)
- Pointer Types
- Copy Semantics Quick Reference
- Third-Party Libraries
- Cross-References
Key facts
- Installs on skills.sh
- 41,121 as of 2026-11-02
- Last repo commit
- 2026-11-01
What it includes
Eight rules, such as preallocate and never rely on growth timing
The skill opens with eight numbered rules. They cover preallocating slices and maps, preferring arrays only for fixed sizes, using container/heap for priority queues, and following the six valid unsafe.Pointer patterns.
Read ·
Best practices summaryHow slices grow, how to preallocate, and the slices package
Covers the three-word slice header, capacity growth, preallocation with make and slices.Grow, and key slices functions. The deep dive is references/slice-internals.md.
Read ·
Slice internalsHash buckets, preallocation and the maps package
Explains maps as hash tables with 8-entry buckets and overflow chains, and why you preallocate with make. The deep dive is references/map-internals.md.
Read ·
Map internalsFixed-size value types for compile-time-known sizes
Arrays copy entirely on assignment and are comparable, so they work as map keys. SKILL.md says to prefer slices for everything else.
Read ·
ArraysWhen to use list, heap, ring and bufio
A table of container/list, container/heap, container/ring and bufio with the job each fits. The deep dive is references/containers.md.
Read ·
container/ packagesBuilder for string building, Buffer when you need io.Reader
Both support Grow(n). The details are in references/containers.md.
Read ·
strings.Builder vs bytes.BufferUse the tightest type constraint, with a small Set example
Guidance for building generic structures with comparable and cmp.Ordered constraints. The deep dive is references/generics.md.
Read ·
Generic collectionsNormal pointers, unsafe.Pointer and weak.Pointer
Compares *T, unsafe.Pointer and weak.Pointer (Go 1.24+) and when each is right. The deep dive is references/pointers.md.
Read ·
Pointer typesWhich types copy by value and which share data
A quick table of what is copied and what stays shared for ints, arrays, structs, slices, maps, channels, pointers and interfaces.
Read ·
Copy semantics tableFive mistakes with the fix for each
Five rows, such as growing a slice in a loop without preallocation or storing unsafe.Pointer as a uintptr across statements.
Read ·
Common mistakesemirpasic/gods, deckarep/golang-set, gammazero/deque
Named for trees, sets and queues beyond the standard library. SKILL.md tells Claude to check each library's own documentation for current API signatures.
Read ·
Third-party libraries
From the official docs
Permissions
Low risk
Claude can edit your Go files and run go and git commands while this skill is active. Work on a branch and read the diff before you commit.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It edits files and runs commands in your project
The frontmatter lists Edit, Write and these shell commands: go:*, golangci-lint:*, git:*, godig:*, gopls:*. Work on a branch and read the diff before you commit. github.com
The recommended plugin route installs the whole repo
The plugin route and the --all skills CLI command add all 46 skill folders in the repo, not only this one. The plugin manifest (.claude-plugin/plugin.json, version 2.0.1) declares a name, description, author, license and keywords, and lists no hooks, commands or MCP servers. The skills CLI docs say --all installs every skill into every agent it supports without prompts. github.com
Technical details
| Sign-in and keys | SKILL.md names no account or API key. |
|---|---|
| Scopes |
|
Questions
What does golang-data-structures do?
It teaches Claude how Go slices, maps, arrays, container/ packages, generic collections and pointers work, so it picks the right one and avoids common mistakes. Examples are preallocating with make, using strings.Builder for string building, and keeping unsafe.Pointer to the six valid patterns.
How do I install golang-data-structures?
Install the whole golang set, not only this skill. The README calls the skills atomic, cross-referencing units and says a partial install gives a potentially inconsistent view. The install box lists the Claude Code plugin (/plugin marketplace add samber/cc, then /plugin install cc-skills-golang@samber), the skills CLI for the whole set or for this skill alone, and the README's Codex, Gemini CLI, Cursor and OpenCode routes. The README documents no Claude app route, so none is listed.
Do I need the other golang skills with golang-data-structures?
Installing the set is the safer choice. SKILL.md hands neighboring topics to other skills: golang-performance, golang-safety, golang-concurrency, golang-design-patterns, golang-structs-interfaces, golang-code-style. The README says to install the general-purpose skills together, and the whole-set install does that.
What does golang-data-structures need on my machine?
The frontmatter names these programs: go. SKILL.md names no API key or account.
Is golang-data-structures safe?
It is instruction text and reference files, and the folder bundles no scripts. When you use it, Claude can edit files and run go, golangci-lint, git, godig and gopls commands in your project, as its frontmatter allows. Work on a branch, read the diff and approve commands you do not recognize.
golang-data-structures vs golang-performance?
golang-data-structures is about choosing and using the structures. Its description says it is not for applying optimization patterns once profiling has found a bottleneck, and points to golang-performance for that.
Does golang-data-structures work in Codex, Cursor or the Claude app?
The SKILL.md compatibility field says it is designed for Claude Code, Codex or a similar harness, and the README says the skills are built for Claude Code, Codex, Gemini, Copilot, Antigravity and Cursor. The install box covers Claude Code, Codex, Gemini CLI, Cursor, OpenCode and the skills CLI. The README documents no Claude app route.
Information
updated Nov 2, 2026
- Repository
- samber/cc-skills-golang
- Folder
skills/golang-data-structures
Sources
Docs, issue trackers and discussions this page is built from.
Show all 6Hide
- cc-skills-golang README · github.com
- skills CLI commands · github.com
- cc-skills-golang plugin.json · github.com
- samber/cc marketplace.json · github.com
- Claude Code skills · code.claude.com
- golang-data-structures SKILL.md · github.com