golang-code-style

レビュー · 64
Registry に収録

Golang code style conventions — line length and breaking, variable declarations, control flow clarity, when comments help vs hurt. Use when writing or reviewing Go code, asking about style or clarity, or establishing project coding standards. Not for naming conventions (→ See `sa

Verified installs0
スター3.0K
バージョン1.0.0
品質82/100 · 強い
信頼64/100 · サンドボックス限定
監査81/100 · 要レビュー

供給アセットの概要

コーディングと開発 Agent

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

カテゴリを見る

シナリオ

コーディング Agent

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

Agent 適合

Claude Code + OpenAI Agents + CLI

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

インストール

準備完了

npx skills add samber/cc-skills-golang --skill golang-code-style

メンテナンス

新しい

最終プッシュから 2 日

リスク

要レビュー

Dependency or permission surface needs review

GitHub 品質

3.0K

82/100 品質 · 72/100 信頼

対象タグ

コーディングコーディング Agentコーディング Agentagent-skill

レビュー注記

Dependency or permission surface needs review · Permission surface may require sandboxing

Agent 導入スコアカード

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

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

品質

強い
82

本番ワークフローの候補に値する堅実な選択肢です。

信頼

サンドボックス限定
64

信頼シグナルが不足または混在する有用な候補です。結果ループがタスク適合を示すまで、隔離されたワークスペースで使用してください。

監査

要レビュー
81

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

OpenAgentSkill Trust Score v5

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

実作業で使う前に、サンドボックスでのみ実行し、近い代替と比較してください。

CodexClaude CodeCursorOpenAgentSkill CLI

スター

GitHub スター 3.0K

リポジトリ活動

スター 3.0K、フォーク 197

メンテナンス

最終プッシュから 2 日

ライセンス

MIT

インストール

npx skills add samber/cc-skills-golang --skill golang-code-style

インストール安全性

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

権限範囲

shell or command execution, filesystem or document access

Agent の成果

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

ドキュメント

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

リスク概要

本番前にレビュー

  • The SKILL.md excerpt references a 'Parallelizing Code Style Reviews' section that is not visible in the provided excerpt; ensure it exists in the full file to avoid broken references.
  • Financial research output is not financial advice; require human review before any live investment decision.
  • Quality score needs review
  • Permission surface needs review: shell or command execution, filesystem or document access

インストール準備状況

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

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

Agent 可読メタデータ

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

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

JSON を開く

適したタスク

  • コーディング Agent ワークフロー
  • Claude Code チーム
  • GitHub 採用シグナルを重視するチーム
  • Inspect source files

適した Agent

CodexClaude CodeCursorOpenAgentSkill CLIOpenAI AgentsCLI

インストール判断

コマンド
npx skills add samber/cc-skills-golang --skill golang-code-style
ポリシー
レビュー
人によるレビュー
はい

信頼とリスク

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

成果ループ

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

インストールコマンド

npx skills add samber/cc-skills-golang --skill golang-code-style

使わない場合

  • ベンダー提供の SLA が必要なチーム
  • production agents without a repository review
  • The SKILL.md excerpt references a 'Parallelizing Code Style Reviews' section that is not visible in the provided excerpt; ensure it exists in the full file to avoid broken references.
  • 高リスク権限のヒント: Shell またはコマンド実行
  • Dependency or permission surface needs review

Agent セーフティ v2

45/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、サブプロセス、またはコマンド実行のワークフローが含まれます。

Browser automation

Skill may drive a browser or interact with web pages.

ネットワークアクセス

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

ファイルシステムアクセス

Skill はプロジェクトファイル、ドキュメント、生成物、ローカルワークスペース状態を読み書きする可能性があります。

  • 高リスク権限のヒント: 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 samber-golang-code-style

Agent 解決プラン

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

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

テキストプランを開く

Agent が確認すべきこと

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

プロンプトをコピー

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

Agent 引き継ぎ

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

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

Install API を開く

Agent プロンプト

Use golang-code-style for this task. Review https://www.openagentskill.com/api/skills/samber-golang-code-style/install, then install with: npx skills add samber/cc-skills-golang --skill golang-code-style

Registry メタデータ

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

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

Manifest を開く

Agent 適合

95/100

コーディング Agent

プラットフォーム

Claude Code, OpenAI Agents

監査レポート

要レビュー · 81/100

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

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

Agent 判断パネル

コーディング Agent 向けの第一候補

有力候補として扱い、自分の Agent スタックで README とインストール経路を検証してください。

95
準備状況
採用
段階

スタック内の役割

第一候補

主な適合

コーディング Agent

信頼ラベル

本番対応

インストールパス

コマンド準備済み

使う場面

  • コーディング Agent ワークフロー
  • Claude Code チーム
  • GitHub 採用シグナルを重視するチーム

根拠

  • GitHub スター 3,010
  • 最近のリポジトリ活動
  • インストールコマンドまたは GitHub リポジトリが利用可能
  • 品質プロファイル 82/100
  • OpenAgentSkill エンゲージメント 4 件

先にレビュー

  • The SKILL.md excerpt references a 'Parallelizing Code Style Reviews' section that is not visible in the provided excerpt; ensure it exists in the full file to avoid broken references.

実装パス

  1. 1サンドボックスの Agent にインストールし、コーディング Agent タスクを一度最初から最後まで実行します。
  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.

信頼プロファイル

サンドボックス限定

信頼シグナルが不足または混在する有用な候補です。結果ループがタスク適合を示すまで、隔離されたワークスペースで使用してください。

64
OpenAgentSkill Trust Score

GitHub 採用度

合格

GitHub スター 3.0K

スター/フォーク活動

情報

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

最近のメンテナンス

合格

最終プッシュから 2 日

ライセンスの明確さ

合格

MIT

良いシグナル

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

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

  • The SKILL.md excerpt references a 'Parallelizing Code Style Reviews' section that is not visible in the provided excerpt; ensure it exists in the full file to avoid broken references.
  • Financial research output is not financial advice; require human review before any live investment decision.
  • Quality score needs review
  • Permission surface needs review: shell or command execution, filesystem or document access
  • Dependency/runtime risk: command execution surface, network or browser surface
  • Permission surface: shell or command execution, filesystem or document access
  • 実際の Agent 成果レポートはまだありません
  • 無人インストールの前に人によるレビューが必要です

推奨アクション

実作業で使う前に、サンドボックスでのみ実行し、近い代替と比較してください。

品質プロファイル

強い Agent ワークフロー向けの候補

本番ワークフローの候補に値する堅実な選択肢です。

82
GitHub スター
3.0K
鮮度
2 日前
インストール準備完了
はい
ライセンス
MIT
インストール前にレビュー: The SKILL.md excerpt references a 'Parallelizing Code Style Reviews' section that is not visible in the provided excerpt; ensure it exists in the full file to avoid broken references.

ワークフロー適合

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

ワークフロー適合

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

代替候補

インストール前に比較

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

すべて比較

概要

--- name: golang-code-style description: "Golang code style conventions — line length and breaking, variable declarations, control flow clarity, when comments help vs hurt. Use when writing or reviewing Go code, asking about style or clarity, or establishing project coding standards. Not for naming conventions (→ See `samber/cc-skills-golang@golang-naming` skill), linter configuration (→ See `samber/cc-skills-golang@golang-lint` skill), or doc comments (→ See `samber/cc-skills-golang@golang-documentation` skill)." user-invocable: true license: MIT compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.3.0" 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 paths: - "**/*.go" ---

**Orchestration mode:** Fan out the sub-agents described in the "Parallelizing Code Style Reviews" section, each covering an independent style concern, when reviewing code style across a large codebase, and merge their findings. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly.

> **Community default.** A company skill that explicitly supersedes `samber/cc-skills-golang@golang-code-style` skill takes precedence.

# Go Code Style

Style rules that require human judgment — linters handle formatting, this skill handles clarity. For naming see `samber/cc-skills-golang@golang-naming` skill; for design patterns see `samber/cc-skills-golang@golang-design-patterns` skill; for struct/interface design see `samber/cc-skills-golang@golang-structs-interfaces` skill.

> "Clear is better than clever." — Go Proverbs

When ignoring a rule, add a comment to the code.

## Line Length & Breaking

No rigid line limit, but lines beyond ~120 characters MUST be broken. Break at **semantic boundaries**, not arbitrary column counts. Function calls with 4+ arguments MUST use one argument per line — even when the prompt asks for single-line code:

```go // Good — each argument on its own line, closing paren separate mux.HandleFunc("/api/users", func(w http.ResponseWriter, r *http.Request) { handleUsers( w, r, serviceName, cfg, logger, authMiddleware, ) }) ```

When a function signature is too long, the real fix is often **fewer parameters** (use an options struct) rather than better line wrapping. For multi-line signatures, put each parameter on its own line.

## Variable Declarations

SHOULD use `:=` for non-zero values, `var` for zero-value initialization. The form signals intent: `var` means "this starts at zero."

```go var count int // zero value, set later name := "default" // non-zero, := is appropriate var buf bytes.Buffer // zero value is ready to use ```

### Slice & Map Initialization

Slices and maps MUST be initialized explicitly, never nil. Nil maps panic on write; nil slices serialize to `null` in JSON (vs `[]` for empty slices), surprising API consumers.

```go users := []User{} // always initialized m := map[string]int{} // always initialized users := make([]User, 0, len(ids)) // preallocate when capacity is known m := make(map[string]int, len(items)) // preallocate when size is known ```

Do not preallocate speculatively — `make([]T, 0, 1000)` wastes memory when the common case is 10 items.

### Composite Literals

Composite literals MUST use field names — positional fields break when the type adds or reorders fields:

```go srv := &http.Server{ Addr: ":8080", ReadTimeout: 5 * time.Second, WriteTimeout: 10 * time.Second, } ```

## Control Flow

### Reduce Nesting

Errors and edge cases MUST be handled first (early return). Keep the happy path at minimal indentation:

```go func process(data []byte) (*Result, error) { if len(data) == 0 { return nil, errors.New("empty data") }

parsed, err := parse(data) if err != nil { return nil, fmt.Errorf("parsing: %w", err) }

return transform(parsed), nil } ```

### Eliminate Unnecessary `else`

When the `if` body ends with `return`/`break`/`continue`, the `else` MUST be dropped. Use default-then-override for simple assignments — assign a default, then override with independent conditions or a `switch`:

```go // Good — default-then-override with switch (cleanest for mutually exclusive overrides) level := slog.LevelInfo switch { case debug: level = slog.LevelDebug case verbose: level = slog.LevelWarn }

// Bad — else-if chain hides that there's a default if debug { level = slog.LevelDebug } else if verbose { level = slog.LevelWarn } else { level = slog.LevelInfo } ```

### Complex Conditions & Init Scope

When an `if` condition has 3+ operands, MUST extract into named booleans — a wall of `||` is unreadable and hides business logic. Keep expensive checks inline for short-circuit benefit. [Details](./references/details.md)

```go // Good — named booleans make intent clear isAdmin := user.Role == RoleAdmin isOwner := resource.OwnerID == user.ID isPublicVerified := resource.IsPublic && user.IsVerified if isAdmin || isOwner || isPublicVerified || permissions.Contains(PermOverride) { allow() } ```

Scope variables to `if` blocks when only needed for the check:

```go if err := validate(input); err != nil { return err } ```

### Switch Over If-Else Chains

When comparing the same variable multiple times, prefer `switch`:

```go switch status { case StatusActive: activate() case StatusInactive: deactivate() default: panic(fmt.Sprintf("unexpected status: %d", status)) } ```

## Function Design

- Functions SHOULD be **short and focused** — one function, one job. - Functions SHOULD have **≤4 parameters**. Beyond that, use an options struct (see `samber/cc-skills-golang@golang-design-patterns` skill). - **Parameter order**: `context.Context` first, then inputs, then output destinations. - Naked returns help in very short functions (1-3 lines) where return values are obvious, but become confusing when readers must scroll to find what's returned — name returns explicitly in longer functions.

```go func FetchUser(ctx context.Context, id string) (*User, error) func SendEmail(ctx context.Context, msg EmailMessage) error // grouped into struct ```

### Prefer `range` for Iteration

SHOULD use `range` over index-based loops. Use `range n` (Go 1.22+) for simple counting.

```go for _, user := range users { process(user) } ```

## Value vs Pointer Arguments

Pass small types (`string`, `int`, `bool`, `time.Time`) by value. Use pointers when mutating, for large structs (~128+ bytes), or when nil is meaningful. [Details](./references/details.md)

## Code Organization Within Files

- **Group related declarations**: type, constructor, methods together - **Order**: package doc, imports, constants, types, constructors, methods, helpers - **One primary type per file** when it has significant methods - **Blank imports** (`_ "pkg"`) register side effects (init functions). Restricting them to `main` and test packages makes side effects visible at the application root, not hidden in library code - **Dot imports** pollute the namespace and make it impossible to tell where a name comes from — never use in library code - **Unexport aggressively** — you can always export later; unexporting is a breaking change. → See `samber/cc-skills-golang@golang-gopls` skill to unexport safely — its rename updates every call site atomically and refuses the change when lowercasing a method would break interface satisfaction, a breakage grep/sed silently ships.

## String Handling

Use `strconv` for simple conversions (faster), `fmt.Sprintf` for complex formatting. Use `%q` in error messages to make string boundaries visible. Use `strings.Builder` for loops, `+` for simple concatenation.

## Type Conversions

Prefer explicit, narrow conversions. Use generics over `any` when a concrete type will do:

```go func Contains[T comparable](slice []T, target T) bool // not []any ```

## Philosophy

- **"A little copying is better than a little dependency"** - **Use `slices` and `maps` standard packages**; for filter/group-by/chunk, use `github.com/samber/lo` - **"Reflection is never clear"** — avoid `reflect` unless necessary - **Don't abstract prematurely** — extract when the pattern is stable - **Minimize public surface** — every exported name is a commitment

## Parallelizing Code Style Reviews

When reviewing code style across a large codebase, use up to 5 parallel sub-agents, each targeting an independent style concern (e.g. control flow, function design, variable declarations, string handling, code organization).

## Enforce with Linters

Many rules are enforced automatically: `gofmt`, `gofumpt`, `goimports`, `gocritic`, `revive`, `wsl_v5`. → See the `samber/cc-skills-golang@golang-lint` skill.

## Cross-References

- → See the `samber/cc-skills-golang@golang-naming` skill for identifier naming conventions - → See the `samber/cc-skills-golang@golang-structs-interfaces` skill for pointer vs value receivers, interface design - → See the `samber/cc-skills-golang@golang-design-patterns` skill for functional options, builders, constructors - → See the `samber/cc-skills-golang@golang-lint` skill for automated formatting enforcement - → See `samber/cc-skills-golang@golang-continuous-integration` skill for automated AI-driven code review in CI using these guidelines - → See `samber/cc-skills-golang@golang-refactoring` skill for mechanically applying guard-clause conversion, function extraction, and options-struct migration safely across many call sites once a review surfaces violations at scale

技術詳細

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

判断の要約

第一候補

95
準備完了
採用
段階

GitHub スター 3,010

監査

インストールレビュー

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

81
要レビュー
セキュリティ
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-code-style 用のシナリオベース草案です。X へ手動投稿できます。

キュレーターノート
golang-code-style: Golang code style conventions — line length and breaking, variable declarations, control flow...

3.0K stars

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

Install: npx skills add samber/cc-skills-golang --skill golang-code-style
返信の下書きを開く

掲載元

Registry により登録

申請可能

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

作成者
samber
インデックス作成者
OpenAgentSkill コミュニティインデックス

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

このスキルを申請

所有者の申請

このスキル掲載を申請

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

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

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

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

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

作者

S

samber

@samber

プラットフォーム適合

健全性シグナル

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

コミュニティシグナル

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

信頼と安全性

サンドボックス限定

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