golang-data-structures

レビュー · 59
Registry に収録

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 sem

Verified installs0
スター12
バージョン1.0.0
品質58/100 · 有望
信頼59/100 · Do not auto-install
監査73/100 · 要レビュー

供給アセットの概要

コーディングと開発 Agent

コードレビュー、リポジトリ分析、テスト、CI、GitHub、DevOps、開発ワークフロー向けのスキルです。

カテゴリを見る

シナリオ

コーディング Agent

リポジトリを理解し、コードを編集し、プルリクエストをレビューできるコーディング Agent が必要です。

Agent 適合

Claude Code + CLI + Codex

Codex、Claude Code、Cursor、CLI、またはカスタム Agent に対応します。

インストール

準備完了

npx skills add yzfly/skills --skill golang-data-structures

メンテナンス

新しい

最終プッシュから 1 日

リスク

要レビュー

Dependency or permission surface needs review

GitHub 品質

12

58/100 品質 · 67/100 信頼

対象タグ

コーディングコーディング Agentデザイン・クリエイティブagent-skill

レビュー注記

Dependency or permission surface needs review · The skill references other skills (golang-safety, golang-concurrency, golang-design-patterns) that are not included in this submission, which may reduce standalone completeness.

Agent 導入スコアカード

信頼、監査、インストール準備状況を一目で確認

公開リポジトリのメタデータ、OpenAgentSkill のレビューシグナル、保守の鮮度、インストール準備状況を組み合わせたスコアです。候補選定の目安であり、人によるレビューの代替ではありません。

品質

有望
58

有用な候補ですが、採用前に代替と比較してください。

信頼

Do not auto-install
59

Trust Score v5 found insufficient evidence for agent installation. Treat this as discovery material, not an executable recommendation.

監査

要レビュー
73

インストール準備、安全メタデータ、保守、採用リスクの機械可読なレビュー。

OpenAgentSkill Trust Score v5

インストール前に人のレビュー

Choose a stronger alternative or inspect the source manually before any install attempt.

CodexClaude CodeCursorOpenAgentSkill CLI

スター

GitHub スター 12

リポジトリ活動

スター 12、フォーク 2

メンテナンス

最終プッシュから 1 日

ライセンス

MIT

インストール

npx skills add yzfly/skills --skill golang-data-structures

インストール安全性

標準パッケージまたはランタイムのインストールパス

権限範囲

shell or command execution, network or browser access

Agent の成果

Agent の成果データはまだありません

ドキュメント

README/SKILL.md の文脈が十分です

リスク概要

本番前にレビュー

  • The skill references other skills (golang-safety, golang-concurrency, golang-design-patterns) that are not included in this submission, which may reduce standalone completeness.
  • Low GitHub adoption signal
  • Quality score needs review
  • GitHub adoption: 12 GitHub stars

インストール準備状況

インストールパスを利用可能

  • インストールパスを利用できます
  • リポジトリの根拠を利用できます
  • ライセンスが明示されています
  • Agent-Proven の成果エビデンスはまだありません

Agent 可読メタデータ

このスキルの機械可読な判断データ。

このブロックまたは埋め込み JSON を使い、Agent がこのスキルをインストールすべきか、代替を選ぶべきか、先に人のレビューを求めるべきかを判断できます。

JSON を開く

適したタスク

  • RAG and knowledge ワークフロー
  • Claude Code チーム
  • builders willing to evaluate younger projects
  • Chunk documents

適した Agent

CodexClaude CodeCursorOpenAgentSkill CLICLI

インストール判断

コマンド
npx skills add yzfly/skills --skill golang-data-structures
ポリシー
レビュー
人によるレビュー
はい

信頼とリスク

信頼
59/100
監査
73/100
リスクレベル
要レビュー

成果ループ

エンドポイント
/api/agent/outcome
イベント ID
resolve
成果
5

インストールコマンド

npx skills add yzfly/skills --skill golang-data-structures

使わない場合

  • ベンダー提供の SLA が必要なチーム
  • production agents without a repository review
  • Low GitHub adoption signal
  • The skill references other skills (golang-safety, golang-concurrency, golang-design-patterns) that are not included in this submission, which may reduce standalone completeness.
  • OpenAgentSkill の利用フィードバックはまだありません

Agent セーフティ v2

49/100 · 自動インストールを避ける

実験的レビュー

Sparse or mixed signals. Useful for discovery, but not for autonomous installation.

Test manually in an isolated workspace and compare against safer alternatives.

API で解決

Shell またはコマンド実行

Skill メタデータに端末、CLI、Shell、サブプロセス、またはコマンド実行のワークフローが含まれます。

