golang-skills
CLAUDE.md7 starsChanged 9 days agoApache-2.0View on GitHub
A Claude Code plugin and Agent Skills pack: 24 Go skills under skills/go-*/, each a SKILL.md plus optional references/, scripts/, assets/. There is no Go application. Two Go modules: hooks/helper (the hooks' parser and receipt runner, standard library only) and evals/, whose tests are the structural suite for the Markdown, shell scripts, and hooks, plus two headless runners (evalrun, abrun) that drive real model sessions. source/ holds upstream style-guide snapshots and is never edited. docs/ holds the retained maintenance policy;…
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- go-code-refactorSkill
- go-code-reviewSkill
- go-codeSkill
- go-concurrencySkill
- go-contextSkill
- go-databaseSkill
- go-data-structuresSkill
- go-defensiveSkill
- go-documentationSkill
- go-error-handlingSkill
- go-functionsSkill
- go-genericsSkill
- go-httpSkill
- go-interfacesSkill
- go-lintingSkill
- go-loggingSkill
- go-namingSkill
- go-packagesSkill
- go-performanceSkill
- go-resilienceSkill
- go-securitySkill
- go-style-coreSkill
- go-testingSkill
- go-troubleshootingSkill
The file
We split this CLAUDE.md into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Write reasoning summaries, planning notes, specs, review summaries, code comments, and user-facing messages in Ukrainian.
- Distinctive: line 9
Keep code identifiers, filenames, commands, package names, and commit messages in English.
- Very specific: line 134
Every rule has one owner skill.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md 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
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Language
- Respond to the user in Ukrainian.
- Write reasoning summaries, planning notes, specs, review summaries, code comments, and user-facing messages in Ukrainian.
- Keep code identifiers, filenames, commands, package names, and commit messages in English.
What this repository is
A Claude Code plugin and Agent Skills pack: 24 Go skills under skills/go-*/,
each a SKILL.md plus optional references/, scripts/, assets/. There is
no Go application. Two Go modules: hooks/helper (the hooks' parser and
receipt runner, standard library only) and evals/, whose tests are the
structural suite for the Markdown, shell scripts, and hooks, plus two headless
runners (evalrun, abrun) that drive real model sessions. source/ holds
upstream style-guide snapshots and is never edited. docs/ holds the retained
maintenance policy; model-run reports and traces are not committed.
CLAUDE.md is listed in .gitignore, so this file stays local unless that
entry is removed.
Commands
Everything the tests shell out to must be on PATH: go (1.27), gofmt, and
golangci-lint (v2.15.0 is pinned in CI; TestScriptFunctional/SetupLintDryRun
fails without the binary).
# Structural suite, as CI runs it. Execs the scripts, compiles every example
# block, drives the hooks through scripted sessions; about a minute with -race.
cd evals && go test -count=1 -race -shuffle=on ./...
# One test or subtest
cd evals && go test -count=1 -run 'TestSkillArchitecture' .
cd evals && go test -count=1 -run 'TestManifestCounts/README.md' .
cd evals && go test -count=1 -run 'TestRoutingGate|TestPromptRouting|TestVetHook|TestSubagentRouting' .
# abrun's own unit tests
cd evals && go test -count=1 ./cmd/abrun/
# The rest of the CI validate job
golangci-lint config verify --config skills/go-linting/assets/golangci.yml
bash -n hooks/*.shModel-driven runs cost tokens and are opt-in:
# Trigger + quality evals from evals/evals.json through `claude -p`
cd evals && go run ./cmd/evalrun -set validation -kind all -j 2 -out evals-results.json
# Chosen quality cases, repeated, and the no-plugin control for a new case
cd evals && go run ./cmd/evalrun -kind quality -ids 65,66 -n 3 -out base.json
cd evals && go run ./cmd/evalrun -kind quality -ids 65,66 -n 3 -no-skill -out control.json
# Same cases with Bash allowed for `go doc` only (read-only otherwise)
cd evals && go run ./cmd/evalrun -kind quality -ids 74 -n 3 -go-doc -out godoc.json
# A/B a skill edit: reference arm from a second checkout, baseline = this tree
cd evals && go run ./cmd/abrun -corpus implement -reference-root ../golang-skills-before \
-arms reference,baseline -n 5 -j 4 -effort medium -keep -out run.jsonabrun sessions have no shell and no MCP server; -gopls mcp (own
--mcp-config) or -gopls cli (Bash(gopls:*)) gives them a gopls route and
records gopls_calls per result. -keep leaves the run's trees under one
$TMPDIR/abrun-keep-* directory, which the run prints. gopls lives in ~/go/bin. -shell go gives
them Bash for the Go toolchain and the bundled scripts (commands counts the
calls).
Architecture
Routing model
go-code is the router for any task that writes Go: load go-style-core
(always; its SKILL.md carries the idiom card) before the first edit,
match the task against the "Route Before The First Edit" table to pick owner
skills and load them in one message, then close with the Verification Gate
that go-linting owns (gofmt, go vet, go test -race, go fix -diff,
golangci-lint, govulncheck). go-code-refactor is the second router, for
behavior-preserving changes. Skills link to siblings relatively
(../go-x/SKILL.md#anchor) so the same tree works under Codex, Cursor, or
copied into ~/.claude/skills/.
hooks/hooks.json wires six scripts that make the routing enforceable in
Claude Code. They need bash and Go only: JSON parsing, the owner heuristics,
the verification gate, and the check receipts live in hooks/helper, which
hooks/go-hook-helper.sh builds on first use into
${XDG_CACHE_HOME:-~/.cache}/golang-skills/hook-helper-<cksum>:
go-code-routing.sh: PostToolUse onSkill|Readrecords loaded skills; PreToolUse onEdit|Writeblocks (exit 2) every.goedit until a router (without one, the entry routerpromptednames, elsego-code),go-style-core(which carries the idiom card), and the owners are inloaded; after SessionStartcompactwrites<state>/compacted(the line count ofloaded), only loads recorded after it count.remindedis only a log: a retry without loads is blocked again, and the third stalled retry of the same edit returns JSONcontinue: false. A skill with no SKILL.md in the plugin copy is reported, not required;GOLANG_SKILLS_ROUTING_GATE=offdisables it. Messages usegolang-skills:<name>whenCLAUDE_PLUGIN_ROOTis set. State lives under${CLAUDE_PLUGIN_DATA:-$TMPDIR/golang-skills-hooks}/routing/<session>/, a subagent's under<session>/agent-<agent_id>/(a fork keeps its parent's); verification state is keyed the same way.go-vet-on-edit.sh: PostToolUse onEdit|Writeof a.gofile runs gofmt, vet,go fix -diff, the package tests, and golangci-lint.GOLANG_SKILLS_EDIT_TESTS=off/GOLANG_SKILLS_EDIT_LINT=offswitch parts off. Never blocks.go-prompt-routing.sh(UserPromptSubmit) andgo-subagent-routing.sh(SessionStart and SubagentStart) inject one note naming the router andgo-style-corebefore the first edit; silent otherwise. On SubagentStart this hook and the ladder hook print JSONadditionalContext: a subagent never sees plain stdout.go-restraint-ladder.sh: SessionStart and SubagentStart in a Go directory printLADDER.mdfrom the ladder heading to its end plus the session'slite/full/ultrarow from go-code's Intensity table, both read at run time; UserPromptSubmit records a level word in<state>/intensity.GOLANG_SKILLS_LADDER=lite|full|ultra|off.go-verification-routing.sh: in a session with a router loaded, PreToolUse onBashblocks a repeated runtime check after a Go edit untilgo-lintingis loaded and the receipt verifier the edit hook printed was attempted; Stop blocks a final message whosepass (hook)/pass (receipt)claims lack current verifier credits, or one that claims a speedup when nobench-compare.sh --verdictran in the session.GOLANG_SKILLS_VERIFICATION_GATE=offdisables it;GOLANG_SKILLS_SPEED_GATE=offonly the speed check.evals/hook_test.godrives the first five;evals/verification_routing_test.godrives the sixth.
Rule ownership
Every rule has one owner skill; other skills route to it in one or two lines
plus a link. docs/RULE_OWNERSHIP.md is the map and is updated before guidance
appears in a second skill. TestRuleOwnershipMap pins specific needles
("Reduce Nesting" only in go-style-core, loggerFromCtx only in the logging
reference); TestRestraintLadder and TestDeleteFirstRule pin that those two
rules each live in exactly one file. The map's "Scope Exceptions" section
records where this repository's own tooling deliberately departs from a
skill's advice (the CI workflow is the main case). Do not "fix" those without
updating the record.
Invariants the eval tests enforce on skill files
Spread across evals/eval_test.go; an ordinary edit trips them:
SKILL.mdat most 400 lines and 26 KB, largest fenced block at most 40 lines; references at most 300 lines, with a## ContentsTOC when over 100 and holding more than one section.TestCompactionKeepsPerEditRulespins the sections that must sit in the first 5,000 tokens.- Frontmatter is
name,description, and (script-backed skills only)allowed-tools. Descriptions are goldens inTestFrontmatterDescriptionsInvariant: changing one means changing the test in the same commit. - Exactly one
## Resource Routingsection listing every file underreferences/,scripts/,assets/(an unlisted file fails as an orphan), and a## Related Skillssection. Every relative link and#anchormust resolve (TestCrossRefs; the CI link check also coversdocs/,agents/, and root Markdown). - A
SKILL.mdbody that names a Go version needs a> Compatibility:note pointing atskills/go-style-core/references/COMPATIBILITY.md. Inline(Go 1.NN+)markers are checked against$GOROOT/api/go1.NN.txtbyTestVersionClaimsMatchToolchain: verify withgo docor the api files, never from memory.TestGoVersionBaselinepins the 1.27 baseline and specific rows. - Reference files open with
> Sources:,> Authority:,> Last verified:within the first 12 lines. - No
$Nor$ARGUMENTS, escaped or not, in aSKILL.md(TestSkillBodyArgumentPlaceholders): Claude Code substitutes skill arguments into the body, code fences included, and other hosts show the backslash. Prose writes$N; SQL with placeholders lives in references. - Self-contained Go example blocks are extracted and compiled (some run) by
the
*_examples_test.gofiles. A deliberate fragment starts mid-function or is introduced as one in the sentence before it. - Counts stated in
README.md,README.uk.md,.claude-plugin/plugin.json, and.claude-plugin/marketplace.json(skills, reference files, scripts, asset templates, trigger and quality evals) must equal what is on disk, and the two manifests must agree on the version (TestManifestCounts). Adding a reference or script means updating all four files; the Ukrainian README is a mirror, not optional.
docs/SKILL_AUTHORING_TEMPLATE.md is the authoring contract behind these,
including how to write for a capable model: cut what it already knows, put the
exception in the code sample rather than a caveat beside it, state a rule's
scope in the rule, name the check that fails when the rule is broken.
Bundled scripts
The 10 skills/*/scripts/*.sh share one CLI contract: --help, --json,
exit 0 clean / 1 findings / 2 usage or environment error, --limit where
output is unbounded, --force on the two that write files. JSON shapes are
specified in docs/SCRIPT_JSON_CONTRACTS.md and asserted by
TestScriptFunctional against evals/fixtures/<area>/ (each area has a clean
tree and a violations tree; no_go_files checks the empty-scan status
marker). Scripts resolve paths relative to their installed skill directory and
run against the target project. Skill text writes every command as
bash <installed-skill-dir>/scripts/<name>.sh (TestScriptCommandsRunThroughBash).
Evaluation harnesses
evals/cmd/evalrunrunsevals.json(trigger_evals,quality_evals) throughclaude --plugin-dirin an empty scratch dir with tools cut toSkill(plus read-only tools for quality), records which skills fired, and has a second model grade quality answers.evals/internal/evalpluginstages a copy of the plugin so restricted sessions can read references without seeing fixtures.evals/cmd/abrunmeasures the code a session writes, not its prose, across arms:no-skill(control),baseline(this tree),reference(-reference-rootto another checkout; the arm for before/after claims), and one arm perevals/ab/variants/*.mdspliced intogo-code-refactor/SKILL.md. Three corpora, never averaged together:evals/ab/<fixture>refactor (score is lines removed with behavior held),evals/ab/_implement(stub bodies; the hidden golden test is the spec), andevals/ab/_review(seeded defects scored against_golden/<fixture>/key.jsonby source line)._golden/is copied in after the session and never reaches the model; the model's own tests are renamed*_test.go.modelfirst.-runnersupports claude, codex, copilot, grok, and opencode with differences documented by the runner implementations; compare arms within one runner.no-skillvsbaselineonly shows a fixture has a trap;referencevsbaselineis what judges a skill edit.- Model-driven runs are exploratory and their reports, traces, and scratch trees stay outside this repository. If a result is published elsewhere, retain the raw JSON with it and compare arms within one runner.
Conventions
- Changes are recorded under
## [Unreleased]inCHANGELOG.md. A release is onerelease: X.Y.Zcommit bumping.claude-plugin/plugin.json,.claude-plugin/marketplace.json, and the changelog heading, then an annotatedvX.Y.Ztag; CI creates the GitHub release from that changelog section once validation passes.docs/RELEASE_CHECKLIST.mdlists the validation set. - Go baseline is 1.27 (supported: 1.26 and 1.27).
skills/go-style-core/references/COMPATIBILITY.mdis the source of truth for every version-sensitive claim and says how to re-verify each against the installed toolchain. The language version is the module'sgodirective, not the installed Go.go-release-watch.ymlreads the baseline sentence in that file andGOLANGCI_LINT_VERSIONinvalidate-skills.ymlby regex, so keep both spellings intact. - Skill wording is judged by measurement, not by reading: a claim that an edit
helps needs a reference-vs-baseline
abrunrun with raw output retained outside the repository. The 400-line cap is a ceiling, not a target; cut only on measured evidence. source/snapshots keep upstream licenses and provenance headers, andTHIRD_PARTY_NOTICES.mdmust cover every file there. Project files are Apache-2.0.
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.

