Logotipo de Go Style Guide

Go Style Guide

Comunidad
madflojo
go-style-guide

Provides Go (Golang) engineering guidance for designing packages, services, and CLIs. Use whenever the task involves Go implementation, refactors, code reviews, API design, package layout, interfaces, constructors/config, error handling, logging, dependency or framework selection, HTTP/service wiring, concurrency/lifecycle, tests, benchmarks, godoc, or maintainability decisions.

Descripción general

Editormadflojo
Repositoriogo-style-agent-skill
Nombre de la habilidadgo-style-guide
Estrellas
41
Forks
3
Archivos incluidos
10
LicenciaApache-2.0
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Archivos incluidos: 10

    Scripts, plantillas y referencias que el modelo puede leer mientras trabaja. Los archivos son de solo lectura y nunca se ejecutan.

  • Código abierto

    Publicada por madflojo en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Go Style Guide en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/madflojo/go-style-agent-skill/tree/main/skills/go-style-guide
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/madflojo/go-style-agent-skill.git /tmp/go-style-agent-skill
mkdir -p .claude/skills
cp -r /tmp/go-style-agent-skill/skills/go-style-guide .claude/skills/go-style-guide
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Go Style Guide en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Go Style Guide automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Go Style Guide no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

Go (Golang) Style Guide Skill

This skill defines practical Go engineering conventions for humans, coding agents, and production-ready systems.

Use this skill whenever you are working with Go: new code, refactors, reviews, architecture decisions, package design, or test strategy.


TL;DR

  • Design for testability first; inject dependencies and keep logic pure.
  • Prefer Config in -> concrete struct out; validate, default, and document important runtime knobs.
  • Errors are contracts: use sentinels for durable branching; wrap the rest with %w or errors.Join.
  • Keep packages reusable: no hidden globals, no default logging, no surprise side effects.
  • Prefer the standard library before adding dependencies; third-party packages must earn their weight through meaningful, maintained, adopted abstraction.
  • Coverage is a signal, not proof; test edge cases and misuse paths, not just happy paths.
  • Follow "accept interfaces, return structs"; consumers usually define interfaces, shared contract packages are a special case.
  • Keep main.go thin; follow existing repo layout conventions rather than forcing one directory shape.
  • Benchmark hot paths before claiming wins, and run concurrency code with -race.
  • Maintain contracts such as function signatures, config shape, error behavior, and doc comments; they are as important as the code itself.

House Style Disclaimer

This is intentionally opinionated. It favors consistency and long-term maintainability over accommodating every Go style preference. If the target repo has clear local conventions, those conventions usually win.


Compatibility

Examples assume modern Go and use standard-library features such as errors.Join and log/slog. Apply the guide within the constraints of the target repository's supported Go version.


Execution Protocol

Follow this workflow when using the skill for implementation work:

  1. Inspect the repository first. Read existing package layout, constructors, tests, and error conventions before proposing new APIs or moving files.

  2. Define the contract before coding. Decide the package boundary, config shape, concrete return type, sentinel errors, dependency seams, and context or shutdown expectations up front.

  3. Write or update tests early when practical. Start with table-driven unit tests, add fuzz tests for parsing or other input-heavy code, and add benchmarks for performance-sensitive paths.

  4. Implement the smallest maintainable change. Follow the repository's existing layout, keep main.go thin, and avoid introducing new abstractions without a clear boundary.

  5. Run the finishing checks. Format with gofmt (and goimports if the repo uses it), run the relevant go test targets, run go test -race when concurrency is involved, and run benchmarks when claiming performance improvements.

  6. Verify the human-facing contract. Make sure docs, comments, config defaults, and error behavior match the code you are shipping.


Quick Rules Table

TopicRuleReference
TestabilityDesign for confidence, not coverage percentages; test edge and misuse casesreferences/TESTING.md
ConstructorsConfig in -> concrete struct out; validate + default in New; use Config.Validate() when config logic growsreferences/CONFIG.md
ErrorsUse sentinels for durable branching; wrap with %w or errors.Join; keep recover at app boundariesreferences/ERRORS.md
LoggingPackages do not log by default; hot-path logging is a performance decisionreferences/LOGGING.md
DependenciesStandard library first; add third-party packages only when they provide meaningful, maintained valuereferences/LAYOUT.md
Interfaces"Accept interfaces, return structs"; consumers usually define interfacesreferences/INTERFACES.md
DocumentationWrite idiomatic godoc and durable comments; never add agent-context commentsreferences/DOCUMENTATION.md
LayoutKeep packages shallow, avoid junk drawers, and follow repo conventionsreferences/LAYOUT.md
Entry Pointsmain.go is wiring onlyreferences/LAYOUT.md
BenchmarksBenchmark hot paths; use b.ReportAllocs() and compare runs with benchstatreferences/BENCHMARKS.md
TestingTable-driven, stdlib-first, defensive against misuse, and fuzz-heavy where inputs are complexreferences/TESTING.md
ConcurrencyEvery goroutine needs a shutdown path; use context.Context, -race, and jitter where neededreferences/CONCURRENCY.md
ReviewsUse the checklist when reviewing Go changesreferences/REVIEW-CHECKLIST.md

Common Pitfalls

  • Returning interfaces by default instead of concrete types.
  • Treating coverage percentages as proof of correctness.
  • Logging in reusable packages instead of returning errors.
  • Adding frameworks or helper libraries when the standard library is already clear enough.
  • Passing global app config through packages rather than local Config.
  • Leaving critical runtime knobs on dangerous defaults.
  • Forcing a house directory layout onto repos that already have clear conventions.
  • Loading every reference document before you know which topic the task touches.
  • Shipping changes that claim performance wins without benchmarks or concurrency safety without -race.

Core Guidance

Load reference files only when the task needs that topic's detail.

  • App packages own dependency wiring, lifecycle, error policy, logging, and metrics policy.
  • Reusable packages return errors, define local Config or Opts, accept initialized dependencies, and avoid hidden logging or global state.
  • Dependency choices should start with the standard library. Reach for a third-party package only when it solves a real problem, is actively maintained, and earns its transitive cost.
  • Services usually keep cmd/<appname>/main.go thin. Follow established repo layout over forcing pkg/, internal/, or any house shape.
  • Libraries usually keep packages shallow and domain-focused.
  • Constructors prefer New(cfg Config) (*T, error), explicit defaults, validation, concrete returns, and immutable normalized config.
  • Interfaces should be small, boundary-driven, and usually consumer-defined.
  • Tests should be table-driven, stdlib-first, defensive, and run with -race for concurrency-sensitive code.
  • Performance claims need benchmarks.
  • Docs, comments, config defaults, error behavior, and signatures are part of the contract.

Reference Loading

Load only the references needed for the active task:

  • Read references/CONFIG.md for constructors, Config structs, defaults, validation, degraded modes, or logging injection.
  • Read references/INTERFACES.md for interface boundaries, driver patterns, mocks/fakes, or concrete return decisions.
  • Read references/ERRORS.md for sentinel errors, wrapping, typed errors, recover placement, or constructor failures.
  • Read references/LOGGING.md for package logging, slog, log levels, async error surfaces, or payload safety.
  • Read references/TESTING.md for table-driven tests, fuzzing, testdata, integration gates, test helpers, or assertion choices.
  • Read references/CONCURRENCY.md for goroutines, context propagation, graceful shutdown, mutex/atomic/channel choices, jitter, or race testing.
  • Read references/LAYOUT.md for package layout, file naming, main.go, dependency hygiene, struct field layout, or export rules.
  • Read references/DOCUMENTATION.md for package docs, godoc, examples, deprecations, internal comments, or field docs.
  • Read references/BENCHMARKS.md for benchmark shape, allocation reporting, concurrent benchmarks, IO benchmarks, or benchstat.
  • Read references/REVIEW-CHECKLIST.md when reviewing a Go PR or doing a final self-check.

Archivos incluidos

El modelo los lee según los necesita mientras la habilidad está cargada. Son archivos de solo lectura y nunca se ejecutan.

Preguntas frecuentes

¿Qué hace la habilidad de IA Go Style Guide?

Provides Go (Golang) engineering guidance for designing packages, services, and CLIs. Use whenever the task involves Go implementation, refactors, code reviews, API design, package layout, interfaces, constructors/config, error handling, logging, dependency or framework selection, HTTP/service wiring, concurrency/lifecycle, tests, benchmarks, godoc, or maintainability decisions.

¿Por qué usar Go Style Guide en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Go Style Guide está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Go Style Guide en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/madflojo/go-style-agent-skill/tree/main/skills/go-style-guide. TypingMind lee el archivo SKILL.md de esa carpeta, empaqueta los archivos de la carpeta e instala el conjunto como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Go Style Guide?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Go Style Guide?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Go Style Guide con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Go Style Guide?

Sí. madflojo la ha publicado en GitHub bajo la licencia Apache-2.0. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