go-standards
/go-standards
Personal Go engineering defaults, grounded in the standard library, for implementing, reviewing, refactoring, or testing Go code. Use when working on Go packages, CLIs, libraries, concurrency primitives, parsers, formatters, config loading, errors, documentation, examples, table-driven tests, fuzz tests, compatibility-sensitive APIs, or repository standards for high-quality Go code. The project's own conventions take precedence over these defaults.
- Author
- leefowlercu ↗
- Repository
- agent-kit ↗
- Licence
- MIT
- Last repository change
- 26.10.2026
Assessment and security
- Files in this package
- 6
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Personal Go engineering defaults, grounded in the standard library, for implementing, reviewing, refactoring, or testing Go code. Use when working on Go packages, CLIs, libraries, concurrency primitives, parsers, formatters, config loading, errors, documentation, examples, table-driven tests, fuzz tests, compatibility-sensitive APIs, or repository standards for high-quality Go code. The project's own conventions take precedence over these defaults.
Original author description
Personal Go engineering defaults, grounded in the standard library, for implementing, reviewing, refactoring, or testing Go code. Use when working on Go packages, CLIs, libraries, concurrency primitives, parsers, formatters, config loading, errors, documentation, examples, table-driven tests, fuzz tests, compatibility-sensitive APIs, or repository standards for high-quality Go code. The project's own conventions take precedence over these defaults.
How it works
- Operating Mode
- Precedence
- Core Workflow
- Default Standards
- References
- Review Posture
- Do Not Generalize
SKILL.md preview
---
name: go-standards
description: Personal Go engineering defaults, grounded in the standard library, for implementing, reviewing, refactoring, or testing Go code. Use when working on Go packages, CLIs, libraries, concurrency primitives, parsers, formatters, config loading, errors, documentation, examples, table-driven tests, fuzz tests, compatibility-sensitive APIs, or repository standards for high-quality Go code. The project's own conventions take precedence over these defaults.
---
# Go Standards
## Operating Mode
Use this skill to make Go code boring, explicit, well-tested, and compatible. Prefer the Go standard library's ordinary public-package style over clever runtime/compiler/internal tricks.
## Precedence
This skill holds the user's personal Go defaults. It fills gaps; it does not override the project.
When guidance conflicts, follow the first source that addresses it:
1. The user's instructions in the current conversation.
2. The project's written standards: the nearest `AGENTS.md` or `CLAUDE.md`, `CONTRIBUTING.md`, and style or architecture docs.
3. The project's enforced tooling: `.golangci.yml`, pre-commit hooks, and the checks CI runs.
4. The conventions in the surrounding code: package layout, naming, error wording, and test libraries and structure. If the repository is inconsistent, match the nearest code (the same package or module).
5. This skill, including its references.
- Do not restructure, rename, or reformat existing code to match this skill unless the user asks.
- Apply this skill's layout and style rules only where the project has no rule or pattern of its own.
- In reviews, judge code against the project's conventions, not this skill's.
- When following the project means departing from this skill in a way the user might not expect, say so in one line.
## Core Workflow
1. Classify the task as implementation, bug fix, API design, refactor, review, or diagnosis.
2. Before proposing code, check Precedence sources 2-4: instruction files, lint and CI configuration, `go.mod`, and the target package and its tests.
3. Write or update tests first when behavior changes; use the standard `testing` package unless the project uses another test library.
4. Implement the smallest API and implementation that satisfies the tests and the project's conventions.
5. Run `gofmt`, or the project's configured formatter, on changed Go files, then run the narrowest meaningful `go test` command. Broaden to `go test ./...` when shared behavior or package boundaries changed.
6. Report exact commands run and any unverified risk.
## Default Standards
- Design APIs around small functions, small interfaces, explicit contracts, and useful zero values.
- Document exported identifiers with behavior, edge cases, concurrency guarantees, ownership rules, and compatibility notes.
- Prefer plain data flow and early returns. Add abstraction only when it removes real duplication or clarifies a boundary.
- Use package-private helpers for implementation details. Use `internal/` for cross-package implementation sharing that must not become public API.
- Return stable, contextual errors. Use wrapping when callers should match with `errors.Is` or `errors.As`; avoid exposing sentinels unless callers need a stable contract.
- Keep tests deterministic, fast, and behavior-focused. Prefer table-driven unit tests for edge cases; add examples for public onboarding; add fuzz tests for parsers, decoders, escaping, tokenization, and boundary-heavy transformations.
- Use `log/slog` for logging and prefer `any` over `interface{}` unless local compatibility requires otherwise.
- Use build tags and platform-specific files for OS/architecture behavior instead of large runtime branches.
- Preserve compatibility unless the user explicitly asks for a breaking change.
## References
Load only the reference needed for the task:
- `references/stdlib-patterns.md`: Load for API design, docs, errors, testing, concurrency, performance, compatibility, platform-specific code, or review checklists.
- `references/stdlib-examples.md`: Load when concrete examples would help apply `references/stdlib-patterns.md` without relying on access to the Go source tree.
- `references/repo-baseline.md`: Load when creating modules, changing package layout, adding logging, or choosing unit vs acceptance test structure.
- `references/cobra-viper.md`: Load when implementing or reviewing Cobra commands, Viper configuration, or Go CLI layout.
## Review Posture
For Go reviews, lead with correctness, compatibility, race/deadlock risk, API ambiguity, error matching regressions, missing tests, and portability. Avoid style-only findings unless they materially affect maintainability or violate the project's conventions. Do not flag code for departing from this skill where the project follows its own convention.
## Do Not Generalize
Do not copy patterns from `runtime`, `syscall`, `unsafe`, compiler packages, generated tables, assembly, or deeply optimized algorithms unless the target package has the same constraints. Convert those observations into ordinary principles: isolate unsafe code, document invariants, test edge cases, and measure performance before optimizing.
Files in this package (6)
- SKILL.md 5 KB
- agents/openai.yaml 1 KB
- references/cobra-viper.md 5 KB
- references/repo-baseline.md 3 KB
- references/stdlib-examples.md 6 KB
- references/stdlib-patterns.md 7 KB
Versions
The database has no other skills named go-standards.
Database snapshot: 13.11.2026 · package version e261e7de3432 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Similar skills
- 100writing-code
Apply Gather V2 coding standards (STANDARDS.md) when writing or modifying code. Use when writing new code, refactoring, or reviewing code for standards compliance. - 82coding-standards
检测代码异味、反模式和可读性问题。在实现功能、评审代码或重构时使用。 - 90quality-engineering-api-fuzz-testing
Author and execute structured API fuzzing, property-based robustness tests, and dynamic authorization checks. Use when fuzzing API payloads, testing schema boundaries, or verifying real-guard access controls. - 93golang-testing
Go testing patterns including table-driven tests, subtests, benchmarks, fuzzing, and test coverage. Follows TDD methodology with idiomatic Go practices. Use when writing Go tests — table-driven cases, subtests, benchmarks, fuzzing, or coverage. - 93golang-testing
Go testing patterns including table-driven tests, subtests, benchmarks, fuzzing, and test coverage. Follows TDD methodology with idiomatic Go practices. Use when writing Go tests — table-driven cases, subtests, benchmarks, fuzzing, or coverage. - 100coding-standards
Detects code smells, anti-patterns, and readability issues. Use when implementing features, reviewing code, or refactoring.