What problem does it solve?
This Skill helps you design, propagate, and debug context.Context usage in Go so cancellation, deadlines, and request-scoped values flow correctly through your application.
Core Features & Use Cases
- Context Propagation: Keeps ctx as the first parameter and preserves the caller's cancellation chain across services, databases, HTTP clients, and goroutines.
- Safe Request-Scoped Values: Shows how to use unexported key types and typed helpers for request IDs, auth principals, and tracing metadata without collisions.
- Cancellation and Background Work: Covers WithCancel, WithTimeout, AfterFunc, and WithoutCancel for long-running tasks, retries, and fire-and-forget work.
- Use Case: A Go handler calls downstream services and DB queries with the same ctx, while an audit goroutine continues safely after the response finishes.
Quick Start
Use the go-context skill to review my Go code for incorrect context propagation, unsafe value keys, and missing cancellation handling.