Logo di Go Naming

Go Naming

Community
eduardo-sl
go-naming

Go naming conventions for packages, files, types, functions, methods, receivers, variables, constants, errors, acronyms and tests, grounded in Effective Go and Go Code Review Comments. Use when: "what should I name this", "name this package", "naming review", "is this name idiomatic", "stuttering names", "Get prefix", "acronym casing", "error variable name", "receiver name". Not for: formatting, imports and declarations (go-coding-standards), carrying out a rename across the codebase (go-semantic-tools, go-refactoring).

Panoramica

Pubblicato daeduardo-sl
Repositorygo-agent-skills
Nome della skillgo-naming
Stelle
86
Fork
11
File inclusi
1
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • File inclusi: 1

    Script, template e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da eduardo-sl su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Go Naming in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/eduardo-sl/go-agent-skills/tree/main/skills/(code-quality)/go-naming
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.

Usala in TypingMind

Attiva Go Naming in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Go Naming non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Go Naming non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Go Naming

In Go the package name is part of every call site, capitalization decides visibility, and short names are the norm. A good name reads well where it is used, not where it is declared.

Community default. A project skill or agent-config rule that explicitly supersedes go-naming takes precedence over this one.

Detailed reference material, loaded on demand:

  • references/examples.md — before/after renames for every rule below, including the initialism and stuttering edge cases.

Read a reference file only when the summary below is not enough.

1. Quick Reference

ElementConventionExample
Packageshort, lowercase, one word, singularorder, httpsign, postgres
Filelowercase, _ allowed, named after its main type or concernorder_service.go, order_service_test.go
Exported identifierMixedCapsParseToken, MaxRetries
Unexported identifiermixedCapsparseToken, maxRetries
Initialismall one caseURL, userID, ServeHTTP, xmlParser
Getter / setterOwner() / SetOwner()never GetOwner()
ConstructorNew for the package's main type, NewThing otherwisering.New, http.NewRequest
Panicking variantMust prefixtemplate.Must, regexp.MustCompile
Functional optionWith + settingWithTimeout, WithLogger
One-method interfacemethod + -erReader, Notifier
Receiver1-2 letters, same on every methodfunc (s *Server)
Sentinel errorErr prefix (err unexported)ErrNotFound, errClosed
Error typeError suffixValidationError
Enum constanttype name prefix, zero = unknownStatusUnknown, StatusActive
TestTest + function, Test + type _ methodTestParse, TestCache_Get

2. Packages

  • Short, lowercase, single word: no underscores, no mixedCaps, no plural (order, not orders).
  • Name it after what it provides: retry, httpsign, postgres. Never util, common, helpers, misc, base, models, types — they say nothing and collect everything.
  • The directory name and the package name match.
  • Avoid names callers want for their variables (url, user, buf) when the package is imported widely; a call site with u := user.New() reads better than shadowing the package.

3. Don't Stutter

The package name is always present at the call site, so don't repeat it:

go
// ✅ Good — reads once
http.Client       order.Service     user.New()     config.Load()

// ❌ Bad — says it twice
http.HTTPClient   order.OrderService user.NewUser() config.LoadConfig()

The rule covers every exported name in the package, not just the main type: in package dbpool, Pool, Status and Option — not DBPool, PoolStatus, PoolOption.

4. MixedCaps, Initialisms and Constants

  • Every identifier is MixedCaps or mixedCaps. Underscores appear only in test names (TestCache_Get), generated code, and cgo.
  • An initialism keeps one case throughout: URL, ID, HTTP, JSON, API — userID, parseURL, ServeHTTP, HTTPServer, xmlHTTPRequest. Never UserId, ParseUrl, HttpServer.
  • Constants are MixedCaps like everything else: MaxRetries, not MAX_RETRIES — case already means "exported" in Go.
  • Name constants for their role, not their value: DefaultPort, not Port8080.
  • Do not shadow predeclared identifiers: len, cap, new, make, close, copy, error, string, min, max.

5. Functions and Methods

  • Getters drop Get: u.Name(), and the setter is u.SetName(). Is/Has/Can stay on boolean predicates: IsActive().
  • Constructors: New when the package has one main type, NewThing otherwise. A constructor that panics on bad input is MustThing.
  • Canonical names carry a contract. Call a method Read, Write, Close, Flush, String, Error or ServeHTTP only if it has the standard signature and meaning — and if it does, use that name (String(), never ToString()).
  • Name for what the caller gets, not how it is computed: Users(), not QueryAndBuildUserList().
  • Format-string variants end in f: Errorf, Logf.

6. Variables and Receivers

  • Name length grows with scope: i, n, err, ctx, buf inside a few lines; retryTimeout, pendingOrders across a function; full words at package level.
  • Don't put the type in the name (userSlice → users, nameStr → name), and don't repeat context the reader already has (order.ID inside type Order, not order.OrderID).
  • Receivers are one or two letters from the type (s *Server, rw *responseWriter), the same on every method of the type — never this or self.
  • Unexported package-level variables may take a _ prefix (_defaultTimeout) to keep them distinct from locals — the Uber style convention. Follow whichever the codebase already uses.
  • Boolean names read as a question: isReady, hasChildren, canRetry.

7. Types and Interfaces

  • Types are nouns: Request, FileHeader, RetryPolicy.
  • A one-method interface is the method plus -er: Reader, Notifier, Validator. Never an I prefix or Interface suffix.
  • Name an interface after the behavior the consumer needs, in the consumer's package (orderStore in the service), not after the implementation it happens to have.

8. Errors

  • Exported sentinels ErrNotFound, unexported errClosed.
  • Error types end in Error: NotFoundError, SyntaxError.
  • Error strings are lowercase with no trailing punctuation, prefixed with the package or operation: "order: invalid quantity". They get wrapped into longer messages, so they must read mid-sentence.

9. Enums and Tests

  • Enum constants are prefixed with their type and start with an explicit Unknown at zero: StatusUnknown, StatusActive, StatusClosed.
  • Tests: TestParse, TestCache_Get, BenchmarkParse, ExampleCache_Get (the example name must match a real identifier, or go vet complains).
  • Subtest names are short lowercase phrases — "empty input", "expired token" — because go test -run 'TestParse/empty_input' selects them.

Applying a Rename

Rename with gopls, not search-and-replace: it follows the type graph and refuses renames that would break interface satisfaction (the go-semantic-tools skill). Then grep struct tags, templates and SQL for the old name — gopls does not see them. Exported names in a published library need a deprecation cycle (the go-refactoring skill).

Verification Checklist

  1. No package named util, common, helpers, models, types, misc or base
  2. No exported name repeats its package name
  3. Initialisms keep one case (ID, URL, HTTP); no ALL_CAPS constants
  4. No Get prefix on getters; Must only on panicking functions
  5. Canonical method names (String, Read, Close, …) have canonical signatures
  6. Receivers are short and identical across a type's methods; no this/self
  7. Sentinels use Err, error types end in Error, error strings are lowercase
  8. Enum constants carry the type prefix and an Unknown zero value
  9. No predeclared identifier is shadowed
  10. Renames done with gopls; tags and templates checked afterwards

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Go Naming?

Go naming conventions for packages, files, types, functions, methods, receivers, variables, constants, errors, acronyms and tests, grounded in Effective Go and Go Code Review Comments. Use when: "what should I name this", "name this package", "naming review", "is this name idiomatic", "stuttering names", "Get prefix", "acronym casing", "error variable name", "receiver name". Not for: formatting, imports and declarations (go-coding-standards), carrying out a rename across the codebase (go-semantic-tools, go-refactoring).

Perché usare Go Naming su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Go Naming è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Go Naming in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/eduardo-sl/go-agent-skills/tree/main/skills/(code-quality)/go-naming. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Go Naming?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Go Naming?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Go Naming: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Go Naming è gratuita?

Sì. È pubblicata su GitHub da eduardo-sl con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