[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CWT9FWV20WFE193WJDH0AM":3,"skill-same:01M7CWT9FWV20WFE193WJDH0AM":65},{"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":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":6,"ownerDescription":44,"updatedAt":45,"install":46,"resources":58},"01M7CWT9FWV20WFE193WJDH0AM","golang-samber-mo",null,"Monadic types for Golang using samber\u002Fmo — Option, Result, Either, Future, IO, Task, and State types for type-safe nullable values, error handling, and functional composition with pipeline sub-packages. Apply when using or adopting samber\u002Fmo, when the codebase imports `github.com\u002Fsamber\u002Fmo`, or when considering functional programming patterns as a safety design for Golang.","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-samber-mo\u002FSkill.md",[],[],"2026-11-15 14:19:17",false,"---\nname: golang-samber-mo\ndescription: \"Monadic types for Golang using samber\u002Fmo — Option, Result, Either, Future, IO, Task, and State types for type-safe nullable values, error handling, and functional composition with pipeline sub-packages. Apply when using or adopting samber\u002Fmo, when the codebase imports `github.com\u002Fsamber\u002Fmo`, or when considering functional programming patterns as a safety design for Golang.\"\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.0.7\"\n  openclaw:\n    emoji: \"🎭\"\n    homepage: https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang\n    requires:\n      bins:\n        - go\n    install: []\n    skill-library-version: \"1.16.0\"\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 AskUserQuestion Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__*\n---\n\n**Persona:** You are a Go engineer bringing functional programming safety to Go. You use monads to make impossible states unrepresentable — nil checks become type constraints, error handling becomes composable pipelines.\n\n**Thinking mode:** Use `ultrathink` when designing multi-step Option\u002FResult\u002FEither pipelines. Wrong type choice creates unnecessary wrapping\u002Funwrapping that defeats the purpose of monads.\n\n# samber\u002Fmo — Monads and Functional Abstractions for Go\n\nGo 1.18+ library providing type-safe monadic types with zero dependencies. Inspired by Scala, Rust, and fp-ts.\n\n**Official Resources:**\n\n- [pkg.go.dev\u002Fgithub.com\u002Fsamber\u002Fmo](https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fsamber\u002Fmo)\n- [github.com\u002Fsamber\u002Fmo](https:\u002F\u002Fgithub.com\u002Fsamber\u002Fmo)\n\nThis skill is not exhaustive. Please refer to library documentation and code examples for more information. For Go package docs, symbols, versions, importers, and known vulnerabilities, → See `samber\u002Fcc-skills-golang@golang-pkg-go-dev` skill (`godig`) — prefer it over Context7 for Go package facts. To navigate this library's usage in your own code (definitions, call sites, diagnostics), → See `samber\u002Fcc-skills-golang@golang-gopls` skill (`gopls`). Context7 remains a fallback for docs not indexed on pkg.go.dev.\n\n```bash\ngo get github.com\u002Fsamber\u002Fmo\n```\n\nFor an introduction to functional programming concepts and why monads are valuable in Go, see [Monads Guide](.\u002Freferences\u002Fmonads-guide.md).\n\n## Core Types at a Glance\n\n| Type | Purpose | Think of it as... |\n| --- | --- | --- |\n| `Option[T]` | Value that may be absent | Rust's `Option`, Java's `Optional` |\n| `Result[T]` | Operation that may fail | Rust's `Result\u003CT, E>`, replaces `(T, error)` |\n| `Either[L, R]` | Value of one of two types | Scala's `Either`, TypeScript discriminated union |\n| `EitherX[L, R]` | Value of one of X types | Scala's `Either`, TypeScript discriminated union |\n| `Future[T]` | Async value not yet available | JavaScript `Promise` |\n| `IO[T]` | Lazy synchronous side effect | Haskell's `IO` |\n| `Task[T]` | Lazy async computation | fp-ts `Task` |\n| `State[S, A]` | Stateful computation | Haskell's `State` monad |\n\n## Option[T] — Nullable Values Without nil\n\nRepresents a value that is either present (`Some`) or absent (`None`). Eliminates nil pointer risks at the type level.\n\n```go\nimport \"github.com\u002Fsamber\u002Fmo\"\n\nname := mo.Some(\"Alice\")          \u002F\u002F Option[string] with value\nempty := mo.None[string]()        \u002F\u002F Option[string] without value\nfromPtr := mo.PointerToOption(ptr) \u002F\u002F nil pointer -> None\n\n\u002F\u002F Safe extraction\nname.OrElse(\"Anonymous\")  \u002F\u002F \"Alice\"\nempty.OrElse(\"Anonymous\")  \u002F\u002F \"Anonymous\"\n\n\u002F\u002F Transform if present, skip if absent\nupper := name.Map(func(s string) (string, bool) {\n    return strings.ToUpper(s), true\n})\n```\n\n**Key methods:** `Some`, `None`, `Get`, `MustGet`, `OrElse`, `OrEmpty`, `Map`, `FlatMap`, `Match`, `ForEach`, `ToPointer`, `IsPresent`, `IsAbsent`.\n\nOption implements `json.Marshaler\u002FUnmarshaler`, `sql.Scanner`, `driver.Valuer` — use it directly in JSON structs and database models.\n\nFor full API reference, see [Option Reference](.\u002Freferences\u002Foption.md).\n\n## Result[T] — Error Handling as Values\n\nRepresents success (`Ok`) or failure (`Err`). Equivalent to `Either[error, T]` but specialized for Go's error pattern.\n\n```go\n\u002F\u002F Wrap Go's (value, error) pattern\nresult := mo.TupleToResult(os.ReadFile(\"config.yaml\"))\n\n\u002F\u002F Same-type transform — errors short-circuit automatically\nupper := mo.Ok(\"hello\").Map(func(s string) (string, error) {\n    return strings.ToUpper(s), nil\n})\n\u002F\u002F Ok(\"HELLO\")\n\n\u002F\u002F Extract with fallback\nval := upper.OrElse(\"default\")\n```\n\n**Go limitation:** Direct methods (`.Map`, `.FlatMap`) cannot change the type parameter — `Result[T].Map` returns `Result[T]`, not `Result[U]`. Go methods cannot introduce new type parameters. For type-changing transforms (e.g. `Result[[]byte]` to `Result[Config]`), use sub-package functions or `mo.Do`:\n\n```go\nimport \"github.com\u002Fsamber\u002Fmo\u002Fresult\"\n\n\u002F\u002F Type-changing pipeline: []byte -> Config -> ValidConfig\nparsed := result.Pipe2(\n    mo.TupleToResult(os.ReadFile(\"config.yaml\")),\n    result.Map(func(data []byte) Config { return parseConfig(data) }),\n    result.FlatMap(func(cfg Config) mo.Result[ValidConfig] { return validate(cfg) }),\n)\n```\n\n**Key methods:** `Ok`, `Err`, `Errf`, `TupleToResult`, `Try`, `Get`, `MustGet`, `OrElse`, `Map`, `FlatMap`, `MapErr`, `Match`, `ForEach`, `ToEither`, `IsOk`, `IsError`.\n\nFor full API reference, see [Result Reference](.\u002Freferences\u002Fresult.md).\n\n## Either[L, R] — Discriminated Union of Two Types\n\nRepresents a value that is one of two possible types. Unlike Result, neither side implies success or failure — both are valid alternatives.\n\n```go\n\u002F\u002F API that returns either cached data or fresh data\nfunc fetchUser(id string) mo.Either[CachedUser, FreshUser] {\n    if cached, ok := cache.Get(id); ok {\n        return mo.Left[CachedUser, FreshUser](cached)\n    }\n    return mo.Right[CachedUser, FreshUser](db.Fetch(id))\n}\n\n\u002F\u002F Pattern match\nresult := fetchUser(\"user-123\")\nresult.Match(\n    func(cached CachedUser) mo.Either[CachedUser, FreshUser] { \u002F* use cached *\u002F },\n    func(fresh FreshUser) mo.Either[CachedUser, FreshUser] { \u002F* use fresh *\u002F },\n)\n```\n\n**When to use Either vs Result:** Use `Result[T]` when one path is an error. Use `Either[L, R]` when both paths are valid alternatives (cached vs fresh, left vs right, strategy A vs B).\n\n`Either3[T1, T2, T3]`, `Either4`, and `Either5` extend this to 3-5 type variants.\n\nFor full API reference, see [Either Reference](.\u002Freferences\u002Feither.md).\n\n## Do Notation — Imperative Style with Monadic Safety\n\n`mo.Do` wraps imperative code in a `Result`, catching panics from `MustGet()` calls:\n\n```go\nresult := mo.Do(func() int {\n    \u002F\u002F MustGet panics on None\u002FErr — Do catches it as Result error\n    a := mo.Some(21).MustGet()\n    b := mo.Ok(2).MustGet()\n    return a * b  \u002F\u002F 42\n})\n\u002F\u002F result is Ok(42)\n\nresult := mo.Do(func() int {\n    val := mo.None[int]().MustGet()  \u002F\u002F panics\n    return val\n})\n\u002F\u002F result is Err(\"no such element\")\n```\n\nDo notation bridges imperative Go style with monadic safety — write straight-line code, get automatic error propagation.\n\n## Pipeline Sub-Packages vs Direct Chaining\n\nsamber\u002Fmo provides two ways to compose operations:\n\n**Direct methods** (`.Map`, `.FlatMap`) — work when the output type equals the input type:\n\n```go\nopt := mo.Some(42)\ndoubled := opt.Map(func(v int) (int, bool) {\n    return v * 2, true\n})  \u002F\u002F Option[int]\n```\n\n**Sub-package functions** (`option.Map`, `result.Map`) — required when the output type differs from input:\n\n```go\nimport \"github.com\u002Fsamber\u002Fmo\u002Foption\"\n\n\u002F\u002F int -> string type change: use sub-package Map\nstrOpt := option.Map(func(v int) string {\n    return fmt.Sprintf(\"value: %d\", v)\n})(mo.Some(42))  \u002F\u002F Option[string]\n```\n\n**Pipe functions** (`option.Pipe3`, `result.Pipe3`) — chain multiple type-changing transformations readably:\n\n```go\nimport \"github.com\u002Fsamber\u002Fmo\u002Foption\"\n\nresult := option.Pipe3(\n    mo.Some(42),\n    option.Map(func(v int) string { return strconv.Itoa(v) }),\n    option.Map(func(s string) []byte { return []byte(s) }),\n    option.FlatMap(func(b []byte) mo.Option[string] {\n        if len(b) > 0 { return mo.Some(string(b)) }\n        return mo.None[string]()\n    }),\n)\n```\n\n**Rule of thumb:** Use direct methods for same-type transforms. Use sub-package functions + pipes when types change across steps.\n\nFor detailed pipeline API reference, see [Pipelines Reference](.\u002Freferences\u002Fpipelines.md).\n\n## Common Patterns\n\n### JSON API responses with Option\n\n```go\ntype UserResponse struct {\n    Name     string            `json:\"name\"`\n    Nickname mo.Option[string] `json:\"nickname\"`  \u002F\u002F omits null gracefully\n    Bio      mo.Option[string] `json:\"bio\"`\n}\n```\n\n### Database nullable columns\n\n```go\ntype User struct {\n    ID       int\n    Email    string\n    Phone    mo.Option[string]  \u002F\u002F implements sql.Scanner + driver.Valuer\n}\n\nerr := row.Scan(&u.ID, &u.Email, &u.Phone)\n```\n\n### Wrapping existing Go APIs\n\n```go\n\u002F\u002F Convert map lookup to Option\nfunc MapGet[K comparable, V any](m map[K]V, key K) mo.Option[V] {\n    return mo.TupleToOption(m[key])  \u002F\u002F m[key] returns (V, bool)\n}\n```\n\n### Uniform extraction with Fold\n\n`mo.Fold` works uniformly across Option, Result, and Either via the `Foldable` interface:\n\n```go\nstr := mo.Fold[error, int, string](\n    mo.Ok(42),  \u002F\u002F works with Option, Result, or Either\n    func(v int) string { return fmt.Sprintf(\"got %d\", v) },\n    func(err error) string { return \"failed\" },\n)\n\u002F\u002F \"got 42\"\n```\n\n## Best Practices\n\n1. **Prefer `OrElse` over `MustGet`** — `MustGet` panics on absent\u002Ferror values; use it only inside `mo.Do` blocks where panics are caught, or when you are certain the value exists\n2. **Use `TupleToResult` at API boundaries** — convert Go's `(T, error)` to `Result[T]` at the boundary, then chain with `Map`\u002F`FlatMap` inside your domain logic\n3. **Use `Result[T]` for errors, `Either[L, R]` for alternatives** — Result is specialized for success\u002Ffailure; Either is for two valid types\n4. **Option for nullable fields, not zero values** — `Option[string]` distinguishes \"absent\" from \"empty string\"; use plain `string` when empty string is a valid value\n5. **Chain, don't nest** — `result.Map(...).FlatMap(...).OrElse(default)` reads left-to-right; avoid nested if\u002Felse patterns when monadic chaining is cleaner\n6. **Use sub-package pipes for multi-step type transformations** — when 3+ steps each change the type, `option.Pipe3(...)` is more readable than nested function calls\n\nFor advanced types (Future, IO, Task, State), see [Advanced Types Reference](.\u002Freferences\u002Fadvanced-types.md).\n\nIf you encounter a bug or unexpected behavior in samber\u002Fmo, open an issue at \u003Chttps:\u002F\u002Fgithub.com\u002Fsamber\u002Fmo\u002Fissues>.\n\n## Cross-References\n\n- -> See `samber\u002Fcc-skills-golang@golang-samber-lo` skill for functional collection transforms (Map, Filter, Reduce on slices) that compose with mo types\n- -> See `samber\u002Fcc-skills-golang@golang-error-handling` skill for idiomatic Go error handling patterns\n- -> See `samber\u002Fcc-skills-golang@golang-safety` skill for nil-safety and defensive Go coding\n- -> See `samber\u002Fcc-skills-golang@golang-database` skill for database access patterns\n- -> See `samber\u002Fcc-skills-golang@golang-design-patterns` skill for functional options and other Go patterns\n","**Persona:** You are a Go engineer bringing functional programming safety to Go. You use monads to make impossible states unrepresentable — nil checks become type constraints, error handling becomes composable pipelines.\n\n**Thinking mode:** Use `ultrathink` when designing multi-step Option\u002FResult\u002FEither pipelines. Wrong type choice creates unnecessary wrapping\u002Funwrapping that defeats the purpose of monads.\n\n# samber\u002Fmo — Monads and Functional Abstractions for Go\n\nGo 1.18+ library providing type-safe monadic types with zero dependencies. Inspired by Scala, Rust, and fp-ts.\n\n**Official Resources:**\n\n- [pkg.go.dev\u002Fgithub.com\u002Fsamber\u002Fmo](https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fsamber\u002Fmo)\n- [github.com\u002Fsamber\u002Fmo](https:\u002F\u002Fgithub.com\u002Fsamber\u002Fmo)\n\nThis skill is not exhaustive. Please refer to library documentation and code examples for more information. For Go package docs, symbols, versions, importers, and known vulnerabilities, → See `samber\u002Fcc-skills-golang@golang-pkg-go-dev` skill (`godig`) — prefer it over Context7 for Go package facts. To navigate this library's usage in your own code (definitions, call sites, diagnostics), → See `samber\u002Fcc-skills-golang@golang-gopls` skill (`gopls`). Context7 remains a fallback for docs not indexed on pkg.go.dev.\n\n```bash\ngo get github.com\u002Fsamber\u002Fmo\n```\n\nFor an introduction to functional programming concepts and why monads are valuable in Go, see [Monads Guide](.\u002Freferences\u002Fmonads-guide.md).\n\n## Core Types at a Glance\n\n| Type | Purpose | Think of it as... |\n| --- | --- | --- |\n| `Option[T]` | Value that may be absent | Rust's `Option`, Java's `Optional` |\n| `Result[T]` | Operation that may fail | Rust's `Result\u003CT, E>`, replaces `(T, error)` |\n| `Either[L, R]` | Value of one of two types | Scala's `Either`, TypeScript discriminated union |\n| `EitherX[L, R]` | Value of one of X types | Scala's `Either`, TypeScript discriminated union |\n| `Future[T]` | Async value not yet available | JavaScript `Promise` |\n| `IO[T]` | Lazy synchronous side effect | Haskell's `IO` |\n| `Task[T]` | Lazy async computation | fp-ts `Task` |\n| `State[S, A]` | Stateful computation | Haskell's `State` monad |\n\n## Option[T] — Nullable Values Without nil\n\nRepresents a value that is either present (`Some`) or absent (`None`). Eliminates nil pointer risks at the type level.\n\n```go\nimport \"github.com\u002Fsamber\u002Fmo\"\n\nname := mo.Some(\"Alice\")          \u002F\u002F Option[string] with value\nempty := mo.None[string]()        \u002F\u002F Option[string] without value\nfromPtr := mo.PointerToOption(ptr) \u002F\u002F nil pointer -> None\n\n\u002F\u002F Safe extraction\nname.OrElse(\"Anonymous\")  \u002F\u002F \"Alice\"\nempty.OrElse(\"Anonymous\")  \u002F\u002F \"Anonymous\"\n\n\u002F\u002F Transform if present, skip if absent\nupper := name.Map(func(s string) (string, bool) {\n    return strings.ToUpper(s), true\n})\n```\n\n**Key methods:** `Some`, `None`, `Get`, `MustGet`, `OrElse`, `OrEmpty`, `Map`, `FlatMap`, `Match`, `ForEach`, `ToPointer`, `IsPresent`, `IsAbsent`.\n\nOption implements `json.Marshaler\u002FUnmarshaler`, `sql.Scanner`, `driver.Valuer` — use it directly in JSON structs and database models.\n\nFor full API reference, see [Option Reference](.\u002Freferences\u002Foption.md).\n\n## Result[T] — Error Handling as Values\n\nRepresents success (`Ok`) or failure (`Err`). Equivalent to `Either[error, T]` but specialized for Go's error pattern.\n\n```go\n\u002F\u002F Wrap Go's (value, error) pattern\nresult := mo.TupleToResult(os.ReadFile(\"config.yaml\"))\n\n\u002F\u002F Same-type transform — errors short-circuit automatically\nupper := mo.Ok(\"hello\").Map(func(s string) (string, error) {\n    return strings.ToUpper(s), nil\n})\n\u002F\u002F Ok(\"HELLO\")\n\n\u002F\u002F Extract with fallback\nval := upper.OrElse(\"default\")\n```\n\n**Go limitation:** Direct methods (`.Map`, `.FlatMap`) cannot change the type parameter — `Result[T].Map` returns `Result[T]`, not `Result[U]`. Go methods cannot introduce new type parameters. For type-changing transforms (e.g. `Result[[]byte]` to `Result[Config]`), use sub-package functions or `mo.Do`:\n\n```go\nimport \"github.com\u002Fsamber\u002Fmo\u002Fresult\"\n\n\u002F\u002F Type-changing pipeline: []byte -> Config -> ValidConfig\nparsed := result.Pipe2(\n    mo.TupleToResult(os.ReadFile(\"config.yaml\")),\n    result.Map(func(data []byte) Config { return parseConfig(data) }),\n    result.FlatMap(func(cfg Config) mo.Result[ValidConfig] { return validate(cfg) }),\n)\n```\n\n**Key methods:** `Ok`, `Err`, `Errf`, `TupleToResult`, `Try`, `Get`, `MustGet`, `OrElse`, `Map`, `FlatMap`, `MapErr`, `Match`, `ForEach`, `ToEither`, `IsOk`, `IsError`.\n\nFor full API reference, see [Result Reference](.\u002Freferences\u002Fresult.md).\n\n## Either[L, R] — Discriminated Union of Two Types\n\nRepresents a value that is one of two possible types. Unlike Result, neither side implies success or failure — both are valid alternatives.\n\n```go\n\u002F\u002F API that returns either cached data or fresh data\nfunc fetchUser(id string) mo.Either[CachedUser, FreshUser] {\n    if cached, ok := cache.Get(id); ok {\n        return mo.Left[CachedUser, FreshUser](cached)\n    }\n    return mo.Right[CachedUser, FreshUser](db.Fetch(id))\n}\n\n\u002F\u002F Pattern match\nresult := fetchUser(\"user-123\")\nresult.Match(\n    func(cached CachedUser) mo.Either[CachedUser, FreshUser] { \u002F* use cached *\u002F },\n    func(fresh FreshUser) mo.Either[CachedUser, FreshUser] { \u002F* use fresh *\u002F },\n)\n```\n\n**When to use Either vs Result:** Use `Result[T]` when one path is an error. Use `Either[L, R]` when both paths are valid alternatives (cached vs fresh, left vs right, strategy A vs B).\n\n`Either3[T1, T2, T3]`, `Either4`, and `Either5` extend this to 3-5 type variants.\n\nFor full API reference, see [Either Reference](.\u002Freferences\u002Feither.md).\n\n## Do Notation — Imperative Style with Monadic Safety\n\n`mo.Do` wraps imperative code in a `Result`, catching panics from `MustGet()` calls:\n\n```go\nresult := mo.Do(func() int {\n    \u002F\u002F MustGet panics on None\u002FErr — Do catches it as Result error\n    a := mo.Some(21).MustGet()\n    b := mo.Ok(2).MustGet()\n    return a * b  \u002F\u002F 42\n})\n\u002F\u002F result is Ok(42)\n\nresult := mo.Do(func() int {\n    val := mo.None[int]().MustGet()  \u002F\u002F panics\n    return val\n})\n\u002F\u002F result is Err(\"no such element\")\n```\n\nDo notation bridges imperative Go style with monadic safety — write straight-line code, get automatic error propagation.\n\n## Pipeline Sub-Packages vs Direct Chaining\n\nsamber\u002Fmo provides two ways to compose operations:\n\n**Direct methods** (`.Map`, `.FlatMap`) — work when the output type equals the input type:\n\n```go\nopt := mo.Some(42)\ndoubled := opt.Map(func(v int) (int, bool) {\n    return v * 2, true\n})  \u002F\u002F Option[int]\n```\n\n**Sub-package functions** (`option.Map`, `result.Map`) — required when the output type differs from input:\n\n```go\nimport \"github.com\u002Fsamber\u002Fmo\u002Foption\"\n\n\u002F\u002F int -> string type change: use sub-package Map\nstrOpt := option.Map(func(v int) string {\n    return fmt.Sprintf(\"value: %d\", v)\n})(mo.Some(42))  \u002F\u002F Option[string]\n```\n\n**Pipe functions** (`option.Pipe3`, `result.Pipe3`) — chain multiple type-changing transformations readably:\n\n```go\nimport \"github.com\u002Fsamber\u002Fmo\u002Foption\"\n\nresult := option.Pipe3(\n    mo.Some(42),\n    option.Map(func(v int) string { return strconv.Itoa(v) }),\n    option.Map(func(s string) []byte { return []byte(s) }),\n    option.FlatMap(func(b []byte) mo.Option[string] {\n        if len(b) > 0 { return mo.Some(string(b)) }\n        return mo.None[string]()\n    }),\n)\n```\n\n**Rule of thumb:** Use direct methods for same-type transforms. Use sub-package functions + pipes when types change across steps.\n\nFor detailed pipeline API reference, see [Pipelines Reference](.\u002Freferences\u002Fpipelines.md).\n\n## Common Patterns\n\n### JSON API responses with Option\n\n```go\ntype UserResponse struct {\n    Name     string            `json:\"name\"`\n    Nickname mo.Option[string] `json:\"nickname\"`  \u002F\u002F omits null gracefully\n    Bio      mo.Option[string] `json:\"bio\"`\n}\n```\n\n### Database nullable columns\n\n```go\ntype User struct {\n    ID       int\n    Email    string\n    Phone    mo.Option[string]  \u002F\u002F implements sql.Scanner + driver.Valuer\n}\n\nerr := row.Scan(&u.ID, &u.Email, &u.Phone)\n```\n\n### Wrapping existing Go APIs\n\n```go\n\u002F\u002F Convert map lookup to Option\nfunc MapGet[K comparable, V any](m map[K]V, key K) mo.Option[V] {\n    return mo.TupleToOption(m[key])  \u002F\u002F m[key] returns (V, bool)\n}\n```\n\n### Uniform extraction with Fold\n\n`mo.Fold` works uniformly across Option, Result, and Either via the `Foldable` interface:\n\n```go\nstr := mo.Fold[error, int, string](\n    mo.Ok(42),  \u002F\u002F works with Option, Result, or Either\n    func(v int) string { return fmt.Sprintf(\"got %d\", v) },\n    func(err error) string { return \"failed\" },\n)\n\u002F\u002F \"got 42\"\n```\n\n## Best Practices\n\n1. **Prefer `OrElse` over `MustGet`** — `MustGet` panics on absent\u002Ferror values; use it only inside `mo.Do` blocks where panics are caught, or when you are certain the value exists\n2. **Use `TupleToResult` at API boundaries** — convert Go's `(T, error)` to `Result[T]` at the boundary, then chain with `Map`\u002F`FlatMap` inside your domain logic\n3. **Use `Result[T]` for errors, `Either[L, R]` for alternatives** — Result is specialized for success\u002Ffailure; Either is for two valid types\n4. **Option for nullable fields, not zero values** — `Option[string]` distinguishes \"absent\" from \"empty string\"; use plain `string` when empty string is a valid value\n5. **Chain, don't nest** — `result.Map(...).FlatMap(...).OrElse(default)` reads left-to-right; avoid nested if\u002Felse patterns when monadic chaining is cleaner\n6. **Use sub-package pipes for multi-step type transformations** — when 3+ steps each change the type, `option.Pipe3(...)` is more readable than nested function calls\n\nFor advanced types (Future, IO, Task, State), see [Advanced Types Reference](.\u002Freferences\u002Fadvanced-types.md).\n\nIf you encounter a bug or unexpected behavior in samber\u002Fmo, open an issue at \u003Chttps:\u002F\u002Fgithub.com\u002Fsamber\u002Fmo\u002Fissues>.\n\n## Cross-References\n\n- -> See `samber\u002Fcc-skills-golang@golang-samber-lo` skill for functional collection transforms (Map, Filter, Reduce on slices) that compose with mo types\n- -> See `samber\u002Fcc-skills-golang@golang-error-handling` skill for idiomatic Go error handling patterns\n- -> See `samber\u002Fcc-skills-golang@golang-safety` skill for nil-safety and defensive Go coding\n- -> See `samber\u002Fcc-skills-golang@golang-database` skill for database access patterns\n- -> See `samber\u002Fcc-skills-golang@golang-design-patterns` skill for functional options and other Go patterns\n",{"name":5,"license":15,"metadata":24,"description":7,"allowed-tools":35,"compatibility":36,"user-invocable":37},{"author":25,"version":26,"openclaw":27},"samber","1.0.7",{"emoji":28,"install":29,"homepage":30,"requires":31,"skill-library-version":34},"🎭",[],"https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang",{"bins":32},[33],"go","1.16.0","Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch mcp__context7__resolve-library-id mcp__context7__query-docs AskUserQuestion Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__*","Designed for Claude Code or similar AI coding agents, and for projects using Golang.",true,"main","8859218955d9504cd18b59e7892100718039d3b4","data\u002Fskills\u002Fsamber-cc-skills-golang\u002Fgolang-samber-mo",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":47,"prompt":57,"zipAvailable":37},[48,51,54],{"tool":49,"command":50},"npx","npx skills add om-scogo\u002Fskillsh-scraper --skill golang-samber-mo",{"tool":52,"command":53},"bunx","bunx skills add om-scogo\u002Fskillsh-scraper --skill golang-samber-mo",{"tool":55,"command":56},"pnpm","pnpm dlx skills add om-scogo\u002Fskillsh-scraper --skill golang-samber-mo","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fsamber-cc-skills-golang\u002Fgolang-samber-mo\u002FSkill.md",[59],{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},"metadata.json","REFERENCE","参考文档",465,"https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fsamber-cc-skills-golang\u002Fgolang-samber-mo\u002Fmetadata.json",[66,73,78,85,90,97],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"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":74,"name":68,"nameZh":6,"description":69,"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},"01M7D6M85CKKN87TA98VCQV4H7","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fyorkeccak-scientific-skills\u002Farxiv-search\u002FSkill.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"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":86,"name":80,"nameZh":6,"description":81,"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},"01M7D4ZHZKJD2RSNGAF63V14P4","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002FSkill.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"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":98,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M7D4Z4MVYVY3NMJ18BNV6WNA","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002FSkill.md",[],[]]