Skip to content
Agentmart
Submit a tool

go-code

Go code quality standards, idioms, and YAGNI/KISS development principles.

Skill by otaviof

IndexedApache-2.0★ 2
Write a review

Chalk Labs

Need help deploying go-code?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/otaviof-go-code

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Go code quality standards, idioms, and YAGNI/KISS development principles.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/go-code

What's inside

Skill name
go-code
Description
Go code quality standards, idioms, and YAGNI/KISS development principles.
License
Apache-2.0
Instructions
122 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

## Core Principles

1. **YAGNI**: Implement only current requirements, no premature abstraction
2. **KISS**: Simple solutions, profile before optimizing
3. **Readability**: Clear code > clever code
4. **Format**: Run `go fmt` after changes, use `goimports`

## Naming

- MixedCaps (not snake_case): `UserService`, `GetUser`, `ErrNotFound`
- Acronyms all caps: `HTTP`, `ID`, `URL`
- Exported names start capital
- Short, descriptive names

## Patterns

### Interfaces
- Small, focused (<3 methods)
- Accept interfaces, return structs
- Define at point of use
- Names often end in -er

### Error Handling

**Requirements:**
- Wrap errors with `%w` for context: `fmt.Errorf("operation failed: %w", err)`
- Sentinel errors for domain logic: `var ErrNotFound = errors.New("not found")`
- Check with `errors.Is()` / `errors.As()`
- Messages: lowercase, no punctuation, add context

```go
func (s *Service) GetUser(ctx context.Context, id int) (*User, error) {
    user, err := s.repo.FindByID(ctx, id)
    if err != nil {
        return nil, fmt.Errorf("failed to get user: %w", err)
    }
    return user, nil
}
```

### Context
- First parameter: `ctx context.Context`
- Pass to all I/O operations
- Check cancellation in long-running operations

### Package Organization
- Group by functionality, not type
- `package user` with `Service`, `Repository`, `Handler`
- Not `package services` with all services

### Tests
```go
tests := []struct {
    name string
    a, b int
    want int
}{
    {"positive", 1, 2, 3},
    {"negative", -1, -2, -3},
}

for _, tt := range tests {
    t.Run(tt.name, func(t *testing.T) {
        got := Add(tt.a, tt.b)
        if got != tt.want {
            t.Errorf("Add(%d, %d) = %d; want %d", tt.a, tt.b, got, tt.want)
        }
    })
}
```

## Anti-Patterns

| Pattern | Example | Fix |
|---------|---------|-----|
| Global State | `var defaultX = ...` | Immutable `init()` only |
| Naked Goroutines | `go func(){}()` | Context cancellation |
| Ignored Errors | `result, _ := op()` | Handle or document |
| Defer in Loops | `defer` in `for` | Manual cleanup |
| String Concat | `s += s2` in loops | `strings.Builder` |
| Large Interfaces | >3 methods | Split or rethink |
| Over-engineering | Factory for simple constructor | Direct `New()` |

## Performance

**sync.Pool:** Use for hot paths; always `Reset()` before `Put()`.

**Zero-alloc:** Pre-allocate slices (`make([]T, 0, cap)`), use `strings.Builder`, prefer `[]byte`.

**Profile:** `go test -cpuprofile=cpu.prof -bench=.` → `go tool pprof` → optimize → repeat.

## Functional Options Pattern

```go
type Server struct {
    host    string
    port    int
    timeout time.Duration
}

type Option func(*Server)

func WithPort(port int) Option {
    return func(s *Server) { s.port = port }
}

func NewServer(opts ...Option) *Server {
    s := &Server{
        host:    "localhost",
        port:    8080,
        timeout: 30 * time.Second,
    }
    for _, opt := range opts {
        opt(s)
    }
    return s
}

// Usage

From otaviof/gosmith, Apache-2.0.

Signals

Stars
2
Forks
0
Open issues
0
Last commit (this folder)
Jan 29, 2026 (9 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from otaviof

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get go-code running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying go-code?

CallGet help
Cite this page

go-code skill. Agent Mart. https://agentmart.dev/skills/otaviof-go-code (last updated 2026-10-24)