npx claudepluginhub otaviof/gosmith --plugin gosmithThis skill cannot use any tools. It operates in read-only mode without the ability to modify files or execute commands.
1. **YAGNI**: Implement only current requirements, no premature abstraction
Verifies tests pass on completed feature branch, presents options to merge locally, create GitHub PR, keep as-is or discard; executes choice and cleans up worktree.
Guides root cause investigation for bugs, test failures, unexpected behavior, performance issues, and build failures before proposing fixes.
Writes implementation plans from specs for multi-step tasks, mapping files and breaking into TDD bite-sized steps before coding.
go fmt after changes, use goimportsUserService, GetUser, ErrNotFoundHTTP, ID, URLRequirements:
%w for context: fmt.Errorf("operation failed: %w", err)var ErrNotFound = errors.New("not found")errors.Is() / errors.As()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
}
ctx context.Contextpackage user with Service, Repository, Handlerpackage services with all servicestests := []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)
}
})
}
| 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() |
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.
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
srv := NewServer(WithPort(3000))