SkillsReviewed · samber

golang-samber-mo

golang-samber-mo is a coding assistant skill for Go developers using samber/mo, but some supplied examples need correction before use. It explains optional values, composable error handling, alternative result types and deferred computations, with particular attention to Go's restrictions on type-changing methods.

Researched 17 Nov 2026

In short.

golang-samber-mo is a coding assistant skill for Go developers using samber/mo, but some supplied examples contain mistakes. Its strongest material explains Option, Result and Either, including when transformations require standalone generic functions instead of direct methods. The references also cover JSON and SQL integration, asynchronous work and deferred side effects. Important weaknesses include an invalid map-lookup example, discarded YAML parsing errors and evaluation expectations that conflict with documented method restrictions. Nothing was executed, and assistant performance, release compatibility and operating costs remain unknown.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete supplied skills/golang-samber-mo folder at revision d68d80aec298e1b74b37c2a472c002b5217248b3: SKILL.md, evals/evals.json, and references/advanced-types.md, either.md, monads-guide.md, option.md, pipelines.md and result.md. Includes the repository-root LICENSE as the related notice. Excludes other repository skills, the samber/mo implementation and its licence, external documentation and host installation documentation. Runtime behavior, compilation, host compatibility, performance and evaluation outcomes remain unassessed; no code was executed.

The overview

Identity

golang-samber-mo is the skills/golang-samber-mo folder in samber/cc-skills-golang, with samber named as its author. It contains SKILL.md, six reference documents and an evaluation specification. It is designed for Claude Code, Codex or similar coding assistant hosts working on Go projects.

