golang-context
Design or repair context propagation, cancellation, deadlines, and request-scoped values in Go APIs.
Skill by reagin
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/reagin-golang-context
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: design
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/golang-context
What's inside
- Skill name
golang-context- Description
- Design or repair context propagation, cancellation, deadlines, and request-scoped values in Go APIs. Use when work crosses request, goroutine, network, or storage boundaries; not for routine formatting or code that already accepts and correctly forwards a context.
- License
- MIT
- Instructions
- 48 lines in SKILL.md · view on GitHub
Files (4)
- SKILL.md
- cancellation.md · references/
- http-services.md · references/
- values-tracing.md · references/
SKILL.md (first lines)
# Go Context Use `context.Context` to carry cancellation, deadlines, and request-scoped metadata across API boundaries. It is not a dependency container or a substitute for ordinary parameters. ## Inspect the lifecycle Before editing, trace the unit of work from its owner to every downstream call: - Where is the root context created? - Which caller owns cancellation and the deadline budget? - Which calls can block, spawn work, or cross a process boundary? - Does any child intentionally outlive its parent, and who owns that child? - Which values are genuinely request-scoped and cross-cutting? Read repository conventions and the minimum Go version in `go.mod`. Preserve established API contracts unless changing them is part of the request. ## API rules - Accept `ctx context.Context` as the first parameter of functions whose work can be cancelled or carries request metadata. Do not add context to pure, immediate helpers without a lifecycle need. - Pass the caller's context downstream rather than replacing it with `Background` in the middle of the call chain. - Do not pass `nil`; use a real parent or `context.TODO()` only as a visible temporary migration marker. - Prefer passing context per operation rather than storing it in a long-lived struct. A struct representing one operation may legitimately contain it when that API's documented lifecycle requires it. - Call a returned cancel function on every path once the derived context is no longer needed, unless ownership of cancellation is explicitly transferred. - A child cannot extend its parent's deadline. Before adding nested timeouts, decide which layer owns the budget and whether the shorter deadline is intentional. For cancellation, detached work, causes, and callbacks, read [cancellation and deadlines](references/cancellation.md). ## Boundary propagation Use context-aware APIs for outbound HTTP, database, RPC, and other blocking calls. A client-wide timeout and a request context solve different problems; keep both when both policies matter. See [HTTP and service boundaries](references/http-services.md). ## Values Use context values only for request-scoped metadata that must cross API boundaries without becoming a business parameter, such as trace state or a request ID. Define typed, package-owned accessors and avoid built-in string keys. See [values and tracing](references/values-tracing.md). ## Review checklist - Cancellation can reach every blocking stage that should stop. - Long loops or channel operations observe cancellation at useful interruption points. - Derived contexts release timers and references promptly. - Detached work has its own owner, timeout, error handling, and shutdown path. - Retries stop when the context is done and do not silently reset the caller's budget. - Returned errors preserve the distinction between cancellation, deadline expiry, and an operation failure when callers rely on it. Run focused tests through the project's existing commands. Prefer deterministic cancellation tests using channels or barriers over timing-only sleeps.
From reagin/agent-skills, MIT.
More from reagin/agent-skills
- 0.565score
golang-continuous-integration
reagin
Create, improve, or simplify GitHub Actions for a Go repository, including tests, linting, caching, matrices, and release gates.
SkillAFreshness: AClaude Code +9 - 0.565score
frontend-apple-design
reagin
Design or review Apple-inspired web interfaces with clear hierarchy, consistent typography and materials, restrained motion, and accessible interactions.
SkillAFreshness: AClaude Code +9 - 0.559score
frontend-ui-refinement
reagin
Refine existing web interfaces and simplify their behavioral tests.
SkillAFreshness: AClaude Code +9 - 0.559score
frontend-react-file-structure
reagin
Use for React TypeScript file-structure work involving ownership or folders for new or moved files, multi-file components with narrow public entries, page and…
SkillAFreshness: AClaude Code +9 - 0.529score
golang-design-patterns
reagin
Select or review idiomatic Go patterns for constructors, configuration, lifecycle, resilience, streaming, data flow, and package boundaries.
SkillBFreshness: BClaude Code +9 - 0.529score
golang-benchmark
reagin
Design, run, and interpret Go benchmarks, profiles, traces, and compiler diagnostics.
SkillBFreshness: BClaude Code +9 - 0.529score
golang-cli
reagin
Design or review the framework-independent behavior and architecture of Go command-line applications: command UX, flags, configuration, output and exit…
SkillBFreshness: BClaude Code +9 - 0.529score
golang-concurrency
reagin
Design or review concurrent Go code involving goroutines, channels, locks, atomics, worker pools, or race and leak symptoms.
SkillBFreshness: BClaude Code +9 - 0.529score
golang-error-handling
reagin
Design or review Go error creation, wrapping, inspection, aggregation, logging boundaries, transport mapping, and panic recovery.
SkillBFreshness: BClaude Code +9 - 0.529score
golang-gopls
reagin
Use gopls through an available host LSP integration, MCP surface, or CLI for semantic Go navigation, references, implementations, call hierarchy, diagnostics…
SkillBFreshness: BClaude Code +9 - 0.526score
golang-database
reagin
Implement or review Go relational-database code using database/sql, pgx, sqlx, or an existing data layer.
SkillBFreshness: BClaude Code +9 - 0.526score
golang-data-structures
reagin
Choose or review Go collections and memory representations when access patterns, ownership, copying, allocation, or generic APIs matter.
SkillBFreshness: BClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Aug 25, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/reagin/agent-skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from reagin
- 0.565score
frontend-apple-design
reagin
Design or review Apple-inspired web interfaces with clear hierarchy, consistent typography and materials, restrained motion, and accessible interactions.
SkillAFreshness: AClaude Code +9 - 0.565score
golang-continuous-integration
reagin
Create, improve, or simplify GitHub Actions for a Go repository, including tests, linting, caching, matrices, and release gates.
SkillAFreshness: AClaude Code +9 - 0.559score
frontend-react-file-structure
reagin
Use for React TypeScript file-structure work involving ownership or folders for new or moved files, multi-file components with narrow public entries, page and…
SkillAFreshness: AClaude Code +9 - 0.559score
frontend-ui-refinement
reagin
Refine existing web interfaces and simplify their behavioral tests.
SkillAFreshness: AClaude Code +9 - 0.529score
golang-benchmark
reagin
Design, run, and interpret Go benchmarks, profiles, traces, and compiler diagnostics.
SkillBFreshness: BClaude Code +9 - 0.529score
golang-concurrency
reagin
Design or review concurrent Go code involving goroutines, channels, locks, atomics, worker pools, or race and leak symptoms.
SkillBFreshness: BClaude Code +9
Cite this page
golang-context skill. Agent Mart. https://agentmart.dev/skills/reagin-golang-context (last updated 2026-10-24)