[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CWCW4E1WAFDNWHTPVHR426":3,"skill-same:01M7CWCW4E1WAFDNWHTPVHR426":58},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":40,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":6,"ownerDescription":43,"updatedAt":44,"install":45,"resources":57},"01M7CWCW4E1WAFDNWHTPVHR426","golang-context",null,"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\u002FTODO\u002FWithoutCancel, or storing values in context. Not for code that merely accepts ctx as first parameter.","om-scogo\u002Fskillsh-scraper","om-scogo","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F160466840?v=4","01M79AWB6DFVCQ7RK70CS34B96","Om Achrekar","01M79AWB6ZM9SKR8KDH1WSSM22",0,"MIT","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fsamber-cc-skills-golang\u002Fgolang-context\u002Fskills\u002Fgolang-context\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: golang-context\ndescription: \"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\u002FTODO\u002FWithoutCancel, or storing values in context. Not for code that merely accepts ctx as first parameter.\"\nuser-invocable: true\nlicense: MIT\ncompatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang.\nmetadata:\n  author: samber\n  version: \"1.2.1\"\n  openclaw:\n    emoji: \"🔗\"\n    homepage: https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang\n    requires:\n      bins:\n        - go\n    install: []\nallowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent\n---\n\n> **Community default.** A company skill that explicitly supersedes `samber\u002Fcc-skills-golang@golang-context` skill takes precedence.\n\n# Go context.Context Best Practices\n\n`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.\n\n## Best Practices Summary\n\n1. The same context MUST be propagated through the entire request lifecycle: HTTP handler → service → DB → external APIs\n2. `ctx` MUST be the first parameter, named `ctx context.Context`\n3. NEVER store context in a struct — pass explicitly through function parameters\n4. NEVER pass `nil` context — use `context.TODO()` if unsure\n5. `cancel()` MUST be called on all control-flow paths for `WithCancel`\u002F`WithTimeout`\u002F`WithDeadline`, unless ownership of the context and cancel function is explicitly returned or transferred\n6. `context.Background()` MUST only be used at the top level (main, init, tests)\n7. **Use `context.TODO()`** as a placeholder when you know a context is needed but don't have one yet\n8. NEVER create a new `context.Background()` in the middle of a request path\n9. Context value keys MUST be unexported types to prevent collisions\n10. Context values MUST only carry request-scoped metadata — NEVER function parameters\n11. **Use `context.WithoutCancel`** (Go 1.21+) when spawning background work that must outlive the parent request\n\n## Creating Contexts\n\n| Situation | Use |\n| --- | --- |\n| Entry point (main, init, test) | `context.Background()` |\n| Function needs context but caller doesn't provide one yet | `context.TODO()` |\n| Inside an HTTP handler | `r.Context()` |\n| Need cancellation control | `context.WithCancel(parentCtx)` |\n| Need a deadline\u002Ftimeout | `context.WithTimeout(parentCtx, duration)` |\n\n## Context Propagation: The Core Principle\n\nThe 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.\n\n```go\n\u002F\u002F ✗ Bad — creates a new context, breaking the chain\nfunc (s *OrderService) Create(ctx context.Context, order Order) error {\n    return s.db.ExecContext(context.Background(), \"INSERT INTO orders ...\", order.ID)\n}\n\n\u002F\u002F ✓ Good — propagates the caller's context\nfunc (s *OrderService) Create(ctx context.Context, order Order) error {\n    return s.db.ExecContext(ctx, \"INSERT INTO orders ...\", order.ID)\n}\n```\n\n## Deep Dives\n\n- **[Cancellation, Timeouts & Deadlines](.\u002Freferences\u002Fcancellation.md)** — How cancellation propagates: `WithCancel` for manual cancellation, `WithTimeout` for automatic cancellation after a duration, `WithDeadline` for absolute time deadlines. Patterns for listening (`\u003C-ctx.Done()`) in concurrent code, `AfterFunc` callbacks, and `WithoutCancel` for operations that must outlive their parent request (e.g., audit logs).\n\n- **[Context Values & Cross-Service Tracing](.\u002Freferences\u002Fvalues-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\u002Funmarshaling context across service boundaries.\n\n- **[Context in HTTP Servers & Service Calls](.\u002Freferences\u002Fhttp-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.\n\n## Cross-References\n\n- → See the `samber\u002Fcc-skills-golang@golang-concurrency` skill for goroutine cancellation patterns using context\n- → See the `samber\u002Fcc-skills-golang@golang-database` skill for context-aware database operations (QueryContext, ExecContext)\n- → See the `samber\u002Fcc-skills-golang@golang-observability` skill for trace context propagation with OpenTelemetry\n- → See the `samber\u002Fcc-skills-golang@golang-design-patterns` skill for timeout and resilience patterns\n\n## Enforce with Linters\n\nMany context pitfalls are caught automatically by linters: `govet`, `staticcheck`. → See the `samber\u002Fcc-skills-golang@golang-lint` skill for configuration and usage.\n","> **Community default.** A company skill that explicitly supersedes `samber\u002Fcc-skills-golang@golang-context` skill takes precedence.\n\n# Go context.Context Best Practices\n\n`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.\n\n## Best Practices Summary\n\n1. The same context MUST be propagated through the entire request lifecycle: HTTP handler → service → DB → external APIs\n2. `ctx` MUST be the first parameter, named `ctx context.Context`\n3. NEVER store context in a struct — pass explicitly through function parameters\n4. NEVER pass `nil` context — use `context.TODO()` if unsure\n5. `cancel()` MUST be called on all control-flow paths for `WithCancel`\u002F`WithTimeout`\u002F`WithDeadline`, unless ownership of the context and cancel function is explicitly returned or transferred\n6. `context.Background()` MUST only be used at the top level (main, init, tests)\n7. **Use `context.TODO()`** as a placeholder when you know a context is needed but don't have one yet\n8. NEVER create a new `context.Background()` in the middle of a request path\n9. Context value keys MUST be unexported types to prevent collisions\n10. Context values MUST only carry request-scoped metadata — NEVER function parameters\n11. **Use `context.WithoutCancel`** (Go 1.21+) when spawning background work that must outlive the parent request\n\n## Creating Contexts\n\n| Situation | Use |\n| --- | --- |\n| Entry point (main, init, test) | `context.Background()` |\n| Function needs context but caller doesn't provide one yet | `context.TODO()` |\n| Inside an HTTP handler | `r.Context()` |\n| Need cancellation control | `context.WithCancel(parentCtx)` |\n| Need a deadline\u002Ftimeout | `context.WithTimeout(parentCtx, duration)` |\n\n## Context Propagation: The Core Principle\n\nThe 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.\n\n```go\n\u002F\u002F ✗ Bad — creates a new context, breaking the chain\nfunc (s *OrderService) Create(ctx context.Context, order Order) error {\n    return s.db.ExecContext(context.Background(), \"INSERT INTO orders ...\", order.ID)\n}\n\n\u002F\u002F ✓ Good — propagates the caller's context\nfunc (s *OrderService) Create(ctx context.Context, order Order) error {\n    return s.db.ExecContext(ctx, \"INSERT INTO orders ...\", order.ID)\n}\n```\n\n## Deep Dives\n\n- **[Cancellation, Timeouts & Deadlines](.\u002Freferences\u002Fcancellation.md)** — How cancellation propagates: `WithCancel` for manual cancellation, `WithTimeout` for automatic cancellation after a duration, `WithDeadline` for absolute time deadlines. Patterns for listening (`\u003C-ctx.Done()`) in concurrent code, `AfterFunc` callbacks, and `WithoutCancel` for operations that must outlive their parent request (e.g., audit logs).\n\n- **[Context Values & Cross-Service Tracing](.\u002Freferences\u002Fvalues-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\u002Funmarshaling context across service boundaries.\n\n- **[Context in HTTP Servers & Service Calls](.\u002Freferences\u002Fhttp-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.\n\n## Cross-References\n\n- → See the `samber\u002Fcc-skills-golang@golang-concurrency` skill for goroutine cancellation patterns using context\n- → See the `samber\u002Fcc-skills-golang@golang-database` skill for context-aware database operations (QueryContext, ExecContext)\n- → See the `samber\u002Fcc-skills-golang@golang-observability` skill for trace context propagation with OpenTelemetry\n- → See the `samber\u002Fcc-skills-golang@golang-design-patterns` skill for timeout and resilience patterns\n\n## Enforce with Linters\n\nMany context pitfalls are caught automatically by linters: `govet`, `staticcheck`. → See the `samber\u002Fcc-skills-golang@golang-lint` skill for configuration and usage.\n",{"name":5,"license":15,"metadata":24,"description":7,"allowed-tools":34,"compatibility":35,"user-invocable":36},{"author":25,"version":26,"openclaw":27},"samber","1.2.1",{"emoji":28,"install":29,"homepage":30,"requires":31},"🔗",[],"https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang",{"bins":32},[33],"go","Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent","Designed for Claude Code or similar AI coding agents, and for projects using Golang.",true,"main","8859218955d9504cd18b59e7892100718039d3b4","data\u002Fskills\u002Fsamber-cc-skills-golang\u002Fgolang-context\u002Fskills\u002Fgolang-context",1,"https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper","https:\u002F\u002Fgithub.com\u002Fom-scogo","SDE-1 @ Scogo ","2026-07-18 12:22:46",{"source":8,"skillName":5,"commands":46,"prompt":56,"zipAvailable":36},[47,50,53],{"tool":48,"command":49},"npx","npx skills add om-scogo\u002Fskillsh-scraper --skill golang-context",{"tool":51,"command":52},"bunx","bunx skills add om-scogo\u002Fskillsh-scraper --skill golang-context",{"tool":54,"command":55},"pnpm","pnpm dlx skills add om-scogo\u002Fskillsh-scraper --skill golang-context","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fsamber-cc-skills-golang\u002Fgolang-context\u002Fskills\u002Fgolang-context\u002FSKILL.md",[],[59,66,71,78,83,90],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7D6MC9FAAEV4CMNYX8W7JTG","arxiv-search","Search arXiv physics, math, and computer science preprints using natural language queries. Powered by Valyu semantic search.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fyorkeccak-scientific-skills\u002Farxiv-search\u002Fskills\u002Farxiv-search\u002FSKILL.md",[],[],{"skillNo":67,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7D6M85CKKN87TA98VCQV4H7","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fyorkeccak-scientific-skills\u002Farxiv-search\u002FSkill.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7D4ZTCS4DR3CE4JY06X84T2","working-with-legacy-code","Safely change and test untested codebases using Feathers' \"Working Effectively with Legacy Code\". Use when the user mentions \"legacy code\", \"no tests\", \"untested codebase\", \"how do I test this\", \"seams\", \"characterization tests\", \"golden master\", \"sprout method\", \"afraid to change this code\", \"monster method\", \"dependency breaking\", or \"inherited a messy codebase\". Also trigger when changing code without tests safely, getting a class under test when constructors, statics, or singletons block it, adding features to tangled modules, or planning incremental test coverage for an old codebase. Covers the legacy-code change algorithm, seams, characterization tests, sprout\u002Fwrap, and dependency-breaking techniques. For refactoring code that already has tests, see refactoring-patterns. For day-to-day code quality, see clean-code.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002Fworking-with-legacy-code\u002FSKILL.md",[],[],{"skillNo":79,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7D4ZHZKJD2RSNGAF63V14P4","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002FSkill.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7D4ZB4CJBFW5JE67CPH2QRV","web-typography","Select, pair, and implement typefaces for web projects. Use when the user mentions \"font pairing\", \"which typeface\", \"line height\", \"responsive typography\", \"web font loading\", \"type hierarchy\", \"variable fonts\", \"FOUT\u002FFOIT\", \"typographic scale\", or \"the text is hard to read\". Also trigger when choosing between system fonts and web fonts, optimizing font-loading performance, or designing readable long-form content. Covers readability evaluation, CSS implementation, and performance optimization. For overall UI design systems, see refactoring-ui. For dramatic typographic experiences, see top-design.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002Fweb-typography\u002FSKILL.md",[],[],{"skillNo":91,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7D4Z4MVYVY3NMJ18BNV6WNA","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002FSkill.md",[],[]]