use-modern-go
jetbrains/go-modern-guidelines
Apply Modern Go Guidelines CLI to ensure idiomatic, version-specific Go code during development.
What is use-modern-go?
A CLI tool that provides version-specific Go idiom guidance based on your project's Go version. Use it before editing Go code to check applicable modern guidelines and ensure your changes follow current best practices.
- List applicable modern Go guidelines for a specific Go version or file
- Explain detailed rationale and examples for specific guideline IDs
- Resolve target Go version from go.mod, go.work, local toolchain, or explicit override
- Provide guidelines ordered by recency to catch both new and older applicable patterns
- Support both Linux/macOS shell scripts and Windows PowerShell execution
How to install use-modern-go
npx skills add https://github.com/jetbrains/go-modern-guidelines --skill use-modern-go- Go project with go.mod or go.work file (or explicit Go version specification)
- Linux, macOS, or Windows PowerShell environment
- Network access for first-run CLI installation to local cache
How to use use-modern-go
- 1.Run the list subcommand on your target Go file: `sh "<skill-dir>/scripts/run-tool.sh" list --file-path path/to/file.go`
- 2.Alternatively, specify the Go version directly: `sh "<skill-dir>/scripts/run-tool.sh" list --go-version 1.24`
- 3.Read the complete list output (ordered newest first) to identify all applicable guidelines
- 4.For guidelines needing clarification, call explain with specific IDs: `sh "<skill-dir>/scripts/run-tool.sh" explain guideline_id`
- 5.Apply returned guidelines to your code changes, skipping only when compilation, behavior, or context clearly conflict
Use cases
- Review guidelines before refactoring an existing Go codebase to modernize it
- Check version-specific idioms when writing new Go modules or packages
- Understand the reasoning behind a modern Go pattern before applying it to your code
- Ensure generated or modified code follows current Go best practices for the project's target version
- Validate style choices against authoritative modern Go guidelines during code review
- Go developers writing or refactoring code
- Teams maintaining Go codebases with version-specific standards
- Developers using AI coding assistants to generate Go code
- Go projects that want to enforce modern idioms across contributors
use-modern-go FAQ
Treat returned guidelines as authoritative for modern Go style. Follow them even if nearby code uses older patterns, unless the guideline would prevent compilation, change behavior, or clearly doesn't match the edited code context.
No. Always read the complete list output without truncating or filtering, as important guidelines may appear anywhere in the ordered list and could be missed otherwise.
It resolves the Go version from go.mod, go.work, the local Go toolchain, or an explicit override passed via the --go-version flag.
Use list first to discover applicable guidelines for your Go version, then call explain only for specific guideline IDs that need detailed rationale or examples before you decide to apply them.
Full instructions (SKILL.md)
Source of truth, from jetbrains/go-modern-guidelines.
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:
listexplain
Before editing Go code:
-
Call the wrapper's
listsubcommand for the relevant Go file.Prefer passing the file you are about to edit:
sh "<skill-dir>/scripts/run-tool.sh" list --file-path path/to/file.goOn 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.
-
If the target Go version is already known, you may pass it directly:
sh "<skill-dir>/scripts/run-tool.sh" list --go-version 1.24 -
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.
-
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
explainsubcommand 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 "<skill-dir>/scripts/run-tool.sh" explain sync_waitgroup_go
Multiple guideline IDs may be requested as positional arguments:
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.
Related skills
More from jetbrains/go-modern-guidelines and the wider catalog.

ai-image-generator
Generate professional images using Gemini or GPT APIs with model selection, prompting framework, and multi-turn editing.

app-docs
Generate complete user documentation for a web app with screenshots. Browses the app via browser automation, screenshots every screen, and produces a structured user guide with step-by-step instructions, annotated screenshots, workflow diagrams, and reference tables. Supports quick (key screens), standard (all pages), thorough (every state and flow), and exhaustive (publishable documentation suite). Triggers: 'document the app', 'user guide', 'app documentation', 'screenshot docs', 'generate user docs', 'help docs', 'how-to guide', 'write the docs'.

aussie-business-english
Australian business English writing style for professional communications — warm, direct, EN-AU spelling (colour, organise, centre). Use whenever the user is writing for an Australian audience: emails, chat messages, proposals, client communications, blog posts, web copy, or any business writing. Apply to drafting, editing, and tone-checking professional text.

award-application
Write compelling award submissions, grant applications, and competition entries. Maps achievements to selection criteria using evidence-based narratives. Use whenever the user is applying for a business award (Telstra, chamber of commerce, industry awards), a grant, a competition, or any submission demonstrating merit against defined criteria.

cloudflare-api
Hit the Cloudflare REST API directly for operations that wrangler and MCP can't handle well. Bulk DNS, custom hostnames, email routing, cache purge, WAF rules, redirect rules, zone settings, Worker routes, D1 cross-database queries, R2 bulk operations, KV bulk read/write, Vectorize queries, Queues, and fleet-wide resource audits. Produces curl commands or scripts. Triggers: 'cloudflare api', 'bulk dns', 'custom hostname', 'email routing', 'cache purge', 'waf rule', 'd1 query', 'r2 bucket', 'kv bulk', 'vectorize query', 'audit resources', 'fleet operation'.

cloudflare-worker-builder
Scaffold and deploy Cloudflare Workers with Hono routing, Vite, and Static Assets.