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.
npx agentmods add skills/yarlson/yarstack/go-code-reducenpx skills add yarlson/yarstack --skill go-code-reducegit clone --depth 1 https://github.com/yarlson/yarstackWrote 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.
[](https://agentmods.dev/skills/yarlson/yarstack/go-code-reduce)<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="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00049 | $0.00694 |
| Opus 5 | $0.00024 | $0.00347 |
| Sonnet 5 | $0.00010 | $0.00139 |
| Haiku 4.5 | $0.00005 | $0.00069 |
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 today.
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.
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
-
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.
-
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.
-
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.
-
Keep explicit code when the alternative adds indirection, reflection, modes, hidden allocation, a one-use helper, or a vocabulary maintainers must learn.
-
Make one coherent reduction at a time. Preview automated rewrites such as
go fix -diff ./..., apply only reviewed transformations, format changed Go files, and exclude unrelated modernization. -
Run focused tests and repository-native checks. Add race tests for concurrency changes, regeneration checks for generated code, and repeated benchmarks for performance-sensitive paths.
-
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.
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.
- today First seen · 39 lines · 49 tokens per session scan A cf46c854609f
go-code-reduce is a skill published in the GitHub repository yarlson/yarstack (3 stars, last pushed 2d ago), licensed MIT. It adds 49 tokens to every session and 694 once invoked, about $0.0002 per session on Opus 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.
Other skills, from other repositories
hns-moaiadk-best-practices
Every change must pass all five dimensions before completion.
hns-moaiadk-patterns
Skill "hns-moaiadk-patterns" from modu-ai/moai-adk, covering moai-adk-go domain patterns, architecture quick reference, key source paths, pipeline specialist delegation map and template-first build cycle.
hns-moaiadk-dev-reference
Skill "hns-moaiadk-dev-reference" from modu-ai/moai-adk, covering hns-moaiadk-dev-reference, version management (from claude.local.md §5), single source of truth, build version injection and build with version injection.
goframe-v2
GoFrame development skill. TRIGGER when writing/modifying Go files, implementing services, creating APIs, or database operations. DO NOT TRIGGER for frontend/shell scripts.
golang-patterns
堅牢で効率的かつ保守可能なGoアプリケーションを構築するための慣用的なGoパターン、ベストプラクティス、規約。.
go-idioms
Go stdlib, error wrapping, interfaces, goroutines, table-driven tests, gofumpt.