agentleFS
MesteriisMesteriis/Engineering-Bible-AI/skills/go/SKILL.md

go

Skill0 starsChanged 4 months agoMITView on GitHub

Applies Go rules for packages, explicit errors, interfaces, concurrency, tests, and tooling.

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 11 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before changing Go code, inspect relevant files when present:

    line 14
  2. Distinctive:

    Follow existing package layout.

    line 34
  3. Very specific:

    Avoid util, common, and helpers dumping grounds.

    line 36
  4. Distinctive:

    Prefer small interfaces defined near consumers.

    line 37
  5. Distinctive:

    Prefer explicit dependencies over package-level mutable globals.

    line 38
  6. Distinctive:

    Keep exported API surface intentional.

    line 39
  7. Very specific:

    Use gofmt/go fmt style.

    line 40
  8. Distinctive:

    Do not panic for normal operational failures.

    line 46
  9. Very specific:

    Do not discard errors with _ unless intentionally safe and obvious.

    line 47
  10. Distinctive:

    Do not store context in structs unless the project has a deliberate pattern.

    line 53
  11. Distinctive:

    Avoid starting goroutines without lifecycle management.

    line 55
  12. Distinctive:

    Do not create large interfaces.

    line 61
  13. Distinctive:

    Do not create interfaces only because one day the clouds may demand it.

    line 62
  14. Distinctive:

    Avoid shared mutable state without synchronization.

    line 66

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: go

Purpose

Apply the shared engineering style to Go projects while respecting Go idioms: small packages, explicit errors, simple interfaces, and boring code.

Inspect First

Before changing Go code, inspect relevant files when present:

  • go.mod
  • go.sum
  • Makefile
  • CI files
  • golangci-lint config
  • existing packages and tests

Infer:

  • Go version;
  • module layout;
  • test style;
  • lint tooling;
  • dependency boundaries;
  • context/error conventions.

Style

  • Follow existing package layout.
  • Keep packages cohesive.
  • Avoid util, common, and helpers dumping grounds.
  • Prefer small interfaces defined near consumers.
  • Prefer explicit dependencies over package-level mutable globals.
  • Keep exported API surface intentional.
  • Use gofmt/go fmt style.

Errors

  • Return errors explicitly.
  • Wrap errors with useful context.
  • Do not panic for normal operational failures.
  • Do not discard errors with _ unless intentionally safe and obvious.
  • Preserve sentinel/domain errors when the project uses them.

Context

  • Pass context.Context through request/operation boundaries.
  • Do not store context in structs unless the project has a deliberate pattern.
  • Respect cancellation and timeouts.
  • Avoid starting goroutines without lifecycle management.

Interfaces

  • Accept interfaces, return concrete types when appropriate.
  • Define interfaces at the consumer boundary.
  • Do not create large interfaces.
  • Do not create interfaces only because one day the clouds may demand it.

Concurrency

  • Avoid shared mutable state without synchronization.
  • Avoid goroutine leaks.
  • Close channels from the sending side.
  • Make ownership of channels and goroutines clear.

Tests and Validation

Common commands, only when configured or clearly available:

go test ./...
go test -race ./...
go vet ./...
gofmt -w <files>
golangci-lint run

Report exact commands and results.

Shared Cross-Ecosystem Style

Apply the shared engineering style from:

  • ../../engineering/05_design_principles.md
  • ../../engineering/06_responsibility_model.md
  • ../../engineering/07_complexity_budget.md
  • ../../engineering/12_naming_bible.md

Language-specific idioms control syntax and ecosystem details, but they must not weaken the core rules: small cohesive units, explicit boundaries, honest validation, no dumping grounds, and no fake placeholders.

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.