ネットワークアクセス

Skill はリモートページ、API、リポジトリ、外部サービスにアクセスする可能性があります。

  • 高リスク権限のヒント: Shell またはコマンド実行
  • Dependency or permission surface needs review

インストール先

Agent ワークフローにこのスキルをインストール

公開インストールエンドポイントからコマンド、安全チェックリスト、対象プロンプト、正規リンクを取得します。

skill install

OpenAgentSkill CLI

Resolve policy, run the source installer safely, and report a verified install receipt.

$ npx --yes https://github.com/Leon-Drq/openagentskill/releases/download/cli-v0.2.1/openagentskill-0.2.1.tgz install yzfly-golang-data-structures

Agent 解決プラン

インストール前に Agent に適合性を検証させます。

Resolve API は第一候補、代替、安全ポリシー、監査メモ、インストール先、Agent がそのまま使えるプロンプトを返します。

テキストプランを開く

Agent が確認すべきこと

  • Resolve API でタスク適合と代替を確認。
  • 監査・信頼スコアと安全ポリシーの警告を確認。
  • Codex、Claude Code、Cursor、CLI のインストール先互換性を確認。

プロンプトをコピー

Task: Use golang-data-structures in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20golang-data-structures%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/yzfly-golang-data-structures/install
Install command: npx skills add yzfly/skills --skill golang-data-structures
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.

Agent 引き継ぎ

別のディレクトリではなく、インストール経路を Agent に渡します。

公開インストールエンドポイントからコマンド、安全チェックリスト、対象プロンプト、正規リンクを取得します。

Install API を開く

Agent プロンプト

Use golang-data-structures for this task. Review https://www.openagentskill.com/api/skills/yzfly-golang-data-structures/install, then install with: npx skills add yzfly/skills --skill golang-data-structures

Registry メタデータ

自動スキル選択用の Agent 可読プロファイル。

Registry API 経由で判断、信頼、監査、ユースケース、インストールのシグナルを提供し、UI をスクレイピングせずに Agent が順位付けできます。

Manifest を開く

Agent 適合

57/100

RAG and knowledge

プラットフォーム

Claude Code

監査レポート

要レビュー · 73/100

インストール準備、安全メタデータ、保守、採用リスクの機械可読なレビュー。

監査レポートを見る評価レポートを見る

Agent 判断パネル

Needs validation for RAG and knowledge

Agent ワークフローに追加する前に手動でリポジトリをレビューしてください。

57
準備状況
レビュー
段階

スタック内の役割

検証が必要

主な適合

RAG and knowledge

信頼ラベル

手動レビューが必要

インストールパス

コマンド準備済み

使う場面

  • RAG and knowledge ワークフロー
  • Claude Code チーム
  • builders willing to evaluate younger projects

根拠

  • 最近のリポジトリ活動
  • インストールコマンドまたは GitHub リポジトリが利用可能
  • 品質プロファイル 58/100

先にレビュー

  • Low GitHub adoption signal
  • The skill references other skills (golang-safety, golang-concurrency, golang-design-patterns) that are not included in this submission, which may reduce standalone completeness.
  • OpenAgentSkill の利用フィードバックはまだありません

実装パス

  1. 1サンドボックスの Agent にインストールし、RAG and knowledge タスクを一度最初から最後まで実行します。
  2. 2Compare output quality, latency, and failure behavior against at least one alternative.
  3. 3Promote it into production only after reviewing repository permissions, license, and maintenance signals.

信頼プロファイル

Do not auto-install

Trust Score v5 found insufficient evidence for agent installation. Treat this as discovery material, not an executable recommendation.

59
OpenAgentSkill Trust Score

GitHub 採用度

修正

GitHub スター 12

スター/フォーク活動

修正

スター 12、フォーク 2; 現在のメタデータでは Issue 活動を利用できません

最近のメンテナンス

合格

最終プッシュから 1 日

ライセンスの明確さ

合格

MIT

良いシグナル

  • AI レビュー承認済み
  • インストールパスを利用できます
  • リポジトリの根拠を利用できます
  • 最近保守されたリポジトリ
  • インストールコマンドに明確な高リスクパターンはありません
  • 成果ループは準備済みですが、最初の実行が必要です

インストール前にレビュー

  • The skill references other skills (golang-safety, golang-concurrency, golang-design-patterns) that are not included in this submission, which may reduce standalone completeness.
  • Low GitHub adoption signal
  • Quality score needs review
  • GitHub adoption: 12 GitHub stars
  • Stars/forks activity: 12 stars, 2 forks; issue activity unavailable in current metadata
  • Dependency/runtime risk: command execution surface, external package install surface
  • 実際の Agent 成果レポートはまだありません
  • 無人インストールの前に人によるレビューが必要です

推奨アクション

Choose a stronger alternative or inspect the source manually before any install attempt.

品質プロファイル

有望 Agent ワークフロー向けの候補

有用な候補ですが、採用前に代替と比較してください。

58
GitHub スター
12
鮮度
1 日前
インストール準備完了
はい
ライセンス
MIT
インストール前にレビュー: Low GitHub adoption signal · The skill references other skills (golang-safety, golang-concurrency, golang-design-patterns) that are not included in this submission, which may reduce standalone completeness.

ワークフロー適合

このスキルを使うシナリオ

ワークフロー適合

完全なワークフローに追加

代替候補

インストール前に比較

このタスクに適する可能性のある類似スキル。

すべて比較

概要

--- name: golang-data-structures description: "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." user-invocable: true license: MIT compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. metadata: author: samber version: "1.1.1" openclaw: emoji: "🗃️" homepage: https://github.com/samber/cc-skills-golang requires: bins: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent ---

**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.

# Go Data Structures

Built-in and standard library data structures: internals, correct usage, and selection guidance. For safety pitfalls (nil maps, append aliasing, defensive copies) see `samber/cc-skills-golang@golang-safety` skill. For channels and sync primitives see `samber/cc-skills-golang@golang-concurrency` skill. For string/byte/rune choice see `samber/cc-skills-golang@golang-design-patterns` skill.

## Best Practices Summary

1. **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 rehashing 2. **Arrays** SHOULD be preferred over slices only for fixed, compile-time-known sizes (hash digests, IPv4 addresses, matrix dimensions) 3. **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 allocated 4. **Use `container/heap`** for priority queues, **`container/list`** only when frequent middle insertions are needed, **`container/ring`** for fixed-size circular buffers 5. **`strings.Builder`** MUST be preferred for building strings; **`bytes.Buffer`** MUST be preferred for bidirectional I/O (implements both `io.Reader` and `io.Writer`) 6. Generic data structures SHOULD use the **tightest constraint** possible — `comparable` for keys, custom interfaces for ordering 7. **`unsafe.Pointer`** MUST only follow the 6 valid conversion patterns from the Go spec — NEVER store in a `uintptr` variable across statements 8. **`weak.Pointer[T]`** (Go 1.24+) SHOULD be used for caches and canonicalization maps to allow GC to reclaim entries

## Slice Internals

A slice is a 3-word header: pointer, length, capacity. Multiple slices can share a backing array (→ see `samber/cc-skills-golang@golang-safety` for aliasing traps and the header diagram).

### Capacity Growth

- < 256 elements: capacity doubles - > = 256 elements: grows by ~25% (`newcap += (newcap + 3*256) / 4`) - Each growth copies the entire backing array — O(n)

### Preallocation

```go // Exact size known users := make([]User, 0, len(ids))

// Approximate size known results := make([]Result, 0, estimatedCount)

// Pre-grow before bulk append (Go 1.21+) s = slices.Grow(s, additionalNeeded) ```

### `slices` Package (Go 1.21+)

Key functions: `Sort`/`SortFunc`, `BinarySearch`, `Contains`, `Compact`, `Grow`. For `Clone`, `Equal`, `DeleteFunc` → see `samber/cc-skills-golang@golang-safety` skill.

**[Slice Internals Deep Dive](./references/slice-internals.md)** — Full `slices` package reference, growth mechanics, `len` vs `cap`, header copying, backing array aliasing.

## Map Internals

Maps are hash tables with 8-entry buckets and overflow chains. They are reference types — assigning a map copies the pointer, not the data.

### Preallocation

```go m := make(map[string]*User, len(users)) // avoids rehashing during population ```

### `maps` Package Quick Reference (Go 1.21+)

| Function | Purpose | | ----------------- | ---------------------------- | | `Collect` (1.23+) | Build map from iterator | | `Insert` (1.23+) | Insert entries from iterator | | `All` (1.23+) | Iterator over all entries | | `Keys`, `Values` | Iterators over keys/values |

For `Clone`, `Equal`, sorted iteration → see `samber/cc-skills-golang@golang-safety` skill.

**[Map Internals Deep Dive](./references/map-internals.md)** — How Go maps store and hash data, bucket overflow chains, why maps never shrink (and what to do about it), comparing map performance to alternatives.

## Arrays

Fixed-size, value types. Copied entirely on assignment. Use for compile-time-known sizes:

```go type Digest [32]byte // fixed-size, value type var grid [3][3]int // multi-dimensional cache := map[[2]int]Result{} // arrays are comparable — usable as map keys ```

