use-modern-go — скилл для Claude Code: что делает и как установить
Проверяет Go-код по актуальным идиомам версии проекта. Пригодится перед написанием, исправлением и рефакторингом.
npx skills add JetBrains/go-modern-guidelines --skill use-modern-go -a claude-codeЧто делает use-modern-go
Скилл подключает Modern Go Guidelines CLI к работе с Go-кодом. Перед правкой он запускает подкоманду list для нужного файла или указанной версии Go, а затем использует полный список рекомендаций в порядке от новых к старым. Вывод нельзя обрезать фильтрами, иначе часть правил можно пропустить.
Версию Go CLI определяет по go.mod, go.work, локальному toolchain или явному параметру. Для деталей по конкретному правилу есть подкоманда explain, которой передают один или несколько ID из результата list. При первом использовании wrapper устанавливает CLI в локальный кэш.
Это повод проверить go.mod или go.work перед правкой: от них зависит набор применяемых рекомендаций. Для запуска доступны shell- и PowerShell-wrapper, а скилл устанавливается отдельно для каждой поддерживаемой платформы.
Какие задачи решает
- проверить Go-файл перед изменением
- подобрать идиомы под версию Go
- найти рекомендации для конкретного правила
- разобрать спорное правило через
explain - провести рефакторинг с учётом актуальных практик Go
Примеры запросов агенту
- Примени `use-modern-go` перед изменением `path/to/file.go` и учти все рекомендации CLI.
- Проверь `path/to/file.go` через `list`, затем объясни применимые правила с помощью `explain`.
- Отрефактори этот Go-код по рекомендациям `use-modern-go` для версии из `go.mod`.
Как установить use-modern-go
1Через Skills CLI (Vercel)
npx skills add JetBrains/go-modern-guidelines --skill use-modern-go -a claude-code2Вручную: положить файлы
~/.claude/skills/use-modern-go/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/use-modern-go/
1Через Skills CLI (Vercel)
npx skills add JetBrains/go-modern-guidelines --skill use-modern-go -a codex2Вручную: положить файлы
.agents/skills/use-modern-go/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add JetBrains/go-modern-guidelines --skill use-modern-go -a cursor2Вручную: положить файлы
.cursor/skills/use-modern-go/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install JetBrains/go-modern-guidelines use-modern-go2Вручную: положить файлы
.github/skills/use-modern-go/SKILL.md1Через Skills CLI (Vercel)
npx skills add JetBrains/go-modern-guidelines --skill use-modern-go -a gemini-cli2Командой платформы
gemini skills install https://github.com/JetBrains/go-modern-guidelines --path plugin/skills/use-modern-goВручную: положить файлы
.devin/skills/use-modern-go/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add JetBrains/go-modern-guidelines --skill use-modern-go -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
Похожие
Вопросы о use-modern-go
Как установить use-modern-go в Claude Code?
Выполните npx skills add JetBrains/go-modern-guidelines --skill use-modern-go -a claude-code, затем повторите npx skills add JetBrains/go-modern-guidelines --skill use-modern-go -a claude-code и проверьте файл ~/.claude/skills/use-modern-go/SKILL.md.
Что делает use-modern-go?
Скилл запускает Modern Go Guidelines CLI перед написанием, исправлением или рефакторингом Go-кода. Он получает рекомендации для версии проекта через list, а подробности по выбранным правилам — через explain.
Как CLI определяет версию Go?
Он смотрит на go.mod, go.work, локальный Go toolchain или явный параметр --go-version. Можно передать файл через --file-path.
Исходный текст
SKILL.md · Apache-2.0
--- name: use-modern-go description: Use the Modern Go Guidelines CLI whenever writing, modifying, fixing, or refactoring Go code. Apply its version-specific guidance to generated changes. --- # Modern Go Guidelines CLI Always write modern, idiomatic Go code. Use the Modern Go Guidelines CLI as the source of truth for modern Go idioms that may be newer than your knowledge cutoff. Command: - Linux or macOS: `sh "<skill-dir>/scripts/run-tool.sh"` - Windows PowerShell: `& '<skill-dir>\scripts\run-tool.ps1'` First run and approvals: On first use, the wrapper installs the Modern Go Guidelines CLI in a local cache directory. Subcommands: - `list` - `explain` Before editing Go code: 1. Call the wrapper's `list` subcommand for the relevant Go file. Prefer passing the file you are about to edit: ```sh sh "<skill-dir>/scripts/run-tool.sh" list --file-path path/to/file.go ``` On Windows, use the PowerShell wrapper with the same arguments. The CLI resolves the applicable Go version from go.mod, go.work, the local Go toolchain, or an explicit override. 2. If the target Go version is already known, you may pass it directly: ```sh sh "<skill-dir>/scripts/run-tool.sh" list --go-version 1.24 ``` 3. Read the complete list output before deciding which guidelines apply. The list output is ordered newest first. Read the full output because older supported guidelines may still apply. Do not pipe the output through head, tail, grep, sed, or any other truncating/filtering command. Important guidelines may otherwise be missed. 4. Treat returned guidelines as authoritative for modern Go style choices in code you are editing. If a guideline applies, follow it even when nearby code or repository convention uses an older pattern. Skip it only when it would not compile, would change behavior, or clearly does not match the edited code. Before skipping a returned guideline that seems relevant, call the wrapper's `explain` subcommand for that guideline ID. Call `explain` only when a specific guideline may apply and you need the detailed explanation or examples. Request only the guideline IDs you intend to evaluate or apply: ```sh sh "<skill-dir>/scripts/run-tool.sh" explain sync_waitgroup_go ``` Multiple guideline IDs may be requested as positional arguments: ```sh sh "<skill-dir>/scripts/run-tool.sh" explain atomic_types errors_as_type ``` Do not call `explain` without guideline IDs. Use `list` first to discover the short guideline list for the target Go version, then call `explain` for the specific returned IDs that need more context.
© JetBrains · Apache-2.0 · JetBrains/go-modern-guidelines