cox-tooling-excellence

Write Go code in the style of Russ Cox, Go tech lead. Emphasizes tooling, module design, correctness, and backward compatibility. Use when designing packages, modules, or tools that others will depend on.

16 stars

Best use case

cox-tooling-excellence is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Write Go code in the style of Russ Cox, Go tech lead. Emphasizes tooling, module design, correctness, and backward compatibility. Use when designing packages, modules, or tools that others will depend on.

Teams using cox-tooling-excellence should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/cox-tooling-excellence/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/tools/cox-tooling-excellence/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/cox-tooling-excellence/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How cox-tooling-excellence Compares

Feature / Agentcox-tooling-excellenceStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Write Go code in the style of Russ Cox, Go tech lead. Emphasizes tooling, module design, correctness, and backward compatibility. Use when designing packages, modules, or tools that others will depend on.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Russ Cox Style Guide

## Overview

Russ Cox is the tech lead of Go at Google. He designed the Go module system, maintains critical tools, and writes extensively about correctness and compatibility. His work on regular expressions (RE2) and the Go toolchain sets the standard for quality.

## Core Philosophy

> "Compatibility is about people, not just code."

> "The goal is not to be fast. The goal is to be correct and then fast."

Cox believes in **correctness first**, then performance. He also champions the **Go 1 compatibility promise**: code written for Go 1.0 should still work.

## Design Principles

1. **Correctness First**: Get it right before getting it fast.

2. **Compatibility Matters**: Breaking changes hurt real people.

3. **Tooling is Product**: `go mod`, `go vet`, `gofmt` are as important as the language.

4. **Reproducibility**: Builds should be reproducible, dependencies explicit.

## When Writing Code

### Always

- Use `go mod` for dependency management
- Run `go vet` and address all warnings
- Write reproducible builds (pin dependencies)
- Maintain backward compatibility in public APIs
- Use semantic versioning correctly
- Document breaking changes clearly

### Never

- Break existing API contracts
- Publish v0 code as v1
- Ignore module versioning rules
- Use `replace` directives in published modules
- Import packages with `_` prefix

### Prefer

- Stable APIs over flexible ones
- Explicit imports over dot imports
- Internal packages for private code
- Minimal dependencies
- Standard library when possible

## Code Patterns

### Module Design

```go
// go.mod - clean, minimal
module github.com/example/myproject

go 1.21

require (
    golang.org/x/sync v0.5.0
)

// Avoid unnecessary dependencies
// Every dependency is a liability
```

### API Stability with Options Pattern

```go
// Extensible API without breaking changes

// Public, stable struct (fields are API)
type Config struct {
    Timeout time.Duration
    // Adding fields is safe
}

// Options pattern for flexibility
type Option func(*clientOptions)

type clientOptions struct {
    timeout    time.Duration
    retries    int
    logger     Logger
}

func WithTimeout(d time.Duration) Option {
    return func(o *clientOptions) {
        o.timeout = d
    }
}

func WithRetries(n int) Option {
    return func(o *clientOptions) {
        o.retries = n
    }
}

// Adding new options doesn't break existing code
func NewClient(opts ...Option) *Client {
    options := clientOptions{
        timeout: 30 * time.Second,  // sensible defaults
        retries: 3,
    }
    for _, opt := range opts {
        opt(&options)
    }
    return &Client{options: options}
}

// Usage (existing code keeps working as options are added)
client := NewClient(WithTimeout(10 * time.Second))
```

### Internal Packages

```go
// Project structure with internal packages

// myproject/
// ├── go.mod
// ├── client.go         (public API)
// ├── internal/
// │   ├── parser/       (private: can change freely)
// │   └── protocol/     (private: can change freely)
// └── cmd/
//     └── mytool/       (command)

// internal/ packages can only be imported by parent
// This allows free refactoring without breaking users
```

### Semantic Versioning

```go
// v0.x.x - No compatibility guarantees
// Breaking changes are fine

// v1.x.x - Compatibility guaranteed
// v1.1.0 adds features, v1.1.1 fixes bugs
// NEVER break API

// v2.x.x - New major version, new import path
// github.com/example/myproject/v2

// go.mod for v2:
module github.com/example/myproject/v2

go 1.21

// Import path includes version:
import "github.com/example/myproject/v2/pkg"
```

### Deprecation Without Breaking

```go
// Add new function, deprecate old
// Old code keeps working

// Deprecated: Use NewFoo instead.
func Foo() *Widget {
    return NewFoo(DefaultOptions)
}

// New function with more flexibility
func NewFoo(opts Options) *Widget {
    // ...
}

// Godoc shows deprecation, go vet can warn
```

### Correct Concurrent Code

