diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-03 22:57:52 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-03 22:57:52 +0200 |
| commit | c74f5ba6ad54760ac4a2010a381148082a86941e (patch) | |
| tree | 7890d375f043b7b51300556da679d9f9195c42f2 | |
| parent | 1e6a156c59c9808aab8ac11a6f08a79cddb4e719 (diff) | |
add 100 go mistakes skill
101 files changed, 2034 insertions, 0 deletions
diff --git a/prompts/skills/100-go-mistakes/SKILL.md b/prompts/skills/100-go-mistakes/SKILL.md new file mode 100644 index 0000000..0dd9633 --- /dev/null +++ b/prompts/skills/100-go-mistakes/SKILL.md @@ -0,0 +1,139 @@ +--- +name: 100-go-mistakes +description: Audits Go code repositories for common mistakes as identified in the "100 Go Mistakes and How to Avoid Them" book. Use this skill when asked to review Go code, check for best practices, or find common anti-patterns in Go. +--- + +# 100 Go Mistakes + +This skill helps you identify and fix the most common mistakes made by Go developers. It is based on the book "100 Go Mistakes and How to Avoid Them" by Teiva Harsanyi. + +## Workflow + +1. **Trigger**: When asked to review Go code or find mistakes, activate this skill. +2. **Analysis**: Use the list below to identify potential areas of concern in the target repository. +3. **Reference**: Read the specific mistake documentation in the `references/` folder to understand the mistake and how to fix it. +4. **Action**: Suggest or apply fixes to the codebase. + +## List of Mistakes + +### 1. Code and Project Organization +- [Mistake #1: Unintended variable shadowing](references/mistake-01-unintended-variable-shadowing.md) +- [Mistake #2: Unnecessary nested code](references/mistake-02-unnecessary-nested-code.md) +- [Mistake #3: Misusing init functions](references/mistake-03-misusing-init-functions.md) +- [Mistake #4: Overusing getters and setters](references/mistake-04-overusing-getters-and-setters.md) +- [Mistake #5: Interface pollution](references/mistake-05-interface-pollution.md) +- [Mistake #6: Interface on the producer side](references/mistake-06-interface-on-the-producer-side.md) +- [Mistake #7: Returning interfaces](references/mistake-07-returning-interfaces.md) +- [Mistake #8: any says nothing](references/mistake-08-any-says-nothing.md) +- [Mistake #9: Being confused about when to use generics](references/mistake-09-being-confused-about-when-to-use-generics.md) +- [Mistake #10: Not being aware of the possible problems with type embedding](references/mistake-10-not-being-aware-of-the-possible-problems-with-type-embedding.md) +- [Mistake #11: Not using the functional options pattern](references/mistake-11-not-using-the-functional-options-pattern.md) +- [Mistake #12: Project misorganization](references/mistake-12-project-misorganization-project-structure-and-package-organization.md) +- [Mistake #13: Creating utility packages](references/mistake-13-creating-utility-packages.md) +- [Mistake #14: Ignoring package name collisions](references/mistake-14-ignoring-package-name-collisions.md) +- [Mistake #15: Missing code documentation](references/mistake-15-missing-code-documentation.md) +- [Mistake #16: Not using linters](references/mistake-16-not-using-linters.md) + +### 2. Data Types +- [Mistake #17: Creating confusion with octal literals](references/mistake-17-creating-confusion-with-octal-literals.md) +- [Mistake #18: Neglecting integer overflows](references/mistake-18-neglecting-integer-overflows.md) +- [Mistake #19: Not understanding floating-points](references/mistake-19-not-understanding-floating-points.md) +- [Mistake #20: Not understanding slice length and capacity](references/mistake-20-not-understanding-slice-length-and-capacity.md) +- [Mistake #21: Inefficient slice initialization](references/mistake-21-inefficient-slice-initialization.md) +- [Mistake #22: Being confused about nil vs. empty slice](references/mistake-22-being-confused-about-nil-vs-empty-slice.md) +- [Mistake #23: Not properly checking if a slice is empty](references/mistake-23-not-properly-checking-if-a-slice-is-empty.md) +- [Mistake #24: Not making slice copies correctly](references/mistake-24-not-making-slice-copies-correctly.md) +- [Mistake #25: Unexpected side effects using slice append](references/mistake-25-unexpected-side-effects-using-slice-append.md) +- [Mistake #26: Slices and memory leaks](references/mistake-26-slices-and-memory-leaks.md) +- [Mistake #27: Inefficient map initialization](references/mistake-27-inefficient-map-initialization.md) +- [Mistake #28: Maps and memory leaks](references/mistake-28-maps-and-memory-leaks.md) |
