go-patterns
Go development patterns: testing, concurrency, errors, review, and conventions.
Best use case
go-patterns is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Go development patterns: testing, concurrency, errors, review, and conventions.
Teams using go-patterns should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/go-patterns/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How go-patterns Compares
| Feature / Agent | go-patterns | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Go development patterns: testing, concurrency, errors, review, and conventions.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
SKILL.md Source
# Go Patterns Skill
Umbrella skill for Go development: testing, concurrency, error handling, anti-patterns,
code review, SAP CC conventions, and quality gates. Routes to the correct reference
based on the Go task at hand.
## Instructions
### Step 1: Identify the Go Domain
Classify the task into one or more domains, then load the corresponding reference files.
Only load what is needed -- do not load all references for every task.
| Domain | Load Reference | When |
|--------|---------------|------|
| Testing | `references/testing.md` | Writing, fixing, or reviewing Go tests |
| Concurrency | `references/concurrency.md` | Goroutines, channels, sync primitives, race conditions |
| Error handling | `references/error-handling.md` | Error wrapping, sentinels, custom types, errors.Is/As |
| Anti-patterns | `references/anti-patterns.md` | Detecting code smells, over-engineering, bad Go patterns |
| Code review | `references/code-review.md` | Reviewing Go code or PRs for quality |
| SAP CC conventions | `references/sapcc-conventions.md` | Working in sapcc/* repos with go-bits |
| Quality gate | `references/quality-gate.md` | Running make check, linting, pre-commit validation |
Multiple domains may apply. For example, reviewing a PR that includes concurrency code
should load both `code-review.md` and `concurrency.md`.
### Step 2: Load and Follow the Reference
Read the selected reference file(s) using `${CLAUDE_SKILL_DIR}/references/<name>.md`.
Each reference contains the full methodology, phases, code examples, and error handling
for that domain. Follow the instructions in the reference as if they were this skill's
instructions.
### Step 3: Use Domain-Specific Sub-References
Some references point to their own sub-reference files for extended patterns:
**Testing** sub-references:
- `${CLAUDE_SKILL_DIR}/references/testing/go-test-patterns.md` -- Full table-driven test, helper, mock examples
- `${CLAUDE_SKILL_DIR}/references/testing/go-benchmark-and-concurrency.md` -- b.Loop() benchmarks, synctest
**Concurrency** sub-references:
- `${CLAUDE_SKILL_DIR}/references/concurrency/concurrency-patterns.md` -- Worker pool, fan-out/fan-in, pipeline, rate limiter, graceful shutdown
**Error handling** sub-references:
- `${CLAUDE_SKILL_DIR}/references/error-handling/patterns.md` -- gopls tracing, HTTP handler patterns, error wrapping in middleware
**Anti-patterns** sub-references:
- `${CLAUDE_SKILL_DIR}/references/anti-patterns/code-examples.md` -- Extended before/after for all 7 anti-patterns
**Code review** sub-references:
- `${CLAUDE_SKILL_DIR}/references/code-review/common-review-comments.md` -- Go code patterns with good/bad examples
**SAP CC conventions** sub-references (extensive):
- `${CLAUDE_SKILL_DIR}/references/sapcc-conventions/sapcc-code-patterns.md` -- Primary reference: actual code patterns
- `${CLAUDE_SKILL_DIR}/references/sapcc-conventions/library-reference.md` -- Complete approved/restricted library table
- `${CLAUDE_SKILL_DIR}/references/sapcc-conventions/architecture-patterns.md` -- Full 102-rule architecture spec
- `${CLAUDE_SKILL_DIR}/references/sapcc-conventions/review-standards-lead.md` -- 21 lead review comments
- `${CLAUDE_SKILL_DIR}/references/sapcc-conventions/review-standards-secondary.md` -- 15 secondary review comments
- `${CLAUDE_SKILL_DIR}/references/sapcc-conventions/anti-patterns.md` -- 20+ quality issues with BAD/GOOD examples
- `${CLAUDE_SKILL_DIR}/references/sapcc-conventions/extended-patterns.md` -- Security, K8s, PR hygiene patterns
- Plus: `api-design-detailed.md`, `build-ci-detailed.md`, `error-handling-detailed.md`,
`go-bits-philosophy-detailed.md`, `pr-mining-insights.md`, `testing-patterns-detailed.md`
**Quality gate** sub-references:
- `${CLAUDE_SKILL_DIR}/references/quality-gate/common-lint-errors.json` -- Linter descriptions and fix suggestions
- `${CLAUDE_SKILL_DIR}/references/quality-gate/makefile-targets.json` -- Available make targets
- `${CLAUDE_SKILL_DIR}/references/quality-gate/expert-review-patterns.md` -- Manual review patterns
- `${CLAUDE_SKILL_DIR}/references/quality-gate/examples.md` -- Detailed usage examples
### Step 4: Execute
Follow the loaded reference methodology. Each reference has its own phases, gates,
and completion criteria. Apply them as written.
## Available Scripts
Scripts are organized by domain in sub-directories:
- **Testing**: `scripts/gen-table-test.sh`, `scripts/bench-compare.sh`
- **Error handling**: `scripts/check-errors.sh`
- **Code review**: `scripts/check-interface-compliance.sh`
- **SAP CC conventions**: `scripts/check-sapcc-identify-endpoint.sh`, `scripts/check-sapcc-auth-ordering.sh`,
`scripts/check-sapcc-json-strict.sh`, `scripts/check-sapcc-time-now.sh`, `scripts/check-sapcc-httptest.sh`,
`scripts/check-sapcc-todo-format.sh`
- **Quality gate**: `scripts/quality_checker.py`, `scripts/validate.py`
## Error Handling
Errors are domain-specific. Load the relevant reference file and check its Error Handling
section for troubleshooting guidance.Related Skills
testing-anti-patterns
Identify and fix testing mistakes: flaky, brittle, over-mocked tests.
x-api
Post tweets, build threads, upload media via the X API.
worktree-agent
Mandatory rules for agents in git worktree isolation.
workflow
Structured multi-phase workflows: review, debug, refactor, deploy, create, research, and more.
workflow-help
Interactive guide to workflow system: agents, skills, routing, execution patterns.
wordpress-uploader
WordPress REST API integration for posts and media uploads.
wordpress-live-validation
Validate published WordPress posts in browser via Playwright.
with-anti-rationalization
Anti-rationalization enforcement for maximum-rigor task execution.
voice-writer
Unified voice content generation pipeline with mandatory validation and joy-check. 8-phase pipeline: LOAD, GROUND, GENERATE, VALIDATE, REFINE, JOY-CHECK, OUTPUT, CLEANUP. Use when writing articles, blog posts, or any content that uses a voice profile. Use for "write article", "blog post", "write in voice", "generate content", "draft article", "write about".
voice-validator
Critique-and-rewrite loop for voice fidelity validation.
vitest-runner
Run Vitest tests and parse results into actionable output.
video-editing
Video editing pipeline: cut footage, assemble clips via FFmpeg and Remotion.