@samber

Creator · samber

Last updated · Aug 24, 2026

golang-modernize

REVIEW · 68Registry indexed

Modernize Golang code to use recent language features, standard library improvements, and idiomatic patterns. Trigger proactively when writing or reviewing Go code and old-style patterns are detected, or when encountering a deprecation warning. Also use when the user explicitly a

OpenAgentSkill Trust Score
68/100

Sandbox only

Quality82/100
Audit82/100
Stars3.1K
Verified installs0

Install targets

Codex install prompt

Install the "golang-modernize" agent skill from https://github.com/samber/cc-skills-golang/tree/main/skills/golang-modernize. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Modernize Golang code to use recent language features, standard library improvements, and idiomatic patterns. Trigger proactively when writing or reviewing Go code and old-style patterns are detected, or when encountering a deprecation warning. Also use when the user explicitly asks for modernization, a Go version upgrade, or a CI/tooling refresh. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"samber-golang-modernize","task":"Install golang-modernize","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.

Supply asset profile

Coding and developer agents

Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.

Browse track

Scenario

Coding agents

I need a coding agent that can understand a repository, edit code, and review pull requests.

Agent fit

Claude Code + OpenAI Agents + CLI

Codex, Claude Code, Cursor, CLI, or custom agents.

Install

Ready

npx skills add samber/cc-skills-golang --skill golang-modernize

Maintenance

fresh

Pushed today

Risk

Needs review

Dependency or permission surface needs review

GitHub quality

3.1K

82/100 Quality · 76/100 Trust

Coverage tags

CodingCoding agentscoding-agentsagent-skill

Review notes

Dependency or permission surface needs review · Permission surface may require sandboxing

Agent adoption scorecard

Trust, audit, and install readiness at a glance

These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.

Quality

Strong
82

Solid option that is likely worth shortlisting for production workflows.

Trust

Sandbox only
68

Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.

Audit

Needs review
82

A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.

OpenAgentSkill Trust Score v5

Human review before install

Run only in a sandbox and compare close alternatives before using it for real work.

CodexClaude CodeCursorOpenAgentSkill CLI

Stars

3.1K GitHub stars

Repo activity

3.1K stars, 204 forks

Maintenance

Pushed today

License

MIT

Install

npx skills add samber/cc-skills-golang --skill golang-modernize

Install safety

standard package or runtime install path

Permission surface

secrets or environment access, shell or command execution

Agent outcomes

No agent outcome data yet

Docs

Strong README/SKILL.md context

Risk summary

Review before production

  • Financial research output is not financial advice; require human review before any live investment decision.
  • Quality score needs review
  • Permission surface needs review: secrets or environment access, shell or command execution
  • Dependency/runtime risk: command execution surface, credential or environment access

Install readiness

Install path available

  • Install path is available
  • Repository evidence is available
  • License is declared
  • No Agent Proven outcome evidence yet

Agent-readable metadata

Machine-readable decision data for this skill.

Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.

View technical data+

Suited tasks

  • Coding agents workflows
  • Claude Code teams
  • teams that value GitHub adoption signals
  • Inspect source files

Suited agents

CodexClaude CodeCursorOpenAgentSkill CLIOpenAI AgentsCLI

Install decision

Command
npx skills add samber/cc-skills-golang --skill golang-modernize
Policy
review
Human review
yes

Trust and risk

Trust
68/100
Audit
82/100
Risk level
Needs review

Outcome loop

Endpoint
/api/agent/outcome
Event ID
resolve
Outcomes
5

Install command

npx skills add samber/cc-skills-golang --skill golang-modernize

Do not use when

  • teams that need a vendor-supported SLA
  • high-compliance environments without internal security review
  • No OpenAgentSkill engagement data yet
  • High-risk permission hints: Shell or command execution, Secrets or environment access
  • Dependency or permission surface needs review

Agent safety v2

38/100 · Avoid automatic install

Experimentalreview

Sparse or mixed signals. Useful for discovery, but not for autonomous installation.

Test manually in an isolated workspace and compare against safer alternatives.

Resolve via API

high

Shell or command execution

Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.

medium

Network access

Skill likely fetches remote pages, APIs, repositories, or external services.

medium

Filesystem access

Skill may read or write project files, documents, generated artifacts, or local workspace state.

high

Secrets or environment access

Skill metadata references credentials, tokens, environment variables, or secret-bearing workflows.

  • High-risk permission hints: Shell or command execution, Secrets or environment access
  • Dependency or permission surface needs review

