luoling8192/go-backend-skills/go-backend-init
Claude Code and agent skill by luoling8192/go-backend-skills
- community
Checking that the SKILL.md file is still in the repository.
Initialize a new Go backend repository with production-grade engineering setup. Use when creating new Go microservice projects, setting up Go repos from scratch, or when the user asks to scaffold a Go backend with best practices (Uber FX, Ent ORM, gRPC, CI/CD, linting, Docker).
Install
npx vskill@latest install luoling8192/go-backend-skills/go-backend-initSKILL.md
Go Backend Repository Initialization Skill
Initialize a production-grade Go backend repository following battle-tested patterns from real microservice projects.
When to Use
- User asks to create a new Go backend project
- User wants to scaffold a Go microservice repo
- User needs a Go project template with CI/CD, linting, Docker, etc.
Initialization Checklist
When invoked, walk through these steps in order. Ask the user for project-specific details first:
- Project name (Go module path, e.g.,
github.com/org/my-service) - Service names (e.g.,
platform,api,worker— at least one) - Go version (default: latest stable, currently 1.25)
- Database (PostgreSQL with Ent ORM is default; ask if needed)
- Proto/gRPC (yes/no — if yes, set up buf + generated code structure)
- System dependencies (any C libraries like libsoxr, etc.)
Directory Structure
Create this structure, adapting service names to the user's input:
File Templates
1. go.mod
After creating, run go mod tidy to resolve dependencies.
2. .editorconfig
3. .golangci.yml
See references/golangci.yml for the full config.
Key principles:
- Use
version: "2"format - Start with
default: all, then disable noisy/opinionated linters - Enable
gofmt+goimportsformatters - Exclude generated code paths (
api/,ent/) withgenerated: lax - Set sane thresholds:
dupl: 600,nestif: min-complexity: 9
4. .gitignore
5. CI Workflow (.github/workflows/ci.yml)
See references/ci.yml for the full workflow.
Key jobs:
- Lint (push only): golangci-lint with 7m timeout
- Unit Test:
go test ./... - Nilaway (null safety): static analysis excluding generated code
- Build Test (PR only):
go build ./... - Autofix (PR only): auto-fix lint and commit with
[autofix]tag, with conflict guard
6. Composite Action (.github/actions/setup-go-env/action.yml)
7. .vscode/settings.json
8. .vscode/extensions.json
9. renovate.json
10. .tool-versions
11. cspell.config.yaml
12. Dockerfile (multi-stage)
See references/Dockerfile for the full template.
Key patterns:
- Build stage:
golang:<version>-bookwormwith system deps - Go mod download first (layer caching)
- Build all services under
./cmd/*dynamically - Runtime stage:
debian:bookworm-slim(minimal image) - Use
--mount=type=cachefor Go build cache
13. Uber FX Entry Point (cmd/<service>/main.go)
14. Uber FX Constructor Pattern
All services and models MUST follow this pattern:
Register in module files:
15. Ent ORM Schema (schema/generate.go)
Schema conventions:
- UUID primary keys:
field.UUID("id", uuid.UUID{}).Default(uuid.New).Unique().Immutable() - Soft delete:
field.Time("deleted_at").Optional().Nillable() - Enum status fields:
field.Enum("status").Values("ACTIVE", "INACTIVE") - Timestamps:
field.Time("created_at").Default(time.Now).Immutable()
16. .env.example
17. CLAUDE.md Template
Generate a CLAUDE.md that documents:
- Project overview (what it does, key capabilities)
- Technology stack
- Essential commands (run, test, lint, generate)
- Architecture (services, layers, communication)
- Directory structure
- Development workflow (schema changes, API changes, service implementation)
- DI patterns (Uber FX constructors)
- Code style and best practices
Use the reference project's CLAUDE.md as a structural template, but tailor content to the new project.
Post-Initialization Steps
After scaffolding, run these commands:
Key Principles
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/go-backend-init/SKILL.md
Popularity
- Repository stars
- 2
- 7-day trend score
- 5
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/luoling8192/go-backend-skills/go-backend-init)