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

go-google-style-decisionsGO Google style decisions 命令行

Agent Skill

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

总安装

392

周安装

16

GitHub Stars

13

下载量

125
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

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

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

SKILL.md

go-google-style-decisions

This skill provides expert guidance on the "Decisions" portion of the Google Go Style Guide. It focuses on the specific choices and trade-offs made to ensure consistency, readability, and maintainability across large Go codebases.

Core Mandates

  1. Clarity over Conciseness: While Go favors brevity, never sacrifice clarity.
  2. Consistency is Key: Adhere to established patterns in the codebase.
  3. Idiomaticity: Follow Go-specific patterns (e.g., error handling, interface usage).
  4. No Underscores: Avoid underscores in names except in specifically allowed cases (tests, generated code).

Developer Workflow

  1. Design: Plan APIs following the "Least Mechanism" principle.
  2. Implement: Write code adhering to the style decisions detailed below.
  3. Lint: Use golangci-lint or go vet to catch common style violations.
  4. Test: Include runnable examples in _test.go files for public APIs.
  5. Review: Ensure changes align with the "Core Principles" of clarity and consistency.

Detailed Guidance

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

1. Naming Conventions

  • Underscores: Do not use underscores in Go names (e.g., pkg_name or var_name).

- *Exceptions*: _test.go files, generated code, and low-level interop.

  • Package Names:

- Short, lowercase, single word. No util or common. - Avoid common variable names (e.g., user as a package name if user is a common variable).

  • Receiver Names:

- Short (1-2 letters). - Consistently used throughout the type's methods. - Usually an abbreviation of the type (e.g., c for Client).

  • Constant Names:

- Use MixedCaps (e.g., ExportedConst, internalConst). - Do NOT use ALL_CAPS or kPrefix.

  • Initialisms:

- Maintain consistent casing (e.g., HTTPClient, urlPath, XMLParser).

  • Getters:

- Omit Get prefix (e.g., use obj.Field() instead of obj.GetField()). - Use Get only if the method is truly "getting" something that isn't a simple field (e.g., GetURL).

  • Variable Names:

- Length should be proportional to scope. Short names for small scopes (e.g., i in a loop), more descriptive names for larger scopes. - Omit types from names (e.g., users instead of userSlice).

2. Commentary

  • Line Length: Aim for ~80 characters. Wrap long comments.
  • Doc Comments: Every top-level exported name MUST have a doc comment.

- Must start with the name of the object. - Must be a complete sentence.

  • Examples: Provide ExampleXxx functions in test files to document public APIs.

3. Error Handling

  • Error as Last Return: Always return error as the final value.
  • Returning Nil: Return nil for the error value on success.
  • Error Interfaces: Exported functions should return the error interface, not a concrete type.
  • Error Strings:

- No capitalization (unless proper nouns/acronyms). - No trailing punctuation.

  • Indentation: Handle errors early and return/continue. Keep the "happy path" at the minimal level of indentation.
  • No In-band Errors: Do not use special values (like -1) to signal errors. Use (value, error) or (value, ok).

4. Language Constructs

  • Composite Literals: Use them for struct initialization. Always specify field names when the struct is from another package.
  • Nil Slices: Prefer var s []int (nil slice) over s:= []int{} (empty slice).

- Avoid APIs that distinguish between nil and empty slices.

  • Braces:

- Closing braces should align with the opening statement. - Avoid "cuddling" (e.g., if err!= nil {...} else {...} is fine, but don't over-compact).

  • Function Formatting: Keep signatures on one line if possible. If they must wrap, indent the arguments.

5. Panic and Recovery

  • Avoid Panic: Do not use panic for normal error handling.
  • Exceptional Only: Use panic only for truly unrecoverable states (e.g., internal invariant failure).
  • Program Termination: Use log.Exit or log.Fatal (which calls os.Exit) only in main or init functions.
  • MustXYZ: Helper functions that terminate the program on failure should be prefixed with Must (e.g., template.Must).

6. Copying

  • Structs with Locks: Be extremely careful copying structs that contain sync.Mutex or other synchronization primitives.
  • Pointer Receivers: If a type has methods with pointer receivers, avoid copying values of that type.

References

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.93%
按下载量换算44

Claude

27.84%
按下载量换算35

Cursor

20.44%
按下载量换算26

Gemini CLI

9.39%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills