[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M76H8T8VS95TSR7SGATSP41E":3,"skill-same:01M76H8T8VS95TSR7SGATSP41E":69},{"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":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":45,"ownerHtmlUrl":46,"ownerBlogUrl":47,"ownerDescription":48,"updatedAt":49,"install":50,"resources":62},"01M76H8T8VS95TSR7SGATSP41E","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. Not for nil-safety and zero-value design without this library (→ See `samber\u002Fcc-skills-golang@golang-safety` skill), nor for native error wrapping with fmt.Errorf, errors.Is and errors.As (→ See `samber\u002Fcc-skills-golang@golang-error-handling` skill).","bg-szy\u002FTOP-SKILLS","bg-szy","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F106576190?v=4","01M73A4E8KPV67SFXRY8XZGNBX","ShuZhiyong","01M73A4E96MQ294MHM74TZBVQD",6,"MIT","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fgolang-samber-mo\u002FSKILL.md",[],[],"2026-11-12 13:55:43",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. Not for nil-safety and zero-value design without this library (→ See `samber\u002Fcc-skills-golang@golang-safety` skill), nor for native error wrapping with fmt.Errorf, errors.Is and errors.As (→ See `samber\u002Fcc-skills-golang@golang-error-handling` skill).\"\nuser-invocable: true\nlicense: MIT\ncompatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang.\nmetadata:\n  author: samber\n  version: \"1.1.2\"\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__*\npaths:\n  - \"**\u002F*.go\"\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:** Reason as thoroughly as possible when designing multi-step Option\u002FResult\u002FEither pipelines — wrong type choice creates unnecessary wrapping\u002Funwrapping that defeats the purpose of monads. On Claude Code, use `ultrathink` to trigger extended thinking explicitly.\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 — refer to library documentation and code examples for more information:\n\n- For Go package docs, symbols, versions, importers, and known vulnerabilities, → See `samber\u002Fcc-skills-golang@golang-pkg-go-dev` skill (`godig`), preferred over Context7 for Go package facts.\n- To navigate this library's usage in your own code (definitions, call sites, diagnostics), → See `samber\u002Fcc-skills-golang@golang-gopls` skill (`gopls`).\n- 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:** Reason as thoroughly as possible when designing multi-step Option\u002FResult\u002FEither pipelines — wrong type choice creates unnecessary wrapping\u002Funwrapping that defeats the purpose of monads. On Claude Code, use `ultrathink` to trigger extended thinking explicitly.\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 — refer to library documentation and code examples for more information:\n\n- For Go package docs, symbols, versions, importers, and known vulnerabilities, → See `samber\u002Fcc-skills-golang@golang-pkg-go-dev` skill (`godig`), preferred over Context7 for Go package facts.\n- To navigate this library's usage in your own code (definitions, call sites, diagnostics), → See `samber\u002Fcc-skills-golang@golang-gopls` skill (`gopls`).\n- 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,"paths":24,"license":15,"metadata":26,"description":7,"allowed-tools":37,"compatibility":38,"user-invocable":39},[25],"**\u002F*.go",{"author":27,"version":28,"openclaw":29},"samber","1.1.2",{"emoji":30,"install":31,"homepage":32,"requires":33,"skill-library-version":36},"🎭",[],"https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang",{"bins":34},[35],"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, Codex or similar harness, and for projects using Golang.",true,"master","fd76f882a04e445e899d5cfb2732f2105ea054ee","skills\u002Fmarketplace\u002Fgolang-samber-mo",0,"https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS","https:\u002F\u002Fbg-szy.github.io\u002FTOP-SKILLS\u002F","https:\u002F\u002Fgithub.com\u002Fbg-szy","https:\u002F\u002Fwww.ecust.edu.cn\u002F","a student of East China University of Science and Technology","2026-11-15 03:38:02",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":39},[52,55,58],{"tool":53,"command":54},"npx","npx skills add bg-szy\u002FTOP-SKILLS --skill golang-samber-mo",{"tool":56,"command":57},"bunx","bunx skills add bg-szy\u002FTOP-SKILLS --skill golang-samber-mo",{"tool":59,"command":60},"pnpm","pnpm dlx skills add bg-szy\u002FTOP-SKILLS --skill golang-samber-mo","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fgolang-samber-mo\u002FSKILL.md",[63],{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":68},"skill-report.json","REFERENCE","参考文档",75454,"https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fgolang-samber-mo\u002Fskill-report.json",[70,78,85,92,99,106],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":77},"01M7DXW9N826PKXK174PVW3038","serpmaven","Scrape Google search results (SERP) to JSON with SERP Maven (serpmaven) - a real Chrome browser on a residential proxy with sticky sessions. Run it as a CLI, a Python library, a local HTTP search API (`serve`), an MCP server or a Docker image; set the proxy login, workers, pages and cost tracking. Use when the user wants Google results, rank tracking, a self-hosted SERP API, or live Google search for an AI agent.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fserpmaven\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"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":77},"01M7DXVHSTWDV65475QEQ915M7","revnu-landing-page-audit","Find out why a landing page isn't turning visitors into signups, demos or sales. Audits one page against what the ad, post or search that sends people there promised, then checks the first screen, proof, call to action, friction and mobile. Returns at most 7 prioritized fixes, plus what is fine and what could not be checked; rewrites specific lines and fixes the page in the repo when asked. Never promises a conversion lift. Works without a Revnu account. Use when the user says or asks: \"audit my landing page\", \"why isn't this page converting\", \"review my homepage\", \"my ads get clicks but no signups\", \"people bounce from the pricing page\", \"CRO review\", \"improve conversion rate\", \"is my hero section clear\", \"roast my landing page\", \"rewrite my headline\", \"what's wrong with this page\", \"landing page feedback\", \"make the signup page convert better\". Not for SEO or AI-search audits, page speed engineering on its own, or building a new page from scratch.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-landing-page-audit\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":77},"01M7DXV8X2D7B3VTD4HHYYHTGR","revnu-growth-context","Write down once who buys, what they're stuck on, what it costs, what proof you have and what you've already tried, so every growth task starts from facts instead of a questionnaire. Creates or updates .agents\u002Frevnu-growth.md from the repo, the live site and the user, and imports an existing product-marketing.md. Use when the user says \"set up our marketing context\", \"who is our ideal customer\", \"write our ICP\", \"describe the product for marketing\", \"positioning doc\", \"what's our brand voice\", \"remember this about our customers\", \"log what we tried\", \"what have we learned from marketing\", \"we changed pricing, update the context\", \"update our growth notes\", \"summarize the business for the agent\", \"import my product-marketing.md\", \"start a growth doc\", or before a first marketing, SEO, outreach or launch task when no context file exists. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-growth-context\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":77},"01M7DXV0DGJ1G0A60PAHC6J3C5","revnu-get-listed","Get onto the third-party pages AI answers and search cite when buyers ask for the best tool in your category: \"best X\" roundups, directories, review sites, GitHub awesome lists, community threads and comparison pages. Finds which ones are cited, ranks them by fit and effort, and drafts each submission, PR or pitch by the target's own rules. Use when the user says \"get us listed\", \"which directories should we submit to\", \"how do we get into best-of lists\", \"why does ChatGPT recommend competitors and not us\", \"get mentioned in AI answers\", \"submit to awesome lists\", \"get on G2\", \"where are our competitors listed\", \"pitch listicle authors\", \"find backlink opportunities\", \"launch directories\", \"get into roundups\", \"Product Hunt alternatives\", \"where should we be listed\", \"get cited by Perplexity\". Never submits, pays or posts without a yes. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-get-listed\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":77},"01M7DXTSPMGT9D6DSS0HP9BSTA","revnu-ai-readiness-audit","Audit whether your website gives ChatGPT, Perplexity, Claude, Gemini and Google's AI Overviews something worth quoting, and fix the pages that don't. Use when the user says or asks \"is my site ready for AI search\", \"audit my site for AI answers\", \"AEO audit\", \"GEO audit\", \"why doesn't ChatGPT quote our pricing\", \"make our pages citable by AI\", \"do I need llms.txt\", \"does schema help with ChatGPT\", \"check our structured data\", \"is our content visible without JavaScript\", \"AI SEO audit\", \"optimize our homepage for AI answers\", \"LLM SEO check\", \"why does AI get our product wrong\", \"fix our site for AI Overviews\". Checks fetchability and indexability, answers in the raw HTML, entity facts, schema (including JS-injected markup), headings, dates and llms.txt, then gives at most 10 prioritised fixes and edits the repo when asked. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-ai-readiness-audit\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":77},"01M7DXSZHCVTRS620GC3S97JZV","proxy-troubleshooting","Diagnose residential proxy failures, with NodeMaven's gateway as the reference - 407 with correct credentials, 406, 410, 500, a connection that hangs, ERR_TUNNEL_CONNECTION_FAILED in a browser, Playwright or Puppeteer ignoring proxy credentials, a sticky session that changes IP, geo-targeting that is silently ignored, passwords with special characters, and unexpected traffic from headless Chrome. Use when a proxy connection fails, returns the wrong location, or costs more traffic than expected.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fproxy-troubleshooting\u002FSKILL.md",[],[]]