Skip to content
Back to skills

Senior Go

ASecurity

Use when designing, implementing, debugging, reviewing, or refactoring Go services, CLIs, or libraries, including packages and interfaces, error handling, context, goroutines and channels, concurrency, HTTP or gRPC servers, database access, modules, tests, benchmarks, or profiling.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 26, 2026
ai-agentsgosqltestingdebuggingrefactoringapidatabaseperformance

Works with

  • cli
  • api

Security analysis

A100/100

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

Scanned November 26, 2026

npx -y skills add a365ngay/CogniRouter --skill senior-go --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Senior Go?

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

Security grade badge for Senior Go
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/a365ngay-senior-go/badge)](https://www.skillsdirectory.com/skills/a365ngay-senior-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: senior-go
description: Use when designing, implementing, debugging, reviewing, or refactoring Go services, CLIs, or libraries, including packages and interfaces, error handling, context, goroutines and channels, concurrency, HTTP or gRPC servers, database access, modules, tests, benchmarks, or profiling.
---

# Senior Go

## Role

Write idiomatic Go: small packages with clear APIs, explicit error handling, context-aware and leak-free concurrency, and code that `go vet` and the race detector accept.

## Before Editing

1. Inspect Go version, module layout (`cmd/`, `internal/`, `pkg/`), HTTP/gRPC framework, database layer (database/sql, sqlx, pgx, GORM, sqlc), configuration, logging (`slog`, zap, zerolog), linters (`golangci-lint`), and test conventions.
2. Trace the request or job from handler through context, validation, service logic, storage, and external calls.
3. Follow the existing structure; do not add a framework, DI container, or abstraction layer for one change.

## Implementation Rules

- Return errors, do not panic, in library and request paths. Wrap with context (`fmt.Errorf("load user %d: %w", id, err)`) and check with `errors.Is`/`errors.As`. Never ignore an error silently.
- Accept `context.Context` as the first parameter for request-scoped work; respect cancellation and deadlines in I/O and loops.
- Every goroutine needs a clear owner and exit path. Use `errgroup`, `sync.WaitGroup`, or channels with defined close semantics; protect shared state with mutexes or confine it to one goroutine.
- Define small interfaces where they are consumed, not where implemented. Keep exported API surface minimal and documented.
- Close resources (`defer rows.Close()`, response bodies) and check `rows.Err()`. Set timeouts on HTTP clients and servers.
- Use parameterized queries, validate input, and never log secrets. Use structured logging consistent with the project.

## Testing and Verification

Run `gofmt`/`goimports`, `go vet`, the project's linter, and `go test ./... -race`. Prefer table-driven tests; add benchmarks for performance-sensitive changes and use `pprof` for evidence.

## Review Checklist

- Are all errors handled or deliberately returned with context?
- Can any goroutine leak, deadlock, or race?
- Is context propagated and honored for I/O?
- Are interfaces and packages small, and is the exported API intentional?

Files in this skill

  • SKILL.md2.3 KB
  • agents/openai.yaml169 B

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.