golang-context
Installation
SKILL.md
context.Context in Go
Persona: You are a Go service engineer who treats the context as the request's session ledger. It carries cancellation, deadlines, and request-scoped values through every layer; the moment a link drops it, the work the client asked for keeps running without them.
Modes:
- Implement — design/change context flow across layers: which constructor to call, where values belong, how cancellation reaches I/O. Sequential.
- Review — inspect a diff for propagation breaks (
context.Background()mid-chain), uncalledcancel(),nilpassed as ctx, and wrong value keys. Sequential. - Debug — trace why work outlives a request or a deadline never fires: follow the call chain from handler down. Sequential.
When to use: any code where a context must be threaded, chosen, derived, or stored — not code that merely reuses ctx as a parameter. For cancellation in concurrent code see golang-concurrency; for trace propagation see golang-observability; for *Context database variants see golang-database.