Логотип Go Style Guide

Go Style Guide

Спільнота
robbyt
go-style-guide

Review Go code for adherence to Go Style Guide. Use when the user requests a code review of completed work, pull requests, or feature branches in Go projects. Focuses on critical bugs, race conditions, and important maintainability issues. Trigger phrases include "review this Go code", "check against style guide", "review my PR", or "review the work done so far".

Огляд

Видавецьrobbyt
Репозиторійclaude-skills
Назва навичкиgo-style-guide
Зірки
42
Форки
2
Файли в пакеті
6
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 6

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Видавець на GitHub: robbyt. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Go Style Guide у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки на GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до розділу «Плагіни» → «Навички».
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/robbyt/claude-skills/tree/main/plugins/go-style-guide/skills/go-style-guide
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/robbyt/claude-skills.git /tmp/claude-skills
mkdir -p .claude/skills
cp -r /tmp/claude-skills/plugins/go-style-guide/skills/go-style-guide .claude/skills/go-style-guide
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Go Style Guide в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Go Style Guide, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Go Style Guide не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

Go Style Guide Reviewer

Review Go code against comprehensive style guide, focusing on critical bugs and important maintainability issues.

This guide assumes Go 1.25+ and does not consider backwards compatibility. All patterns use modern Go best practices.

Reference Files

Load references based on code patterns found during review:

Code PatternReference File
go func(), sync.Mutex, sync., channels, atomicreferences/concurrency.md
err, error, panic, Must functionsreferences/errors.md
interface, embedding, receivers, func New, init()references/api-design.md
slice/map return, slices.Clone, maps.Clonereferences/api-design.md
_test.go, t., b.references/testing.md
naming, comments, loggingreferences/style.md

Quick reference: references/review-checklist.md - critical patterns with code examples

Note: "Copying at boundaries" lives in api-design.md but relates to concurrency safety - check both when ownership/encapsulation is the concern.

Quick Style Reference

Basic rules that don't need a file lookup:

  • Package names: lowercase, no underscores, singular (net/url not net/urls)
  • Receiver names: 1-2 letters, consistent across all methods (func (c *Client) Connect())
  • Error strings: lowercase, no punctuation (errors.New("connection failed"))
  • Variable names: short for small scopes (i, v), longer for large scopes (requestTimeout)

Review Process

Follow this 3-phase workflow for systematic code review:

Phase 1: Scope Identification

Determine what code to review based on the user's request:

Pull Request / Branch Review:

bash
# Get all changed files in branch
git diff --name-only main...HEAD | grep '\.go$'

# Get diff with context
git diff main...HEAD

Specific Files:

bash
# User specifies file(s) directly
# Read the files using the Read tool

Recent Work:

bash
# Review recent commits
git log --oneline -n 10
git diff HEAD~5..HEAD

Output: List of Go files and changes to review.

Phase 2: Code Analysis

Review the code systematically using the bundled references:

  1. Start with critical issues (load references/review-checklist.md for quick patterns):

    • Unhandled errors
    • Type assertions without check
    • Panics in production code
    • Fire-and-forget goroutines
    • Mutex races and missing defers
    • Nil pointer dereferences
  2. Check important patterns:

    • Error handling (wrapping, naming, handling once)
    • Boundary safety (copying slices/maps)
    • Struct design (embedding, initialization)
    • Concurrency lifecycle (goroutine management)
    • Exit handling (os.Exit only in main)
  3. Consult topic files as needed (see Reference Files table above):

    • For detailed explanations of specific patterns
    • When encountering unfamiliar idioms
    • To verify best practices for specific scenarios

Grep patterns for architectural issues:

bash
# Find panic usage (context-dependent - init/main vs library)
rg 'panic\(' --type go

# Find goroutine launches (check lifecycle management)
rg '\bgo\s+' --type go

# Find os.Exit or log.Fatal (should only be in main)
rg '(os\.Exit|log\.Fatal)' --type go

# Find global var declarations (check for mutable state)
rg '^var\s+\w+\s*=' --type go

Phase 3: Report Findings

Structure the review with Critical and Important issues only (skip Minor issues per user preference).

Format:

markdown
## Code Review Summary

[1-2 sentence overview of code quality and adherence]

**Note**: This review focuses on architectural and semantic issues that require human judgment. For syntax, formatting, and common bugs (unhandled errors, type assertions, etc.), ensure `golangci-lint` is run separately.

## Critical Issues

[Issues that could cause bugs, panics, or data races - MUST fix]

### [Issue Title]
**Location**: `file.go:123` or `functionName()`
**Severity**: Critical

