Golang Backend Development
Installation
SKILL.md
Golang Backend Development Standards
This skill defines the architectural requirements, coding standards, and best practices for the Golang backend. AI agents must adhere to these guidelines to ensure consistency, maintainability, and extensibility.
1. Project Organization
-
See
references/PROJECT_ORGANIZATION.mdfor examples. -
backend/cmd/: Application entry points. Keepmain.goslim; use it for configuration and component initialization. -
backend/internal/: Project-internal code.handler/: HTTP layer. UsesHandlergeneric wrapper. Defers logic toservice.service/: Domain logic layer. Orchestrates business rules and repository calls.repository/: Data layer. Handles raw SQL queries viapgxpool.models/: Data structures (DB models, DTOs, request/response types).
-
backend/pkg/: Shared utility packages (e.g., customstatemachine). -
backend/migrations/: SQL migration scripts.