[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7E5CZTMZ0B7YG70DHT1WC8T":3,"skill-same:01M7E5CZTMZ0B7YG70DHT1WC8T":78},{"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":39,"commitSha":40,"skillDirectory":41,"forksCount":14,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":44,"ownerDescription":45,"updatedAt":46,"install":47,"resources":59},"01M7E5CZTMZ0B7YG70DHT1WC8T","golang-context",null,"Propagate Go context.Context cancellation, deadlines, and request-scoped values through APIs. Use when work needs a cancellation contract or context misuse causes leaks or timeouts.","w0rxbend\u002Fdot-agents","w0rxbend","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F8176996?v=4","01M7E4XY3Y871Z2NFBXF3H3T8F","Oleksandr B.","01M7E4XY51E6NSG05FXR36H9RV",0,"MIT","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-context\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: golang-context\ndescription: \"Propagate Go context.Context cancellation, deadlines, and request-scoped values through APIs. Use when work needs a cancellation contract or context misuse causes leaks or timeouts.\"\nuser-invocable: true\nlicense: MIT\ncompatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang.\nmetadata:\n  author: samber\n  version: \"1.3.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 build:*) Bash(go test:*) Bash(go vet:*) Bash(golangci-lint run:*) Bash(git status:*) Bash(git diff:*) Bash(git log:*) Bash(git show:*) Agent\npaths:\n  - \"**\u002F*.go\"\n---\n\n> **Community default.** Company skill explicitly superseding `samber\u002Fcc-skills-golang@golang-context` skill takes precedence.\n\n# Go context.Context Best Practices\n\n## Best Practices Summary\n\n1. Propagate same context through whole request lifecycle: HTTP handler → service → DB → external APIs. Any link starting fresh context keeps running after client leaves.\n2. Take `ctx` as first parameter, named `ctx context.Context`. Fixed position makes context-aware APIs obvious at a glance; linters check it.\n3. Pass context as function parameter, not struct field. Struct outlives its request, so later calls reuse context already cancelled or owned by someone else.\n4. Pass `context.TODO()`, not `nil` context. `nil` panics on first `Done()` or `Value()` call, far from caller that passed it.\n5. Call `cancel()` on all control-flow paths for `WithCancel`\u002F`WithTimeout`\u002F`WithDeadline`, unless ownership of context and cancel function is explicitly returned or transferred. Uncalled `cancel()` keeps child attached to parent and leaks its timer until parent finishes.\n6. Create `context.Background()` only at top-level entry points (main, init, tests). Deeper in call chain, especially mid-request, it detaches work from caller's deadline and cancellation (propagation break below).\n7. Use `context.TODO()` as placeholder when context needed but none exists yet. Marks gap for later fix instead of hiding it behind deliberate-looking `Background()`.\n8. Declare context value keys as unexported types. Plain `string` key: two packages using `\"user\"` silently overwrite each other.\n9. Carry only request-scoped metadata in context values, never function parameters. `Value()` results lose compile-time typing and vanish from function signature.\n10. Use `context.WithoutCancel` (Go 1.21+) for background work that must outlive parent request. Otherwise handler return cancels just-started audit log or cleanup.\n\n## Creating Contexts\n\n| Situation | Use |\n| --- | --- |\n| Entry point (main, init, test) | `context.Background()` |\n| Function needs context, caller doesn't provide one yet | `context.TODO()` |\n| Inside HTTP handler | `r.Context()` |\n| Need cancellation control | `context.WithCancel(parentCtx)` |\n| Need deadline\u002Ftimeout | `context.WithTimeout(parentCtx, duration)` |\n\n## Context Propagation: The Core Principle\n\nKey rule: **propagate same context through entire call chain**. Then cancelling parent 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    _, err := s.db.ExecContext(context.Background(), \"INSERT INTO orders ...\", order.ID)\n    return err\n}\n\n\u002F\u002F ✓ Good — propagates the caller's context\nfunc (s *OrderService) Create(ctx context.Context, order Order) error {\n    _, err := s.db.ExecContext(ctx, \"INSERT INTO orders ...\", order.ID)\n    return err\n}\n```\n\n## Deep Dives\n\n- **[Cancellation, Timeouts & Deadlines](.\u002Freferences\u002Fcancellation.md)** — How cancellation propagates: `WithCancel` (manual), `WithTimeout` (after a duration), `WithDeadline` (absolute time). Listening (`\u003C-ctx.Done()`) in concurrent code, `AfterFunc` callbacks, `WithoutCancel` for operations that must outlive parent request (e.g., audit logs).\n\n- **[Context Values & Cross-Service Tracing](.\u002Freferences\u002Fvalues-tracing.md)** — Safe value patterns: unexported key types prevent namespace collisions; when to use context values (request ID, user ID) vs function parameters. Trace propagation: OpenTelemetry trace headers, correlation IDs for log aggregation, marshaling\u002Funmarshaling context across service boundaries.\n\n- **[Context in HTTP Servers & Service Calls](.\u002Freferences\u002Fhttp-services.md)** — Handler context: `r.Context()` for request-scoped cancellation, middleware, propagation to services. HTTP clients: `NewRequestWithContext`, client timeouts, context-aware retries. Database: always use `*Context` variants (`QueryContext`, `ExecContext`) to respect deadlines.\n\n## Cross-References\n\n- → See `samber\u002Fcc-skills-golang@golang-concurrency` skill for goroutine cancellation patterns using context\n- → See `samber\u002Fcc-skills-golang@golang-database` skill for context-aware database operations (QueryContext, ExecContext)\n- → See `samber\u002Fcc-skills-golang@golang-observability` skill for trace context propagation with OpenTelemetry\n- → See `samber\u002Fcc-skills-golang@golang-design-patterns` skill for timeout and resilience patterns\n\n## Enforce with Linters\n\n`govet` and `staticcheck` linters catch many context pitfalls automatically. → See `samber\u002Fcc-skills-golang@golang-lint` skill for configuration and usage.\n","> **Community default.** Company skill explicitly superseding `samber\u002Fcc-skills-golang@golang-context` skill takes precedence.\n\n# Go context.Context Best Practices\n\n## Best Practices Summary\n\n1. Propagate same context through whole request lifecycle: HTTP handler → service → DB → external APIs. Any link starting fresh context keeps running after client leaves.\n2. Take `ctx` as first parameter, named `ctx context.Context`. Fixed position makes context-aware APIs obvious at a glance; linters check it.\n3. Pass context as function parameter, not struct field. Struct outlives its request, so later calls reuse context already cancelled or owned by someone else.\n4. Pass `context.TODO()`, not `nil` context. `nil` panics on first `Done()` or `Value()` call, far from caller that passed it.\n5. Call `cancel()` on all control-flow paths for `WithCancel`\u002F`WithTimeout`\u002F`WithDeadline`, unless ownership of context and cancel function is explicitly returned or transferred. Uncalled `cancel()` keeps child attached to parent and leaks its timer until parent finishes.\n6. Create `context.Background()` only at top-level entry points (main, init, tests). Deeper in call chain, especially mid-request, it detaches work from caller's deadline and cancellation (propagation break below).\n7. Use `context.TODO()` as placeholder when context needed but none exists yet. Marks gap for later fix instead of hiding it behind deliberate-looking `Background()`.\n8. Declare context value keys as unexported types. Plain `string` key: two packages using `\"user\"` silently overwrite each other.\n9. Carry only request-scoped metadata in context values, never function parameters. `Value()` results lose compile-time typing and vanish from function signature.\n10. Use `context.WithoutCancel` (Go 1.21+) for background work that must outlive parent request. Otherwise handler return cancels just-started audit log or cleanup.\n\n## Creating Contexts\n\n| Situation | Use |\n| --- | --- |\n| Entry point (main, init, test) | `context.Background()` |\n| Function needs context, caller doesn't provide one yet | `context.TODO()` |\n| Inside HTTP handler | `r.Context()` |\n| Need cancellation control | `context.WithCancel(parentCtx)` |\n| Need deadline\u002Ftimeout | `context.WithTimeout(parentCtx, duration)` |\n\n## Context Propagation: The Core Principle\n\nKey rule: **propagate same context through entire call chain**. Then cancelling parent 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    _, err := s.db.ExecContext(context.Background(), \"INSERT INTO orders ...\", order.ID)\n    return err\n}\n\n\u002F\u002F ✓ Good — propagates the caller's context\nfunc (s *OrderService) Create(ctx context.Context, order Order) error {\n    _, err := s.db.ExecContext(ctx, \"INSERT INTO orders ...\", order.ID)\n    return err\n}\n```\n\n## Deep Dives\n\n- **[Cancellation, Timeouts & Deadlines](.\u002Freferences\u002Fcancellation.md)** — How cancellation propagates: `WithCancel` (manual), `WithTimeout` (after a duration), `WithDeadline` (absolute time). Listening (`\u003C-ctx.Done()`) in concurrent code, `AfterFunc` callbacks, `WithoutCancel` for operations that must outlive parent request (e.g., audit logs).\n\n- **[Context Values & Cross-Service Tracing](.\u002Freferences\u002Fvalues-tracing.md)** — Safe value patterns: unexported key types prevent namespace collisions; when to use context values (request ID, user ID) vs function parameters. Trace propagation: OpenTelemetry trace headers, correlation IDs for log aggregation, marshaling\u002Funmarshaling context across service boundaries.\n\n- **[Context in HTTP Servers & Service Calls](.\u002Freferences\u002Fhttp-services.md)** — Handler context: `r.Context()` for request-scoped cancellation, middleware, propagation to services. HTTP clients: `NewRequestWithContext`, client timeouts, context-aware retries. Database: always use `*Context` variants (`QueryContext`, `ExecContext`) to respect deadlines.\n\n## Cross-References\n\n- → See `samber\u002Fcc-skills-golang@golang-concurrency` skill for goroutine cancellation patterns using context\n- → See `samber\u002Fcc-skills-golang@golang-database` skill for context-aware database operations (QueryContext, ExecContext)\n- → See `samber\u002Fcc-skills-golang@golang-observability` skill for trace context propagation with OpenTelemetry\n- → See `samber\u002Fcc-skills-golang@golang-design-patterns` skill for timeout and resilience patterns\n\n## Enforce with Linters\n\n`govet` and `staticcheck` linters catch many context pitfalls automatically. → See `samber\u002Fcc-skills-golang@golang-lint` skill for configuration and usage.\n",{"name":5,"paths":24,"license":15,"metadata":26,"description":7,"allowed-tools":36,"compatibility":37,"user-invocable":38},[25],"**\u002F*.go",{"author":27,"version":28,"openclaw":29},"samber","1.3.1",{"emoji":30,"install":31,"homepage":32,"requires":33},"🔗",[],"https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang",{"bins":34},[35],"go","Read Edit Write Glob Grep Bash(go build:*) Bash(go test:*) Bash(go vet:*) Bash(golangci-lint run:*) Bash(git status:*) Bash(git diff:*) Bash(git log:*) Bash(git show:*) Agent","Designed for Claude Code, Codex or similar harness, and for projects using Golang.",true,"main","101d0f67250256ca5d80dc3f95767cad7b541457","skills\u002Fgo\u002Fgolang-context","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents","https:\u002F\u002Fgithub.com\u002Fw0rxbend","https:\u002F\u002Freadme.worxbend.com\u002F","Fluent in Backend-ese (microservices, distributed systems, you know the drill)\r\nFunctional Programming Fanatic...","2026-11-14 14:44:12",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":38},[49,52,55],{"tool":50,"command":51},"npx","npx skills add w0rxbend\u002Fdot-agents --skill golang-context",{"tool":53,"command":54},"bunx","bunx skills add w0rxbend\u002Fdot-agents --skill golang-context",{"tool":56,"command":57},"pnpm","pnpm dlx skills add w0rxbend\u002Fdot-agents --skill golang-context","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-context\u002FSKILL.md",[60,66,70,74],{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"evals\u002Fevals.json","REFERENCE","参考文档",13535,"https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-context\u002Fevals\u002Fevals.json",{"path":67,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fcancellation.md",5655,"https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-context\u002Freferences\u002Fcancellation.md",{"path":71,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Fhttp-services.md",3738,"https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-context\u002Freferences\u002Fhttp-services.md",{"path":75,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fvalues-tracing.md",2962,"https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fgo\u002Fgolang-context\u002Freferences\u002Fvalues-tracing.md",[79,86,93,101,108,115],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7E6TS1SW1ZSXN748N0RBGHT","wiki-builder","Create and maintain a local Markdown research wiki (sources with provenance, compiled concept\u002Fsource pages, index, maintenance log) driven by a per-wiki config. Use when the user wants to start a wiki or knowledge base, ingest sources into one, or query and update it; use wiki-page-writer for a single code deep-dive page.","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fwiki-builder\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7E6S8ARS0VQR85H4FEC390B","refactoring-guru","Diagnose a named code smell and apply the smallest behavior-preserving refactoring, with verification before and after and an explicit stop condition. Use for structural refactors (extract, move, consolidate, change ownership), not for feature or bug work; for readability cleanup of recent changes use code-simplification.","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Frefactoring-guru\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":97,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M7E6RRXCYGSHA0ZBFX3YZP7Y","legacy-seams","When changing untested legacy code, pin the observed results with characterization tests and open the smallest seam that substitutes only the blocking dependency, separate from any later logic change. Use when a clock, random source, I\u002FO, global, or hidden constructor blocks a test or a safe edit. Use test-driven-development for a new behavior or a bug, refactoring-guru for one named structural refactor after the seam exists, and code-refactoring-tech-debt to choose which legacy to replace.","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Flegacy-seams\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Flegacy-seams\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M7E6QZ11XWSNHCBGYK8HH97C","idea-refine","Refine a raw idea into a one-page brief (problem statement, recommended direction, assumptions to validate, MVP scope, not-doing list) through divergent then convergent thinking. Use when an idea is still vague or you want options and a stress test before committing; use interview-me when the goal itself is unclear and spec-driven-development once the direction is chosen.","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fidea-refine\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":19},"01M7E6N2N7BYW7BA5XGM0QD3B4","code-review-and-quality","Review rubric and approval standard for any change before merge, including code written by you, another agent, or a human: five axes (correctness, readability, architecture, security, performance), change sizing, structural remedies, severity labels, and feedback technique. Use to judge whether a change is fit to merge; use code-review to run a PR or diff review end to end.","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fcode-review-and-quality\u002FSKILL.md",[],[],{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":119,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":19},"01M7E6MNCZPTRD77Z419X755HQ","code-perfection","Smell and style gate for code you write or change. Bans known code smells (long method, large class, primitive obsession, long parameter list, data clumps, duplicate code, dead code, feature envy, shotgun surgery, flag arguments, message chains) and enforces behavior-preserving structure. On Scala files, enforces worxbend style. Use while implementing, reviewing a diff for smells, or when a smell or style violation is suspected. Routine construction stays with code-complete. SOLID and DRY stay with clean-code-guard. One named structural refactor stays with refactoring-guru.","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fcode-perfection\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fcode-perfection\u002FSKILL.md",[],[]]