Установка
SKILL.md
Go Code Review Checklist
Compatibility:
references/WEB-SERVER.mduseslog/slogexamples that require Go 1.21+.
Resource Routing
assets/review-template.md- Use when formatting review output with Must Fix, Should Fix, and Nits sections.scripts/pre-review.sh- Run before manual review to collect gofmt, go vet, and golangci-lint results.references/WEB-SERVER.md- Read when reviewing an HTTP server that combines concurrency, context, logging, error handling, and shutdown behavior.
Review Procedure
Use
assets/review-template.mdwhen formatting the output of a code review to ensure consistent structure with Must Fix / Should Fix / Nits severity grouping.
- Run
gofmt -d .andgo vet ./...to catch mechanical issues first - Read the diff file-by-file; for each file, check the categories below in order
- Flag issues with specific line references and the rule name
- After reviewing all files, re-read flagged items to verify they're genuine issues
- Summarize findings grouped by severity (must-fix, should-fix, nit)
Validation: After completing the review, re-read the diff once more to verify every flagged issue is real. Remove any finding you cannot justify with a specific line reference.
Formatting
- gofmt: Code is formatted with
gofmtorgoimports→ go-linting
Documentation
- Comment sentences: Comments are full sentences starting with the name being described, ending with a period → go-documentation
- Doc comments: All exported names have doc comments; non-trivial unexported declarations too → go-documentation
- Package comments: Package comment appears adjacent to package clause with no blank line → go-documentation
- Named result parameters: Only used when they clarify meaning (e.g., multiple same-type returns), not just to enable naked returns → go-documentation
Error Handling
- Handle errors: No discarded errors with
_; handle, return, or (exceptionally) panic → go-error-handling - Error strings: Lowercase, no punctuation (unless starting with proper noun/acronym) → go-error-handling
- In-band errors: No magic values (-1, "", nil); use multiple returns with error or ok bool → go-error-handling
- Indent error flow: Handle errors first and return; keep normal path at minimal indentation → go-error-handling
Naming
- MixedCaps: Use
MixedCapsormixedCaps, never underscores; unexported ismaxLengthnotMAX_LENGTH→ go-naming - Initialisms: Keep consistent case:
URL/url,ID/id,HTTP/http(e.g.,ServeHTTP,xmlHTTPRequest) → go-naming - Variable names: Short names for limited scope (
i,r,c); longer names for wider scope → go-naming - Receiver names: One or two letter abbreviation of type (
cforClient); nothis,self,me; consistent across methods → go-naming - Package names: No stuttering (use
chubby.Filenotchubby.ChubbyFile); avoidutil,common,misc→ go-packages - Avoid built-in names: Don't shadow
error,string,len,cap,append,copy,new,make→ go-declarations
Concurrency
- Goroutine lifetimes: Clear when/whether goroutines exit; document if not obvious → go-concurrency
- Synchronous functions: Prefer sync over async; let callers add concurrency if needed → go-concurrency
- Contexts: First parameter; not in structs; no custom Context types; pass even if you think you don't need to → go-context
Interfaces
- Interface location: Define in consumer package, not implementor; return concrete types from producers → go-interfaces
- No premature interfaces: Don't define before used; don't define "for mocking" on implementor side → go-interfaces
- Receiver type: Use pointer if mutating, has sync fields, or is large; value for small immutable types; don't mix → go-interfaces
Data Structures
- Empty slices: Prefer
var t []string(nil) overt := []string{}(non-nil zero-length) → go-data-structures - Copying: Be careful copying structs with pointer/slice fields; don't copy
*Tmethods' receivers by value → go-data-structures
Security
- Crypto rand: Use
crypto/randfor keys, notmath/rand→ go-defensive - Don't panic: Use error returns for normal error handling; panic only for truly exceptional cases → go-defensive
Declarations and Initialization
- Group similar: Related
var/const/typein parenthesized blocks; separate unrelated → go-declarations - var vs :=: Use
varfor intentional zero values;:=for explicit assignments → go-declarations - Reduce scope: Move declarations close to usage; use if-init to limit variable scope → go-declarations
- Struct init: Always use field names; omit zero fields;
varfor zero structs → go-declarations - Use
any: Preferanyoverinterface{}in new code → go-declarations
Functions
- File ordering: Types → constructors → exported methods → unexported → utilities → go-functions
- Signature formatting: All args on own lines with trailing comma when wrapping → go-functions
- Naked parameters: Add
/* name */comments for ambiguous bool/int args, or use custom types → go-functions - Printf naming: Functions accepting format strings end in
fforgo vet→ go-functions
Style
- Line length: No rigid limit, but avoid uncomfortably long lines; break by semantics, not arbitrary length → go-style-core
- Naked returns: Only in short functions; explicit returns in medium/large functions → go-style-core
- Pass values: Don't use pointers just to save bytes; pass
stringnot*stringfor small fixed-size types → go-performance - String concatenation:
+for simple;fmt.Sprintffor formatting;strings.Builderfor loops → go-performance
Logging
- Use slog: New code uses
log/slog, notlogorfmt.Printlnfor operational logging → go-logging - Structured fields: Log messages use static strings with key-value attributes, not fmt.Sprintf → go-logging
- Appropriate levels: Debug for developer tracing, Info for notable events, Warn for recoverable issues, Error for failures → go-logging
- No secrets in logs: PII, credentials, and tokens are never logged → go-logging
Imports
- Import groups: Standard library first, then blank line, then external packages → go-packages
- Import renaming: Avoid unless collision; rename local/project-specific import on collision → go-packages
- Import blank:
import _ "pkg"only in main package or tests → go-packages - Import dot: Only for circular dependency workarounds in tests → go-packages
Generics
- When to use: Only when multiple types share identical logic and interfaces don't suffice → go-generics
- Type aliases: Use definitions for new types; aliases only for package migration → go-generics
Testing
- Examples: Include runnable
Examplefunctions or tests demonstrating usage → go-documentation - Useful test failures: Messages include what was wrong, inputs, got, and want; order is
got != want→ go-testing - TestMain: Use only when all tests need common setup with teardown; prefer scoped helpers first → go-testing
- Real transports: Prefer
httptest.NewServer+ real client over mocking HTTP → go-testing
Automated Checks
Run automated pre-review checks:
bash scripts/pre-review.sh ./... # text output
bash scripts/pre-review.sh --json ./... # structured JSON output
Or manually: gofmt -l <path> && go vet ./... && golangci-lint run ./...
Fix any issues before proceeding to the checklist above. For linter setup and configuration, see go-linting.
Related Skills
- Style foundations: See go-style-core when resolving formatting debates or applying the clarity > simplicity > concision priority
- Linting setup: See go-linting when configuring golangci-lint or adding automated checks to CI
- Error strategy: See go-error-handling when reviewing error wrapping, sentinel errors, or the handle-once pattern
- Naming conventions: See go-naming when evaluating identifier names, receiver names, or package-symbol stuttering
- Testing patterns: See go-testing when reviewing test code for table-driven structure, failure messages, or helper usage
- Concurrency safety: See go-concurrency when reviewing goroutine lifetimes, channel usage, or mutex placement
- Logging practices: See go-logging when reviewing log usage, structured logging, or slog configuration
Вставить в README
Ссылка на карточку для вашего README — без картинок и счётчиков.
[DarkPlay: go-code-review](https://darkplay.ru/ai/skills/golang-skills-go-code-review)
Из того же репозитория
Похожие скиллы и другие разделы каталога
Та же категория — сравните, что ещё подойдёт под вашу задачу.
fixreact · Используйте при ошибках линтера, проблемах с форматированием или перед коммитом, чтобы…
karpathy-guidelinesmultica-ai · Правила поведения для снижения типичных ошибок LLM при написании кода. Используйте при…
frontend-code-reviewlanggenius · Ревью фронтенда Dify: корректность, доступность, компоненты, dify-ui, тесты
code-review-and-qualityaddyosmani · Многоаспектное ревью кода перед слиянием: оценка качества по нескольким измерениям до…
code-reviewergoogle-gemini · Навык для ревью кода. Поддерживает локальные изменения — как в индексе, так и в рабочем…
bmad-code-reviewbmad-code-org · Состязательное ревью кода с параллельными слоями проверки и структурированной…
cookbook-auditanthropics · Проверяет ноутбук Anthropic Cookbook по рубрике. Используется при любом запросе на ревью…
typescript-reviewmetabase · Проверяет изменения кода на TypeScript и JavaScript на соответствие стандартам…
build-graphtirth8205 · Построение или обновление графа знаний для ревью кода. Запустите в первую очередь для…
code-qualitytursodatabase · Общие правила корректности, паттерны Rust, комментарии и борьба с избыточной сложностью…Самые востребованные скиллов раздела по установкам и звёздам.
find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.Соседние разделы каталога: возможно, нужный инструмент живёт там.
mattpocock-skillsmattpocock · Агентские навыки Matt Pocock для настоящей инженерии: разбор задач, потоки спецификаций и…
superpowersobra · Базовая библиотека навыков для Claude Code: TDD, отладка, паттерны совместной работы и…
eccaffaan-m · Нативный для harness операторский слой ECC: 67 агентов, 278 навыков, 94 шима устаревших…
A11y Architectaffaan-m · Архитектор доступности, специализирующийся на соответствии WCAG 2.2 для веба и нативных…
Add Language Rulesaffaan-m · Каркас команды workflow для add-language-rules в everything-claude-code.
Code Architectaffaan-m · Проектирует архитектуру функций, анализируя существующие паттерны и соглашения кодовой…
Code Exploreraffaan-m · Глубоко анализирует существующие функции кодовой базы, прослеживая пути выполнения…
Code Revieweraffaan-m · Эксперт по ревью кода. Проактивно проверяет код на качество, безопасность и…
Code Simplifieraffaan-m · Упрощение и очистка кода без изменения поведения.
Comment Analyzeraffaan-m · Анализ комментариев в коде на точность, полноту и риск устаревания.Лучшие ИИ-инструменты для программирования
Подборка нейросетей и ИИ-ассистентов для разработки и автоматизации кода. Сервисы, которые ускоряют написание, ревью и отладку, экономят часы рутины и снижают порог входа в сложные
GenAPIGenapi
Notepad++ AINotepad-plus-plus
Creatium MaxCremax
Emacs AIGnu
KiteKite
Amazon Q DeveloperAmazonЛучшие ИИ-инструменты для генерации видео
Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,
VEED.IOVeed
MootionMootion
Sora (OpenAI)OpenAI
viralpulse.appViralpulse
Viral Maker AIViral-makerЛучшие ИИ-инструменты для генерации текста и копирайтинга
Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра
NeuroscribeNeuroscribe
GoGPTGogpt
НейроТекстерNeuro-texter
ChatGPTOpenAI
Cosmo ScribeCosmoscribe
Memo HelperCopilot33
LibraChatLibrachat