Agent resolve plan

Let an agent verify fit before installing.

The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.

Open text plan

Agent should check

  • Task fit and alternatives from Resolve API.
  • Audit score, trust score, and safety policy warnings.
  • Install target compatibility for Codex, Claude Code, Cursor, or CLI.

Copy prompt

Task: Use golang-modernize in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20golang-modernize%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/samber-golang-modernize/install
Install command: npx skills add samber/cc-skills-golang --skill golang-modernize
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.

Agent handoff

Give an agent the install path, not another directory page.

Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.

Open install API

Agent prompt

Use golang-modernize for this task. Review https://www.openagentskill.com/api/skills/samber-golang-modernize/install, then install with: npx skills add samber/cc-skills-golang --skill golang-modernize

Registry metadata

Agent-readable profile for automatic skill selection.

This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.

Open manifest

Agent fit

93/100

Coding agents

Platforms

Claude Code, OpenAI Agents

Audit report

Needs review · 82/100

A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.

View audit reportView eval report

Agent decision cockpit

Primary pick for Coding agents

Use this as a leading candidate, then validate the README and install path in your own agent stack.

93
Readiness
Adopt
Stage

Role in stack

Primary pick

Primary fit

Coding agents

Trust label

Production-ready

Install path

Command ready

Use when

  • Coding agents workflows
  • Claude Code teams
  • teams that value GitHub adoption signals

Evidence

  • 3,056 GitHub stars
  • recent repository activity
  • install command or GitHub repo available
  • 82/100 quality profile

review first

  • No OpenAgentSkill engagement data yet

Implementation path

  1. 1Install it in a sandbox agent and run one Coding agents task end to end.
  2. 2Compare output quality, latency, and failure behavior against at least one alternative.
  3. 3Promote it into production only after reviewing repository permissions, license, and maintenance signals.

Trust profile

Sandbox only

Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.

68
OpenAgentSkill Trust Score

GitHub adoption

PASS

3.1K GitHub stars

Stars/forks activity

INFO

3.1K stars, 204 forks; issue activity unavailable in current metadata

Recent maintenance

PASS

Pushed today

License clarity

PASS

MIT

Good signals

  • AI review approved
  • Install path is available
  • Repository evidence is available
  • Recently maintained repository
  • Meaningful GitHub adoption signal
  • Install command has no obvious high-risk pattern
  • Outcome loop is ready but needs first real agent run

Review before install

  • Financial research output is not financial advice; require human review before any live investment decision.
  • Quality score needs review
  • Permission surface needs review: secrets or environment access, shell or command execution
  • Dependency/runtime risk: command execution surface, credential or environment access
  • Permission surface: secrets or environment access, shell or command execution
  • No real agent outcome reports yet
  • Human review required before unattended installation

Recommended action

Run only in a sandbox and compare close alternatives before using it for real work.

Quality profile

Strong candidate for agent workflows

Solid option that is likely worth shortlisting for production workflows.

82
GitHub stars
3.1K
Freshness
Today
Install ready
Yes
License
MIT

Workflow fit

Use this skill in these scenarios

Workflow fit

Add it to a complete workflow

Alternative shortlist

Compare before you install

Similar skills that may fit this task.

Compare all

Overview

