CtrlK
BlogDocsLog inGet started
Tessl Logo

evilissimo/naming-things

Reviews and improves **names** in code — variables, functions, classes, modules, parameters — for clarity, intent, and consistency with language/team conventions. Triggers when asked to review names, rename things, improve code readability, clean up confusing code, or when examining code with generic/vague names like "data", "info", "manager", "temp", "util". Does NOT trigger for general code review unrelated to naming, architecture design, debugging, or performance optimization. Identifies naming anti-patterns (generic names, misleading names, type-encoding, abbreviations), suggests role-based names that reveal intent, checks consistency with project/domain vocabulary, and flags misalignment with language culture.

91

1.05x
Quality

90%

Does it follow best practices?

Impact

94%

1.05x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

golang.mdreferences/

Go Naming Conventions

Based on Effective Go, the Go Code Review Comments, and community conventions.

Convention Table

ThingConventionExample
Variable (local)mixedCaps / camelCaseuserName, totalCount
Exported variablePascalCaseMaxRetryCount, DefaultTimeout
Function (unexported)camelCasecalculateTotal(), getUser()
Function (exported)PascalCaseProcessOrder(), SendEmail()
Method receiver1-3 letter abbreviationu *User, s *Store, r *Reader
Type (struct, interface)PascalCaseCustomerOrder, HttpClient
Interface (1 method)Name + er suffixReader, Writer, Stringer
Interface (multiple)DescriptiveStorageBackend, PaymentGateway
ConstantmixedCaps / PascalCasemaxRetryCount, StatusOK
Packageshort, lowercase, one wordhttp, json, fmt, strings
Filesnake_caseorder_service.go
Test functionPascalCaseTestProcessOrder
BenchmarkPascalCaseBenchmarkProcessOrder

Key Points

  • Brevity is expected — Go prefers shorter names than other languages, but clarity still wins
  • gofmt enforces style — but naming is convention, not automated
  • Receiver names should be short and consistent across methods on the same type (usually 1-3 chars)
  • Single-letter receivers (u for *User, s for *Store) are fine — don't use self or this
  • Exported vs unexported = public vs private (capital letter = exported)
  • Interface with one method gets the method name + er: io.Reader, io.Writer, fmt.Stringer
  • Interface with multiple methods gets a descriptive name: net.Listener, http.Handler
  • Avoid stutter — don't repeat package name: http.Server not http.HttpServer, time.Duration not time.TimeDuration
  • Boolean parameters often benefit from a wrapper function: WithLogging() vs Run(true)
  • Package names are lowercase, concise, and importable: json, xml, http (not jsonutils)

Stutter Examples

BadGoodReason
order.OrderDataorder.Order or order.DataType already in order package
user.UserManageruser.Manager or user.ServicePackage context makes it clear
config.ConfigOptionsconfig.OptionsRedundant prefix

Common Offenses

BadGoodReason
GetUser()User() or FetchUser()Get prefix is often unnecessary in Go
this / selfu / s / cGo convention is short receiver names
util / common / mischttphelper, stringutilBetter to organize by domain
JsonParserjson.Parser or ParserStutter from package qualifier
Dataorders, users, recordsToo generic
Init()New() / Open() / Connect()New is Go convention for constructors

SKILL.md

tile.json