**Current Code**:
```go
[problematic code snippet]

Issue: [What's wrong and why it's critical]

Recommended:

go
[corrected code]

Guideline: [Reference to style guide section, e.g., "Error Handling > Type Assertions"]


Important Issues

[Issues affecting maintainability, performance, or style - Should fix]

[Use same format as Critical Issues]


Positive Observations

[Acknowledge good practices: proper error wrapping, clean concurrency patterns, good test structure]


Recommendations

  1. [Prioritized action items]
  2. [Suggest running golangci-lint skill if not already done]

## Optional: Automated Linting Integration

Before or after manual review, suggest running automated linters for complementary coverage:

**If golangci-lint skill is available**:
"Consider running the `golangci-lint` skill for automated static analysis. Say 'run golangci-lint' to execute."

**Manual linting**:
```bash
# Run staticcheck
staticcheck ./...

# Run golangci-lint
golangci-lint run

Key Focus Areas

Critical (Architecture & Safety)

  • Goroutine lifecycle issues (fire-and-forget)
  • Race conditions (requires race detector, not linter)
  • Panics in production (context-dependent: library vs main)

Important (Design & Patterns)

  • Error handling strategy (when/where to handle, observability boundaries)
  • Data ownership (boundaries, copying, shared state)
  • Concurrency patterns (channel sizing, context propagation)
  • API design (embedding, evolution, encapsulation)
  • Testing strategy (table-driven, parallel, time mocking)

Skip (Handled by Linters or Out of Scope)

Linter-Caught Issues:

  • Unhandled errors (errcheck)
  • Type assertions without checks (staticcheck)
  • Missing struct field names (govet)
  • Import grouping (goimports/gci)
  • Formatting issues (gofmt)
  • Common bugs (staticcheck, govet)

Subjective Preferences (Do Not Flag):

  • Assertion library choice: Use what codebase uses; don't add to new projects unless requested. Both manual checks and assertion libraries (testify, assert) are valid.
  • Line length variations: Focus on refactoring opportunities, not mechanical line breaking
  • Test helper patterns: Either testing.T parameter or returning errors acceptable; ensure t.Helper() used
  • Performance nitpicks: Only flag when profiling data shows actual impact

Review Principles

When evaluating code, apply Google's Core Principles in order (from references/style.md):

  1. Clarity: Is the purpose and rationale clear?
  2. Simplicity: Does it accomplish goals in the straightforward manner?
  3. Concision: High signal-to-noise ratio?
  4. Maintainability: Can future programmers modify it correctly?
  5. Consistency: Aligns with broader codebase patterns?

Then apply specific review guidance:

  1. Be specific: Quote exact code, provide exact fixes
  2. Cite guidelines: Reference specific sections of the style guide
  3. Explain impact: Why does this matter? (correctness, maintainability, performance)
  4. Prioritize: Critical issues first, important second
  5. Acknowledge good code: Recognize patterns that follow the core principles

When to Load Reference Files

Load references/review-checklist.md first for quick architectural patterns - it focuses on semantic issues requiring judgment.

Load topic-specific files based on code patterns (see Reference Files table):

  • concurrency.md - goroutines, mutexes, races, channels
  • errors.md - error types, wrapping, panic avoidance
  • api-design.md - interfaces, function design, data boundaries
  • testing.md - table tests, parallel tests, benchmarks
  • style.md - naming, documentation, code style

Important: Skip reporting issues that golangci-lint would catch. The agent should focus on design, architecture, and context-dependent patterns that require human understanding.

Context Matters

Some patterns have exceptions:

  • init() acceptable for database driver registration
  • panic() acceptable in tests (use t.Fatal or t.FailNow)
  • Global constants acceptable
  • Embedding in private structs sometimes acceptable for composition

Apply judgment based on context and domain.

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ Go Style Guide?

Review Go code for adherence to Go Style Guide. Use when the user requests a code review of completed work, pull requests, or feature branches in Go projects. Focuses on critical bugs, race conditions, and important maintainability issues. Trigger phrases include "review this Go code", "check against style guide", "review my PR", or "review the work done so far".

Навіщо використовувати Go Style Guide у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Go Style Guide — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Go Style Guide у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/robbyt/claude-skills/tree/main/plugins/go-style-guide/skills/go-style-guide. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Go Style Guide?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Go Style Guide?

Зі скількома забажаєте. У TypingMind ви можете використовувати Go Style Guide із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Go Style Guide?

На GitHub цю навичку публікує robbyt. Умови ліцензування дивіться в репозиторії. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