agentsclimarketplace

Idiomatic go

Skill saifoelloh/golang-best-practices-skill/idiomatic-go

Production-ready Go code review skill for AI agents based on authoritative sources

Install
npx -y skills add saifoelloh/golang-best-practices-skill --skill idiomatic-go

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 16 stars16 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Idiomatic Go style and best practices review. Use when checking interface design, pointer usage, or Go-specific idioms. Ensures code follows standard Go conventions and readability principles.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

3.3 KB, as published. Nobody here has run it

Golang Idiomatic Patterns

Expert-level review for idiomatic Go patterns. Ensures code follows Go conventions, proper interface design, and appropriate pointer usage.

When to Apply

Use this skill when:

  • Ensuring code follows Go idioms
  • Reviewing interface design patterns
  • Checking pointer vs value usage
  • Verifying "Accept interfaces, return structs" pattern
  • Auditing usecase complexity
  • Ensuring small, focused interfaces

Rule Categories by Priority

PriorityCountFocus
High1Method receivers
Medium5Go idioms and patterns

Rules Covered (6 total)

High-Impact Patterns (1)

  • high-pointer-receiver - Use pointer receivers for mutations

Medium Improvements (5)

  • medium-interface-pollution - Keep interfaces small (<5 methods)
  • medium-accept-interface-return-struct - API flexibility pattern
  • medium-pointer-overuse - Don't overuse pointers for small types
  • medium-usecase-complexity - Move business logic to domain entities
  • medium-interface-in-implementation - Define interfaces where used

Common Idiomatic Patterns

Accept Interfaces, Return Structs

// ✅ GOOD: Accept interface, return struct
func Process(r io.Reader) (*Result, error) {
    // ...
    return &Result{}, nil
}

Small Interfaces

// ✅ GOOD: Small, focused interface
type Reader interface {
    Read(p []byte) (n int, err error)
}

Pointer Receivers for Mutations

// ✅ GOOD: Pointer receiver modifies state
func (u *User) UpdateEmail(email string) {
    u.Email = email
}

Trigger Phrases

This skill activates when you say:

  • "Is this idiomatic Go?"
  • "Review Go style"
  • "Check interface design"
  • "Verify pointer usage"
  • "Review Go conventions"
  • "Check for Go anti-patterns"

How to Use

For Idiomatic Review

  1. Check method receivers (pointer vs value)
  2. Verify interface sizes and locations
  3. Review pointer usage appropriateness
  4. Check "accept interfaces, return structs" pattern

Output Format

## Idiomatic Go Improvements: X

### [Rule Name] (Line Y)
**Pattern**: Interface Design / Pointer Usage / Method Receiver
**Issue**: Violates Go idiom
**Fix**: Suggested correction
**Example**:
```go
// Idiomatic Go code

Related Skills

Philosophy

Based on "Learning Go" and Effective Go:

  • Simplicity over cleverness - Boring code is good code
  • Interfaces are satisfied implicitly - Define where used
  • Composition over inheritance - Embed types, don't extend
  • Clear is better than clever - Readability wins

Notes

  • Focus on Go-specific patterns
  • Not general programming practices
  • Emphasizes Go conventions and idioms
  • Based on Effective Go and community standards

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.