go-context-cancellation

Implement Go functions that accept context and check ctx.Done() for cancellation.

3|Updated Nov 28, 2025
One-click install
npx skills add https://github.com/JamesPrial/claudefiles --skill go-context-cancellation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-context-cancellation
Source: https://github.com/JamesPrial/claudefiles/tree/main/skills/golang/concurrency/context
Command: npx skills add https://github.com/JamesPrial/claudefiles --skill go-context-cancellation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill emphasizes passing context and checking ctx.Done() to enable graceful shutdown of long-running operations.

Core Features & Use Cases

  • Context First: Function signatures start with context.Context.
  • Cancellation Propagation: Downstream calls receive the same context.
  • Time Limits: Use WithTimeout/WithDeadline to bound work.

Quick Start

Implement a function that takes context and respects cancellation in a loop.