golang-context
Idiomatic context.Context usage in Golang — creation, propagation, cancellation, timeouts, deadlines, context values, and cross-service tracing. Apply when working with context.Context in any Go code.
供給アセットの概要
コーディングと開発 Agent
コードレビュー、リポジトリ分析、テスト、CI、GitHub、DevOps、開発ワークフロー向けのスキルです。
シナリオ
コーディング Agent
リポジトリを理解し、コードを編集し、プルリクエストをレビューできるコーディング Agent が必要です。
Agent 適合
Claude Code + CLI + Codex
Codex、Claude Code、Cursor、CLI、またはカスタム Agent に対応します。
インストール
準備完了
npx skills add yzfly/skills --skill golang-context
メンテナンス
新しい
本日プッシュ
リスク
要レビュー
Dependency or permission surface needs review
GitHub 品質
12
58/100 品質 · 70/100 信頼
対象タグ
レビュー注記
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent 導入スコアカード
信頼、監査、インストール準備状況を一目で確認
公開リポジトリのメタデータ、OpenAgentSkill のレビューシグナル、保守の鮮度、インストール準備状況を組み合わせたスコアです。候補選定の目安であり、人によるレビューの代替ではありません。
品質
有望有用な候補ですが、採用前に代替と比較してください。
信頼
サンドボックス限定信頼シグナルが不足または混在する有用な候補です。結果ループがタスク適合を示すまで、隔離されたワークスペースで使用してください。
監査
要レビューインストール準備、安全メタデータ、保守、採用リスクの機械可読なレビュー。
OpenAgentSkill Trust Score v5
インストール前に人のレビュー
実作業で使う前に、サンドボックスでのみ実行し、近い代替と比較してください。
スター
GitHub スター 12
リポジトリ活動
スター 12、フォーク 2
メンテナンス
本日プッシュ
ライセンス
MIT
インストール
npx skills add yzfly/skills --skill golang-context
インストール安全性
標準パッケージまたはランタイムのインストールパス
権限範囲
shell or command execution, network or browser access
Agent の成果
Agent の成果データはまだありません
ドキュメント
README/SKILL.md の文脈が十分です
リスク概要
本番前にレビュー
- Low GitHub adoption signal
- Quality score needs review
- Permission surface needs review: shell or command execution, network or browser access
- GitHub adoption: 12 GitHub stars
インストール準備状況
インストールパスを利用可能
- インストールパスを利用できます
- リポジトリの根拠を利用できます
- ライセンスが明示されています
- Agent-Proven の成果エビデンスはまだありません
Agent 可読メタデータ
このスキルの機械可読な判断データ。
このブロックまたは埋め込み JSON を使い、Agent がこのスキルをインストールすべきか、代替を選ぶべきか、先に人のレビューを求めるべきかを判断できます。
適したタスク
- コーディング Agent ワークフロー
- Claude Code チーム
- builders willing to evaluate younger projects
- Inspect source files
適した Agent
インストール判断
- コマンド
- npx skills add yzfly/skills --skill golang-context
- ポリシー
- レビュー
- 人によるレビュー
- はい
信頼とリスク
- 信頼
- 62/100
- 監査
- 75/100
- リスクレベル
- 要レビュー
成果ループ
- エンドポイント
- /api/agent/outcome
- イベント ID
- resolve
- 成果
- 5
使わない場合
- ベンダー提供の SLA が必要なチーム
- production agents without a repository review
- Low GitHub adoption signal
- OpenAgentSkill の利用フィードバックはまだありません
- 高リスク権限のヒント: Shell またはコマンド実行
代替スキル
Code Review
168.6K スター
npx skills add mattpocock/skills --skill code-review
代替スキル
Grill With Docs
164.7K スター
npx skills add mattpocock/skills --skill grill-with-docs
代替スキル
To Spec
164.7K スター
npx skills add mattpocock/skills --skill to-spec
代替スキル
To Tickets
176.7K スター
npx skills add mattpocock/skills --skill to-tickets
Agent セーフティ v2
47/100 · 自動インストールを避ける
Sparse or mixed signals. Useful for discovery, but not for autonomous installation.
Test manually in an isolated workspace and compare against safer alternatives.
高
Shell またはコマンド実行
Skill メタデータに端末、CLI、Shell、サブプロセス、またはコマンド実行のワークフローが含まれます。
中
ネットワークアクセス
Skill はリモートページ、API、リポジトリ、外部サービスにアクセスする可能性があります。
中
データベースアクセス
Skill はスキーマを確認し、データベースを照会し、永続ストアを扱う可能性があります。
- 高リスク権限のヒント: Shell またはコマンド実行
- Dependency or permission surface needs review
インストール先
Agent ワークフローにこのスキルをインストール
公開インストールエンドポイントからコマンド、安全チェックリスト、対象プロンプト、正規リンクを取得します。
OpenAgentSkill CLI
Resolve policy, run the source installer safely, and report a verified install receipt.
$ npx --yes https://github.com/Leon-Drq/openagentskill/releases/download/cli-v0.2.1/openagentskill-0.2.1.tgz install yzfly-golang-contextAgent 解決プラン
インストール前に Agent に適合性を検証させます。
Resolve API は第一候補、代替、安全ポリシー、監査メモ、インストール先、Agent がそのまま使えるプロンプトを返します。
JSON を開く
/api/agent/resolve?task=Use%20golang-context%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve テキスト
/api/agent/resolve?task=Use%20golang-context%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
インストール引き継ぎ
/api/skills/yzfly-golang-context/install
Agent が確認すべきこと
- Resolve API でタスク適合と代替を確認。
- 監査・信頼スコアと安全ポリシーの警告を確認。
- Codex、Claude Code、Cursor、CLI のインストール先互換性を確認。
プロンプトをコピー
Task: Use golang-context in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20golang-context%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/yzfly-golang-context/install
Install command: npx skills add yzfly/skills --skill golang-context
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent 引き継ぎ
別のディレクトリではなく、インストール経路を Agent に渡します。
公開インストールエンドポイントからコマンド、安全チェックリスト、対象プロンプト、正規リンクを取得します。
インストール引き継ぎ
/api/skills/yzfly-golang-context/install
LLM テキスト形式
/api/skills/yzfly-golang-context/install?format=text
代替を探す
/api/skills/search?q=golang-context&limit=3
Agent プロンプト
Use golang-context for this task. Review https://www.openagentskill.com/api/skills/yzfly-golang-context/install, then install with: npx skills add yzfly/skills --skill golang-contextRegistry メタデータ
自動スキル選択用の Agent 可読プロファイル。
Registry API 経由で判断、信頼、監査、ユースケース、インストールのシグナルを提供し、UI をスクレイピングせずに Agent が順位付けできます。
Manifest
/api/registry/manifest/yzfly-golang-context
LLM テキスト
/api/registry/manifest/yzfly-golang-context?format=text
インストール別名
/api/registry/install/yzfly-golang-context
推奨
/api/registry/recommend?task=Use%20golang-context%20in%20an%20agent%20workflow&limit=3
Agent 適合
コーディング Agent
プラットフォーム
Claude Code
Agent 判断パネル
Needs validation for Coding agents
Agent ワークフローに追加する前に手動でリポジトリをレビューしてください。
スタック内の役割
検証が必要
主な適合
コーディング Agent
信頼ラベル
手動レビューが必要
インストールパス
コマンド準備済み
使う場面
- コーディング Agent ワークフロー
- Claude Code チーム
- builders willing to evaluate younger projects
根拠
- 最近のリポジトリ活動
- インストールコマンドまたは GitHub リポジトリが利用可能
- 品質プロファイル 58/100
先にレビュー
- Low GitHub adoption signal
- OpenAgentSkill の利用フィードバックはまだありません
実装パス
- 1サンドボックスの Agent にインストールし、コーディング Agent タスクを一度最初から最後まで実行します。
- 2Compare output quality, latency, and failure behavior against at least one alternative.
- 3Promote it into production only after reviewing repository permissions, license, and maintenance signals.
信頼プロファイル
サンドボックス限定
信頼シグナルが不足または混在する有用な候補です。結果ループがタスク適合を示すまで、隔離されたワークスペースで使用してください。
GitHub 採用度
修正GitHub スター 12
スター/フォーク活動
修正スター 12、フォーク 2; 現在のメタデータでは Issue 活動を利用できません
最近のメンテナンス
合格本日プッシュ
ライセンスの明確さ
合格MIT
良いシグナル
- AI レビュー承認済み
- インストールパスを利用できます
- リポジトリの根拠を利用できます
- 最近保守されたリポジトリ
- インストールコマンドに明確な高リスクパターンはありません
- 成果ループは準備済みですが、最初の実行が必要です
インストール前にレビュー
- Low GitHub adoption signal
- Quality score needs review
- Permission surface needs review: shell or command execution, network or browser access
- GitHub adoption: 12 GitHub stars
- Stars/forks activity: 12 stars, 2 forks; issue activity unavailable in current metadata
- Dependency/runtime risk: command execution surface, network or browser surface
- Permission surface: shell or command execution, network or browser access
- 実際の Agent 成果レポートはまだありません
- 無人インストールの前に人によるレビューが必要です
推奨アクション
実作業で使う前に、サンドボックスでのみ実行し、近い代替と比較してください。
品質プロファイル
有望 Agent ワークフロー向けの候補
有用な候補ですが、採用前に代替と比較してください。
ワークフロー適合
このスキルを使うシナリオ
Build and ship code
Coding agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Manage repositories
GitHub automation
I need my agent to triage GitHub issues, review pull requests, and summarize repository changes.
Operate web apps
Browser automation
I need my agent to control a browser, fill forms, and verify web app workflows.
ワークフロー適合
完全なワークフローに追加
Inspect, patch, and verify code
Coding review agent
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Operate and verify web apps
Browser QA agent
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Design, build, test, and ship interfaces
Frontend and UI
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
代替候補
インストール前に比較
このタスクに適する可能性のある類似スキル。
Code Review
Review a branch or diff against repository standards and the originating spec in two independent analysis passes.
Grill With Docs
A relentless interview that pressure-tests a plan against the codebase, sharpens domain language, and updates CONTEXT.md and ADRs when decisions become durable.
To Spec
Turn the current conversation and codebase context into a structured implementation spec, then publish it to the configured project issue tracker.
To Tickets
Break a plan, spec, or conversation into independently actionable tracer-bullet tickets with explicit blocking relationships.
概要
--- name: golang-context description: "Idiomatic context.Context usage in Golang — creation, propagation, cancellation, timeouts, deadlines, context values, and cross-service tracing. Apply when working with context.Context in any Go code." user-invocable: true license: MIT compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. metadata: author: samber version: "1.1.1" openclaw: emoji: "🔗" homepage: https://github.com/samber/cc-skills-golang requires: bins: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent ---
> **Community default.** A company skill that explicitly supersedes `samber/cc-skills-golang@golang-context` skill takes precedence.
# Go context.Context Best Practices
`context.Context` is Go's mechanism for propagating cancellation signals, deadlines, and request-scoped values across API boundaries and between goroutines. Think of it as the "session" of a request — it ties together every operation that belongs to the same unit of work.
## Best Practices Summary
1. The same context MUST be propagated through the entire request lifecycle: HTTP handler → service → DB → external APIs 2. `ctx` MUST be the first parameter, named `ctx context.Context` 3. NEVER store context in a struct — pass explicitly through function parameters 4. NEVER pass `nil` context — use `context.TODO()` if unsure 5. `cancel()` MUST always be deferred immediately after `WithCancel`/`WithTimeout`/`WithDeadline` 6. `context.Background()` MUST only be used at the top level (main, init, tests) 7. **Use `context.TODO()`** as a placeholder when you know a context is needed but don't have one yet 8. NEVER create a new `context.Background()` in the middle of a request path 9. Context value keys MUST be unexported types to prevent collisions 10. Context values MUST only carry request-scoped metadata — NEVER function parameters 11. **Use `context.WithoutCancel`** (Go 1.21+) when spawning background work that must outlive the parent request
## Creating Contexts
| Situation | Use | | --- | --- | | Entry point (main, init, test) | `context.Background()` | | Function needs context but caller doesn't provide one yet | `context.TODO()` | | Inside an HTTP handler | `r.Context()` | | Need cancellation control | `context.WithCancel(parentCtx)` | | Need a deadline/timeout | `context.WithTimeout(parentCtx, duration)` |
## Context Propagation: The Core Principle
The most important rule: **propagate the same context through the entire call chain**. When you propagate correctly, cancelling the parent context cancels all downstream work automatically.
```go // ✗ Bad — creates a new context, breaking the chain func (s *OrderService) Create(ctx context.Context, order Order) error { return s.db.ExecContext(context.Background(), "INSERT INTO orders ...", order.ID) }
// ✓ Good — propagates the caller's context func (s *OrderService) Create(ctx context.Context, order Order) error { return s.db.ExecContext(ctx, "INSERT INTO orders ...", order.ID) } ```
## Deep Dives
- **[Cancellation, Timeouts & Deadlines](./references/cancellation.md)** — How cancellation propagates: `WithCancel` for manual cancellation, `WithTimeout` for automatic cancellation after a duration, `WithDeadline` for absolute time deadlines. Patterns for listening (`<-ctx.Done()`) in concurrent code, `AfterFunc` callbacks, and `WithoutCancel` for operations that must outlive their parent request (e.g., audit logs).
- **[Context Values & Cross-Service Tracing](./references/values-tracing.md)** — Safe context value patterns: unexported key types to prevent namespace collisions, when to use context values (request ID, user ID) vs function parameters. Trace context propagation: OpenTelemetry trace headers, correlation IDs for log aggregation, and marshaling/unmarshaling context across service boundaries.
- **[Context in HTTP Servers & Service Calls](./references/http-services.md)** — HTTP handler context: `r.Context()` for request-scoped cancellation, middleware integration, and propagating to services. HTTP client patterns: `NewRequestWithContext`, client timeouts, and retries with context awareness. Database operations: always use `*Context` variants (`QueryContext`, `ExecContext`) to respect deadlines.
## Cross-References
- → See the `samber/cc-skills-golang@golang-concurrency` skill for goroutine cancellation patterns using context - → See the `samber/cc-skills-golang@golang-database` skill for context-aware database operations (QueryContext, ExecContext) - → See the `samber/cc-skills-golang@golang-observability` skill for trace context propagation with OpenTelemetry - → See the `samber/cc-skills-golang@golang-design-patterns` skill for timeout and resilience patterns
## Enforce with Linters
Many context pitfalls are caught automatically by linters: `govet`, `staticcheck`. → See the `samber/cc-skills-golang@golang-lint` skill for configuration and usage.
技術詳細
- バージョン
- 1.0.0
- ライセンス
- MIT
- 最終更新
- 2026年8月23日
- 公開日
- 2026年8月23日
判断の要約
検証が必要
最近のリポジトリ活動
Agent 実証エビデンス
Agent 実証エビデンス
Resolve、レビュー、インストール、限定実行後の成果レポート。
- 成功率
- —
- 直近の失敗
- —
- 成果
- 0
- 出力品質
- —
- 失敗
- 0
- 非該当
- 0
- インストール数
- 0
- リスクによりブロック
- 0
- 設定が必要
- 0
- 本番
- 0
Agent の実行結果はまだありません。最初の実行では /api/agent/outcome を通じて成功、設定要件、リスクによるブロック、失敗、非該当を報告できます。
成長ループ
共有キット
golang-context 用のシナリオベース草案です。X へ手動投稿できます。
A practical pick for the next repo task: golang-context: Idiomatic context.Context usage in Golang — creation, propagation, cancellation, timeouts, deadlines, context values, and c... 12 stars https://www.openagentskill.com/skills/yzfly-golang-context?ref=x
任意:インストールコマンド付きの返信
Listing + install path for golang-context: https://www.openagentskill.com/skills/yzfly-golang-context?ref=x Install: npx skills add yzfly/skills --skill golang-context
掲載元
Registry により登録
この掲載は公開ソースから登録されており、メンテナー申請が承認されるまで公式として表示されません。
- 作成者
- yzfly
- ソース
- yzfly/skills
- インデックス作成者
- OpenAgentSkill コミュニティインデックス
帰属は公開リポジトリまたは作成者プロフィールにリンクされています。作成者は掲載を申請して所有権シグナルを更新できます。
このスキルを申請所有者の申請
このスキル掲載を申請
この Registry により登録 掲載は yzfly に帰属していますが、まだ公式として表示されていません。申請すると、確認済み所有者シグナルが追加され、今後の公開、インストール、監査更新の信頼性が高まります。
クリエイター被リンクキット
README にエビデンスバッジを追加
開発者がリポジトリを評価する場所で、正規掲載、現在の信頼・監査シグナル、実際の Agent-Proven エビデンスを表示します。
[](https://www.openagentskill.com/skills/yzfly-golang-context)
[](https://www.openagentskill.com/skills/yzfly-golang-context)
[](https://www.openagentskill.com/skills/yzfly-golang-context/audit)
[](https://www.openagentskill.com/skills/yzfly-golang-context)作者
yzfly
@yzfly
プラットフォーム適合
健全性シグナル
- GitHub スター
- 12
- 品質スコア
- 31/100
- 最終 GitHub プッシュ
- 2026年8月23日
- フレームワークのヒント
- 不明
- OpenAgentSkill 閲覧数
- 0
- インストールコピー数
- 0
- 外部クリック
- 0
コミュニティシグナル
このスキルが Agent ワークフローに役立つかを共有してください。集約されたフィードバックがランキングを改善します。
信頼と安全性
サンドボックス限定
- GitHub 採用度GitHub スター 12修正
- スター/フォーク活動スター 12、フォーク 2; 現在のメタデータでは Issue 活動を利用できません修正
- 最近のメンテナンス本日プッシュ合格
- ライセンスの明確さMIT合格
- README/SKILL.md の完全性メタデータには十分な利用・ワークフロー文脈があります合格
- 依存関係/ランタイムのリスクcommand execution surface, network or browser surface確認
関連スキル
Code Review
Review a branch or diff against repository standards and the originating spec in two independent analysis passes.
168.6K スターGrill With Docs
A relentless interview that pressure-tests a plan against the codebase, sharpens domain language, and updates CONTEXT.md and ADRs when decisions become durable.
164.7K スターTo Spec
Turn the current conversation and codebase context into a structured implementation spec, then publish it to the configured project issue tracker.
164.7K スターTo Tickets
Break a plan, spec, or conversation into independently actionable tracer-bullet tickets with explicit blocking relationships.
176.7K スター