agentleFS
DankosikDankosik/golang-backend-skills/skills/go-design/SKILL.md

go-design

Skill0 starsChanged 2 months agoMITView on GitHub

Decide or review Go responsibilities, package boundaries, consumer interfaces, and concrete abstractions.

The file

Files
SKILL.md

Go Design

Design for cohesion: a business rule should have one natural home, and callers should need little knowledge of its implementation. Honor requirements and preserve settled choices outside the requested change.

Trace the requested behavior through existing callers before introducing structure. Put invariants where all relevant paths encounter them. Keep transport, business policy, and persistence distinguishable where their contracts differ; let the actual problem determine the packages and types required.

Prefer concrete types and ordinary functions. Introduce a narrow interface at the consumer when it isolates a real dependency or variation; a single implementation can justify that boundary. Do not mirror every struct with an interface or expose an interface only to manufacture mocks. A function parameter may express a single operation more directly.

Choose composition, explicit dependencies, meaningful package names, and the smallest exported surface. Keep internal details private. Avoid generic utility packages, speculative extension points, and layers that merely forward the same knowledge.

Apply SOLID, DRY, and YAGNI as judgment: centralize shared rules while preserving independent reasons to change. Evaluate abstractions by what their callers no longer need to understand, including mutation ownership, resource lifetime, and error contracts.

For analysis or review without a change request, cite the affected callers and explain the responsibility problem without editing files. Distinguish a violated project rule from a design preference; check what a boundary owns before recommending removal. For refactoring, finish when the changed responsibility has a clear owner, each retained boundary earns its cost, and focused checks preserve caller-visible behavior and effect ordering. Do not make design a prerequisite for an already settled implementation task.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.