Go google style decisions

From metalagman/agent-skills · View interactive version

Go google style decisions is an AI agent skill from the GitHub repository metalagman/agent-skills. Expertise in Go programming decisions according to the Google Go Style Guide. Focuses on specific choices for naming, error handling, and language usage.

How to use this skill

Skill file

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

2. Commentary

3. Error Handling

4. Language Constructs

5. Panic and Recovery

6. Copying

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.