PlugWiki

golang-samber-mo Skill for Claude: What It Does and How to Install It

Makes Claude use samber/mo in Go: Option, Result and Either types for nil-safe values and composable error handling.

Installs
39K
on skills.sh
Stars
3.7K
on GitHub
Files
7
besides SKILL.md
Updated
Nov 2026
last repo commit

This skill covers samber/mo, a Go library of monadic types. Claude picks between Option for values that may be absent, Result for success or failure and Either for two valid alternatives.

It also explains a Go limit: direct methods cannot change the type, so type-changing steps use the sub-package functions or mo.Do. It asks Claude to reason carefully about pipeline design and mentions ultrathink on Claude Code.

Good for

  • Go developers who like functional patterns from Rust or Scala
  • Teams removing nil checks with Option types
  • Anyone chaining steps that can fail with Result pipelines

Install golang-samber-mo

Claude Code

  1. 1

    Copy this prompt.

    Install the golang-samber-mo skill in Claude Code. Run this command:
    
    npx skills add https://github.com/samber/cc-skills-golang --skill golang-samber-mo
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

From its listing on skills.sh. Source.

What's in the skill

When it loads

Monadic types for Golang using samber/mo — 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/mo, when the codebase imports `github.com/samber/mo`, 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/cc-skills-golang@golang-safety` skill), nor for native error wrapping with fmt.Errorf, errors.Is and errors.As (→ See `samber/cc-skills-golang@golang-error-handling` skill).

Sections in SKILL.md

  1. Core Types at a Glance
  2. Option[T] — Nullable Values Without nil
  3. Result[T] — Error Handling as Values
  4. Either[L, R] — Discriminated Union of Two Types
  5. Do Notation — Imperative Style with Monadic Safety
  6. Pipeline Sub-Packages vs Direct Chaining
  7. Common Patterns
  8. JSON API responses with Option
  9. Database nullable columns
  10. Wrapping existing Go APIs
  11. Uniform extraction with Fold
  12. Best Practices
  13. Cross-References

Key facts

Author
samber
License
MIT
Installs on skills.sh
38,996 (Nov 2, 2026)
Last repo commit
Nov 1, 2026
Skill version
1.1.2
Library version covered
1.16.0

What it includes

  • A value that is present or absent, without nil

    Methods include Some, None, Get, OrElse, Map and Match. It works with JSON and database scanning.

    Try: “Replace these nil pointer fields with samber/mo Option values.”

    Write · Option[T]

  • Success or failure as a value

    Ok, Err, Try, Map, FlatMap and MapErr. Direct methods cannot change the type parameter.

    Write · Result[T]

  • One of two valid types

    Use Result when one side is an error and Either when both sides are valid. Either3 to Either5 add more variants.

    Write · Either[L, R]

  • mo.Do wraps imperative code in a Result

    Catches panics from MustGet so straight-line code still gets error propagation.

    Write · Do notation

  • option.Map, result.Map and Pipe functions

    Needed when the output type differs from the input type.

    Write · Pipeline sub-packages

  • Advanced types in references/advanced-types.md

    Reference guide for the other monadic types in the library.

    Read · Future, IO, Task, State

  • Introduction to why monads help in Go

    Reference guide in references/monads-guide.md.

    Read · Monads guide

From the official docs

Permissions

Low risk

The skill lets Claude edit your Go files and run go, golangci-lint and git commands, and it may fetch web pages. Keep permission prompts on for git and review diffs.

What it can do

  • Read your data
  • Create and change things
  • Delete things
  • Read-only mode

Watch out for

  • It lists git and shell commands as allowed tools

    The allowed-tools line covers any go, golangci-lint and git command (git:*), not just read ones. Keep Claude Code's permission prompts on for git commands that change history. github.com

  • It may fetch web pages or query Context7

    It lists WebFetch and the Context7 tools as allowed. Library names and questions can leave your machine. Do not put secrets in prompts about this code. github.com

Security advisories

No published security advisories as of Nov 2, 2026.

Technical details
Turning on read-onlyNo read-only mode in SKILL.md. Use version control.
Talks toWebFetch is listed as an allowed tool. Library lookups go to Context7 if the Context7 MCP server is installed (the skill uses it as a fallback)
Sign-in and keysSKILL.md does not mention any account or key.
Scopes
  • Reads and edits files in your Go project

  • SKILL.md lists these as allowed tools: go, golangci-lint, git, godig and gopls commands

Questions

What does the golang-samber-mo skill do?

It teaches Claude to use samber/mo for monadic types in Go. Claude uses Option, Result and Either, and chains them with pipelines instead of repeated nil and error checks.

How do I install golang-samber-mo?

Use the install box at the top of this page. It is a text skill with reference guides, so there is nothing to compile. Start a new session so it loads, then work in a Go project.

When should I not use it?

Its description says it is not for nil-safety and zero-value design without this library (use the golang-safety skill), nor for native error wrapping with fmt.Errorf, errors.Is and errors.As (use golang-error-handling).

Result or Either?

Use Result when one path is an error. Use Either when both paths are valid alternatives, such as cached or fresh data.

Does it need other skills from the same repo?

SKILL.md does not list any other skill as required. SKILL.md points to related skills in samber/cc-skills-golang for side topics, and the README says installing only a subset gives a partial and possibly inconsistent view of the guidelines. For best results it recommends installing the general-purpose Go skills together.

Is golang-samber-mo safe?

Mostly, for your own Go projects. It is instructions plus reference files, and it lets Claude edit files and run go and git commands. Review diffs, keep the project under version control and avoid secrets in prompts.

Does golang-samber-mo work in Codex, Cursor or the Claude app?

It is designed for Claude Code, Codex or a similar tool, and the README says the skills are built for Claude Code, Codex, Gemini, Copilot, Antigravity and Cursor. Because it works on your Go files and uses the go command, use a coding tool rather than the Claude app.

Information

updated Nov 2, 2026

Folder
skills/golang-samber-mo

samber/cc-skills-golangskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 2
  1. golang-samber-mo SKILL.md · github.com
  2. cc-skills-golang README · github.com

Updated Nov 2, 2026.