Prefer slices for everything else — arrays cannot grow and pass by value (expensive for large sizes).

## container/ Standard Library

| Package | Data Structure | Best For | | --- | --- | --- | | `container/list` | Doubly-linked list | LRU caches, frequent middle insertion/removal | | `container/heap` | Min-heap (priority queue) | Top-K, scheduling, Dijkstra | | `container/ring` | Circular buffer | Rolling windows, round-robin | | `bufio` | Buffered reader/writer/scanner | Efficient I/O with small reads/writes |

Container types use `any` (no type safety) — consider generic wrappers. **[Container Patterns, bufio, and Examples](./references/containers.md)** — When to use each container type, generic wrappers to add type safety, and `bufio` patterns for efficient I/O.

## strings.Builder vs bytes.Buffer

Use `strings.Builder` for pure string concatenation (avoids copy on `String()`), `bytes.Buffer` when you need `io.Reader` or byte manipulation. Both support `Grow(n)`. **[Details and comparison](./references/containers.md)**

## Generic Collections (Go 1.18+)

Use the tightest constraint possible. `comparable` for map keys, `cmp.Ordered` for sorting, custom interfaces for domain-specific ordering.

```go type Set[T comparable] map[T]struct{}

func (s Set[T]) Add(v T) { s[v] = struct{}{} } func (s Set[T]) Contains(v T) bool { _, ok := s[v]; return ok } ```

**[Writing Generic Data Structures](./references/generics.md)** — Using Go 1.18+ generics for type-safe containers, understanding constraint satisfaction, and building domain-specific generic types.

## Pointer Types

| Type | Use Case | Zero Value | | --- | --- | --- | | `*T` | Normal indirection, mutation, optional values | `nil` | | `unsafe.Pointer` | FFI, low-level memory layout (6 spec patterns only) | `nil` | | `weak.Pointer[T]` (1.24+) | Caches, canonicalization, weak references | N/A |

**[Pointer Types Deep Dive](./references/pointers.md)** — Normal pointers, `unsafe.Pointer` (the 6 valid spec patterns), and `weak.Pointer[T]` for GC-safe caches that don't prevent cleanup.

## Copy Semantics Quick Reference

| Type | Copy Behavior | Independence | | --- | --- | --- | | `int`, `float`, `bool`, `string` | Value (deep copy) | Fully independent | | `array`, `struct` | Value (deep copy) | Fully independent | | `slice` | Header copied, backing array shared | Use `slices.Clone` | | `map` | Reference copied | Use `maps.Clone` | | `channel` | Reference copied | Same channel | | `*T` (pointer) | Address copied | Same underlying value | | `interface` | Value copied (type + value pair) | Depends on held type |

## Third-Party Libraries

For advanced data structures (trees, sets, queues, stacks) beyond the standard library:

- **`emirpasic/gods`** — comprehensive collection library (trees, sets, lists, stacks, maps, queues) - **`deckarep/golang-set`** — thread-safe and non-thread-safe set implementations - **`gammazero/deque`** — fast double-ended queue

When using third-party libraries, refer to their official documentation and code examples for current API signatures. Context7 can help as a discoverability platform.

## Cross-References

- → See `samber/cc-skills-golang@golang-performance` skill for struct field alignment, memory layout optimization, and cache locality - → See `samber/cc-skills-golang@golang-safety` skill for nil map/slice pitfalls, append aliasing, defensive copying, `slices.Clone`/`Equal` - → See `samber/cc-skills-golang@golang-concurrency` skill for channels, `sync.Map`, `sync.Pool`, and all sync primitives - → See `samber/cc-skills-golang@golang-design-patterns` skill for `string` vs `[]byte` vs `[]rune`, iterators, streaming - → See `samber/cc-skills-golang@golang-structs-interfaces` skill for struct composition, embedding, and generics vs `any` - → See `samber/cc-skills-golang@golang-code-style` skill for slice/map initialization style

## Common Mistakes

| Mistake | Fix | | --- | --- | | Growing a slice in a loop without preallocation | Each growth copies the entire backing array — O(n) per growth. Use `make([]T, 0, n)` or `slices.Grow` | | Using `container/list` when a slice would suffice | Linked lists have poor cache locality (each node is a separate heap allocation). Benchmark first | | `bytes.Buffer` for pure string building | Buffer's `String()` copies the underlying bytes. `strings.Builder` avoids this copy | | `unsafe.Pointer` stored as `uintptr` across statements | GC can move the object between statements — the `uintptr` becomes a dangling reference | | Large struct values in maps (copying overhead) | Map access copies the entire value. Use `map[K]*V` for large value types to avoid the copy |

