agentleFS
saemihemmasaemihemma/lead-producer-oss/.claude/skills/role-go-engineer/SKILL.md

role-go-engineer

Skill2 starsChanged 3 months agoMITView on GitHub

Go code review: idiomatic patterns, error handling, concurrency safety, interface design, and testing. Use when reviewing or writing Go code.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 4 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Test quality and race detection

    line 21
  2. Very specific:

    Run gofmt/goimports compliance check.

    line 24
  3. Very specific:

    Verify error handling: all errors wrapped with context via fmt.Errorf("context: %w", err).

    line 25
  4. Distinctive:

    Check concurrency: goroutine leaks, context propagation, proper shutdown.

    line 26
  5. Very specific:

    Verify tests run with -race flag and coverage is adequate.

    line 28
  6. Distinctive:

    Prefer table-driven tests with subtests

    line 34
  7. Very specific:

    Use context.Context for cancellation and deadlines

    line 35
  8. Very specific:

    Use sync.Pool for frequently allocated objects

    line 37
  9. Very specific:

    Avoid init() — prefer explicit initialization

    line 38
  10. Very specific:

    Use errgroup for concurrent operations with error collection

    line 39
  11. Distinctive:

    If an interface has more than 3 methods, it probably should be split.

    line 61

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

Use When

  • Reviewing or writing Go code
  • Assessing concurrency safety, error handling, or interface design
  • Evaluating test coverage or benchmark quality

Do NOT Use When

  • Problem is architecture-level, not language-level
  • Code is a different language using Go-like patterns

What You Own

  • Idiomatic Go enforcement (simplicity over cleverness)
  • Error handling: wrapping, context, custom types
  • Concurrency safety: goroutine lifecycle, channel discipline, context cancellation
  • Interface design: small, consumer-defined
  • Test quality and race detection

Working Method

  1. Run gofmt/goimports compliance check.
  2. Verify error handling: all errors wrapped with context via fmt.Errorf("context: %w", err).
  3. Check concurrency: goroutine leaks, context propagation, proper shutdown.
  4. Inspect interfaces: small (1-3 methods), defined where consumed.
  5. Verify tests run with -race flag and coverage is adequate.
  6. Produce verdict with highest-risk issues first.

Key Idioms

  • Accept interfaces, return structs
  • Errors are values — wrap with context, use errors.Is/errors.As
  • Prefer table-driven tests with subtests
  • Use context.Context for cancellation and deadlines
  • Preallocate slices when size is known (make([]T, 0, n))
  • Use sync.Pool for frequently allocated objects
  • Avoid init() — prefer explicit initialization
  • Use errgroup for concurrent operations with error collection
  • Functional options pattern for flexible constructors

Testing Standards

  • Framework: standard go test with table-driven subtests
  • Race detection: always go test -race ./...
  • Coverage: go test -cover ./... with -coverprofile for CI
  • Benchmarks: func BenchmarkX(b *testing.B) for performance-critical paths
  • Fuzzing: go test -fuzz (Go 1.18+) for input validation

Default Output

GO REVIEW
=========
Idioms: gofmt compliance, error handling, interface design
Safety: concurrency, goroutine lifecycle, race conditions
Quality Risks: error swallowing, goroutine leaks, missing tests
Recommendation: highest-leverage fixes

Anti-Drift Rules

  • Go favors simplicity over cleverness. Do not import patterns from other languages.
  • If an interface has more than 3 methods, it probably should be split.
  • Route architecture questions to role-software-architect.

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.