cc-skills-golang Skill:46 个原子化 Go 技能的人工蒸馏指南

总结

cc-skills-golang Skill:给 Go 开发者的 46 个原子化 AI 技能库,把 samber 多年的 Go 实战经验蒸馏成 Claude Code / Codex / Cursor 通吃的 SKILL.md 合集。这是 2026 年 8 月 GitHub SkillsMP 主题下增长最快的 Go 专项仓库,单周内冲上 skillsmp 热门,作者亲自标注「No AI slop here. AI-made skills are useless」——全人工 review & 重写过的生产级指南。

功能与原则

核心能力是把 Go 工程经验封装成 46 个可独立触发、互相交叉引用的原子化技能,覆盖 Code Quality(命名、风格、错误处理)、Arch & Design(项目布局、设计模式、依赖注入)、QA & Perf(测试、基准、性能调优)、Security(snyk agent scan、安全审计)、Library(samber 系列、cobra、viper、wire、testify、grpc 等 20+ 主流库)。所有技能遵循「SKILL.md 入口保持精简,深度内容挂 references 子目录」的渐进披露原则,触发时才加载相关章节,不污染 context。

设计原则是「atomic, cross-referencing units」——比如 golang-error-handling 会引用 golang-samber-oopsgolang-samber-sloggolang-observability 会引用 golang-error-handling。作者明确警告「installing only a subset will give you a partial and potentially inconsistent view」,建议整组安装。每条技能都带 metadata.author: samberversion 字段,并支持 company skill override——公司内部规范可以显式覆盖社区默认。

认可度

  • GitHub Star 数:截至 2026-08-18 约 2,995 stars(GitHub API 实测),Forks 196
  • 创建时间:2026-03-21,最后更新 2026-08-18 18:35 UTC(今天仍在维护)
  • GitHub Trending:进入 skillsmp.com GitHub Topic 热门排序,更新时间在 Aug 13 / Aug 18 等多个近期节点
  • 覆盖工具:Claude Code、Codex、Cursor、Gemini CLI、Copilot、OpenCode、OpenClaw、Antigravity 共 8 大主流 AI 编程平台全适配
  • SkillsMP 主题:被 GitHub Topic「skillsmp」收录并高居前列,329 条总星数
  • 作者背景:samber(Samuel Berthe,GitHub 2,282 followers、252 个公开仓库、Go 开源资深贡献者)

链接

GitHub 仓库:https://github.com/samber/cc-skills-golang

关联仓库(通用 skills):https://github.com/samber/cc-skills

原作者

Samuel Berthe / GitHub @samber——法国南特 Software Engineer,定位是「Go Open-sourcer | GenAI community leader」。维护 samber/oops、samber/lo、samber/slog、samber/hot、samber/mo 等多个 Go 热门库(GitHub 累计数十万 stars),Substack「Go Gazer」Go 资讯专栏作者。2026 年开始把十几年 Go 工程经验蒸馏成 Agent Skills,开源在 cc-skills / cc-skills-golang 两个仓库,承诺所有 skill 人工 review & 重写,杜绝「AI slop」。

介绍

cc-skills-golang 是一个专注 Go 语言的 AI Agent 技能合集,源自 samber 多年的 Go 项目 commit 历史蒸馏。它不是简单的 prompt 模板集合,而是一套工程化、可审计、跨工具链的 SKILL.md 标准实现。每条 skill 单独放在 skills/<name>/ 目录下,包含 SKILL.md 主入口、references/ 深度文档、evals/ 评估用例——满足 agentskills.io 规范的完整结构。

46 个 Go 技能分四大类:Code Quality(12 条:golang-code-style、golang-error-handling、golang-naming、golang-lint、golang-refactoring、golang-modernize、golang-safety 等)、Arch & Design(7 条:golang-project-layout、golang-design-patterns、golang-dependency-injection、golang-dependency-management、golang-data-structures、golang-graphql、golang-grpc 等)、QA & Perf(4 条:golang-testing、golang-benchmark、golang-performance、golang-troubleshooting)、Library(23 条:golang-samber-oops、golang-samber-slog、golang-samber-lo、golang-samber-mo、golang-samber-do、golang-samber-hot、golang-spf13-cobra、golang-spf13-viper、golang-google-wire、golang-stretchr-testify、golang-uber-fx、golang-uber-dig、golang-swagger 等)。

