clean-code-naming
Skill3 starsChanged 8 months agoMITView on GitHub
Go naming conventions and Clean Code naming principles. Use when creating, renaming, or reviewing names of functions, variables, types, constants, packages, or interfaces in Go code. Triggers on new type definitions, function signatures, variable declarations, and package naming.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- lifeodyssey/craftsmanship-skillstheir own version, first seen Apr 23, 2026
- masonhuemmer/dopsword for word, first seen Mar 24, 2026
Other versions2 projects use a version of this.
Word for word · 1
- masonhuemmer/dops★ 3100% same
Edited · 0
None found.
Wrote their own version · 1
- lifeodyssey/craftsmanship-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository19 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- bubbletea-patternsSkill
- charm-stylingSkill
- clean-code-boundariesSkill
- clean-code-designSkill
- clean-code-errorsSkill
- clean-code-functionsSkill
- clean-code-solidSkill
- clean-code-testingSkill
- cli-structureSkill
- create-runbookSkill
- demo-recordingSkill
- mutation-testingSkill
- shell-scriptsSkill
- spec-workflowSkill
- tdd-workflowSkill
- tui-layoutSkill
- tui-testingSkill
- wizard-formsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 4 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
No underscores, no mixedCaps
- Very specific: line 16
Avoid generic names: util, common, helpers, misc — find a more specific name
- Very specific: line 23
Do NOT prefix with I (no IReader) — this is not Go idiom
- Distinctive: line 28
Use MixedCaps (exported) or mixedCaps (unexported)
- Very specific: line 29
Start with a verb: Get, Set, New, Create, Parse, Validate
- Very specific: line 41
No Hungarian notation, no type prefixes (strName, intCount)
- Very specific: line 43
Avoid data, info, temp, tmp, val — they say nothing
- Very specific: line 48
Not ALL_CAPS (that's not Go idiom, except for generated code)
- Very specific: line 56
Avoid stutter with package name: user.User is fine, but user.UserService stutters — prefer user.Service
- Very specific: line 61
If the spec says "deployment target", the type is DeploymentTarget, not Dest or Location
- Very specific: line 66
Do not rename well-established Go conventions (err, ctx, ok, i)
- Distinctive: line 67
Do not add comments to compensate for bad names — fix the name instead
- Distinctive: line 68
Do not use abbreviations unless they are universally understood in the domain
- Very specific: line 69
Do not use var names that shadow builtin or imported names
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Clean Code Naming for Go
Apply these naming principles to all Go code. Go idioms take precedence over generic Clean Code advice.
Package Names
- Short, lowercase, single-word names:
http,fmt,user - No underscores, no mixedCaps
- Name should describe what the package provides, not what it contains
- Avoid generic names:
util,common,helpers,misc— find a more specific name - The package name is part of the call site:
http.Getnothttputil.HTTPGet
Interface Names
- Single-method interfaces use the method name +
ersuffix:Reader,Writer,Closer,Formatter - Multi-method interfaces describe the capability:
ReadWriter,Handler - Do NOT prefix with
I(noIReader) — this is not Go idiom - Define interfaces where they are consumed, not where they are implemented
Function and Method Names
- Use MixedCaps (exported) or mixedCaps (unexported)
- Start with a verb:
Get,Set,New,Create,Parse,Validate - Getters omit
Get: useName()notGetName()(Go convention) - Setters use
Set:SetName() - Constructors use
New:NewServer,NewClient - Boolean-returning functions read as questions:
IsValid,HasPermission,CanRetry - The name should make the function's behavior obvious — if you need a comment to explain what it does, rename it
Variable Names
- Short names in small scopes:
i,n,r,w,err,ctxare idiomatic Go - Longer, descriptive names in larger scopes or when the type isn't obvious
- Receivers are 1-2 letters, consistent across methods:
sforServer,cforClient - No Hungarian notation, no type prefixes (
strName,intCount) - Boolean variables read as predicates:
ok,found,done,valid - Avoid
data,info,temp,tmp,val— they say nothing
Constants
- MixedCaps like variables:
MaxRetries,DefaultTimeout - Not ALL_CAPS (that's not Go idiom, except for generated code)
- Group related constants with
iotawhen sequential values make sense
Type Names
- Nouns that describe what the type is:
Server,Request,Config - No
Typesuffix:UsernotUserType - No
Structsuffix:ConfignotConfigStruct - Avoid stutter with package name:
user.Useris fine, butuser.UserServicestutters — preferuser.Service
Spec Traceability
- Names in code should mirror the domain language used in specs
- If the spec says "deployment target", the type is
DeploymentTarget, notDestorLocation - Consistent vocabulary between spec and code eliminates translation overhead
What NOT to Do
- Do not rename well-established Go conventions (
err,ctx,ok,i) - Do not add comments to compensate for bad names — fix the name instead
- Do not use abbreviations unless they are universally understood in the domain
- Do not use
varnames that shadow builtin or imported names
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

