go-standard-package-layout

Organize Go codebases with a standardized package layout.

8|2|Updated Dec 29, 2025
One-click install
npx skills add https://github.com/fwojciec/jira4claude --skill go-standard-package-layout
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-standard-package-layout
Source: https://github.com/fwojciec/jira4claude/tree/main/.claude/skills/go-standard-package-layout
Command: npx skills add https://github.com/fwojciec/jira4claude --skill go-standard-package-layout

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Structure Go applications using Ben Johnson's Standard Package Layout to improve maintainability and clarity by separating domain logic, dependency-bound subpackages, and explicit wiring.

Core Features & Use Cases

  • Root package contains the domain core with pure logic and no external dependencies
  • Subpackages named after each external dependency isolate integration points
  • Shared mock package simplifies testing without external frameworks
  • Main wiring composes all components explicitly for predictable builds

Quick Start

Start by placing domain types in the root package, creating dependency-named subpackages for external concerns, and wiring everything explicitly in the cmd package.

Frequently Asked Questions about go-standard-package-layout

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

FAQPage Schema
How do I structure a Go project for better maintainability?

Structure Go codebases by placing domain core logic in the root package, creating dependency-named subpackages for external concerns, and wiring components explicitly in the main package to improve maintainability and testability.

What is Ben Johnson's standard package layout in Go?

Ben Johnson's standard package layout organizes Go applications by keeping pure domain logic in the root package, isolating external concerns in dependency-named subpackages, and using a shared mock package for testing without external frameworks.

How do I organize Go packages to keep domain logic separate from external dependencies?

Keep domain logic separate by placing pure domain types and logic in the root package, then creating subpackages named after each external dependency to isolate integration points, ensuring the core remains free of external concerns.

Does this Go package layout require external testing frameworks for mocks?

No, this Go package layout does not require external testing frameworks. It uses a shared mock package to simplify testing, allowing you to test domain logic and dependencies without adding third-party testing dependencies.

What's the best way to wire Go application components for predictable builds?

The best way to wire Go components for predictable builds is explicit composition in the main package. This standard package layout approach assembles all dependency-named subpackages and domain core in one place for clear, predictable dependency injection.

When should I use a domain-core package layout for my Go application?

Use a domain-core package layout when your Go application needs scalable structure and testability. It enforces clear placement, naming, and wiring rules, making it ideal for projects where separating pure domain logic from external integration points is critical.