[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6JGSFBW5K952KA2B6T0MBXT":3,"skill-same:01M6JGSFBW5K952KA2B6T0MBXT":99},{"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":28,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":59,"commitSha":60,"skillDirectory":61,"forksCount":62,"repositoryHtmlUrl":63,"repositoryHomepageUrl":6,"ownerHtmlUrl":64,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":65,"install":66,"resources":79},"01M6JGSFBW5K952KA2B6T0MBXT","golang-samber-oops",null,"Structured error handling in Golang with samber\u002Foops — error builders, stack traces, error codes, error context, error wrapping, error attributes, user-facing vs developer messages, panic recovery, and logger integration. Apply when using or adopting samber\u002Foops, or when the codebase already imports github.com\u002Fsamber\u002Foops.","muratovv\u002Fai-hats","muratovv","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F7502801?v=4","01M6JGCBN4KEJX012GPJVSH04T","Fedor Muratov","01M6JGCBSNMN7CW3RGTPPE0MN2",3,"MIT","https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fusage\u002Fskills\u002Fgolang-samber-oops\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"golang","golang samber oops","oops","write","imports","attributes","error","false","query","context7","edit","MCP","read","stack","projects","Bash","messages","git","code","ai coding agents","2026-11-10 10:12:30",false,"---\nname: golang-samber-oops\ndescription: >-\n  Structured error handling in Golang with samber\u002Foops — error builders,\n  stack traces, error codes, error context, error wrapping, error\n  attributes, user-facing vs developer messages, panic recovery, and\n  logger integration. Apply when using or adopting samber\u002Foops, or when\n  the codebase already imports github.com\u002Fsamber\u002Foops.\nuser-invocable: false\nlicense: MIT\ncompatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang.\nmetadata:\n  author: samber\n  version: \"1.1.2\"\nallowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch mcp__context7__resolve-library-id mcp__context7__query-docs\n---\n\n**Persona:** You are a Go engineer who treats errors as structured data. Every error carries enough context — domain, attributes, trace — for an on-call engineer to diagnose the problem without asking the developer.\n\n# samber\u002Foops Structured Error Handling\n\n**samber\u002Foops** is a drop-in replacement for Go's standard error handling that adds structured context, stack traces, error codes, public messages, and panic recovery. Variable data goes in `.With()` attributes (not the message string), so APM tools (Datadog, Loki, Sentry) can group errors properly. Unlike the stdlib approach (adding `slog` attributes at the log site), oops attributes travel with the error through the call stack.\n\n## Why use samber\u002Foops\n\nStandard Go errors lack context — you see `connection failed` but not which user triggered it, what query was running, or the full call stack. `samber\u002Foops` provides:\n\n- **Structured context** — key-value attributes on any error\n- **Stack traces** — automatic call stack capture\n- **Error codes** — machine-readable identifiers\n- **Public messages** — user-safe messages separate from technical details\n- **Low-cardinality messages** — variable data in `.With()` attributes, not the message string, so APM tools group errors properly\n\nThis skill is not exhaustive. Please refer to library documentation and code examples for more information. Context7 can help as a discoverability platform.\n\n## Core pattern: Error builder chain\n\nAll `oops` errors use a fluent builder pattern:\n\n```go\nerr := oops.\n    In(\"user-service\").           \u002F\u002F domain\u002Ffeature\n    Tags(\"database\", \"postgres\").  \u002F\u002F categorization\n    Code(\"network_failure\").       \u002F\u002F machine-readable identifier\n    User(\"user-123\", \"email\", \"foo@bar.com\").  \u002F\u002F user context\n    With(\"query\", query).          \u002F\u002F custom attributes\n    Errorf(\"failed to fetch user: %s\", \"timeout\")\n```\n\nTerminal methods:\n\n- `.Errorf(format, args...)` — create a new error\n- `.Wrap(err)` — wrap an existing error\n- `.Wrapf(err, format, args...)` — wrap with a message\n- `.Join(err1, err2, ...)` — combine multiple errors\n- `.Recover(fn)` \u002F `.Recoverf(fn, format, args...)` — convert panic to error\n\n### Error builder methods\n\n| Methods | Use case |\n| --- | --- |\n| `.With(\"key\", value)` | Add custom key-value attribute (lazy `func() any` values supported) |\n| `.WithContext(ctx, \"key1\", \"key2\")` | Extract values from Go context into attributes (lazy values supported) |\n| `.In(\"domain\")` | Set the feature\u002Fservice\u002Fdomain |\n| `.Tags(\"auth\", \"sql\")` | Add categorization tags (query with `err.HasTag(\"tag\")`) |\n| `.Code(\"iam_authz_missing_permission\")` | Set machine-readable error identifier\u002Fslug |\n| `.Public(\"Could not fetch user.\")` | Set user-safe message (separate from technical details) |\n| `.Hint(\"Runbook: https:\u002F\u002Fdoc.acme.org\u002Fdoc\u002Fabcd.md\")` | Add debugging hint for developers |\n| `.Owner(\"team\u002Fslack\")` | Identify responsible team\u002Fowner |\n| `.User(id, \"k\", \"v\")` | Add user identifier and attributes |\n| `.Tenant(id, \"k\", \"v\")` | Add tenant\u002Forganization context and attributes |\n| `.Trace(id)` | Add trace \u002F correlation ID (default: ULID) |\n| `.Span(id)` | Add span ID representing a unit of work\u002Foperation (default: ULID) |\n| `.Time(t)` | Override error timestamp (default: `time.Now()`) |\n| `.Since(t)` | Set duration based on time since `t` (exposed via `err.Duration()`) |\n| `.Duration(d)` | Set explicit error duration |\n| `.Request(req, includeBody)` | Attach `*http.Request` (optionally including body) |\n| `.Response(res, includeBody)` | Attach `*http.Response` (optionally including body) |\n| `oops.FromContext(ctx)` | Start from an `OopsErrorBuilder` stored in a Go context |\n\n## Common scenarios\n\n### Database\u002Frepository layer\n\n```go\nfunc (r *UserRepository) FetchUser(id string) (*User, error) {\n    query := \"SELECT * FROM users WHERE id = $1\"\n    row, err := r.db.Query(query, id)\n    if err != nil {\n        return nil, oops.\n            In(\"user-repository\").\n            Tags(\"database\", \"postgres\").\n            With(\"query\", query).\n            With(\"user_id\", id).\n            Wrapf(err, \"failed to fetch user from database\")\n    }\n    \u002F\u002F ...\n}\n```\n\n### HTTP handler layer\n\n```go\nfunc (h *Handler) CreateUser(w http.ResponseWriter, r *http.Request) {\n    userID := getUserID(r)\n\n    err := h.service.CreateUser(r.Context(), userID)\n    if err != nil {\n        return oops.\n            In(\"http-handler\").\n            Tags(\"endpoint\", \"\u002Fusers\").\n            Request(r, false).\n            User(userID).\n            Wrapf(err, \"create user failed\")\n    }\n\n    w.WriteHeader(http.StatusCreated)\n}\n```\n\n### Service layer with reusable builder\n\n```go\nfunc (s *UserService) CreateOrder(ctx context.Context, req CreateOrderRequest) error {\n    builder := oops.\n        In(\"order-service\").\n        Tags(\"orders\", \"checkout\").\n        Tenant(req.TenantID, \"plan\", req.Plan).\n        User(req.UserID, \"email\", req.UserEmail)\n\n    product, err := s.catalog.GetProduct(ctx, req.ProductID)\n    if err != nil {\n        return builder.\n            With(\"product_id\", req.ProductID).\n            Wrapf(err, \"product lookup failed\")\n    }\n\n    if product.Stock \u003C req.Quantity {\n        return builder.\n            Code(\"insufficient_stock\").\n            Public(\"Not enough items in stock.\").\n            With(\"requested\", req.Quantity).\n            With(\"available\", product.Stock).\n            Errorf(\"insufficient stock for product %s\", req.ProductID)\n    }\n\n    return nil\n}\n```\n\n## Error wrapping best practices\n\n### DO: Wrap directly, no nil check needed\n\n```go\n\u002F\u002F ✓ Good — Wrap returns nil if err is nil\nreturn oops.Wrapf(err, \"operation failed\")\n\n\u002F\u002F ✗ Bad — unnecessary nil check\nif err != nil {\n    return oops.Wrapf(err, \"operation failed\")\n}\nreturn nil\n```\n\n### DO: Add context at each layer\n\nEach architectural layer SHOULD add context via Wrap\u002FWrapf — at least once per package boundary (not necessarily at every function call).\n\n```go\n\u002F\u002F ✓ Good — each layer adds relevant context\nfunc Controller() error {\n    return oops.In(\"controller\").Trace(traceID).Wrapf(Service(), \"user request failed\")\n}\n\nfunc Service() error {\n    return oops.In(\"service\").With(\"op\", \"create_user\").Wrapf(Repository(), \"db operation failed\")\n}\n\nfunc Repository() error {\n    return oops.In(\"repository\").Tags(\"database\", \"postgres\").Errorf(\"connection timeout\")\n}\n```\n\n### DO: Keep error messages low-cardinality\n\nError messages MUST be low-cardinality for APM aggregation. Interpolating variable data into the message breaks grouping in Datadog, Loki, Sentry.\n\n```go\n\u002F\u002F ✗ Bad — high-cardinality, breaks APM grouping\noops.Errorf(\"failed to process user %s in tenant %s\", userID, tenantID)\n\n\u002F\u002F ✓ Good — static message + structured attributes\noops.With(\"user_id\", userID).With(\"tenant_id\", tenantID).Errorf(\"failed to process user\")\n```\n\n## Panic recovery\n\n`oops.Recover()` MUST be used in goroutine boundaries. Convert panics to structured errors:\n\n```go\nfunc ProcessData(data string) (err error) {\n    return oops.\n        In(\"data-processor\").\n        Code(\"panic_recovered\").\n        Hint(\"Check input data format and dependencies\").\n        With(\"panic_value\", r).\n        Recover(func() {\n            riskyOperation(data)\n        })\n}\n```\n\n## Accessing error information\n\n`samber\u002Foops` errors implement the standard `error` interface. Access additional info:\n\n```go\nif oopsErr, ok := err.(oops.OopsError); ok {\n    fmt.Println(\"Code:\", oopsErr.Code())\n    fmt.Println(\"Domain:\", oopsErr.Domain())\n    fmt.Println(\"Tags:\", oopsErr.Tags())\n    fmt.Println(\"Context:\", oopsErr.Context())\n    fmt.Println(\"Stacktrace:\", oopsErr.Stacktrace())\n}\n\n\u002F\u002F Get public-facing message with fallback\npublicMsg := oops.GetPublic(err, \"Something went wrong\")\n```\n\n### Output formats\n\n```go\nfmt.Printf(\"%+v\\n\", err)       \u002F\u002F verbose with stack trace\nbytes, _ := json.Marshal(err)  \u002F\u002F JSON for logging\nslog.Error(err.Error(), slog.Any(\"error\", err))  \u002F\u002F slog integration\n```\n\n## Context propagation\n\nCarry error context through Go contexts:\n\n```go\nfunc middleware(next http.Handler) http.Handler {\n    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n        builder := oops.\n            In(\"http\").\n            Request(r, false).\n            Trace(r.Header.Get(\"X-Trace-ID\"))\n\n        ctx := oops.WithBuilder(r.Context(), builder)\n        next.ServeHTTP(w, r.WithContext(ctx))\n    })\n}\n\nfunc handler(ctx context.Context) error {\n    return oops.FromContext(ctx).Tags(\"handler\", \"users\").Errorf(\"something failed\")\n}\n```\n\nFor assertions, configuration, and additional logger examples, see [Advanced patterns](.\u002Freferences\u002Fadvanced.md).\n\n## References\n\n- [github.com\u002Fsamber\u002Foops](https:\u002F\u002Fgithub.com\u002Fsamber\u002Foops)\n- [pkg.go.dev\u002Fgithub.com\u002Fsamber\u002Foops](https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fsamber\u002Foops)\n\n## Cross-References\n\n- → See `samber\u002Fcc-skills-golang@golang-error-handling` skill for general error handling patterns\n- → See `samber\u002Fcc-skills-golang@golang-observability` skill for logger integration and structured logging\n","**Persona:** You are a Go engineer who treats errors as structured data. Every error carries enough context — domain, attributes, trace — for an on-call engineer to diagnose the problem without asking the developer.\n\n# samber\u002Foops Structured Error Handling\n\n**samber\u002Foops** is a drop-in replacement for Go's standard error handling that adds structured context, stack traces, error codes, public messages, and panic recovery. Variable data goes in `.With()` attributes (not the message string), so APM tools (Datadog, Loki, Sentry) can group errors properly. Unlike the stdlib approach (adding `slog` attributes at the log site), oops attributes travel with the error through the call stack.\n\n## Why use samber\u002Foops\n\nStandard Go errors lack context — you see `connection failed` but not which user triggered it, what query was running, or the full call stack. `samber\u002Foops` provides:\n\n- **Structured context** — key-value attributes on any error\n- **Stack traces** — automatic call stack capture\n- **Error codes** — machine-readable identifiers\n- **Public messages** — user-safe messages separate from technical details\n- **Low-cardinality messages** — variable data in `.With()` attributes, not the message string, so APM tools group errors properly\n\nThis skill is not exhaustive. Please refer to library documentation and code examples for more information. Context7 can help as a discoverability platform.\n\n## Core pattern: Error builder chain\n\nAll `oops` errors use a fluent builder pattern:\n\n```go\nerr := oops.\n    In(\"user-service\").           \u002F\u002F domain\u002Ffeature\n    Tags(\"database\", \"postgres\").  \u002F\u002F categorization\n    Code(\"network_failure\").       \u002F\u002F machine-readable identifier\n    User(\"user-123\", \"email\", \"foo@bar.com\").  \u002F\u002F user context\n    With(\"query\", query).          \u002F\u002F custom attributes\n    Errorf(\"failed to fetch user: %s\", \"timeout\")\n```\n\nTerminal methods:\n\n- `.Errorf(format, args...)` — create a new error\n- `.Wrap(err)` — wrap an existing error\n- `.Wrapf(err, format, args...)` — wrap with a message\n- `.Join(err1, err2, ...)` — combine multiple errors\n- `.Recover(fn)` \u002F `.Recoverf(fn, format, args...)` — convert panic to error\n\n### Error builder methods\n\n| Methods | Use case |\n| --- | --- |\n| `.With(\"key\", value)` | Add custom key-value attribute (lazy `func() any` values supported) |\n| `.WithContext(ctx, \"key1\", \"key2\")` | Extract values from Go context into attributes (lazy values supported) |\n| `.In(\"domain\")` | Set the feature\u002Fservice\u002Fdomain |\n| `.Tags(\"auth\", \"sql\")` | Add categorization tags (query with `err.HasTag(\"tag\")`) |\n| `.Code(\"iam_authz_missing_permission\")` | Set machine-readable error identifier\u002Fslug |\n| `.Public(\"Could not fetch user.\")` | Set user-safe message (separate from technical details) |\n| `.Hint(\"Runbook: https:\u002F\u002Fdoc.acme.org\u002Fdoc\u002Fabcd.md\")` | Add debugging hint for developers |\n| `.Owner(\"team\u002Fslack\")` | Identify responsible team\u002Fowner |\n| `.User(id, \"k\", \"v\")` | Add user identifier and attributes |\n| `.Tenant(id, \"k\", \"v\")` | Add tenant\u002Forganization context and attributes |\n| `.Trace(id)` | Add trace \u002F correlation ID (default: ULID) |\n| `.Span(id)` | Add span ID representing a unit of work\u002Foperation (default: ULID) |\n| `.Time(t)` | Override error timestamp (default: `time.Now()`) |\n| `.Since(t)` | Set duration based on time since `t` (exposed via `err.Duration()`) |\n| `.Duration(d)` | Set explicit error duration |\n| `.Request(req, includeBody)` | Attach `*http.Request` (optionally including body) |\n| `.Response(res, includeBody)` | Attach `*http.Response` (optionally including body) |\n| `oops.FromContext(ctx)` | Start from an `OopsErrorBuilder` stored in a Go context |\n\n## Common scenarios\n\n### Database\u002Frepository layer\n\n```go\nfunc (r *UserRepository) FetchUser(id string) (*User, error) {\n    query := \"SELECT * FROM users WHERE id = $1\"\n    row, err := r.db.Query(query, id)\n    if err != nil {\n        return nil, oops.\n            In(\"user-repository\").\n            Tags(\"database\", \"postgres\").\n            With(\"query\", query).\n            With(\"user_id\", id).\n            Wrapf(err, \"failed to fetch user from database\")\n    }\n    \u002F\u002F ...\n}\n```\n\n### HTTP handler layer\n\n```go\nfunc (h *Handler) CreateUser(w http.ResponseWriter, r *http.Request) {\n    userID := getUserID(r)\n\n    err := h.service.CreateUser(r.Context(), userID)\n    if err != nil {\n        return oops.\n            In(\"http-handler\").\n            Tags(\"endpoint\", \"\u002Fusers\").\n            Request(r, false).\n            User(userID).\n            Wrapf(err, \"create user failed\")\n    }\n\n    w.WriteHeader(http.StatusCreated)\n}\n```\n\n### Service layer with reusable builder\n\n```go\nfunc (s *UserService) CreateOrder(ctx context.Context, req CreateOrderRequest) error {\n    builder := oops.\n        In(\"order-service\").\n        Tags(\"orders\", \"checkout\").\n        Tenant(req.TenantID, \"plan\", req.Plan).\n        User(req.UserID, \"email\", req.UserEmail)\n\n    product, err := s.catalog.GetProduct(ctx, req.ProductID)\n    if err != nil {\n        return builder.\n            With(\"product_id\", req.ProductID).\n            Wrapf(err, \"product lookup failed\")\n    }\n\n    if product.Stock \u003C req.Quantity {\n        return builder.\n            Code(\"insufficient_stock\").\n            Public(\"Not enough items in stock.\").\n            With(\"requested\", req.Quantity).\n            With(\"available\", product.Stock).\n            Errorf(\"insufficient stock for product %s\", req.ProductID)\n    }\n\n    return nil\n}\n```\n\n## Error wrapping best practices\n\n### DO: Wrap directly, no nil check needed\n\n```go\n\u002F\u002F ✓ Good — Wrap returns nil if err is nil\nreturn oops.Wrapf(err, \"operation failed\")\n\n\u002F\u002F ✗ Bad — unnecessary nil check\nif err != nil {\n    return oops.Wrapf(err, \"operation failed\")\n}\nreturn nil\n```\n\n### DO: Add context at each layer\n\nEach architectural layer SHOULD add context via Wrap\u002FWrapf — at least once per package boundary (not necessarily at every function call).\n\n```go\n\u002F\u002F ✓ Good — each layer adds relevant context\nfunc Controller() error {\n    return oops.In(\"controller\").Trace(traceID).Wrapf(Service(), \"user request failed\")\n}\n\nfunc Service() error {\n    return oops.In(\"service\").With(\"op\", \"create_user\").Wrapf(Repository(), \"db operation failed\")\n}\n\nfunc Repository() error {\n    return oops.In(\"repository\").Tags(\"database\", \"postgres\").Errorf(\"connection timeout\")\n}\n```\n\n### DO: Keep error messages low-cardinality\n\nError messages MUST be low-cardinality for APM aggregation. Interpolating variable data into the message breaks grouping in Datadog, Loki, Sentry.\n\n```go\n\u002F\u002F ✗ Bad — high-cardinality, breaks APM grouping\noops.Errorf(\"failed to process user %s in tenant %s\", userID, tenantID)\n\n\u002F\u002F ✓ Good — static message + structured attributes\noops.With(\"user_id\", userID).With(\"tenant_id\", tenantID).Errorf(\"failed to process user\")\n```\n\n## Panic recovery\n\n`oops.Recover()` MUST be used in goroutine boundaries. Convert panics to structured errors:\n\n```go\nfunc ProcessData(data string) (err error) {\n    return oops.\n        In(\"data-processor\").\n        Code(\"panic_recovered\").\n        Hint(\"Check input data format and dependencies\").\n        With(\"panic_value\", r).\n        Recover(func() {\n            riskyOperation(data)\n        })\n}\n```\n\n## Accessing error information\n\n`samber\u002Foops` errors implement the standard `error` interface. Access additional info:\n\n```go\nif oopsErr, ok := err.(oops.OopsError); ok {\n    fmt.Println(\"Code:\", oopsErr.Code())\n    fmt.Println(\"Domain:\", oopsErr.Domain())\n    fmt.Println(\"Tags:\", oopsErr.Tags())\n    fmt.Println(\"Context:\", oopsErr.Context())\n    fmt.Println(\"Stacktrace:\", oopsErr.Stacktrace())\n}\n\n\u002F\u002F Get public-facing message with fallback\npublicMsg := oops.GetPublic(err, \"Something went wrong\")\n```\n\n### Output formats\n\n```go\nfmt.Printf(\"%+v\\n\", err)       \u002F\u002F verbose with stack trace\nbytes, _ := json.Marshal(err)  \u002F\u002F JSON for logging\nslog.Error(err.Error(), slog.Any(\"error\", err))  \u002F\u002F slog integration\n```\n\n## Context propagation\n\nCarry error context through Go contexts:\n\n```go\nfunc middleware(next http.Handler) http.Handler {\n    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n        builder := oops.\n            In(\"http\").\n            Request(r, false).\n            Trace(r.Header.Get(\"X-Trace-ID\"))\n\n        ctx := oops.WithBuilder(r.Context(), builder)\n        next.ServeHTTP(w, r.WithContext(ctx))\n    })\n}\n\nfunc handler(ctx context.Context) error {\n    return oops.FromContext(ctx).Tags(\"handler\", \"users\").Errorf(\"something failed\")\n}\n```\n\nFor assertions, configuration, and additional logger examples, see [Advanced patterns](.\u002Freferences\u002Fadvanced.md).\n\n## References\n\n- [github.com\u002Fsamber\u002Foops](https:\u002F\u002Fgithub.com\u002Fsamber\u002Foops)\n- [pkg.go.dev\u002Fgithub.com\u002Fsamber\u002Foops](https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fsamber\u002Foops)\n\n## Cross-References\n\n- → See `samber\u002Fcc-skills-golang@golang-error-handling` skill for general error handling patterns\n- → See `samber\u002Fcc-skills-golang@golang-observability` skill for logger integration and structured logging\n",{"name":5,"license":15,"metadata":54,"description":7,"allowed-tools":57,"compatibility":58,"user-invocable":50},{"author":55,"version":56},"samber","1.1.2","Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch mcp__context7__resolve-library-id mcp__context7__query-docs","Designed for Claude Code or similar AI coding agents, and for projects using Golang.","master","b4819add93efbaf4d80627118ec34680406b309b","packages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fusage\u002Fskills\u002Fgolang-samber-oops",1,"https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats","https:\u002F\u002Fgithub.com\u002Fmuratovv","2026-11-05 20:59:10",{"source":8,"skillName":5,"commands":67,"prompt":77,"zipAvailable":78},[68,71,74],{"tool":69,"command":70},"npx","npx skills add muratovv\u002Fai-hats --skill golang-samber-oops",{"tool":72,"command":73},"bunx","bunx skills add muratovv\u002Fai-hats --skill golang-samber-oops",{"tool":75,"command":76},"pnpm","pnpm dlx skills add muratovv\u002Fai-hats --skill golang-samber-oops","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fusage\u002Fskills\u002Fgolang-samber-oops\u002FSKILL.md",true,[80,86,91,95],{"path":81,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":84,"sourceHtmlUrl":85},"evals\u002Fevals.json","REFERENCE","参考文档",12023,"https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fusage\u002Fskills\u002Fgolang-samber-oops\u002Fevals\u002Fevals.json",{"path":87,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":89,"sourceHtmlUrl":90},"LICENSE","许可证",1070,"https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fusage\u002Fskills\u002Fgolang-samber-oops\u002FLICENSE",{"path":92,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":93,"sourceHtmlUrl":94},"metadata.yaml",648,"https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fusage\u002Fskills\u002Fgolang-samber-oops\u002Fmetadata.yaml",{"path":96,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":97,"sourceHtmlUrl":98},"references\u002Fadvanced.md",1347,"https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fusage\u002Fskills\u002Fgolang-samber-oops\u002Freferences\u002Fadvanced.md",[100,127,151,170,194,206],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":49},"01M6PVFB1SM738R2SRSRSF7CY6","tool-evaluation-protocol","Time-bounded protocol for evaluating new tools, libraries, or methodologies before adoption. Use when evaluating a candidate dependency for the project, researching a methodology (e.g. ML\u002FLLM frameworks, testing approaches), or following up on a hype-driven recommendation.","https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fexperimental\u002Fusage\u002Fskills\u002Ftool-evaluation-protocol\u002FSKILL.md",[],[107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126],"protocol","Evaluation","tool","tool evaluation protocol","testing","ml","libraries","adoption","methodology","Tools","use","dependency","up","frameworks","time","project","recommendation","for","bounded","candidate",{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":49},"01M6PVF7HATBEX1G7N50E2QT57","systematic-debugging","4-phase bug-fix protocol (evidence, pattern, hypothesis, verify). Use when investigating any error, failure, or unexpected behavior, handling bug reports from users or monitoring, or diagnosing test failures with non-obvious causes.","https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fexperimental\u002Fusage\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[134,135,136,137,107,138,139,140,141,142,117,143,144,145,146,147,35,148,149,150],"systematic debugging","debugging","systematic","test","monitoring","hypothesis","verify","behavior","fix","evidence","bug","reports","pattern","users","with","bug-fix","phase",{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":158,"publishedAt":49},"01M6PVF3MTQN3RPF73AN34856J","skill-template","Canonical template and validation guide for ai-hats skills. Use when creating a new skill, reviewing an existing one for structural compliance, or deciding which pattern fits a new behavior.","https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fexperimental\u002Fusage\u002Fskills\u002Fskill-template\u002FSKILL.md",[157],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[159,160,161,162,163,141,164,117,165,146,166,167,168,124,169],"template","skill template","validation","compliance","hats","guide","new skill","structural","canonical","which","Existing",{"skillNo":171,"name":172,"nameZh":6,"description":173,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":174,"categories":175,"keywords":177,"publishedAt":49},"01M6PVF06SCV28QARM5MQPANC9","skill-optimization","Audit and refactor library components to eliminate redundancy and staleness. Use during periodic library maintenance, after adding multiple new skills or rules, when a role's token budget is too high, or after retrospectives identify component issues.","https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fexperimental\u002Fusage\u002Fskills\u002Fskill-optimization\u002FSKILL.md",[176],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[178,179,180,181,182,183,184,185,186,187,117,188,189,190,191,192,193],"Optimization","skill optimization","components","component","issues","library","audit","refactor","Budget","Rules","periodic","maintenance","token","token budget","role","high",{"skillNo":195,"name":196,"nameZh":6,"description":197,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":198,"categories":199,"keywords":200,"publishedAt":49},"01M6PVEXM9717016T9MW82HDCT","silent-fallback-gate","PreToolUse hook — refuses an Edit or Write that adds an inert broad except. Use when a Python edit was blocked for a silent fallback.","https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fexperimental\u002Fusage\u002Fskills\u002Fsilent-fallback-gate\u002FSKILL.md",[],[201,202,203,204,32,39,117,205,124],"gate","fallback","silent fallback gate","python","hook",{"skillNo":207,"name":208,"nameZh":6,"description":209,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":210,"categories":211,"keywords":213,"publishedAt":49},"01M6PVESM49C5NT7SB7N3F76VS","retro-to-framework","Convert an observation about agent behavior — from a retrospective or from a single incident — into a framework-level change (hook, rule, skill, skill update). Use after a retrospective identifies problems that are not project-specific, after an incident where an agent misapplied a component it had read, when CLAUDE.md band-aids accumulate (more than 3 per-project rules that could be generic), or when the same problem recurs across multiple projects.","https:\u002F\u002Fgithub.com\u002Fmuratovv\u002Fai-hats\u002Fblob\u002Fmaster\u002Fpackages\u002Fai-hats-library\u002Fsrc\u002Fai_hats_library\u002Fexperimental\u002Fusage\u002Fskills\u002Fretro-to-framework\u002FSKILL.md",[212],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[214,215,216,217,181,218,43,219,187,141,117,220,221,122,222,223,224,225,226,227],"framework","retro","retro to framework","change","retrospective","convert","incident","across","problem","about","more","skill update","single","generic"]