安装方式支持统一 CLI(npx skills add https://github.com/samber/cc-skills-golang --all),也支持逐条安装(--skill golang-performance),还覆盖 Claude Code 的 plugin marketplace、Gemini CLI extension、Cursor/Copilot/OpenCode/Antigravity 的路径发现——一套仓库,8 平台通用。

特点

  • 46 个原子化技能:细分到命名、错误处理、设计模式、测试、性能、安全、20+ 主流库,每个 skill 都是独立可触发的最小单元
  • 人工 review 兜底:作者在 README 明确标注「Bootstrapped with Claude Code by distilling my Go project commits. Edited, tested, reviewed and reworked by a human. No AI slop here.」,区别于纯 AI 生成的质量参差
  • 渐进披露设计:SKILL.md 主文件保持精简(通常 5-10 KB),深度内容 references/ 子目录按需加载,触发技能时只把相关章节注入 context
  • 跨工具链覆盖:8 大 AI 编程平台统一一套技能,迁移工具链时技能不丢失
  • MIT License 开源:商用 / 私有 fork / 改造均可,metadata.author 字段方便公司内 fork 后标注归属

使用方法

方式一:skills CLI(推荐,通用)

# 安装全部 Go 技能
npx skills add https://github.com/samber/cc-skills-golang --all

# 只安装指定技能(如性能调优)
npx skills add https://github.com/samber/cc-skills-golang --skill golang-performance

# 查看可用技能列表
npx skills add https://github.com/samber/cc-skills-golang --list

方式二:Claude Code Plugin Marketplace

# 添加 samber 仓库为 marketplace
/plugin marketplace add samber/cc

# 安装 Go 技能包
/plugin install cc-skills-golang@samber

方式三:手动 git clone

# 复制到 OpenClaw skills 目录
git clone https://github.com/samber/cc-skills-golang.git ~/.openclaw/skills/cc-skills-golang

# 或复制到工作区目录
git clone https://github.com/samber/cc-skills-golang.git ~/.openclaw/workspace/skills/cc-skills-golang

最小调用示例

# 安装后在 AI 编程会话中直接触发:
$golang-error-handling     # 让 Claude Code 审计 / 改写 Go 错误处理
$golang-performance        # 让 Claude Code 分析 / 优化性能瓶颈
$golang-testing            # 让 Claude Code 补全 / 审查 Go 测试

使用场景与人群

适用场景
Go 项目初始化:新建项目时让 Agent 按 samber 项目布局(golang-project-layout)生成目录结构
代码审查 PR:用 golang-code-style / golang-lint / golang-error-handling 三个 skill 并行审计
性能调优:让 Agent 跑 benchmark 并按 golang-performance / golang-benchmark 准则分析
库迁移:从 cobra 迁 viper、迁 wire / fx / dig,技能里有专门的 golang-spf13-cobra / golang-google-wire 等专家指南
安全审计:golang-safety / snyk-agent-scan-compliance 自动扫描漏洞
错误处理统一:golang-error-handling 把「log OR return」单一处理规则固化成 Agent 必须遵守的约束

目标用户
– Go 后端工程师(尤其在用 Claude Code / Cursor / Codex 的)
– 团队 Tech Lead 想给团队统一 Go 编码规范
– Agent Skills 学习者(这是一份高质量 SKILL.md 标准范例)
– 关注 Go 工程化 / 防御性编程的资深开发者

输入与输出案例

案例一:错误处理审计

  • 输入(prompt):
    $golang-error-handling
    Audit error handling in /pkg/billing/ — focus on the single-handling rule (logged OR returned, NEVER both), swallowed errors, and missing wrapping context.
  • 输出(摘录):
  • 找到 7 处 _ = doSomething() 静默吞错,建议改为 if err := doSomething(); err != nil { ... }
  • 找到 3 处 log.Println(err); return err 重复处理,违反 single-handling rule
  • 找到 12 处错误未 wrap,建议改为 fmt.Errorf("processing invoice %s: %w", id, err)
  • 推荐引入 samber/oops 为生产错误携带 stack trace + 用户上下文

案例二:性能调优

  • 输入(prompt):
    $golang-performance
    Analyze the hot path in /pkg/orderbook/match.go — propose allocations and lock contention improvements.
  • 输出(摘录):
  • 识别 3 处 sync.Mutex 锁粒度过粗,建议拆为 orderID-level 分片锁
  • 识别 5 处 fmt.Sprintf 在热路径,建议改 strconv.AppendInt 复用 buffer
  • 给出 benchmark baseline:BenchmarkMatchOrder-8 12453 ns/op 4096 B/op 12 allocs/op
  • 给出优化后预期:~6200 ns/op 512 B/op 2 allocs/op,同时附 pprof 采样位置建议

GitHub:https://github.com/samber/cc-skills-golang
License:MIT
截至 2026-08-18 约 2,995 stars · 196 forks · 46 个原子化 Go 技能 · MIT 开源


GitHub: https://github.com/samber/cc-skills-golang

评论区

0 条评论

登录后可评论。

Skill超级捕获手 14 阅读