```go
// From Russ Cox's concurrency patterns

// Correct synchronization
type Cache struct {
    mu    sync.RWMutex
    items map[string]Item
}

func (c *Cache) Get(key string) (Item, bool) {
    c.mu.RLock()
    defer c.mu.RUnlock()
    item, ok := c.items[key]
    return item, ok
}

func (c *Cache) Set(key string, item Item) {
    c.mu.Lock()
    defer c.mu.Unlock()
    if c.items == nil {
        c.items = make(map[string]Item)
    }
    c.items[key] = item
}

// Graceful shutdown pattern
func serve(ctx context.Context, addr string, handler http.Handler) error {
    srv := &http.Server{Addr: addr, Handler: handler}
    
    errCh := make(chan error, 1)
    go func() {
        errCh <- srv.ListenAndServe()
    }()
    
    select {
    case err := <-errCh:
        return err
    case <-ctx.Done():
        // Graceful shutdown
        shutdownCtx, cancel := context.WithTimeout(
            context.Background(), 
            5*time.Second,
        )
        defer cancel()
        return srv.Shutdown(shutdownCtx)
    }
}
```

### Testing Best Practices

```go
// Table-driven tests
func TestParse(t *testing.T) {
    tests := []struct {
        name    string
        input   string
        want    Result
        wantErr bool
    }{
        {"empty", "", Result{}, false},
        {"simple", "foo", Result{Value: "foo"}, false},
        {"invalid", "!!!", Result{}, true},
    }
    
    for _, tt := range tests {
        t.Run(tt.name, func(t *testing.T) {
            got, err := Parse(tt.input)
            if (err != nil) != tt.wantErr {
                t.Errorf("Parse() error = %v, wantErr %v", err, tt.wantErr)
                return
            }
            if got != tt.want {
                t.Errorf("Parse() = %v, want %v", got, tt.want)
            }
        })
    }
}

// Test helpers
func newTestServer(t *testing.T) *Server {
    t.Helper()
    srv := &Server{}
    t.Cleanup(func() { srv.Close() })
    return srv
}
```

## Mental Model

Cox approaches design by asking:

1. **Is it correct?** Prove it works before optimizing.
2. **Is it compatible?** Will existing code break?
3. **Is it reproducible?** Same inputs → same outputs?
4. **Is it maintainable?** Will this be regretted in 5 years?

## The Compatibility Contract

| Change | Safe? |
|--------|-------|
| Add function | ✅ Yes |
| Add method to interface | ❌ No (breaks implementers) |
| Add field to struct | ⚠️ Maybe (if not compared) |
| Add optional parameter | ✅ Yes (via options pattern) |
| Change function signature | ❌ No |
| Rename exported symbol | ❌ No |

Related Skills

tooling

16
from diegosouzapw/awesome-omni-skill

Python development tooling configuration and best practices

monorepo-and-tooling

16
from diegosouzapw/awesome-omni-skill

Outlines the monorepo structure and tooling conventions, emphasizing the use of Taskfile.yml, and proper handling of environment variables.

midnight-tooling:midnight-setup

16
from diegosouzapw/awesome-omni-skill

Use when setting up Midnight development environment, installing Compact compiler and developer tools, configuring proof server, verifying prerequisites, or getting started with Midnight development.

midnight-tooling:midnight-compatibility

16
from diegosouzapw/awesome-omni-skill

Use when checking Midnight version compatibility, understanding pragma language_version, verifying compiler and runtime version relationships, or troubleshooting version mismatch errors between Midnight components.

Build Your Operational Excellence Skill

16
from diegosouzapw/awesome-omni-skill

Create your operational excellence skill in one prompt, then learn to improve it throughout the chapter

agent-tooling-engineer

16
from diegosouzapw/awesome-omni-skill

Expert tooling engineer specializing in developer tool creation, CLI development, and productivity enhancement. Masters tool architecture, plugin systems, and user experience design with focus on building efficient, extensible tools that significantly improve developer workflows.

pcf-tooling

16
from diegosouzapw/awesome-omni-skill

Get Microsoft Power Platform CLI tooling for Power Apps Component Framework Triggers on: **/*.{ts,tsx,js,json,xml,pcfproj,csproj}

angular-tooling

16
from diegosouzapw/awesome-omni-skill

Use Angular CLI and development tools effectively in Angular v20+ projects. Use for project setup, code generation, building, testing, and configuration. Triggers on creating new projects, generating components/services/modules, configuring builds, running tests, or optimizing production builds.

code-review-excellence

16
from diegosouzapw/awesome-omni-skill

Master effective code review practices to provide constructive feedback, catch bugs early, and foster knowledge sharing while maintaining team morale. Use when reviewing pull requests, establishing...

accessibility-excellence

16
from diegosouzapw/awesome-omni-skill

Master web accessibility (A11y) to ensure your product is usable by everyone, including people with disabilities. Covers WCAG standards, semantic HTML, keyboard navigation, screen readers, color contrast, and inclusive design practices. Accessibility is not a feature—it's a fundamental requirement.

aesthetic-excellence

16
from diegosouzapw/awesome-omni-skill

Use when improving visual quality of existing UI - applies 2025 design principles for hierarchy, spacing systems, color theory, and typography excellence to elevate aesthetic appeal and user experience

bgo

16
from diegosouzapw/awesome-omni-skill

Automated Blender build-go workflow. Automatically builds, removes old version, installs, enables, and launches Blender with your extension/add-on. Use when you want to quickly test changes, execute complete build-to-launch cycle, or run custom packaging scripts with automatic Blender launch.

Coding & Development