跳转到正文
报告库
用途分类 / 开发辅助

Golang Samber Mo Skill 安全审计

作者说它能做什么(原文)

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 z

第三方安全检查结论

发现安全风险

已检查文件
8
发现的风险
2
会不会运行危险命令?检查是否下载程序后直接运行、让他人远程控制电脑,或藏起要运行的命令。未发现风险
会不会泄露文件和密钥?检查是否发送含密码或密钥的文件,以及代码里是否直接写了密钥。发现 1 项风险
中风险

遇到异常时被指示公开提交 issue,可能泄露私有项目信息并代表用户发言

原文依据:1 处
发现了什么

正文直接要求在 samber/mo 的公共 GitHub 仓库开 issue,没有要求先征得用户同意,也没有要求清除代码、路径、配置、日志或业务数据。

为什么需要注意

若代理照做,错误报告可能通过用户账户公开发布敏感项目细节,并产生未经用户批准的外部沟通和长期公开记录。该文本不证明 issue 已被创建。

这是正文中的直接指令,不只是示例或安全警告:遇到库问题时要求在公共 GitHub 仓库开 issue。执行该动作需要代表用户对外发布内容,可能把私有代码片段、错误日志、路径或业务背景带到公开页面;文本没有要求先取得同意或脱敏。用户可限制技能只生成 issue 草稿,并要求发布前确认内容、目标仓库和隐私处理。

SKILL.md:273来自说明文档打开原文件
If you encounter a bug or unexpected behavior in samber/mo, open an issue at <https://github.com/samber/mo/issues>.
会不会删除文件或一直在后台运行?检查是否大范围删除文件、改写磁盘,或设置自动启动。未发现风险
会不会绕过安全保护?检查是否跳过网站安全验证、开放过多文件权限,或取消操作前的确认。发现 1 项风险
中风险

权限声明允许任意 Git 命令及宽泛的 Go 命令,超出纯 API 指南所需范围

原文依据:2 处
发现了什么

`Bash(git:*)` 可覆盖推送、强制重置、清理和删除分支等高影响操作;`Bash(go:*)` 也可运行项目代码、生成器或修改持久 Go 环境配置。正文没有为这些宽泛权限建立逐项确认或目标限制。

为什么需要注意

如果 Skill 内容、外部文档或代理判断被误导,用户仓库可能被改写,未提交文件可能丢失,代码可能被推送到远端,或项目代码在本机执行。权限本身不证明这些操作已经发生。

该技能的声明用途是提供 samber/mo 的 Go 类型与组合模式指导,但工具权限包含不受子命令限制的 `git:*` 和 `go:*`。这本身不证明任何命令会执行;不过,一旦代理选择调用它们,权限可覆盖修改仓库、运行项目代码或更改 Go 配置等超出文档查询所需的操作。用户可要求作者将权限缩小到只读命令,并要求任何写入、执行项目代码或远程 Git 操作事先确认。

SKILL.md:18来自说明文档打开原文件
    skill-library-version: "1.16.0"allowed-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__*paths:
查看另外 1 个位置
SKILL.md:3来自说明文档打开原文件
name: golang-samber-modescription: "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)."user-invocable: true
会不会误导 AI 或隐藏内容?检查工作说明是否要求 AI 忽略你的指令、干扰检查结果,或夹带看不见的文字。未发现风险
会不会偷偷改推广链接或收款方?检查是否强制替换推广链接或收款对象,同时要求隐瞒更改。未发现风险

Skill 逻辑拆解

8 个说明模块

该 Skill 是面向 Go 项目的编程指南,主要建议使用 samber/mo 的 Option、Result、Either 及相关管道类型;其声明的作用范围是 Go 源文件。

查看原文
SKILL.md:2来自说明文档打开原文件
---name: golang-samber-modescription: "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)."user-invocable: true
SKILL.md:19来自说明文档打开原文件
allowed-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__*paths:  - "**/*.go"---

文档展示了通过 `go get` 添加第三方依赖。若代理实际执行,该命令会联网下载模块,并通常修改当前项目的 go.mod/go.sum;这属于采用库时的正常安装行为,但不应仅因查看用法而自动执行。

查看原文
SKILL.md:42来自说明文档打开原文件
```bashgo get github.com/samber/mo```

参考资料包含读取本地配置文件和访问示例 API 的代码,但它们位于讲解性 Go 代码块中,并非要求审计或运行时立即执行。

