What problem does it solve?
This Skill helps you correctly design, audit, and fix context.Context usage across Go applications so cancellation, deadlines, and request-scoped data flow cleanly through every layer.
Core Features & Use Cases
- Propagation Discipline: Keep the same context moving from HTTP handlers to services, databases, and external APIs.
- Cancellation and Timeouts: Apply WithCancel, WithTimeout, WithDeadline, and proper cancel cleanup to avoid leaks and stuck work.
- Request-Scoped Values: Use unexported keys for trace IDs, tenant IDs, and other metadata without polluting function parameters.
- Background Work: Use WithoutCancel when asynchronous work must survive past the request lifecycle.
- Practical Review Support: Catch common Go mistakes such as storing context in structs, using Background in the middle of a request, or forgetting context-aware database and HTTP calls.
Quick Start
Use the golang-context skill to review this Go code and fix its context propagation, cancellation, timeout, and request-value handling.