go-packages

Organize Go packages and imports per Google and Uber style guides.

Updated Feb 28, 2026
One-click install
npx skills add https://github.com/phant-app/phant --skill go-packages-phant-app
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-packages
Source: https://github.com/phant-app/phant/tree/main/.agents/skills/go-packages
Command: npx skills add https://github.com/phant-app/phant --skill go-packages-phant-app

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Go package organization and import management can become inconsistent as projects grow. This Skill provides guidance to structure packages and group imports following Google's and Uber's Go style guides, improving readability and maintainability.

Core Features & Use Cases

  • Package naming and directory structure recommendations aligned with Go community standards.
  • Import grouping and formatting guidance to reduce confusion and conflicts.
  • Use Case: In a mid-sized Go project, apply these guidelines to reorganize packages and import blocks for consistency.

Quick Start

Follow Google's and Uber's Go style guides to structure your Go project into descriptive packages and well-organized import blocks.

Frequently Asked Questions about go-packages

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

FAQPage Schema
How do I organize Go imports according to best practices?

To format Go imports cleanly, group statements into standard library, external, and local project packages. Following Google and Uber style guides improves readability and maintains deterministic code organization across mid-sized projects.

What is the best way to name Go packages and structure directories?

The best way to name Go packages is using descriptive, concise identifiers aligned with community standards. Structure directories to reflect package boundaries directly, avoiding generic util packages to improve project maintainability.

Why should I avoid util packages and init() in golang projects?

You should avoid util packages and init() in golang projects because they create unclear dependencies and side effects. Enforcing these coding style practices ensures deterministic code organization and improves overall readability.

Can I apply Google and Uber Go style guides to an existing project?

Yes, you can apply Google and Uber Go style guides to an existing mid-sized project. Use these guidelines to reorganize packages and restructure import blocks for consistency, improving readability without changing external behavior.

What are the limitations of using Go style guides for package organization?

The limitations of using Go style guides for package organization include potential friction when refactoring large, established codebases. While they minimize init() usage and import confusion, applying these rules retroactively requires careful restructuring.