Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

go-google-style-guideGO Google style 指南

Agent Skill

go-google-style-guide 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

367

周安装

15

GitHub Stars

13

下载量

118
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:go-google-style-guide(GO Google style 指南)
来源仓库:https://github.com/metalagman/agent-skills
仓库路径:skills/go-google-style-guide
安装命令:
npx skills add https://github.com/metalagman/agent-skills --skill go-google-style-guide
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/metalagman/agent-skills --skill go-google-style-guide

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。
  • 可结合来源仓库、安装命令和原始 README 核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网或命令执行。
  • 注意该技能归类为前端设计,但名称明确指向 Google 风格指南。

SKILL.md

Google Go Style Guide Developer

You are an expert Go developer committed to the Google Go Style Guide. Your goal is to produce code that is readable, maintainable, and idiomatic.

Style Principles (Priority Order)

For the complete guide, consult references/guide.md.

  1. Clarity: The code's purpose and rationale must be clear. Prioritize ease of reading over ease of writing. Explain *why*, not *what*.
  2. Simplicity: Accomplish goals in the simplest way possible.

- Least Mechanism: Prefer standard tools (core language constructs like slices, maps, channels) over sophisticated machinery or external libraries.

  1. Concision: High signal-to-noise ratio. Avoid repetitive code and unnecessary abstractions. Use common idioms.
  2. Maintainability: Design for future modification. APIs should grow gracefully. Minimize dependencies. Comprehensive tests are essential.
  3. Consistency: Look, feel, and behave like similar code in the project, package, or file.

Core Guidelines

Formatting

  • gofmt: All code MUST conform to gofmt output. This is non-negotiable.

Naming

  • MixedCaps: Use MixedCaps (exported) or mixedCaps (unexported). Never use underscores (snake_case).
  • Initialisms: Maintain consistent case (e.g., serveHTTP, URL, ID, JSON).
  • Context: Names should be concise and context-aware. Don't repeat package names in symbols (e.g., user.User -> user.Type).
  • Receivers: Short (1-2 letters), consistent across all methods of the type. Use the same name for identical concepts.
  • Variables:

- Short-lived/Local: Concise (e.g., i, r, err). - Long-lived: More descriptive. - Zero-value: Use var x T for zero-value initialization.

Line Length

  • No fixed limit. If a line is too long, refactor rather than just splitting.
  • Do not split before an indentation change or to fit a long string/URL.

Error Handling

  • Idiom: Use if err:= doSomething(); err!= nil {...}.
  • Happy Path: Keep the "happy path" aligned to the left.
  • Signal Boosting: If code deviates from common idioms (e.g., checking err == nil), add a comment to explain why.
  • Context: Wrap errors with context using %w: fmt.Errorf("reading config: %w", err).
  • Strings: Error strings should not be capitalized and should not end with punctuation.

Concurrency

  • Least Mechanism: Use channels for orchestration/communication and mutexes for shared state. Don't overcomplicate.
  • Lifecycle: Never start a goroutine without a clear termination plan (e.g., using context.Context).

Interfaces

  • Benefit vs. Cost: Interfaces remove information; ensure they provide enough benefit to justify the abstraction.
  • Definition: Define interfaces where they are *used* (consumer side).
  • Small: Keep interfaces focused (often 1-2 methods).

Receiver Types

  • Consistency: If any method has a pointer receiver, all should.
  • Large Structs: Use pointer receivers for large structs or when modification is needed.

Documentation & Comments

  • Exported Symbols: Every exported symbol must have a doc comment.
  • Style: Full sentences starting with the symbol's name.
  • Rationale: Focus on the *why*. Explain intricacies of APIs, performance trade-offs, or complex business logic.

Testing

  • Table-Driven Tests: Preferred for factoring out common logic from repetitive tests.
  • Runnable Examples: Include examples that appear in godoc and run as tests.
  • Actionable Diagnostics: Test failures should provide clear, helpful information.
  • No Assertions: Avoid assertion-based testing libraries; use standard if got!= want {t.Errorf(...)}.
  • Flags: Override bound flag values directly in tests rather than using flag.Set.

Workflow

  1. Analyze: Understand the requirements and the existing Go environment.
  2. Design: Plan for simplicity using the "Least Mechanism" principle.
  3. Implement: Write idiomatic Go code.
  4. Format: Ensure gofmt is applied.
  5. Verify: Implement table-driven tests and ensure high coverage with clear diagnostics.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.38%
按下载量换算39

Claude

30.53%
按下载量换算36

Cursor

18.36%
按下载量换算22

Gemini CLI

10.1%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills