[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6F1Z57Z14AT7VVFPGK6MXYT":3,"skill-same:01M6F1Z57Z14AT7VVFPGK6MXYT":116},{"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":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":59,"repositoryHtmlUrl":60,"repositoryHomepageUrl":6,"ownerHtmlUrl":61,"ownerBlogUrl":6,"ownerDescription":62,"updatedAt":63,"install":64,"resources":77},"01M6F1Z57Z14AT7VVFPGK6MXYT","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.","luokai0\u002Fai-agent-skills-by-luo-kai","luokai0","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F266954973?v=4","01M6E16VNT42JB8B3X3254QWJ7","luo kai","01M6E16VTFVP6S5XJF1V1MPV90",14,"MIT","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fgolang-samber-mo\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"golang","golang samber mo","option","functional","types","error","io","false","query","nullable","either","design","projects","Bash","Composition","pipeline","code","packages","ai coding agents","MCP","2026-11-10 10:12:30",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: 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.0.3\"\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 WebFetch mcp__context7__resolve-library-id mcp__context7__query-docs AskUserQuestion\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. Context7 can help as a discoverability platform.\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.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. Context7 can help as a discoverability platform.\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.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":44,"description":7,"allowed-tools":54,"compatibility":55,"user-invocable":40},{"author":45,"version":46,"openclaw":47},"samber","1.0.3",{"emoji":48,"install":49,"homepage":50,"requires":51},"?",[],"https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang",{"bins":52},[53],"go","Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch mcp__context7__resolve-library-id mcp__context7__query-docs AskUserQuestion","Designed for Claude Code or similar AI coding agents, and for projects using Golang.","main","4d2fb89cdfb75f3f6fd3c6c5ec9ad90ea129eb3c","ai-agent-skills\u002F22-clawhub-skills\u002Fgolang-samber-mo",2,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai","https:\u002F\u002Fgithub.com\u002Fluokai0","a solo builder.","2026-05-06 04:29:04",{"source":8,"skillName":5,"commands":65,"prompt":75,"zipAvailable":76},[66,69,72],{"tool":67,"command":68},"npx","npx skills add luokai0\u002Fai-agent-skills-by-luo-kai --skill golang-samber-mo",{"tool":70,"command":71},"bunx","bunx skills add luokai0\u002Fai-agent-skills-by-luo-kai --skill golang-samber-mo",{"tool":73,"command":74},"pnpm","pnpm dlx skills add luokai0\u002Fai-agent-skills-by-luo-kai --skill golang-samber-mo","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fgolang-samber-mo\u002FSKILL.md",true,[78,84,88,92,96,100,104,108,112],{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"_meta.json","REFERENCE","参考文档",135,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fgolang-samber-mo\u002F_meta.json",{"path":85,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":86,"sourceHtmlUrl":87},".clawhub\u002Forigin.json",148,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fgolang-samber-mo\u002F.clawhub\u002Forigin.json",{"path":89,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":90,"sourceHtmlUrl":91},"evals\u002Fevals.json",22354,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fgolang-samber-mo\u002Fevals\u002Fevals.json",{"path":93,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":94,"sourceHtmlUrl":95},"references\u002Fadvanced-types.md",7520,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fgolang-samber-mo\u002Freferences\u002Fadvanced-types.md",{"path":97,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":98,"sourceHtmlUrl":99},"references\u002Feither.md",4887,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fgolang-samber-mo\u002Freferences\u002Feither.md",{"path":101,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":102,"sourceHtmlUrl":103},"references\u002Fmonads-guide.md",6897,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fgolang-samber-mo\u002Freferences\u002Fmonads-guide.md",{"path":105,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":106,"sourceHtmlUrl":107},"references\u002Foption.md",4490,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fgolang-samber-mo\u002Freferences\u002Foption.md",{"path":109,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":110,"sourceHtmlUrl":111},"references\u002Fpipelines.md",5317,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fgolang-samber-mo\u002Freferences\u002Fpipelines.md",{"path":113,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":114,"sourceHtmlUrl":115},"references\u002Fresult.md",3664,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fgolang-samber-mo\u002Freferences\u002Fresult.md",[117,144,161,182,209,234],{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":39},"01M6F2SKTE208174C7S7JJCZC7","write-contracts","Generates secure Aptos Move V2 smart contracts with Object model, Digital Asset integration, security patterns, and storage type guidance. Includes comprehensive storage decision framework for optimal data structure selection. Triggers on: 'write contract', 'create NFT collection', 'build marketplace', 'implement minting', 'generate Move module', 'create token contract', 'build DAO', 'implement staking'. Ask storage questions when: 'store', 'track', 'registry', 'mapping', 'list', 'collection'.","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fwrite-contracts\u002FSKILL.md",[],[124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143],"write","contracts","write contracts","storage","secure","create","generate","collection","model","decision","ask","smart-contracts","selection","objects","structure","nft","token","aptos","critical","move",{"skillNo":145,"name":146,"nameZh":6,"description":147,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":148,"categories":149,"keywords":150,"publishedAt":39},"01M6F2RFXJ6T9MKW0A7N7GM45B","web-search","通用网络搜索技能，支持多引擎搜索（百度、必应、DuckDuckGo），无需API密钥即可获取实时信息","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fweb-search-ex-skill\u002FSKILL.md",[],[151,152,153,154,155,156,157,158,159,160],"web","search","web search","搜索","baidu","bing","duckduckgo","百度","多引擎","internet",{"skillNo":162,"name":163,"nameZh":6,"description":164,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":167,"publishedAt":39},"01M6F2K968G1FZEZFPW2E6B222","solo-build","Execute implementation plan tasks with TDD workflow, auto-commit, and phase gates. Use when user says \"build it\", \"start building\", \"execute plan\", \"implement tasks\", \"ship it\", or references a track ID. Do NOT use for planning (use \u002Fplan) or scaffolding (use \u002Fscaffold).","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fsolo-build\u002FSKILL.md",[],[168,169,170,38,171,172,173,35,152,32,174,175,124,176,177,178,27,179,180,181],"build","solo","solo build","workflow","commit","tasks","plan","read","auto","references","context7","scaffolding","ship it","project",{"skillNo":183,"name":184,"nameZh":6,"description":185,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":186,"categories":187,"keywords":188,"publishedAt":39},"01M6F2GKN39SGHSPWYB3662YC8","react-email","Use when building HTML email templates with React components, adding a visual email editor to an application using the React Email visual editor, rendering emails to HTML, or sending emails with Resend. Covers welcome emails, password resets, notifications, order confirmations, newsletters, transactional emails, and the embeddable email editor component.","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Freact-email-skills\u002FSKILL.md",[],[189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208],"react","email","react email","github","editor","components","react components","component","welcome","https","notifications","password","node","use","html","resend","visual","emails","rendering","with",{"skillNo":210,"name":211,"nameZh":6,"description":212,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":213,"categories":214,"keywords":215,"publishedAt":39},"01M6F2FBVGVDFSG8SSFJGXA40C","APITester Agent-Driven API Testing","Test API endpoints and document responses. Define tests in plain English, run them, get formatted results. Agent-driven Postman alternative.","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fopenclaw-api-tester\u002FSKILL.md",[],[216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233],"testing","api","api testing","driven","APITester Agent Driven API Testing","test","run","postman","results","plain english","tester","endpoints","document","get","define","tests","english","api-tester",{"skillNo":235,"name":236,"nameZh":6,"description":237,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":238,"categories":239,"keywords":240,"publishedAt":39},"01M6F273Y3NGAPVJZ608BC0G9G","hubspot-implementation-plan","Generate a phased implementation plan from a HubSpot audit report. Creates prioritized, sequenced cleanup processes with effort estimates, dependencies, and automation feasibility. Use after running \u002Fhubspot-audit.","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fhubspot-implementation-plan\u002FSKILL.md",[],[174,241,242,243,244,245,246,130,247,248,249,250,251,202,252,253,208,254],"implementation","hubspot","hubspot implementation plan","automation","feasibility","cleanup","planning","report","audit","audit report","phased implementation","dependencies","processes","hubspot audit"]