swe-programming-golang
Go coding standards from authoritative docs/explanation/software-engineering/programming-languages/golang/ documentation
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Go coding standards from authoritative docs/explanation/software-engineering/programming-languages/golang/ documentation
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
AI agent development standards including frontmatter structure, naming conventions, tool access patterns, model selection, and reference documentation structure
Comprehensive project planning standards for plans/ directory including folder structure (ideas/, backlog/, in-progress/, done/), stage-aware naming convention (done uses YYYY-MM-DD__identifier/; backlog and in-progress use identifier/ with no date prefix), five-document file organization (README.md, brd.md, prd.md, tech-docs.md, delivery.md for multi-file default; single README.md for trivially-small single-file exception), BRD/PRD content-placement rules, Gherkin acceptance criteria, and the mandatory structured multiple-choice grilling gates (pre-write and post-write) for resolving design decisions with the user. Essential for creating structured, executable project plans.
Trunk Based Development workflow - all development on main branch with small frequent commits, minimal branching, and continuous integration. Covers when branches are justified (exceptional cases only), commit patterns, feature flag usage for incomplete work, environment branch rules (deployment only), and AI agent default behavior (the repo-wide default delivery mode is `worktree-to-pr` -- a short-lived plan branch in a disposable worktree pushed to a draft PR; direct push to main remains available as an explicit selection). Essential for understanding repository git workflow and keeping branches short-lived
Workflow pattern standards for creating multi-agent orchestrations including YAML frontmatter (name, description, tags, status, agents, parameters), execution phases (sequential/parallel/conditional), agent coordination patterns, and Gherkin success criteria. Essential for defining reusable, validated workflow processes.
Common software development workflow patterns shared across all language developer agents
Three-stage content quality workflow pattern (Maker creates, Checker validates, Fixer remediates) with detailed execution workflows. Use when working with content quality workflows, validation processes, audit reports, or implementing maker/checker/fixer agent roles.
| name | swe-programming-golang |
| description | Go coding standards from authoritative docs/explanation/software-engineering/programming-languages/golang/ documentation |
Progressive disclosure of Go coding standards for agents writing Go code.
Authoritative Source: docs/explanation/software-engineering/programming-languages/golang/README.md
Usage: Auto-loaded for agents when writing Go code. Provides quick reference to idioms, best practices, and antipatterns.
IMPORTANT: This skill provides demo-specific style guides, not educational tutorials.
You MUST understand Go fundamentals before using these standards. Complete the demo Go learning path first:
What this skill covers: demo naming conventions, framework choices, repository-specific patterns, how to apply Go knowledge in THIS codebase.
What this skill does NOT cover: Go syntax, language fundamentals, generic patterns (those are in crud-fs-ts-nextjs).
Packages: lowercase, single word
http, json, user, paymentTypes and Functions: MixedCaps
UserAccount, CalculateTotal()userAccount, calculateTotal()Variables: Short names in limited scope
i, j for loop countersr for reader, w for writerdefaultTimeoutConstants: MixedCaps (not UPPER_CASE)
MaxRetries, DefaultTimeoutGenerics: Use for type-safe data structures
func Map[T, U any](slice []T, f func(T) U) []U {
result := make([]U, len(slice))
for i, v := range slice {
result[i] = f(v)
}
return result
}
Error Wrapping: Use fmt.Errorf with %w
if err != nil {
return fmt.Errorf("failed to process user: %w", err)
}
Struct Embedding: Use for composition
type User struct {
BaseModel
Name string
}
Explicit Error Returns: Always check errors
result, err := doSomething()
if err != nil {
return fmt.Errorf("operation failed: %w", err)
}
Custom Error Types: Define for specific cases
type ValidationError struct {
Field string
Err error
}
func (e *ValidationError) Error() string {
return fmt.Sprintf("validation failed for %s: %v", e.Field, e.Err)
}
Error Wrapping: Preserve error chain
return fmt.Errorf("processing user %s: %w", userID, err)
Goroutines: Use for concurrent operations
go func() {
// Concurrent work
}()
Channels: Use for communication
ch := make(chan Result, 10) // Buffered
ch <- result // Send
result := <-ch // Receive
Context: Use for cancellation and timeouts
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
Table-Driven Tests: Preferred testing pattern
tests := []struct {
name string
input int
expected int
}{
{"positive", 5, 10},
{"zero", 0, 0},
{"negative", -5, -10},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result := double(tt.input)
if result != tt.expected {
t.Errorf("got %d, want %d", result, tt.expected)
}
})
}
Test Helpers: Use t.Helper() for helper functions
func assertEqual(t *testing.T, got, want any) {
t.Helper()
if got != want {
t.Errorf("got %v, want %v", got, want)
}
}
Input Validation: Validate all external input
SQL Injection: Use parameterized queries
rows, err := db.Query("SELECT * FROM users WHERE id = ?", userID)
Context Timeouts: Always set timeouts
ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()
Authoritative Index: docs/explanation/software-engineering/programming-languages/golang/README.md