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

way-go-style风格

Agent Skill

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

总安装

423

周安装

18

GitHub Stars

3

下载量

148
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/way-platform/skills --skill way-go-style

简介

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

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态和协作事项进行整理。
  • 通过 npx skills add 命令安装,需结合原始 README 核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网或命令执行。
  • 注意该技能当前无原始 SKILL.md 内容可参考,实际功能以仓库实现为准。

SKILL.md

Way Go Style

Project Setup (AGENTS.md)

Go projects MUST include this skill's Way Specific Conventions in their AGENTS.md file to ensure compliance.

  1. Reference this skill: Under "Local Skills".
  2. Copy Conventions: Copy the Way Specific Conventions section below into AGENTS.md under "Key Conventions".

Way Specific Conventions

  • Testing: Use standard testing and github.com/google/go-cmp/cmp only. No frameworks (Testify, Ginkgo, etc.).
  • Linting: Run GolangCI-Lint v2. Configure via project-specific .golangci.yml.
  • Build: Use way-magefile skill.
  • Encore: Use encore-go-* skills. Encore conventions (e.g., globals) take precedence.

Overview

This skill provides a condensed reference for writing high-quality Go code, synthesizing advice from "Effective Go", Google's "Code Review Comments", and other authoritative sources. It focuses on idiomatic usage, correctness, and maintainability.

Effective Go Idioms

Critical idioms from Effective Go.

Control Flow & Error Handling

  • Defer Evaluation: Arguments to deferred functions are evaluated immediately at the call site (not at execution).
  • Init Scope: Use if err:= f(); err!= nil to restrict variable scope.
  • Switch: Use tagless switch {case condition:...} instead of long if-else chains.
  • Internal Panic/Recover: Use panic to simplify deep error handling in complex internal code (e.g., parsers), but always recover at the package boundary to return a standard error.

Types & Interfaces

  • Functional Adapters: Define methods on function types (e.g., type MyFunc func()) to satisfy interfaces. See http.HandlerFunc.
  • Interface Verification: Use a global blank assignment to ensure a type satisfies an interface at compile time: var _ Interface = (*Type)(nil).

Google Style Decisions & Best Practices

Key decisions from the Google Go Style Guide and Code Review Comments.

Core Principles

  • Clarity: "Clear to the reader" is priority #1. Explain *why*, not just *what*.
  • Simplicity: "Least Mechanism". Prefer core constructs (slices, maps) over complex abstractions.
  • Concision: High signal-to-noise ratio. Avoid boilerplate.

Naming & Structure

  • Packages: Single-word, lowercase (e.g., task, not task_manager). Avoid util, common.
  • Receivers: 1-2 letter abbreviations (e.g., c for Client). NEVER use me, this, self.
  • Constants: Always MixedCaps (e.g., MaxLength), even if exported. NEVER MAX_LENGTH.
  • Getters: Owner() (not GetOwner).
  • Interfaces: One-method interfaces -> Method + -er (e.g., Reader). Define in the consumer package. Keep them small.

Functions & Methods

  • Receiver Type:

- **Pointer (*T): If mutating, contains sync.Mutex, or large struct. - Value (T): Maps, channels, functions, small immutable structs. - Consistency:** Prefer all pointers or all values for a type's methods.

  • Pass Values: Don't pass pointers to small types (*string, *int) just to save memory.
  • Synchronous: Prefer synchronous APIs. Let the caller decide to use goroutines.
  • Must Functions: MustXYZ panic on failure. Use only for package-level init or test helpers.

Error Handling

  • Flow: Handle errors immediately (if err!= nil {return err}). Keep "happy path" unindented. Avoid else.
  • Structure: Use %w with fmt.Errorf to wrap errors for programmatic inspection (errors.Is).
  • Panics: Never panic in libraries. Return errors. log.Fatal is okay in main.
  • Strings: Lowercase, no punctuation (e.g., fmt.Errorf("something bad")) for easy embedding.

Concurrency

  • Lifetimes: Never start a goroutine without knowing how it stops.
  • Context: Always first arg ctx context.Context. Never store in structs.
  • Copying: Do not copy structs with sync.Mutex or bytes.Buffer.

Testing

  • Framework: Use testing package. No assertion libraries (use cmp for diffs).
  • Helpers: Mark setup/teardown functions with t.Helper().
  • Failure Messages: YourFunc(%v) = %v, want %v. (Got before Want).
  • Table-Driven: Use field names in struct literals for clarity.
  • Subtests: Use t.Run() for clear scope and filtering. Avoid slashes in names.

Global State & Init

  • Avoid Globals: Libraries should not rely on package-level vars. Allow clients to instantiate (New()).
  • Initialization: Use := for non-zero values. Use var t []T (nil) for empty slices.
  • Imports: Group order: Stdlib, Project/Vendor, Side-effects (_). No . imports.

Practical Go Cheat Sheet

Best practices for maintainable Go from Dave Cheney's Practical Go.

Guiding Principles

  • Simplicity, Readability, Productivity: The core values. Clarity > Brevity.
  • Identifiers: Choose for clarity. Length proportional to scope/lifespan. Don't include type in name (e.g., usersMap -> users).

Design & Structure

  • Package Names: Name for what it *provides* (e.g., http), not what it contains. Avoid util, common.
  • Project Structure: Prefer fewer, larger packages. Arrange files by import dependency.
  • API Design: Hard to misuse. Avoid multiple params of same type. Avoid nil params.
  • Interfaces: Let functions define behavior they require (e.g., take io.Writer not *os.File).
  • Zero Value: Make structs useful without explicit initialization (e.g., sync.Mutex, bytes.Buffer).

Concurrency & Errors

  • Concurrency: Leave it to the caller. Never start a goroutine without knowing when/how it stops.
  • Errors: Eliminate error handling by eliminating errors (e.g., bufio.Scanner). Handle errors once (don't log AND return).
  • Return Early: Use guard clauses. Keep the "happy path" left-aligned.

Available References

Detailed documentation available in the references/ directory:

- Guide: Core guidelines. - Decisions: Normative style decisions. - Best Practices: Evolving guidance.

  • Practical Go: Dave Cheney's advice on writing maintainable Go programs.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.74%
按下载量换算54

Claude

30.97%
按下载量换算46

Cursor

16.89%
按下载量换算25

Gemini CLI

8.45%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills