Agent skill

Go Style Core

by cxuu in cxuu/golang-skills

A skill your agent uses when working with Go formatting, line length, nesting, naked returns, semicolons, or core style principles.

Apache-2.0Auto-check passedWriting & Content

Install Go Style Core

skills CLI
$ npx skills add cxuu/golang-skills --skill go-style-core -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cxuu/golang-skills go-style-core --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cxuu/golang-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/go-style-core .claude/skills/go-style-core && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
go-style-core
GitHub stars
172
Token cost
~1.3k tokens
SKILL.md length
433 words
Files
3 (incl. references)
Skills in repo
20
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses when working with Go formatting, line length, nesting, naked returns, semicolons, or core style principles.

  • Works in 5 steps: Clarity — Can a reader understand the… → Simplicity — Is this the simplest way to… → Concision — Does every line earn its… → …
  • Working with Go formatting
  • SKILL.md covers Resource Routing, Style Principles (Priority…, Formatting and Reduce Nesting, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Go Style Core is an agent skill from cxuu/golang-skills. Use when working with Go formatting, line length, nesting, naked returns, semicolons, or core style principles. Also use when a style question isn't covered by a more specific skill, even if the user doesn't reference a specific style rule. Does not cover domain-specific patterns like error handling, naming, or testing (see specialized skills). Acts as fallback when no more specific style skill applies.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/FORMATTING.md` and `references/PRINCIPLES.md`).

It sits in Writing & Content, covering Plain language and style rules. The repository describes itself as: AI Agent Skills for idiomatic, production-ready Go code, distilled from Google, Uber, Community. The licence is Apache-2.0.

When your agent uses it

  • Working with Go formatting
  • Core style principles
  • A style question isnt covered by a more specific skill
  • Even if the user doesnt reference a specific style rule

Example prompts

  • “t covered by a more specific skill, even if the user doesn”
  • “/go-style-core”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Clarity — Can a reader understand the code without extra context?
  2. Simplicity — Is this the simplest way to accomplish the goal?
  3. Concision — Does every line earn its place?
  4. Maintainability — Will this be easy to modify later?
  5. Consistency — Does it match surrounding code and project conventions?

What it can do on your machine

Read from SKILL.md and the folder at commit 91f0c2e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are go).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Go Style Core loads about 1.3k tokens when it runs, and up to ~2.6k if it reads all its reference files. Until then it costs about 105 tokens; SKILL.md has 433 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~105
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from cxuu/golang-skills at commit 91f0c2e, republished under its Apache-2.0 licence (© cxuu). 433 words, ~1,347 tokens.

Download SKILL.mdSave it as .claude/skills/go-style-core/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
go-style-core
description
Use when working with Go formatting, line length, nesting, naked returns, semicolons, or core style principles. Also use when a style question isn't covered by a more specific skill, even if the user doesn't reference a specific style rule. Does not cover domain-specific patterns like error handling, naming, or testing (see specialized skills). Acts as fallback when no more specific style skill applies.

Go Style Core Principles

Resource Routing

  • references/PRINCIPLES.md - Read when resolving conflicts between clarity, simplicity, concision, maintainability, and consistency.
  • references/FORMATTING.md - Read when handling gofmt, line breaks, whitespace, comments, or semicolons.

Style Principles (Priority Order)

When writing readable Go code, apply these principles in order of importance:

Priority Order
  1. Clarity — Can a reader understand the code without extra context?
  2. Simplicity — Is this the simplest way to accomplish the goal?
  3. Concision — Does every line earn its place?
  4. Maintainability — Will this be easy to modify later?
  5. Consistency — Does it match surrounding code and project conventions?

Formatting

Run gofmt — no exceptions. There is no rigid line length limit, but Uber suggests a soft limit of 99 characters. Break by semantics, not length — refactor rather than just wrap.


Reduce Nesting

Handle error cases and special conditions first. Return early or continue the loop to keep the "happy path" unindented.

go
// Bad: Deeply nested
for _, v := range data {
    if v.F1 == 1 {
        v = process(v)
        if err := v.Call(); err == nil {
            v.Send()
        } else {
            return err
        }
    } else {
        log.Printf("Invalid v: %v", v)
    }
}

// Good: Flat structure with early returns
for _, v := range data {
    if v.F1 != 1 {
        log.Printf("Invalid v: %v", v)
        continue
    }

    v = process(v)
    if err := v.Call(); err != nil {
        return err
    }
    v.Send()
}
Unnecessary Else

If a variable is set in both branches of an if, use default + override pattern.

go
// Bad: Setting in both branches
var a int
if b {
    a = 100
} else {
    a = 10
}

// Good: Default + override
a := 10
if b {
    a = 100
}

Naked Returns

A return statement without arguments returns the named return values. This is known as a "naked" return.

go
func split(sum int) (x, y int) {
    x = sum * 4 / 9
    y = sum - x
    return // returns x, y
}
Guidelines for Naked Returns
  • OK in small functions: Naked returns are fine in functions that are just a handful of lines
  • Be explicit in medium+ functions: Once a function grows to medium size, be explicit with return values for clarity
  • Don't name results just for naked returns: Clarity of documentation is always more important than saving a line or two
go
// Good: Small function, naked return is clear
func minMax(a, b int) (min, max int) {
    if a < b {
        min, max = a, b
    } else {
        min, max = b, a
    }
    return
}

// Good: Larger function, explicit return
func processData(data []byte) (result []byte, err error) {
    result = make([]byte, 0, len(data))

    for _, b := range data {
        if b == 0 {
            return nil, errors.New("null byte in data")
        }
        result = append(result, transform(b))
    }

    return result, nil // explicit: clearer in longer functions
}

See go-documentation for guidance on Named Result Parameters.


Show full SKILL.md (181 more words)Show less

Semicolons

Go's lexer automatically inserts semicolons after any line whose last token is an identifier, literal, or one of: break continue fallthrough return ++ -- ) }.

This means opening braces must be on the same line as the control structure:

go
// Good: brace on same line
if i < f() {
    g()
}

// Bad: brace on next line — lexer inserts semicolon after f()
if i < f()  // wrong!
{           // wrong!
    g()
}

Idiomatic Go only has explicit semicolons in for loop clauses and to separate multiple statements on a single line.


Quick Reference

PrincipleKey Question
ClarityCan a reader understand what and why?
SimplicityIs this the simplest approach?
ConcisionIs the signal-to-noise ratio high?
MaintainabilityCan this be safely modified later?
ConsistencyDoes this match surrounding code?
  • Naming conventions: See go-naming when applying MixedCaps, choosing identifier names, or resolving naming debates
  • Error flow: See go-error-handling when structuring error-first guard clauses or reducing nesting via early returns
  • Documentation: See go-documentation when writing doc comments, named return parameters, or package-level docs
  • Linting enforcement: See go-linting when automating style checks with golangci-lint or configuring CI
  • Code review: See go-code-review when applying style principles during a systematic code review
  • Logging style: See go-logging when reviewing logging practices, choosing between log and slog, or structuring log output

© cxuu, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in skills/go-style-core of cxuu/golang-skills.

  • SKILL.md
  • references/FORMATTING.md
  • references/PRINCIPLES.md

Open the folder on GitHubat commit 91f0c2e

Compare with similar skills

Go Style Core next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Go Style Core compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Go Style Core this skillcxuu/golang-skills172—~1.3kAutomated safety check: PassApache-2.0
Asd Ste100danyuchn/asd-ste100-skill4.2k—~4.1kAutomated safety check: PassMIT
Simple Issue Descriptionevery-app/open-seo23k1 repos~1.2kAutomated safety check: PassMIT
Ponytail AuditDietrichGebert/ponytail159k—~1.4kAutomated safety check: PassMIT
Technical Writing Standardcursor/plugins10k10 repos~2.4kAutomated safety check: PassNone
Natural Japanese Business Writingcoji/natural-japanese1.9k—~2.1kAutomated safety check: PassMIT

Similar skills

  • Asd Ste100

    danyuchn/asd-ste100-skill

    A skill your agent uses when English text must be parsed without a human to resolve ambiguity — tool descriptions, error messages, inter-agent instructions, system prompts, status reports — and…

    4.2k GitHub stars~4.1k tokensUpdated 5 days ago
    Writing & ContentAuto-check passed
  • Simple Issue Description

    every-app/open-seo

    Turn a rough bug report, feature request, support note, or pull request into a short, plain-language issue focused on the problem and desired behavior.

    23k GitHub starsUsed in 1 repo~1.2k tokens
    Writing & ContentAuto-check passed
  • Ponytail Audit

    DietrichGebert/ponytail

    Quality audit of a whole repo: bugs, security holes, what breaks under real load, risky code without tests, slow paths, and what to delete, merge or split.

    159k GitHub stars~1.4k tokensUpdated yesterday
    Writing & ContentAuto-check passed
  • Official

    Applies four layers of technical-writing rules to docs, RFCs, readmes, PR descriptions and commit messages so a tired engineer follows them on the first read.

    10k GitHub starsUsed in 10 repos~2.4k tokens
    Writing & ContentAuto-check passed
  • Writes and edits Japanese business documents so they read clearly and naturally, removes AI-sounding phrasing and can score how AI-like a text reads.

    1.9k GitHub stars~2.1k tokensUpdated 1 mo ago
    Writing & ContentAuto-check passed
  • Pgjev

    realZachi/pg-jev

    Install, configure, query and explain pgjev (the jev PostgreSQL extension that filters, ranks and classifies rows with plain-language conditions via TypeSafe's Jev model).

    1.1k GitHub stars~2.9k tokensUpdated 3 days ago
    Writing & ContentAuto-check passed

More from cxuu/golang-skills

All 20 skills in this repo
  • Go Testing

    cxuu/golang-skills

    A skill your agent uses when writing, reviewing, or improving Go test code — including table-driven tests, subtests, parallel tests, test helpers, test doubles, and assertions with cmp.Diff.

    172 GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Go Code Review

    cxuu/golang-skills

    A skill your agent uses when reviewing Go code or checking code against community style standards.

    172 GitHub stars~2.7k tokensUpdated 3 mo ago
    Auto-check passed
  • Go Performance

    cxuu/golang-skills

    A skill your agent uses when optimizing Go code, investigating slow performance, or writing performance-critical sections.

    172 GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Go Documentation

    cxuu/golang-skills

    A skill your agent uses when writing or reviewing documentation for Go packages, types, functions, or methods.

    172 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed
  • Go Error Handling

    cxuu/golang-skills

    A skill your agent uses when writing Go code that returns, wraps, or handles errors — choosing between sentinel errors, custom types, and fmt.Errorf (%w vs %v), structuring error flow, or deciding…

    172 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Go Interfaces

    cxuu/golang-skills

    A skill your agent uses when defining or implementing Go interfaces, designing abstractions, creating mockable boundaries for testing, or composing types through embedding.

    172 GitHub stars~1.4k tokensUpdated 3 mo ago
    Auto-check passed

Questions about Go Style Core

What does Go Style Core do?

A skill your agent uses when working with Go formatting, line length, nesting, naked returns, semicolons, or core style principles. Go Style Core is an agent skill from cxuu/golang-skills. Use when working with Go formatting, line length, nesting, naked returns, semicolons, or core style principles.

When should I use Go Style Core?

Go Style Core fits situations like: working with Go formatting; core style principles; A style question isnt covered by a more specific skill; even if the user doesnt reference a specific style rule.

How do I install Go Style Core in Claude Code?

Run `npx skills add cxuu/golang-skills --skill go-style-core -a claude-code`. Or copy the skill folder (skills/go-style-core in cxuu/golang-skills) into .claude/skills/go-style-core in your project. Claude Code loads it when a task matches its description.

How do I install Go Style Core in Codex?

Run `npx skills add cxuu/golang-skills --skill go-style-core -a codex`. Or copy the skill folder (skills/go-style-core in cxuu/golang-skills) into .agents/skills/go-style-core in your project. Codex loads it when a task matches its description.

Can I use Go Style Core in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cxuu/golang-skills --skill go-style-core -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/go-style-core, .gemini/skills/go-style-core, .github/skills/go-style-core and .opencode/skills/go-style-core in your project.

What does Go Style Core need to run?

SKILL.md names no scripts, command-line tools or credentials: Go Style Core is instructions for the agent only.

Does Go Style Core access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Go Style Core safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Go Style Core use?

Go Style Core is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Go Style Core use?

About 1.3k tokens (SKILL.md is roughly 5.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.3k tokens, read only when the agent opens those files.

What are the alternatives to Go Style Core?

Skills that share tags, products or a category with Go Style Core: Asd Ste100 (danyuchn/asd-ste100-skill, 4.2k stars), Simple Issue Description (every-app/open-seo, 23k stars), Ponytail Audit (DietrichGebert/ponytail, 159k stars) and Technical Writing Standard (cursor/plugins, 10k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Go Style Core?

cxuu (a GitHub user) maintains it in cxuu/golang-skills, which has 172 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on June 20, 2026.

Source: cxuu/golang-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.