## References

- [Go Data Structures (Russ Cox)](https://research.swtch.com/godata) - [The Go Memory Model](https://go.dev/ref/mem) - [Effective Go](https://go.dev/doc/effective_go)

技術詳細

バージョン
1.0.0
ライセンス
MIT
最終更新
2026年8月23日
公開日
2026年8月23日

判断の要約

検証が必要

57
準備完了
レビュー
段階

最近のリポジトリ活動

監査

インストールレビュー

インストールと採用のレビュー

73
要レビュー
セキュリティ
74/100
メンテナンス
100/100
インストール
92/100
完全な監査を開く評価レポートを見る

Agent 実証エビデンス

Agent 実証エビデンス

Resolve、レビュー、インストール、限定実行後の成果レポート。

0
実証済み
Needs first agent run自動インストール: 先にレビュー最新: 不明
成功率
直近の失敗
成果
0
出力品質
失敗
0
非該当
0
インストール数
0
リスクによりブロック
0
設定が必要
0
本番
0

Agent の実行結果はまだありません。最初の実行では /api/agent/outcome を通じて成功、設定要件、リスクによるブロック、失敗、非該当を報告できます。

インストール

Agent ワークフローに追加

無料・オープンソース. 本番 Agent にインストールする前にレポートを確認してください。

成長ループ

共有キット

X

golang-data-structures 用のシナリオベース草案です。X へ手動投稿できます。

キュレーターノート
golang-data-structures: Golang data structures — slices (internals, capacity growth, preallocation, slices package),...

12 stars

https://www.openagentskill.com/skills/yzfly-golang-data-structures?ref=x
X 下書きを開く
任意:インストールコマンド付きの返信
Listing + install path for golang-data-structures:
https://www.openagentskill.com/skills/yzfly-golang-data-structures?ref=x

Install: npx skills add yzfly/skills --skill golang-data-structures
返信の下書きを開く

掲載元

Registry により登録

申請可能

この掲載は公開ソースから登録されており、メンテナー申請が承認されるまで公式として表示されません。

作成者
yzfly
ソース
yzfly/skills
インデックス作成者
OpenAgentSkill コミュニティインデックス

帰属は公開リポジトリまたは作成者プロフィールにリンクされています。作成者は掲載を申請して所有権シグナルを更新できます。

このスキルを申請

所有者の申請

このスキル掲載を申請

この Registry により登録 掲載は yzfly に帰属していますが、まだ公式として表示されていません。申請すると、確認済み所有者シグナルが追加され、今後の公開、インストール、監査更新の信頼性が高まります。

クリエイター被リンクキット

README にエビデンスバッジを追加

開発者がリポジトリを評価する場所で、正規掲載、現在の信頼・監査シグナル、実際の Agent-Proven エビデンスを表示します。

[![Listed on OpenAgentSkill](https://www.openagentskill.com/api/badge/yzfly-golang-data-structures?metric=listed&label=Listed)](https://www.openagentskill.com/skills/yzfly-golang-data-structures)
[![OpenAgentSkill Trust](https://www.openagentskill.com/api/badge/yzfly-golang-data-structures?metric=trust&label=Trust)](https://www.openagentskill.com/skills/yzfly-golang-data-structures)
[![OpenAgentSkill Audit](https://www.openagentskill.com/api/badge/yzfly-golang-data-structures?metric=audit&label=Audit)](https://www.openagentskill.com/skills/yzfly-golang-data-structures/audit)
[![Agent Proven](https://www.openagentskill.com/api/badge/yzfly-golang-data-structures?metric=proven&label=Agent%20Proven)](https://www.openagentskill.com/skills/yzfly-golang-data-structures)

作者

Y

yzfly

@yzfly

プラットフォーム適合

健全性シグナル

GitHub スター
12
品質スコア
31/100
最終 GitHub プッシュ
2026年8月23日
フレームワークのヒント
不明
OpenAgentSkill 閲覧数
0
インストールコピー数
0
外部クリック
0

コミュニティシグナル

このスキルが Agent ワークフローに役立つかを共有してください。集約されたフィードバックがランキングを改善します。

信頼と安全性

Do not auto-install

59
  • GitHub 採用度GitHub スター 12修正
  • スター/フォーク活動スター 12、フォーク 2; 現在のメタデータでは Issue 活動を利用できません修正
  • 最近のメンテナンス最終プッシュから 1 日合格
  • ライセンスの明確さMIT合格
  • README/SKILL.md の完全性メタデータには十分な利用・ワークフロー文脈があります合格
  • 依存関係/ランタイムのリスクcommand execution surface, external package install surface確認