Go patterns
Go development patterns: testing, concurrency, errors, review, and conventions.From its SKILL.md
npx -y skills add notque/vexjoy-agent --skill go-patternsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
7.0 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it
Go Patterns Skill
Umbrella skill for Go development: testing, concurrency, error handling, failure modes, code review, SAP CC conventions, and quality gates. Routes to the correct reference based on the Go task at hand.
Reference Loading Table
| Signal | Load These Files | Why |
|---|---|---|
| Testing | testing.md | Writing, fixing, or reviewing Go tests |
| Concurrency | concurrency.md | Goroutines, channels, sync primitives, race conditions |
| Error handling | error-handling.md | Error wrapping, sentinels, custom types, errors.Is/As |
| Review patterns | preferred-patterns.md | Detecting code smells, over-engineering, bad Go patterns |
| Code review | code-review.md | Reviewing Go code or PRs for quality |
| SAP CC conventions | sapcc-conventions.md | Working in sapcc/* repos with go-bits |
| Quality gate | quality-gate.md | Running make check, linting, pre-commit validation |
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 |
| Review patterns | references/preferred-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
Review-pattern sub-references:
${CLAUDE_SKILL_DIR}/references/preferred-patterns/code-examples.md-- Extended before/after for all 7 failure modes
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:
${CLAUDE_SKILL_DIR}/references/sapcc-conventions/sapcc-code-patterns.md-- Primary reference: code patterns, testing patterns, failure modes (merged from testing-patterns-detailed.md and preferred-patterns.md)${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.md-- Lead + secondary review standards (merged)${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
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.
What ships with it: 39 files
444.3 KB alongside SKILL.md, 12 of them executable
references/
- code-review/common-review-comments.md6.6 KB
- code-review.md12.0 KB
- concurrency/concurrency-patterns.md5.3 KB
- concurrency.md11.5 KB
- error-handling.md10.7 KB
- error-handling/patterns.md4.2 KB
- preferred-patterns/code-examples.md11.6 KB
- preferred-patterns.md12.5 KB
- quality-gate/common-lint-errors.json7.6 KB
- quality-gate/examples.md11.1 KB
- quality-gate/expert-review-patterns.md4.5 KB
- quality-gate/makefile-targets.json5.1 KB
- quality-gate.md7.4 KB
- sapcc-conventions/api-design-detailed.md22.7 KB
- sapcc-conventions/architecture-patterns.md18.6 KB
- sapcc-conventions/build-ci-detailed.md18.7 KB
- sapcc-conventions/error-handling-detailed.md20.1 KB
- sapcc-conventions/extended-patterns.md7.1 KB
- sapcc-conventions/go-bits-philosophy-detailed.md24.5 KB
- sapcc-conventions/library-reference.md14.0 KB
- sapcc-conventions.md34.6 KB
- sapcc-conventions/pr-mining-insights.md17.5 KB
- sapcc-conventions/review-standards.md10.5 KB
- sapcc-conventions/sapcc-code-patterns.md46.2 KB
- testing/go-benchmark-and-concurrency.md5.3 KB
- testing/go-test-patterns.md9.0 KB
- testing.md9.4 KB
scripts/
- bench-compare.shruns7.1 KB
- check-errors.shruns7.1 KB
- check-interface-compliance.shruns6.4 KB
- check-sapcc-auth-ordering.shruns5.5 KB
- check-sapcc-httptest.shruns4.4 KB
- check-sapcc-identify-endpoint.shruns5.8 KB
- check-sapcc-json-strict.shruns4.9 KB
- check-sapcc-time-now.shruns4.2 KB
- check-sapcc-todo-format.shruns4.1 KB
- gen-table-test.shruns4.2 KB
- quality_checker.pyruns16.2 KB
- validate.pyruns6.3 KB