golang-context
Idiomatic context.Context usage in Golang — propagation through API boundaries, cancellation, timeouts and deadlines, request-scoped values, context.WithoutCancel for background work outliving requests. Apply when designing context propagation across layers, debugging leaked or u
Profil aset
Agent pemrograman dan pengembangan
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Skenario
Agent pemrograman
I need a coding agent that can understand a repository, edit code, and review pull requests.
Kecocokan Agent
Claude Code + OpenAI Agents + CLI
Cocok untuk Codex, Claude Code, Cursor, CLI, atau Agent khusus.
Pasang
Siap
npx skills add samber/cc-skills-golang --skill golang-context
Pemeliharaan
Terkini
2 hari sejak push
Risiko
Perlu ditinjau
Dependency or permission surface needs review
Kualitas GitHub
3.0K
82/100 Kualitas · 79/100 Kepercayaan
Tag cakupan
Catatan ulasan
Dependency or permission surface needs review · Permission surface may require sandboxing
Kartu adopsi Agent
Kepercayaan, audit, dan kesiapan pemasangan dalam sekali lihat
Skor ini menggabungkan metadata repositori publik, sinyal ulasan OpenAgentSkill, kebaruan pemeliharaan, dan kesiapan pemasangan. Ini adalah sinyal shortlist, bukan pengganti peninjauan manusia.
Kualitas
KuatSolid option that is likely worth shortlisting for production workflows.
Kepercayaan
Hanya sandboxKandidat berguna dengan sinyal kepercayaan yang kurang atau bercampur. Gunakan di ruang kerja terisolasi hingga loop hasil membuktikan kecocokan tugas.
Audit
Perlu ditinjauTinjauan yang dapat dibaca mesin tentang kesiapan pemasangan, metadata keamanan, pemeliharaan, dan risiko adopsi.
Trust Score OpenAgentSkill v5
Tinjauan manusia sebelum pemasangan
Jalankan hanya dalam sandbox dan bandingkan alternatif terdekat sebelum digunakan untuk kerja nyata.
Star
3.0K star GitHub
Aktivitas repositori
3.0K star dan 197 fork
Pemeliharaan
2 hari sejak push
Lisensi
MIT
Pasang
npx skills add samber/cc-skills-golang --skill golang-context
Keamanan pemasangan
Jalur pemasangan paket atau runtime standar
Cakupan izin
shell or command execution, network or browser access
Hasil Agent
Belum ada data hasil Agent
Dokumentasi
Konteks README/SKILL.md kuat
Ringkasan risiko
Tinjau sebelum produksi
- Quality score needs review
- Permission surface needs review: shell or command execution, network or browser access
- Dependency/runtime risk: command execution surface, network or browser surface
- Permission surface: shell or command execution, network or browser access
Kesiapan pemasangan
Jalur pemasangan tersedia
- Jalur pemasangan tersedia
- Bukti repositori tersedia
- Lisensi dinyatakan
- Belum ada bukti hasil Agent-Proven
Metadata yang dapat dibaca Agent
Data keputusan yang dapat dibaca mesin untuk skill ini.
Gunakan blok ini atau JSON tersemat untuk memutuskan apakah Agent perlu memasang skill ini, memilih alternatif, atau meminta tinjauan manusia terlebih dahulu.
Tugas yang sesuai
- alur kerja Agent pemrograman
- Tim Claude Code
- Tim yang menghargai sinyal adopsi GitHub
- Inspect source files
Agent yang sesuai
Keputusan pemasangan
- Perintah
- npx skills add samber/cc-skills-golang --skill golang-context
- Kebijakan
- Tinjau
- Tinjauan manusia
- Ya
Kepercayaan dan risiko
- Kepercayaan
- 71/100
- Audit
- 84/100
- Tingkat risiko
- Perlu ditinjau
Lingkar hasil
- Endpoint
- /api/agent/outcome
- ID event
- resolve
- Hasil
- 5
Perintah pemasangan
npx skills add samber/cc-skills-golang --skill golang-contextJangan gunakan ketika
- Tim yang membutuhkan SLA dengan dukungan vendor
- Lingkungan berkompliansi tinggi tanpa tinjauan keamanan internal
- No major risk signals from current metadata
- Petunjuk izin berisiko tinggi: eksekusi shell atau perintah
- Dependency or permission surface needs review
Skill alternatif
Frontend Design
170.9K Star
npx skills add anthropics/skills --skill frontend-design
Skill alternatif
Taste Skill: Anti-Slop Frontend
79.0K Star
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Skill alternatif
Canvas Design
170.9K Star
npx skills add anthropics/skills --skill canvas-design
Skill alternatif
Anthropic Brand Guidelines
170.9K Star
npx skills add anthropics/skills --skill brand-guidelines
Keamanan Agent v2
56/100 · Tinjau sebelum memasang
Sparse or mixed signals. Useful for discovery, but not for autonomous installation.
Test manually in an isolated workspace and compare against safer alternatives.
Tinggi
Eksekusi shell atau perintah
Metadata skill merujuk terminal, CLI, shell, subprocess, atau alur kerja eksekusi perintah.
Sedang
Akses jaringan
Skill kemungkinan mengambil halaman jarak jauh, API, repositori, atau layanan eksternal.
Sedang
Akses database
Skill dapat memeriksa skema, mengkueri database, atau bekerja dengan penyimpanan persisten.
- Petunjuk izin berisiko tinggi: eksekusi shell atau perintah
- Dependency or permission surface needs review
Target pemasangan
Pasang skill ini di alur Agent Anda
Gunakan endpoint publik untuk mengambil perintah, checklist keamanan, prompt target, dan tautan kanonis.
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 samber-golang-contextRencana resolusi Agent
Biarkan Agent memverifikasi kecocokan sebelum memasang.
API Resolve mengembalikan skill utama, alternatif, kebijakan keamanan, catatan audit, target pemasangan, dan prompt siap pakai.
Buka JSON
/api/agent/resolve?task=Use%20golang-context%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Teks Resolve
/api/agent/resolve?task=Use%20golang-context%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Serah-terima pemasangan
/api/skills/samber-golang-context/install
Agent harus memeriksa
- Task fit and alternatives from Resolve API.
- Audit score, trust score, and safety policy warnings.
- Install target compatibility for Codex, Claude Code, Cursor, or CLI.
Salin prompt
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/samber-golang-context/install
Install command: npx skills add samber/cc-skills-golang --skill golang-context
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Serah-terima Agent
Berikan jalur pemasangan kepada Agent, bukan direktori lain.
Gunakan endpoint publik untuk mengambil perintah, checklist keamanan, prompt target, dan tautan kanonis.
Serah-terima pemasangan
/api/skills/samber-golang-context/install
Format teks LLM
/api/skills/samber-golang-context/install?format=text
Cari alternatif
/api/skills/search?q=golang-context&limit=3
Prompt Agent
Use golang-context for this task. Review https://www.openagentskill.com/api/skills/samber-golang-context/install, then install with: npx skills add samber/cc-skills-golang --skill golang-contextMetadata Registry
Profil yang dapat dibaca Agent untuk pemilihan skill otomatis.
API Registry menyediakan sinyal keputusan, kepercayaan, audit, use case, dan pemasangan tanpa mengikis UI.
Manifest
/api/registry/manifest/samber-golang-context
Teks LLM
/api/registry/manifest/samber-golang-context?format=text
Alias pemasangan
/api/registry/install/samber-golang-context
Rekomendasikan
/api/registry/recommend?task=Use%20golang-context%20in%20an%20agent%20workflow&limit=3
Kecocokan Agent
Agent pemrograman
Tag use case
Platform
Claude Code, OpenAI Agents
Laporan audit
Perlu ditinjau · 84/100
Tinjauan yang dapat dibaca mesin tentang kesiapan pemasangan, metadata keamanan, pemeliharaan, dan risiko adopsi.
Panel keputusan Agent
Pilihan utama untuk Agent pemrograman
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Peran di stack
Pilihan utama
Kecocokan utama
Agent pemrograman
Label kepercayaan
Siap produksi
Jalur pemasangan
Perintah siap
Gunakan saat
- alur kerja Agent pemrograman
- Tim Claude Code
- Tim yang menghargai sinyal adopsi GitHub
Bukti
- 3,010 star GitHub
- recent repository activity
- install command or GitHub repo available
- profil kualitas 82/100
- 2 event interaksi OpenAgentSkill
tinjau dulu
- No major risk signals from current metadata
Jalur implementasi
- 1Pasang di Agent sandbox dan jalankan satu tugas Agent pemrograman dari awal hingga akhir.
- 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.
Profil kepercayaan
Hanya sandbox
Kandidat berguna dengan sinyal kepercayaan yang kurang atau bercampur. Gunakan di ruang kerja terisolasi hingga loop hasil membuktikan kecocokan tugas.
Adopsi GitHub
Lulus3.0K star GitHub
Aktivitas star/fork
Info3.0K star dan 197 fork; aktivitas issue tidak tersedia dalam metadata saat ini
Pemeliharaan terbaru
Lulus2 hari sejak push
Kejelasan lisensi
LulusMIT
Sinyal positif
- Tinjauan AI disetujui
- Jalur pemasangan tersedia
- Bukti repositori tersedia
- Repositori yang baru dipelihara
- Sinyal adopsi GitHub yang bermakna
- Perintah pemasangan tidak memiliki pola berisiko tinggi yang jelas
- Loop hasil siap tetapi membutuhkan eksekusi Agent nyata pertama
Tinjau sebelum memasang
- Quality score needs review
- Permission surface needs review: shell or command execution, network or browser access
- Dependency/runtime risk: command execution surface, network or browser surface
- Permission surface: shell or command execution, network or browser access
- Belum ada laporan hasil Agent nyata
- Tinjauan manusia diperlukan sebelum pemasangan tanpa pengawasan
Tindakan yang disarankan
Jalankan hanya dalam sandbox dan bandingkan alternatif terdekat sebelum digunakan untuk kerja nyata.
Profil kualitas
Kuat kandidat untuk alur kerja Agent
Solid option that is likely worth shortlisting for production workflows.
Kecocokan alur kerja
Gunakan skill ini pada skenario berikut
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.
Verify behavior
Testing and QA
I need my agent to test a web app, reproduce bugs, and verify fixes.
Kecocokan alur kerja
Tambahkan ke alur kerja lengkap
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.
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.
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.
Daftar alternatif
Bandingkan sebelum memasang
Similar skills that may fit this task.
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Taste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Canvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
Anthropic Brand Guidelines
Apply Anthropic official brand colors, typography, and visual standards to appropriate Anthropic-related artifacts.
Ringkasan
--- name: golang-context description: "Idiomatic context.Context usage in Golang — propagation through API boundaries, cancellation, timeouts and deadlines, request-scoped values, context.WithoutCancel for background work outliving requests. Apply when designing context propagation across layers, debugging leaked or unexpired contexts, choosing between context.Background/TODO/WithoutCancel, or storing values in context. Not for code that merely accepts ctx as first parameter." user-invocable: true license: MIT compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.3.0" 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 paths: - "**/*.go" ---
> **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 be called on all control-flow paths for `WithCancel`/`WithTimeout`/`WithDeadline`, unless ownership of the context and cancel function is explicitly returned or transferred 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.
Detail teknis
- Versi
- 1.0.0
- Lisensi
- MIT
- Pembaruan terakhir
- 20 Agu 2026
- Diterbitkan
- 20 Agu 2026
Ringkasan keputusan
Pilihan utama
3,010 star GitHub
Audit
Tinjauan pemasangan
Tinjauan pemasangan dan adopsi
- Keamanan
- 80/100
- Pemeliharaan
- 100/100
- Pasang
- 92/100
Bukti tervalidasi Agent
Bukti tervalidasi Agent
Laporan hasil setelah resolve, tinjau, pasang, dan satu eksekusi terbatas.
- Tingkat sukses
- —
- Kegagalan terbaru
- —
- Hasil
- 0
- Kualitas output
- —
- Gagal
- 0
- Tidak relevan
- 0
- Pemasangan
- 0
- Diblokir risiko
- 0
- Perlu penyiapan
- 0
- Produksi
- 0
Belum ada data hasil Agent. Eksekusi pertama dapat melaporkan keberhasilan, kebutuhan setup, blok risiko, kegagalan, atau tidak relevan melalui /api/agent/outcome.
Pasang
Tambahkan ke alur Agent
Gratis dan sumber terbuka. Tinjau laporan sebelum memasang pada Agent produksi.
Siklus pertumbuhan
Kit berbagi
Draf berbasis skenario untuk golang-context, siap untuk posting manual di X.
A practical pick for design or creative work: golang-context: Idiomatic context.Context usage in Golang — propagation through API boundaries, cancellation, timeouts and deadlines, reque... 3.0K stars https://www.openagentskill.com/skills/samber-golang-context?ref=x
Balasan opsional dengan perintah pemasangan
Listing + install path for golang-context: https://www.openagentskill.com/skills/samber-golang-context?ref=x Install: npx skills add samber/cc-skills-golang --skill golang-context
Sumber listing
Diindeks Registry
Listing ini diindeks dari sumber publik dan belum ditandai resmi hingga klaim pemelihara disetujui.
- Kreator
- samber
- Sumber
- samber/cc-skills-golang
- Diindeks oleh
- Indeks komunitas OpenAgentSkill
Atribusi menautkan ke repositori publik atau profil kreator. Kreator dapat mengklaim listing untuk memperbarui sinyal kepemilikan.
Klaim skill iniKlaim pemilik
Klaim listing skill ini
Listing Diindeks Registry ini dikaitkan dengan samber, tetapi belum ditandai resmi. Klaim untuk menambahkan sinyal pemilik terverifikasi dan membuat pembaruan peluncuran, pemasangan, serta audit berikutnya lebih tepercaya.
Kit backlink kreator
Tambahkan badge bukti ke README Anda
Tampilkan listing kanonis, sinyal kepercayaan dan audit saat ini, serta bukti Agent-Proven nyata di tempat pengembang mengevaluasi repositori.
[](https://www.openagentskill.com/skills/samber-golang-context)
[](https://www.openagentskill.com/skills/samber-golang-context)
[](https://www.openagentskill.com/skills/samber-golang-context/audit)
[](https://www.openagentskill.com/skills/samber-golang-context)Penulis
samber
@samber
Tag
Kecocokan platform
Sinyal kesehatan
- Star GitHub
- 3.0K
- Skor kualitas
- 48/100
- Push GitHub terakhir
- 20 Agu 2026
- Petunjuk framework
- Tidak diketahui
- Tampilan OpenAgentSkill
- 2
- Salinan pemasangan
- 0
- Klik keluar
- 0
Sinyal komunitas
Bagikan apakah skill ini bermanfaat untuk alur kerja Agent Anda. Masukan gabungan meningkatkan peringkat dari waktu ke waktu.
Kepercayaan & keamanan
Hanya sandbox
- Adopsi GitHub3.0K star GitHubLulus
- Aktivitas star/fork3.0K star dan 197 fork; aktivitas issue tidak tersedia dalam metadata saat iniInfo
- Pemeliharaan terbaru2 hari sejak pushLulus
- Kejelasan lisensiMITLulus
- Kelengkapan README/SKILL.mdMetadata memuat konteks penggunaan dan alur kerja yang cukupLulus
- Risiko dependensi/runtimecommand execution surface, network or browser surfacePeriksa
Skill terkait
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
170.9K StarTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
79.0K StarCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
170.9K StarAnthropic Brand Guidelines
Apply Anthropic official brand colors, typography, and visual standards to appropriate Anthropic-related artifacts.
170.9K Star