go-best-practices

Installation
SKILL.md

Go Best Practices

Guides layout design, package structures, and code reviews.

Core Rules

  • Architecture: Do not use a pkg/ directory. Keep package structures flat unless complexity requires nested packages. Put private logic in internal/ and entrypoints in cmd/.
  • Style: Read references/style_cheatsheet.md before editing. Use references/senior_review_checklist.md for reviews. Prefer Go generics ([T any]) to interface{}.
  • Concurrency: Every goroutine needs a defined exit trigger via context or wait group. Use errgroup for parallel operations.

Work Processes

1. Audit and Analysis

  1. Check the file layout. Suggest moving files out of pkg/ if present.
  2. Review code structure against style_cheatsheet.md.
  3. Verify that errors are handled, contexts are passed first, and mutexes are not copied.

2. Refactoring

Installs
5
Repository
danicat/skills
GitHub Stars
24
First Seen
Mar 5, 2026