查看原文
references/advanced-types.md:116来自说明文档打开原文件
```goio := mo.NewIOEither(func() mo.Either[error, string] {    data, err := os.ReadFile("config.yaml")    if err != nil {        return mo.Left[error, string](err)    }    return mo.Right[error, string](string(data))})
references/advanced-types.md:184来自说明文档打开原文件
```gote := mo.NewTaskEither(func() *mo.Future[string] {    return mo.NewFuture(func(resolve func(string), reject func(error)) {        resp, err := http.Get("https://api.example.com/data")        if err != nil {            reject(err)            return        }        defer resp.Body.Close()        body, err := io.ReadAll(resp.Body)

Skill 明确警告 MustGet 在缺值或错误时会 panic,并建议优先使用回退值,仅在 mo.Do 捕获范围内或已确定存在值时使用。

查看原文
SKILL.md:264来自说明文档打开原文件
1. **Prefer `OrElse` over `MustGet`** — `MustGet` panics on absent/error values; use it only inside `mo.Do` blocks where panics are caught, or when you are certain the value exists2. **Use `TupleToResult` at API boundaries** — convert Go's `(T, error)` to `Result[T]` at the boundary, then chain with `Map`/`FlatMap` inside your domain logic
从这里开始 · 工作说明SKILL.md
golang-samber-mo
连线表示工作说明包含的模块,不是实际运行顺序。点击模块可查看原文。 另有 1 个章节,可在原文件中查看。

文件引用关系图

9 处引用
哪些文件发起引用引用了什么
连线表示真实的文件引用,不是运行顺序。点击节点可高亮相关连线,并查看具体文件和原文位置。虚线表示还有文件需要定位。
文件与检查记录8 个文件

检查范围与遗漏

逐文件查看涉及的内容

下方列出本次涉及的原文范围;纳入检查不代表已查清所有问题。

  • SKILL.md已纳入全文
  • references/advanced-types.md已纳入全文
  • references/either.md已纳入全文
  • references/monads-guide.md已纳入全文
  • references/option.md已纳入全文
  • references/pipelines.md已纳入全文
  • references/result.md已纳入全文
  • evals/evals.json已纳入全文

这份报告只针对上方版本。我们看了拿到的代码和说明文件,没有实际运行 Skill,也没有检查它另外安装的软件包。因此,这不是“保证安全”的承诺;换了版本或使用环境,结果也可能不同。

  • SKILL.md工作说明
  • evals/evals.json配套文件
  • references/advanced-types.md配套文件
  • references/either.md配套文件
  • references/monads-guide.md配套文件
  • references/option.md配套文件
  • references/pipelines.md配套文件
  • references/result.md配套文件

代码和说明中提到的操作

连接外部网站
SKILL.md:12来自说明文档打开原文件
    emoji: "🎭"    homepage: https://github.com/samber/cc-skills-golang    requires:
SKILL.md:33来自说明文档打开原文件
- [pkg.go.dev/github.com/samber/mo](https://pkg.go.dev/github.com/samber/mo)- [github.com/samber/mo](https://github.com/samber/mo)
SKILL.md:34来自说明文档打开原文件
- [pkg.go.dev/github.com/samber/mo](https://pkg.go.dev/github.com/samber/mo)- [github.com/samber/mo](https://github.com/samber/mo)
运行命令
SKILL.md:18来自说明文档打开原文件
    skill-library-version: "1.16.0"allowed-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__*paths:
SKILL.md:42来自说明文档打开原文件
```bashgo get github.com/samber/mo
读取文件
SKILL.md:94来自说明文档打开原文件
// Wrap Go's (value, error) patternresult := mo.TupleToResult(os.ReadFile("config.yaml"))
SKILL.md:113来自说明文档打开原文件
parsed := result.Pipe2(    mo.TupleToResult(os.ReadFile("config.yaml")),    result.Map(func(data []byte) Config { return parseConfig(data) }),
evals/evals.json:20来自说明文档打开原文件
    "description": "Tests whether the model knows when to use Result[T] vs (T, error)",    "prompt": "I'm writing a Go function that reads a config file, parses YAML, validates the config, and returns the result. The function is part of a public API package. Should I use samber/mo Result[T] as the return type?",    "trap": "Without the skill, the model either always uses Result or always uses (T, error). The correct answer is: use (T, error) at public API boundaries for Go idiom compliance, but use Result internally for chaining.",
读取了多少行
1,721
文件校验值(用于核对版本)
c79d5a49f4a55f02aca39745df49eb15a639c3844889235526476daa7400df6f