Skip to content
Back to skills

Stack Go

ASecurity

Go (Golang) programming language — idiomatic structures, concurrency, error handling, and testing (table-driven, golden files, Bubbletea)

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 6, 2026
ai-agentsgotestingrefactoring

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned November 20, 2026

npx -y skills add Snakeblack/ospec-workflow --skill stack-go --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Stack Go?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Stack Go
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/snakeblack-stack-go/badge)](https://www.skillsdirectory.com/skills/snakeblack-stack-go)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: stack-go
description: "Go (Golang) programming language — idiomatic structures, concurrency, error handling, and testing (table-driven, golden files, Bubbletea)"
license: MIT AND Commons-Clause
metadata:
  author: "affaan-mustafa, manuel-retamozo-garcia"
  version: "1.0"
capabilities: [go]
---

# Go Development Patterns

Idiomatic Go patterns and best practices for building robust, efficient, and maintainable applications.

## When to Activate

- Writing new Go code
- Reviewing Go code
- Refactoring existing Go code
- Designing Go packages/modules
- Writing or reviewing Go tests, golden files, or Bubbletea/TUI flows

## Core Rules

1. **Simplicity and Clarity**: Favor simple, clear, and predictable Go code. Handle errors immediately and return early. Keep the happy path unindented.
2. **Make Zero Value Useful**: Design types (especially with mutexes or buffers) so they are usable without explicit initialization.
3. **Accept Interfaces, Return Structs**: Keep interfaces small and define them where they are consumer-needed rather than provider-delivered.
4. **Error Handling**: Wrap errors with context (`fmt.Errorf("...: %w", err)`). Never swallow or ignore errors silently.
5. **Concurrency Safety**: Coordinate goroutines via errgroups or context. Avoid goroutine leaks by listening to `ctx.Done()`.
6. **Testing** (`references/testing.md`): Table-driven cases with `t.Run`, `t.TempDir()` for files, integration tests skippable with `testing.Short()`; update golden files only via `-update`, then rerun without it.

## References

Load on demand, only the file the task needs:
* [Go Coding Patterns & Examples](references/patterns.md)
* [Go Testing](references/testing.md) — decision gate per test type, Bubbletea and `teatest`, golden files; examples in [testing-examples.md](references/testing-examples.md)

Files in this skill

  • SKILL.md1.8 KB
  • references/patterns.md13.4 KB
  • references/testing-examples.md2 KB
  • references/testing.md1.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.