The original folder at the supplied revision is available at [https://github.com/samber/cc-skills-golang/tree/d68d80aec298e1b74b37c2a472c002b5217248b3/skills/golang-samber-mo]. The skill supplies instructions and reference material for using the separate samber/mo Go library.

Assessment

The resource offers useful library-specific detail: the distinction between absence, failure and valid alternatives; the callback signatures of transformation methods; and the need for sub-package functions when types change. Its introductory guide also explains these ideas without assuming prior knowledge of monads.

Use the material with code review. Several examples and evaluation assertions conflict with its more precise API references. The 23 evaluation scenarios describe intended answers, but provide no execution results or evidence that the skill improves assistant output.

Users

The clearest audience is Go developers whose projects already import github.com/samber/mo, or teams considering it for nullable database fields, optional configuration and multi-step transformations. Beginners get an explanation of wrapped values and automatic propagation of absence or failure; experienced developers get signatures and composition patterns.

The guide recommends conventional Go for simple operations, complicated recovery at individual steps and teams unfamiliar with functional programming. The skill's description also directs general nil-safety and native error-wrapping work to separate skills.

Capabilities

The core guidance covers Option[T] for a value that may be absent, Result[T] for success or failure, and Either[L, R] for two valid alternatives. Either3 through Either5 extend the alternative-type pattern. The Option reference documents JSON encoding, SQL scanning and database value conversion.

The pipeline reference describes standalone Map and FlatMap functions and Pipe1 through Pipe10 for transformations that change types. Additional material covers Future, lazy IO and Task computations, error-aware variants, and State computations that carry state between steps.

Using it

Requirements

The skill declares a Go executable requirement and describes samber/mo as a Go 1.18+ library. The documented omitzero JSON omission feature requires Go 1.24+. No specific samber/mo release is pinned, so the minimum library release supporting every illustrated API is unknown.

A coding assistant host must load the skill and make its relative reference files available. The declared tool list includes file editing, Go and Git commands, documentation lookup and agent delegation; actual availability and permissions depend on the host. Supported host versions and compatibility results are not supplied.

Mechanism

The skill gives the assistant written guidance about choosing types and composing operations. Option transformations skip absent values, while Result transformations propagate an existing failure. Map transforms a contained value; FlatMap chains an operation that returns another wrapped value.

Direct methods retain their existing type parameter. Option.Map takes a callback returning (T, bool), while Result.Map takes one returning (T, error). Standalone functions such as option.Map and result.FlatMap can change the contained type. The documented mo.Do pattern uses MustGet inside a closure and converts its extraction panics into a Result error.

Setup

Obtain the original skill folder and preserve the relative layout of SKILL.md and references. Retain the repository LICENSE when copying or redistributing it. The supplied files do not give a host-specific skill installation command or installation directory.

For the Go dependency, SKILL.md gives go get github.com/samber/mo. This adds the library to a Go project; loading the assistant skill is a separate step. The command contains no version constraint, so confirm the required APIs and choose an appropriate dependency version before adopting the examples.

Example

A concrete example converts an optional integer into optional text: option.Map(func(v int) string { return strconv.Itoa(v) })(mo.Some(42)). It uses github.com/samber/mo, github.com/samber/mo/option and strconv. The standalone function permits the change from Option[int] to Option[string], which the direct Option.Map method cannot express.

For a fallible configuration pipeline, the intended pattern is to wrap file reading with TupleToResult, parse through a function returning Result[Config], and validate through another FlatMap step. Parsing errors must be preserved; the supplied YAML pipeline example discards yaml.Unmarshal's returned error. These are explanations from static reading, with no executed results.

Assessment & evidence

Limitations

The map-lookup example uses mo.TupleToOption(m[key]), and evaluation scenario 20 reinforces it. The reference lists TupleToOption as taking a value and a bool. A map lookup needs the comma-ok assignment first: value, ok := m[key]; then mo.TupleToOption(value, ok). The supplied direct-call pattern should be corrected.

The YAML pipeline ignores the parsing error. Evaluation scenario 13 also offers a direct string-to-integer FlatMap chain despite the documented restriction that direct methods retain the same contained type. A type-changing sub-package function is needed for that transition.

JSON omission guidance is inconsistent: the main example suggests omission, while the Option reference says None serializes as null and documents omission through Go 1.24+ omitzero. The guide also overstates enforced handling of absence; its own references document that MustGet can panic. No benchmarks substantiate the guide's allocation-overhead statement.

Reasoning

The strongest reason to use this skill is its explicit treatment of library-specific distinctions: absence versus failure, valid alternatives versus errors, and same-type methods versus type-changing functions. Those distinctions give developers concrete questions to ask when reviewing generated code.

The adoption tradeoff is additional abstraction and team learning. The guide itself limits the benefit to suitable pipelines and optional-value models. Its usefulness is therefore most plausible in an existing samber/mo codebase; improvement over an assistant using ordinary library documentation has not been measured.

Alternatives

The guide discusses plain pointers or meaningful zero values for suitable data models, and conventional (T, error) returns with explicit error checks for simpler operations or detailed recovery. These approaches avoid introducing monadic composition where the team finds ordinary Go clearer.

The skill links to upstream documentation at [https://pkg.go.dev/github.com/samber/mo] and [https://github.com/samber/mo]. It also names separate golang-safety and golang-error-handling skills. Those external resources and related skills were not supplied, so their contents and comparative quality are not assessed.

Evidence

The supplied material contains the main skill, references for monads, Option, Result, Either, pipelines and advanced types, plus evals/evals.json and the repository LICENSE. The evaluation file contains 23 authored prompt-and-assertion scenarios covering intended type choices and API usage.

These scenarios establish the author's expectations, including some inconsistent expectations; they are not evaluation results. No underlying samber/mo implementation, compilation output, assistant comparison, host integration results or benchmarks are supplied. Nothing was installed or executed.

Access & freshness

Costs

Operating cost is unknown. The files supply no host subscription prices, model charges, token estimates or measured resource usage. The MIT licence grants permission to use and redistribute the skill, but does not establish the cost of running a coding assistant with it.

Rights

SKILL.md declares MIT licensing, supported by the repository LICENSE naming Samuel Berthe, copyright 2026. The notice permits use, copying, modification, publication, distribution, sublicensing and sale, provided the copyright and permission notices remain in copies or substantial portions.

The licence supplies the material without warranty and disclaims liability. These notices support redistribution of the supplied skill files with the notice retained. The separate samber/mo library's licence and rights for externally linked materials are not established by the supplied files.

Freshness

The supplied snapshot was captured on 2026-11-17 at repository revision d68d80aec298e1b74b37c2a472c002b5217248b3. SKILL.md declares version 1.1.2 and a separate skill-library-version value of 1.16.0. Neither identifies the samber/mo dependency version.

No release history or maintenance timeline is supplied. Compatibility with later library releases or particular coding assistant versions is unknown.

Actions

Before adopting the examples, choose a samber/mo version and confirm the documented symbols and signatures. Correct the map-lookup example, preserve parsing errors in configuration pipelines, and use sub-package functions whenever the contained type changes.

For an initial project trial, compile generated code and check present and absent values, success and failure paths, and the exact JSON distinction between null and omitted fields. Review MustGet usage and deferred-computation behavior against project requirements. These verification steps remain outstanding.

Evidence for this report

LICENSEnotice · checked 2026-11-17
skills/golang-samber-mo/SKILL.mdselected · checked 2026-11-17
skills/golang-samber-mo/evals/evals.jsonselected · checked 2026-11-17
skills/golang-samber-mo/references/either.mdselected · checked 2026-11-17
skills/golang-samber-mo/references/option.mdselected · checked 2026-11-17
skills/golang-samber-mo/references/result.mdselected · checked 2026-11-17