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/muratmirgun/gophersnpx agentmods add skills/muratmirgun/gophers/go-clean-architectureWrote 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/muratmirgun/gophers/go-clean-architecture)<a href="https://agentmods.dev/skills/muratmirgun/gophers/go-clean-architecture"><img src="https://agentmods.dev/badge/skills/muratmirgun/gophers/go-clean-architecture/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/muratmirgun/gophers/go-clean-architecture"><img src="https://agentmods.dev/badge/skills/muratmirgun/gophers/go-clean-architecture.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.00070 | $0.02420 |
| Opus 5 | $0.00035 | $0.01210 |
| Sonnet 5 | $0.00014 | $0.00484 |
| Haiku 4.5 | $0.00007 | $0.00242 |
Grade A, and why
go-clean-architecture 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 10d 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 — 189 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Go Clean Architecture
A Go service organized into four concentric layers — Domain, Usecase, Repository, Delivery — where source code depends inward only. Done well, the HTTP framework and the database are interchangeable details; the business logic is testable without either.
This skill is framework-agnostic. Swap Gin for Fiber, Echo, Chi, or net/http by replacing the delivery layer — zero changes elsewhere.
Core Rules
- Dependency Rule. Source depends inward: Delivery → Usecase → Domain. Repository implements interfaces declared in Domain. Domain depends on nothing.
- Framework is a detail. Gin/Fiber/Echo/Chi/net-http types live only in
internal/delivery/. Usecases see plain Go values. - Database is a detail. SQL, sqlx, sqlc, pgx, GORM live only in
internal/repository/. Usecases see repository interfaces. - Domain owns the interfaces; layers below provide implementations.
UserRepositoryis an interface ininternal/domain; the Postgres struct is ininternal/repositoryand unexported. - DTOs at the edges. Delivery layer maps HTTP request bodies to domain inputs and domain entities to response bodies. Usecases never see
*gin.Context,http.Request, or DB rows. cmd/<binary>/main.gois the only place that knows the whole system. Wiring (DI) is explicit, framework-free Go code.
When This Pays Off
| Symptom | What clean architecture buys you |
|---|---|
| HTTP handlers contain SQL | Move SQL into a repository; handlers shrink to 5 lines |
| Tests need a running DB | Mock the repository interface; usecase tests run in milliseconds |
| Swapping web frameworks is a rewrite | Replace internal/delivery/http; nothing else touched |
| Business rules duplicated across handlers | Single usecase function, called by HTTP, gRPC, and a CLI |
| ORM hooks fire in surprising places | Repository methods are explicit; no hidden behavior |
If the service is a 200-line cron job, this skill is overkill. If it will live 3+ years and grow features, it's the cheapest insurance you can buy.
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.
- 10d ago First seen · 189 lines · 70 tokens per session scan A 5ce9c776bc0a
go-clean-architecture is a skill published in the GitHub repository muratmirgun/gophers (8 stars, last pushed 1mo ago), licensed MIT. It adds 70 tokens to every session and 2,420 once invoked, about $0.0003 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-31.
Other skills, from other repositories
go
Use when writing Go services, CLIs, or libraries. Covers idiomatic error wrapping, goroutine and context discipline, interface design, table-driven tests, and the race detector.
golang-pro
Implements concurrent Go patterns using goroutines and channels, designs and builds microservices with gRPC or REST, optimizes Go application performance with pprof, and enforces idiomatic Go with generics, interfaces, and robust error handling. Use when building Go applications requiring concurrent programming…
go-programming-expert
Expert-level skill for Go programming (Go 1.25+). Covers high-performance microservices, concurrency patterns, sqlc, net/http, Gin/Echo/Fiber, gRPC, and testing in English and Indonesian.
encore-go-api
Define typed API endpoints in Encore Go using //encore:api annotations. Covers typed request/response structs, path/query/header/cookie params, and error returns. For raw endpoints (//encore:api raw) and inbound webhooks, use encore-go-webhook instead.
encore-go-webhook
Receive inbound webhooks from external services (Stripe, GitHub, Slack, Twilio, etc.) in Encore Go using //encore:api raw. The right skill any time the user names a third-party provider that POSTs events to a URL you own.
encore-go-bucket
Store unstructured files in Encore Go using objects.NewBucket from encore.dev/storage/objects — uploads, images, documents, blobs.