go-code-reduce

go-code-reduce is a skill for Claude Code from yarlson/yarstack. It costs 49 tokens per session (771 once invoked), scanned A, original, MIT.

A Go code-reduction skill for removing unnecessary maintenance work while keeping behavior unchanged. Go is a programming language; the skill focuses on simpler standard language or library constructs rather than merely shortening files.

In plain words
What is it for?
Use it when asked to reduce Go boilerplate, duplication, obsolete idioms, or maintenance burden in an existing repository.
Why use it?
It helps reduce dead code, duplicated mechanics, obsolete compatibility code, and unnecessarily broad interfaces without changing errors, ordering, APIs, or other stated behavior.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the yarstack plugin — 46 skills, 1 agent shipped together

Good fit Use it when asked to reduce Go boilerplate, duplication, obsolete idioms, or maintenance burden in an existing repository.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yarlson/yarstack/go-code-reduce
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add yarlson/yarstack --skill go-code-reduce
Clone the repo
git clone --depth 1 https://github.com/yarlson/yarstack

Made for: Claude Code.

Or install yarstack, the plugin that ships this one along with the rest of its 46 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for go-code-reduce

README.md
[![agentmods](https://agentmods.dev/badge/skills/yarlson/yarstack/go-code-reduce/github.svg)](https://agentmods.dev/skills/yarlson/yarstack/go-code-reduce)
Your own site
<a href="https://agentmods.dev/skills/yarlson/yarstack/go-code-reduce"><img src="https://agentmods.dev/badge/skills/yarlson/yarstack/go-code-reduce/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for go-code-reduce

Your own site · 80×15
<a href="https://agentmods.dev/skills/yarlson/yarstack/go-code-reduce"><img src="https://agentmods.dev/badge/skills/yarlson/yarstack/go-code-reduce.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 771 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00049 $0.00771
Opus 5.5 $0.00020 $0.00308
Sonnet 5.5 $0.00010 $0.00154
Haiku 4.5 $0.00005 $0.00077

Measured 12d ago against content hash 0ba1cc0d76d8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

go-code-reduce scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/yarstack/skills/go-code-reduce/SKILL.md · 39 lines

How it starts

The opening of the file, as written. The whole thing — 39 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Reduce Go Code

Reduce authored maintenance burden, not raw repository lines. Prefer deleting mechanics through standard Go constructs over compressing domain logic or introducing project-specific abstractions.

Workflow

  1. Read the repository guidance, module Go version, closest source and tests, generated-file markers, and affected public consumers. Keep an assessment read-only unless edits are authorized.

  2. State the behavior that must remain unchanged, including errors and wrapped identities, nil versus empty values, ordering, serialization, cancellation, cleanup, exported APIs, build variants, and relevant performance bounds.

  3. Rank evidenced candidates in this order:

    • delete dead, obsolete, forwarding, compatibility, or unnecessarily exported code when consumers permit it;
    • replace hand-written mechanics with version-supported language, built-in, or standard-library operations;
    • shrink producer APIs and define small interfaces at actual consumers;
    • consolidate an algorithm only when multiple real copies differ solely by type or repeated traversal;
    • generate code only when repetition is mechanically derived from one authoritative source;
    • add a dependency only when it removes a meaningful subsystem after adapters, tooling, security, and update costs.
  4. Keep explicit code when the alternative adds indirection, reflection, modes, hidden allocation, a one-use helper, or a vocabulary maintainers must learn.

  5. Make one coherent reduction at a time. Preview automated rewrites with go fix -diff ./...; it exits non-zero when it finds fixes, so a non-zero exit with a diff is not a failure. List the available fixers with go tool fix help. Apply only reviewed transformations, format the changed Go files, and exclude unrelated modernization.

  6. Run focused tests and the repository's checks. Run go test -race on packages whose concurrency changed. For generated code, run the generator and confirm git diff --exit-code is clean. For performance-sensitive paths, run the benchmarks before and after with -count=10, and compare them with benchstat when it is installed.

  7. Compare only relevant before-and-after evidence. Separate authored production, test, and generated code; a valid reduction lowers authored code or duplication without materially increasing complexity, API surface, dependencies, or runtime cost.

Read the full file on GitHub · 39 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago Changed 0ba1cc0d76d8
  2. 1mo ago First seen · 39 lines · 49 tokens per session scan A cf46c854609f

Subscribe to this mod's changes

go-code-reduce is a skill published in the GitHub repository yarlson/yarstack (3 stars, last pushed 11d ago), licensed MIT. It adds 49 tokens to every session and 771 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.

Related

Other skills, from other repositories

ring:verifying-code

Verifying a Go project: runs every quality check (lint, vet, imports, format, docs, unit, integration, E2E) and returns a single MERGEREADY or NEEDSFIX verdict. Report-only: never fixes anything. Use for a quick pre-merge or pre-PR check outside a full dev-cycle. Skip when not a Go project, when you want a single…

LerianStudio/ring · 101 tokens

writing-go

Idiomatic Go development. Use when writing Go code, designing APIs, reviewing Go implementations, or changing Go tests. Follow the module's target Go version. Prefer stdlib, concrete types, explicit errors, goroutine ownership, fast feedback, and behavior tests. NOT for Python, Rust, TypeScript, shell scripts, or…

alexei-led/cc-thingz · 72 tokens

review-golang

Run a comprehensive Go code review on git-changed files using the golang-pro agent with Context7 library docs.

ivklgn/ai-kit · 26 tokens

agent-go-reviewer

Expert Go code reviewer specializing in idiomatic Go, concurrency patterns, error handling, and performance. Use for all Go code changes. MUST BE USED for Go projects.

KunanonJ/ai-skills-hub · 38 tokens

neneko-code-taste

Use when implementing or reviewing Go changes that should match tRPC-Agent-Go's code taste: minimal compatible diffs, consumer-oriented APIs, explicit ownership, and contract-level tests. Do not use for generic Go formatting-only requests.

XnLemon/Neneko-skill · 51 tokens

google-go-style

Use when writing, reviewing, or refactoring Go code; when handling errors (fmt.Errorf, %w, sentinel, errors.Is, errors.As); when deciding between panic, error return, and log.Fatal; when writing tests (table-driven, t.Helper, t.Fatal vs t.Error, goroutines); when designing API surface (option struct, variadic options…

cicdteam/google-go-style · 110 tokens