use-modern-go — Claude Code skill: what it does, how to install
Checks Go code against current, version-specific idioms. Useful before writing, fixing, or refactoring project code.
npx skills add JetBrains/go-modern-guidelines --skill use-modern-go -a claude-codeWhat use-modern-go does
The skill connects the Modern Go Guidelines CLI to Go code changes. Before editing, it runs the list subcommand for the target file or a specified Go version, then applies the complete output from newest to oldest. Do not truncate that output with filters, because older applicable guidance may be missed.
The CLI resolves the Go version from go.mod, go.work, the local Go toolchain, or an explicit override. Use explain for details and examples of selected guideline IDs returned by list. On first use, the wrapper installs the CLI in a local cache.
Check go.mod or go.work before editing. They affect which guidance the CLI returns. The skill includes shell and PowerShell wrappers, and installation is provided separately for each supported platform.
What it helps with
- check a Go file before editing it
- match code choices to the project’s Go version
- find applicable modern Go guidelines
- inspect a specific guideline with
explain - refactor Go code using current guidance
Example prompts for the agent
- Apply `use-modern-go` before editing `path/to/file.go` and follow the CLI guidance.
- Run `list` for `path/to/file.go`, then use `explain` for the returned rules that need more detail.
- Refactor this Go code with `use-modern-go` using the version declared in `go.mod`.
How to install use-modern-go
1Skills CLI (Vercel)
npx skills add JetBrains/go-modern-guidelines --skill use-modern-go -a claude-code2Manually: put the files in place
~/.claude/skills/use-modern-go/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/use-modern-go/
1Skills CLI (Vercel)
npx skills add JetBrains/go-modern-guidelines --skill use-modern-go -a codex2Manually: put the files in place
.agents/skills/use-modern-go/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add JetBrains/go-modern-guidelines --skill use-modern-go -a cursor2Manually: put the files in place
.cursor/skills/use-modern-go/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install JetBrains/go-modern-guidelines use-modern-go2Manually: put the files in place
.github/skills/use-modern-go/SKILL.md1Skills CLI (Vercel)
npx skills add JetBrains/go-modern-guidelines --skill use-modern-go -a gemini-cli2Platform CLI
gemini skills install https://github.com/JetBrains/go-modern-guidelines --path plugin/skills/use-modern-goManually: put the files in place
.devin/skills/use-modern-go/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add JetBrains/go-modern-guidelines --skill use-modern-go -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Similar
Questions about use-modern-go
How do I install use-modern-go in Claude Code?
Run npx skills add JetBrains/go-modern-guidelines --skill use-modern-go -a claude-code, run npx skills add JetBrains/go-modern-guidelines --skill use-modern-go -a claude-code again, then check ~/.claude/skills/use-modern-go/SKILL.md.
What does use-modern-go do?
The skill runs the Modern Go Guidelines CLI before Go code is written, fixed, or refactored. It gets version-specific guidance with list and provides details through explain.
How does the CLI determine the Go version?
It checks go.mod, go.work, the local Go toolchain, or an explicit --go-version value. You can also pass a file with --file-path.
Source text
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