Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/saifoelloh/golang-best-practices-skillnpx agentmods add skills/saifoelloh/golang-best-practices-skill/design-patternsWrote 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/saifoelloh/golang-best-practices-skill/design-patterns)<a href="https://agentmods.dev/skills/saifoelloh/golang-best-practices-skill/design-patterns"><img src="https://agentmods.dev/badge/skills/saifoelloh/golang-best-practices-skill/design-patterns/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.
<a href="https://agentmods.dev/skills/saifoelloh/golang-best-practices-skill/design-patterns"><img src="https://agentmods.dev/badge/skills/saifoelloh/golang-best-practices-skill/design-patterns.svg" alt="Reviewed on agentmods" width="80" 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.00040 | $0.01011 |
| Opus 5 | $0.00020 | $0.00505 |
| Sonnet 5 | $0.00008 | $0.00202 |
| Haiku 4.5 | $0.00004 | $0.00101 |
Grade A, and why
golang-design-patterns 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.
How it starts
The opening of the file, as written. The whole thing — 152 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Golang Design Patterns & Refactoring
Expert-level code refactoring and design pattern application for Go. Detects code smells, suggests refactoring strategies, and applies proven design patterns to improve maintainability.
When to Apply
Use this skill when:
- Refactoring complex or legacy code
- Reducing technical debt
- Extracting reusable patterns
- Simplifying large functions (God Objects)
- Improving code maintainability
- Applying Gang of Four patterns to Go
Rule Categories by Priority
| Priority | Count | Focus |
|---|---|---|
| High | 2 | Critical refactoring needs |
| Medium | 11 | Code quality improvements |
Rules Covered (13 total)
High-Impact Patterns (2)
high-god-object- Extract logic from 300+ line functionshigh-extract-method- Name complex code blocks with descriptive methods
Medium Improvements (11)
medium-primitive-obsession- Replace primitives with value objectsmedium-long-parameter-list- Use parameter objects for >5 paramsmedium-data-clumps- Extract repeated parameter groupsmedium-feature-envy- Move logic closer to datamedium-magic-constants- Replace magic numbers with named constantsmedium-builder-pattern- Fluent API for complex constructionmedium-factory-constructor- Validated object creationmedium-introduce-parameter-object- Group related parametersmedium-switch-to-strategy- Replace type switches with interfacesmedium-middleware-decorator- Decorator pattern for http.Handlermedium-law-of-demeter- Reduce coupling, avoid message chains
Common Refactoring Patterns
God Object → Extracted Methods
// ❌ 500 line function
func (u *Usecase) Process() { ... }
// ✅ Extracted methods
func (u *Usecase) Process() {
u.validate()
u.transform()
u.persist()
}
Primitive Obsession → Value Object
// ❌ Primitive types
func CreateUser(email string) { ... }
// ✅ Value object
type Email struct { value string }
func CreateUser(email Email) { ... }
What ships with it
13 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- rules/high-extract-method.md 5.2 KB
- rules/high-god-object.md 5.0 KB
- rules/medium-builder-pattern.md 1.4 KB
- rules/medium-data-clumps.md 1.6 KB
- rules/medium-factory-constructor.md 1.6 KB
- rules/medium-feature-envy.md 1.7 KB
- rules/medium-introduce-parameter-object.md 1.3 KB
- rules/medium-law-of-demeter.md 1.7 KB
- rules/medium-long-parameter-list.md 1.8 KB
- rules/medium-magic-constants.md 1.6 KB
- rules/medium-middleware-decorator.md 2.0 KB
- rules/medium-primitive-obsession.md 2.2 KB
- rules/medium-switch-to-strategy.md 2.1 KB
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.
- 12d ago First seen · 152 lines · 40 tokens per session scan A c8915335c997
golang-design-patterns is a skill published in the GitHub repository saifoelloh/golang-best-practices-skill (15 stars, last pushed 6mo ago), licensed MIT. It adds 40 tokens to every session and 1,011 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-08-30.
Other skills, from other repositories
golang-refactoring
Golang refactoring — safe, at-scale restructuring of existing Go code: a coverage-adaptive safety net, behavior-preserving transforms (gopls Rename/Extract, gofmt -r, gopatch), the Fowler catalog mapped to Go, breaking import cycles, and small stacked PRs. Apply when a function or type has grown too large, a code…
sapcc-review
Gold-standard SAP CC Go code review: 10 parallel domain specialists.
go-concurrency-safety
L1 supplement - audits Go-specific concurrency hazards in node client code: map iteration non-determinism, goroutine leaks, mutex ordering, panic boundaries, context cancellation.
design-review
Deep design review of Go codebase — naming, structure, consistency, interfaces, error handling. Scores each dimension and provides actionable fixes.
agents-md
Generate AGENTS.md files for Go, Rust, TypeScript, and Java projects. Use this skill whenever the user asks to create, scaffold, bootstrap, update, or review an AGENTS.md (or agent-instructions, CLAUDE.md, repo guide for agents) file in a codebase. Also trigger when the user says "add AGENTS.md", "make this repo…
sapcc-audit
Full-repo SAP CC Go compliance audit against review standards.