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

go-idiomatic

Skill0 starsChanged 2 months agoMITView on GitHub

Review or improve Go value, error, interface, and collection semantics while preserving caller contracts.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Treat slices and maps as shared storage unless ownership proves otherwise.

    line 12
  2. Distinctive:

    Use errors as values. Add meaningful context, preserve intentional error identity, and inspect wrapped errors with the supported standard …

    line 14
  3. Distinctive:

    Reuse: Prefer existing project, standard-library, and established dependency operations when their semantics match.

    line 16

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Go Idiomatic

Contracts. Make the caller's expectations visible in ordinary Go. Identify values, absence, mutation, ordering, effects, and failures before changing their representation. Follow the module's supported Go version and conventions. Honor requirements and preserve settled choices outside the requested change.

Use useful zero values where they fit; distinguish an invalid state from an empty result. Preserve nil versus empty where callers or serialization observe it. A typed nil inside an interface is not a nil interface. Choose receivers for mutation, identity, and method sets. Make aliasing explicit when copying reference fields; synchronization primitives must not be copied after use.

Treat slices and maps as shared storage unless ownership proves otherwise. Cloning is shallow; map iteration is unordered. Keep effects and branching explicit instead of hiding them inside clever expressions or transformation pipelines.

Use errors as values. Add meaningful context, preserve intentional error identity, and inspect wrapped errors with the supported standard matching APIs. Wrapping exposes a cause as part of the caller's contract; routine failures do not need panics.

Reuse. Prefer existing project, standard-library, and established dependency operations when their semantics match. Generics should express a real shared algorithm or type relationship. Keep wrappers only for domain meaning or adaptation.

For review-only work, cite the affected code, caller-visible contract, and triggering value; explain the smallest justified change without editing files. For implementation, finish with formatted code and focused checks for the observable contract the change could disturb; avoid unrelated style churn.

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.