Skip to main content
skill CX Codex

go — Claude Code skill: Go APIs and microservices

A skill that tells the agent how to write idiomatic Go: layered architecture, net/http APIs, goroutines, table-driven tests. Useful for backend work in Go.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Mindrally/skills --skill go -a claude-code
Open on GitHub

What go does

The skill sets rules for how the agent writes Go. It covers idiomatic style, a project layout with cmd/, internal/, pkg/, api/, configs/ and test/, interface-driven design with explicit dependency injection, and error handling through wrapping instead of panics.

For APIs it points at the standard net/http package and the new ServeMux from Go 1.22 with path patterns. Input validation, JSON responses, and middleware for logging and authentication each get a section. Concurrency is spelled out too: context propagation, channels, cancellation, avoiding race conditions. Tests are table-driven, with integration tests for APIs and mocks built on interfaces.

The DevOps part names golangci-lint, security checks in CI, and OpenTelemetry for tracing. One thing to check before you install: the skill expects Go 1.22 or newer, so the ServeMux examples won't compile on older toolchains. It installs across six platforms; in Claude the file lands at ~/.claude/skills/go/SKILL.md.

What it helps with

  • split a project into handlers, services and repositories
  • define routes on the Go 1.22 ServeMux
  • add middleware for logging and authentication
  • move error handling from panics to wrapped errors
  • write table-driven tests and interface-based mocks

Example prompts for the agent

  • add a POST /orders endpoint with body validation and a JSON response
  • refactor this code into clean architecture layers
  • write table-driven tests for the orders service

How to install go

1Skills CLI (Vercel)

npx skills add Mindrally/skills --skill go -a claude-code

2Manually: put the files in place

~/.claude/skills/go/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/go/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about go

How do I install the go skill in Claude?

Run npx skills add Mindrally/skills --skill go -a claude-code. The skill file ends up at ~/.claude/skills/go/SKILL.md.

What does the go skill do?

It gives the agent Go development rules: idiomatic code, clean architecture, net/http APIs, goroutine handling, testing and linting.

Which Go version does it need?

The instructions call for Go 1.22 or newer, because of the new ServeMux with path patterns and regex support.

Source text

SKILL.md · Apache-2.0
---
name: go
description: Expert in Go/Golang development with focus on APIs, microservices, and clean architecture
metadata:
  maintainer: Mindrally
  source: https://github.com/Mindrally/skills
---

# Go (Golang)

You are an expert in Go development with deep knowledge of APIs, microservices, and backend systems.

## Core Principles

- Write idiomatic Go code following Go conventions
- Utilize Go 1.22+ features including new routing capabilities
- Follow RESTful API design principles
- Implement proper error handling with custom error types when beneficial

## Code Organization

- Clean Architecture principles with handlers, services, repositories, and domain models
- Interface-driven development with explicit dependency injection
- Modular project structure:
  - cmd/ - Application entry points
  - internal/ - Private application code
  - pkg/ - Public libraries
  - api/ - API definitions
  - configs/ - Configuration files
  - test/ - Test files

## API Development

- Use the standard library's `net/http` package
- Leverage Go 1.22's new ServeMux with wildcard matching and regex support
- Implement proper HTTP method handling (GET, POST, PUT, DELETE)
- Input validation and JSON response formatting
- Middleware implementation for logging and authentication

## Error Handling

- Use wrapped errors for traceability
- Implement explicit error handling
- Return errors rather than panicking
- Provide meaningful error messages
- Handle errors at appropriate levels

## Concurrency

- Goroutine safety and context propagation
- Use channels for communication between goroutines
- Implement proper cancellation with context
- Avoid race conditions with proper synchronization

## Testing

- Table-driven unit testing patterns
- Integration testing for APIs
- Mocking with interfaces
- Use testing package effectively

## DevOps Integration

- Linting with golangci-lint
- Security checks in CI pipelines
- OpenTelemetry for distributed tracing and observability
- Proper logging with structured log formats

© Mindrally · Apache-2.0 · Mindrally/skills

Similar skills

All skills for Programming languages →

From the same set168

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor