module-conventions

Enforce Go module path, version, and dependency conventions in go.mod.

Updated Feb 7, 2026
One-click install
npx skills add https://github.com/jsamuelsen11/claude-config --skill module-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: module-conventions
Source: https://github.com/jsamuelsen11/claude-config/tree/main/plugins/ccfg-golang/skills/module-conventions
Command: npx skills add https://github.com/jsamuelsen11/claude-config --skill module-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide defines and enforces Go module conventions to ensure robust module paths, versioning, and dependency practices that prevent broken builds and inconsistent module histories.

Core Features & Use Cases

  • Module Path Configuration: Ensure the module path in go.mod is the full repository import path, typically matching the repository URL.
  • Go Version Management: Specify a minimum Go version in go.mod and pin exact toolchains with .go-version and toolchain directives.
  • Dependency Management: Provide tidy/verify workflows, controlled upgrades with go get, and clear indirect/direct dependency handling.
  • Package Organization & Versioning: Recommend cmd/internal/public structure, semantic versioning with v-prefix tags, and workspace guidance for multi-module repos.
  • Use cases include initializing new projects, refactoring module paths, upgrading dependencies, and maintaining consistent module boundaries across teams.

Quick Start

Create a new Go module with a full repository path, set a minimum Go version, and scaffold the recommended directory structure.

Frequently Asked Questions about module-conventions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure the module path in go.mod for a private repository?

Configure the Go module path in go.mod to match the full repository import path, typically the repository URL, ensuring correct dependency resolution for private repositories and preventing broken builds.

What is the best way to manage Go module versions across a multi-repo workspace?

Manage Go module versions across multi-repo workspaces by specifying a minimum Go version in go.mod, pinning exact toolchains with .go-version and toolchain directives, and applying workspace organization patterns for consistent boundaries.

How do I safely upgrade dependencies using go mod tidy and go get?

Safely upgrade dependencies by using go get for controlled version updates and executing go mod tidy workflows to clean up indirect and direct dependency handling, ensuring the module history remains consistent.

When should I use replace directives in a Go module?

Use replace directives in a Go module during refactoring or multi-repo setups to redirect import paths locally, with guidance provided to ensure module boundaries are maintained and builds do not break.

What directory structure should I use for organizing Go packages?

Organize Go packages using the cmd/internal/public directory structure to enforce clear module boundaries, ensuring robust package separation and consistent versioning across team projects.

How do I enforce a minimum Go version for my project?

Enforce a minimum Go version by specifying it in the go.mod file and pinning the exact toolchain with .go-version and toolchain directives, preventing incompatible builds across different environments.