--- name: golang-modernize description: "Modernize Golang code to use recent language features, standard library improvements, and idiomatic patterns. Trigger proactively when writing or reviewing Go code and old-style patterns are detected, or when encountering a deprecation warning. Also use when the user explicitly asks for modernization, a Go version upgrade, or a CI/tooling refresh." user-invocable: true license: MIT compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.3.0" openclaw: emoji: "🔄" homepage: https://github.com/samber/cc-skills-golang requires: bins: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch WebSearch AskUserQuestion EnterWorktree ExitWorktree paths: - "**/*.go" ---

<!-- markdownlint-disable ol-prefix -->

**Persona:** You are a Go modernization engineer. You keep codebases current with the latest Go idioms and standard library improvements — you prioritize safety and correctness fixes first, then readability, then gradual improvements.

**Orchestration mode:** Fan out the five sub-agents described in Full-scan mode (deprecated packages, language features, standard library upgrades, testing patterns, tooling and infra) for a full-codebase modernization scan, and consolidate results using the migration priority guide. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly.

**Modes:**

- **Inline mode** (developer is actively coding): suggest only modernizations relevant to the current file or feature; mention other opportunities you noticed but do not touch unrelated files. - **Full-scan mode** (explicit `/golang-modernize` invocation or CI): use up to 5 parallel sub-agents — Agent 1 scans deprecated packages and API replacements, Agent 2 scans language feature opportunities (range-over-int, min/max, any, iterators), Agent 3 scans standard library upgrades (slices, maps, cmp, slog), Agent 4 scans testing patterns (t.Context, b.Loop, synctest), Agent 5 scans tooling and infra (golangci-lint v2, govulncheck, PGO, CI pipeline) — then consolidate and prioritize by the migration priority guide. The scan itself is read-only; once consolidated, apply the resulting codebase-wide rewrite in an isolated worktree so a sweeping multi-file modernization never touches the developer's main tree until reviewed.

**Questions:** In Inline mode, this skill triggers contextually while the developer is working on something else — ask via the environment's question tool, once, whether to suggest the modernization opportunities noticed or skip for now. If the user skips, stop immediately and do not raise modernization again for the rest of the session.

# Go Code Modernization Guide

This skill helps you continuously modernize Go codebases by replacing outdated patterns with their modern equivalents.

**Scope**: This skill covers the last 3 years of Go modernization (Go 1.21 through Go 1.26, released 2023-2026). While this skill can be used for projects targeting Go 1.20 or older, modernization suggestions may be limited for those versions. For best results, consider upgrading the Go version first. Some older modernizations (e.g., `any` instead of `interface{}`, `errors.Is`/`errors.As`, `strings.Cut`) are included because they are still commonly missed, but many pre-1.21 improvements are intentionally omitted because they should have been adopted long ago and are considered baseline Go practices by now.

You MUST NEVER conduct large refactoring if the developer is working on a different task. But TRY TO CONVINCE your human it would improve the code quality.

## Workflow

When invoked:

1. **Check the project's `go.mod` or `go.work`** to determine the current Go version (`go` directive) 2. **Check the latest Go version** using the Go Version Changelogs table below and suggest upgrading if the project's `go.mod` is behind 3. **Read `.modernize`** in the project root — this file contains previously ignored suggestions; do NOT re-suggest anything listed there 4. **Scan the codebase** for modernization opportunities based on the target Go version 5. **Run `golangci-lint`** with the `modernize` linter if available 6. **Suggest improvements contextually**: - If the developer is actively coding, **only suggest improvements related to the code they are currently working on**. Do not refactor unrelated files. Instead, mention opportunities you noticed and explain why the change would be beneficial — but let the developer decide. - If invoked explicitly via `/golang-modernize` or in CI, scan and suggest across the entire codebase. 7. **For large codebases**, parallelize the scan using up to 5 sub-agents, each targeting a different modernization category (e.g. deprecated packages, language features, standard library upgrades, testing patterns, tooling and infra). Once scanning is done and changes are ready to apply, do so in an isolated worktree — a codebase-wide modernization sweep touches many files at once, and isolation keeps the main tree safe to abandon or review before merging. 8. **Before suggesting a dependency update**, run `go mod tidy` and the test suite to verify compatibility. Ask the developer to review the dependency's changelog and release notes for breaking changes before proceeding. 9. **If the developer explicitly ignores a suggestion**, write a short memo to `.modernize` in the project root so it is not suggested again. Format: one line per ignored suggestion, with a short description.

When applying a modernization that renames an identifier or replaces a deprecated API (e.g. `reflect.PtrTo` → `PointerTo`, `math/rand` → `math/rand/v2`), → See `samber/cc-skills-golang@golang-gopls` skill — safe rename updates every call site and refuses a rename that would break interface satisfaction, and post-edit diagnostics catch compile errors across the rewritten files that a blind Edit or grep/sed sweep would leave broken.

### `.modernize` file format

``` # Ignored modernization suggestions # Format: <date> <category> <description> 2026-01-15 slog-migration Team decided to keep zap for now 2026-02-01 math-rand-v2 Legacy module requires math/rand compatibility ```

## Go Version Changelogs

Reference the relevant changelog when suggesting a modernization:

| Version | Release | Changelog | | ------- | ------------- | --------------------------- | | Go 1.21 | August 2023 | <https://go.dev/doc/go1.21> | | Go 1.22 | February 2024 | <https://go.dev/doc/go1.22> | | Go 1.23 | August 2024 | <https://go.dev/doc/go1.23> | | Go 1.24 | February 2025 | <https://go.dev/doc/go1.24> | | Go 1.25 | August 2025 | <https://go.dev/doc/go1.25> | | Go 1.26 | February 2026 | <https://go.dev/doc/go1.26> |

For versions newer than Go 1.26, consult the official Go release notes.

When the project's `go.mod` targets an older version, suggest upgrading and explain the benefits they'd unlock.

## Using the modernize linter

The `modernize` linter (available since **golangci-lint v2.6.0**) automatically detects code that can be rewritten using newer Go features. It originates from `golang.org/x/tools/go/analysis/passes/modernize`; `gopls` and Go 1.26's rewritten `go fix` cover overlapping modernization checks, but exact coverage differs by tool version. See the `samber/cc-skills-golang@golang-lint` skill for configuration.

## Version-specific modernizations

For detailed before/after examples for each Go version (1.21–1.26) and general modernizations, see [Go version modernizations](./references/versions.md).

## Tooling modernization

For CI tooling, govulncheck, PGO, golangci-lint v2, and AI-powered modernization pipelines, see [Tooling modernization](./references/tooling.md).

## Deprecated Packages Migration

| Deprecated | Replacement | Since | | --- | --- | --- | | `math/rand` | `math/rand/v2` | Go 1.22 | | `crypto/elliptic` (most functions) | `crypto/ecdh` | Go 1.21 | | `reflect.SliceHeader`, `StringHeader` | `unsafe.Slice`, `unsafe.String` | Go 1.21 | | `reflect.PtrTo` | `reflect.PointerTo` | Go 1.22 | | `runtime.GOROOT()` | `go env GOROOT` | Go 1.24 | | `runtime.SetFinalizer` | `runtime.AddCleanup` | Go 1.24 | | `crypto/cipher.NewOFB`, `NewCFB*` | AEAD modes or `NewCTR` | Go 1.24 | | `golang.org/x/crypto/sha3` | `crypto/sha3` | Go 1.24 | | `golang.org/x/crypto/hkdf` | `crypto/hkdf` | Go 1.24 | | `golang.org/x/crypto/pbkdf2` | `crypto/pbkdf2` | Go 1.24 | | `testing/synctest.Run` | `testing/synctest.Test` | Go 1.25 | | `crypto/rsa.EncryptPKCS1v15` for new encryption use | RSA-OAEP (`rsa.EncryptOAEP` / `rsa.EncryptOAEPWithOptions`) or HPKE/KEM design | Go 1.26 | | `net/http/httputil.ReverseProxy.Director` | `ReverseProxy.Rewrite` | Go 1.26 |

## Migration Priority Guide

When modernizing a codebase, prioritize changes by impact:

### High priority (safety and correctness)

1. Remove loop variable shadow copies _(Go 1.22+)_ — prevents subtle bugs 2. Replace `math/rand` with `math/rand/v2` _(Go 1.22+)_ — remove `rand.Seed` calls 3. Use `os.Root` for user-supplied file paths _(Go 1.24+)_ — prevents path traversal 4. Run `govulncheck` _(Go 1.22+)_ — catch known vulnerabilities 5. Use `errors.Is`/`errors.As` instead of direct comparison _(Go 1.13+)_ 6. Migrate deprecated crypto packages _(Go 1.24+)_ — security critical

### Medium priority (readability and maintainability)

7. Replace `interface{}` with `any` _(Go 1.18+)_ 8. Use `min`/`max` builtins _(Go 1.21+)_ 9. Use `range` over int _(Go 1.22+)_ 10. Use `slices` and `maps` packages _(Go 1.21+)_ 11. Use `cmp.Or` for default values _(Go 1.22+)_ 12. Use `sync.OnceValue`/`sync.OnceFunc` _(Go 1.21+)_ 13. Use `sync.WaitGroup.Go` _(Go 1.25+)_ 14. Use `t.Context()` in tests _(Go 1.24+)_ 15. Use `b.Loop()` in benchmarks _(Go 1.24+)_

### Lower priority (gradual improvement)

16. Migrate to `slog` from third-party loggers _(Go 1.21+)_ 17. Adopt iterators where they simplify code _(Go 1.23+)_ 18. Replace `sort.Slice` with `slices.SortFunc` _(Go 1.21+)_ 19. Use `strings.SplitSeq` and iterator variants _(Go 1.24+)_ 20. Move tool deps to `go.mod` tool directives _(Go 1.24+)_ 21. Enable PGO for production builds _(Go 1.21+)_ 22. Upgrade to golangci-lint v2 with modernize linter _(golangci-lint v2.6.0+)_ 23. Add `govulncheck` to CI pipeline 24. Set up monthly modernization CI pipeline 25. Evaluate `encoding/json/v2` only when the project explicitly opts into `GOEXPERIMENT=jsonv2` _(Go 1.25+, experimental)_ 26. Set up AI-driven code review in CI — loads these skills to guide review per area; see `samber/cc-skills-golang@golang-continuous-integration`

## Related Skills

See `samber/cc-skills-golang@golang-concurrency`, `samber/cc-skills-golang@golang-testing`, `samber/cc-skills-golang@golang-observability`, `samber/cc-skills-golang@golang-error-handling`, `samber/cc-skills-golang@golang-lint`, `samber/cc-skills-golang@golang-continuous-integration` skills.

- → See `samber/cc-skills-golang@golang-refactoring` skill for staging a large modernization sweep as small human-reviewed PRs instead of one big worktree sweep.

Technical details

Version
1.0.0
License
MIT
Last updated
Aug 24, 2026
Published
Aug 24, 2026

Decision snapshot

Primary pick

93
Ready
Adopt
Stage

3,056 GitHub stars

Audit

Install review

Install and adoption review

82
Needs review
Security
75/100
Maintenance
100/100
Install
92/100
Open full auditView eval report

Agent-proven evidence

Agent-proven evidence

Outcome reports after resolve, review, install, and one narrow run.

0
Proven
Needs first agent runAuto-install: review firstLast: Unknown
Success rate
Recent failure
Outcomes
0
Output quality
Failed
0
Not relevant
0
Installs
0
Risk blocked
0
Setup needed
0
Production
0

No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.

Install

Add to agent workflow

Free and open source. Review the report before installing into production agents.

Growth loop

Share kit

X

Scenario-led draft for golang-modernize, ready for a manual X post.

Curator note
golang-modernize: Modernize Golang code to use recent language features, standard library improvements, and idi...

3.1K stars

https://www.openagentskill.com/skills/samber-golang-modernize?ref=x
Open X draft
Optional reply with install command
Listing + install path for golang-modernize:
https://www.openagentskill.com/skills/samber-golang-modernize?ref=x

Install: npx skills add samber/cc-skills-golang --skill golang-modernize

Listing source

Registry indexed

Claimable

This listing was indexed from public sources and is not marked official until a maintainer claim is approved.

Creator
samber
Indexed by
OpenAgentSkill community index

Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.

Claim this skill

Owner claim

Claim this skill listing

This Registry indexed listing is attributed to samber but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.

Creator backlink kit

Add the evidence badges to your README

Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.

[![Listed on OpenAgentSkill](https://www.openagentskill.com/api/badge/samber-golang-modernize?metric=listed&label=Listed)](https://www.openagentskill.com/skills/samber-golang-modernize)
[![OpenAgentSkill Trust](https://www.openagentskill.com/api/badge/samber-golang-modernize?metric=trust&label=Trust)](https://www.openagentskill.com/skills/samber-golang-modernize)
[![OpenAgentSkill Audit](https://www.openagentskill.com/api/badge/samber-golang-modernize?metric=audit&label=Audit)](https://www.openagentskill.com/skills/samber-golang-modernize/audit)
[![Agent Proven](https://www.openagentskill.com/api/badge/samber-golang-modernize?metric=proven&label=Agent%20Proven)](https://www.openagentskill.com/skills/samber-golang-modernize)

Author

S

samber

@samber

Health signals

GitHub stars
3.1K
Quality score
48/100
Last GitHub push
Aug 24, 2026
Framework hints
Unknown
OpenAgentSkill views
0
Install copies
0
Outbound clicks
0

Community signal

Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.

Trust & safety

Sandbox only

68
  • GitHub adoption3.1K GitHub starsPASS
  • Stars/forks activity3.1K stars, 204 forks; issue activity unavailable in current metadataINFO
  • Recent maintenancePushed todayPASS
  • License clarityMITPASS
  • README/SKILL.md completenessMetadata includes enough usage and workflow contextPASS
  • Dependency/runtime riskcommand execution surface, credential or environment accessFIX