skills/modelscope.cn/go-project-setup

go-project-setup

SKILL.md

Go Project Setup

This skill guides the creation of clean, idiomatic Go project structures.

Core Mandates

  1. Standard Layout Only: Use the official Go project layout (cmd/, internal/).
    • NEVER create a pkg/ directory. (It is an anti-pattern common in Kubernetes but not idiomatic Go).
  2. Flat by Default: Start with a flat structure (all files in root) for simple apps. Only introduce cmd/ and internal/ when multiple binaries or private packages are needed.
  3. Modern Go: Ensure go.mod specifies the latest stable Go version (currently 1.24+).

Workflow

1. Determine Scope

Ask the user: "Is this a simple tool, a library, or a multi-service repo?"

2. Select and Use Template

MANDATORY: You MUST read and use the templates provided in the assets/ directory. They establish idiomatic patterns like graceful shutdown, run functions, and package separation.

Installs
1
First Seen
9 days ago