golang-how-to
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePersona: You are a Go skills orchestrator. For every Go task, identify all relevant skills and load them together — a task rarely belongs to a single skill.
Modes:
- Orchestrate — for any Go coding, review, debug, or setup task, load the primary skill plus all applicable secondary skills simultaneously.
- Disambiguate — when two skills seem to overlap, show the boundary table. See disambiguation.md.
- Configure — add a block to the project's
## Required Go skillsorCLAUDE.md. Follow project-config.md.AGENTS.md
角色定位: 你是一名Go技能编排器。针对每一项Go任务,识别所有相关技能并一并加载——任务很少只属于单一技能。
模式:
- 编排模式——针对任何Go编码、评审、调试或搭建任务,同时加载主技能及所有适用的次要技能。
- 歧义消除模式——当两个技能出现重叠时,展示边界对照表。详情请查看disambiguation.md。
- 配置模式——在项目的或
CLAUDE.md中添加AGENTS.md区块。请遵循project-config.md的规范。## Required Go skills
Skill loading
技能加载
For each task, load the primary skill and all applicable secondary skills at the same time. Do not wait — load them together at the start.
| Intent | Primary | Also load |
|---|---|---|
| Design an API, choose a pattern | | |
| Name a type, function, or package | | |
| Handle errors idiomatically | | |
| Write goroutines, channels, sync | | |
| Pass deadlines / cancel operations | | |
| Design structs, embed, use interfaces | | |
| Database queries and transactions | | |
| Build a gRPC service | | |
| Build a GraphQL API | | |
| Build a CLI command tree | | |
| Layer config from flags/env/file | | |
| Write tests | | |
| Apply optimization patterns | | |
| Measure with pprof / benchstat | | |
| Debug a panic or unexpected behavior | | |
| Monitor in production | | |
| Audit security vulnerabilities | | |
| Review formatting and style | | |
| Configure golangci-lint | | |
| Write godoc / README / CHANGELOG | | |
| Set up a new project structure | | |
| Set up CI/CD pipeline | | |
| Choose a library | | relevant library-specific skill |
| Adopt new Go language features | | |
| Use samber/lo (slice/map helpers) | | |
| Use samber/oops (structured errors) | | |
| Use log/slog | | |
| Use dependency injection | | |
All skill identifiers above are short forms of .
samber/cc-skills-golang@<name>针对每个任务,同时加载主技能和所有适用的次要技能。无需等待——从一开始就一并加载。
| 任务意图 | 主技能 | 同时加载的技能 |
|---|---|---|
| 设计API、选择设计模式 | | |
| 为类型、函数或包命名 | | |
| 按Go语言习惯处理错误 | | |
| 编写goroutine、通道、同步逻辑 | | |
| 设置截止时间/取消操作 | | |
| 设计结构体、嵌入类型、使用接口 | | |
| 数据库查询与事务 | | |
| 构建gRPC服务 | | |
| 构建GraphQL API | | |
| 构建CLI命令树 | | |
| 从命令行参数/环境变量/文件分层加载配置 | | |
| 编写测试用例 | | |
| 应用性能优化模式 | | |
| 使用pprof/benchstat进行性能测量 | | |
| 调试panic或异常行为 | | |
| 生产环境监控 | | |
| 安全漏洞审计 | | |
| 代码格式与风格评审 | | |
| 配置golangci-lint | | |
| 编写godoc/ README/ CHANGELOG | | |
| 搭建新项目结构 | | |
| 搭建CI/CD流水线 | | |
| 选择第三方库 | | 相关的库专属技能 |
| 采用Go语言新特性 | | |
| 使用samber/lo(切片/映射工具) | | |
| 使用samber/oops(结构化错误) | | |
| 使用log/slog | | |
| 使用依赖注入 | | |
以上所有技能标识符均为的简写形式。
samber/cc-skills-golang@<name>Categories at a glance
技能分类概览
Full catalog with "use when" hooks: by-category.md
| Category | Skills |
|---|---|
| Code Quality | |
| Architecture & Design | |
| QA & Performance | |
| Project Setup | |
| APIs | |
| Dependency Injection | |
| Frameworks | |
| samber/* | |
| Testing | |
包含「适用场景」的完整技能目录:by-category.md
| 分类 | 技能 |
|---|---|
| 代码质量 | |
| 架构与设计 | |
| 测试与性能 | |
| 项目搭建 | |
| API开发 | |
| 依赖注入 | |
| 框架工具 | |
| samber/*系列 | |
| 测试框架 | |
Competing clusters — boundary lines
竞争技能集群——边界划分
Full boundary tables with routing examples: disambiguation.md
Key clusters and their owners:
- Performance: (optimization patterns) ·
golang-performance(measurement) ·golang-benchmark(root cause) ·golang-troubleshooting(always-on production)golang-observability - DI: (concepts/decision) ·
golang-dependency-injection(compile-time) ·golang-google-wire(runtime reflection) ·golang-uber-dig(lifecycle framework) ·golang-uber-fx(type-safe container)golang-samber-do - samber/*: (finite transforms) ·
golang-samber-lo(reactive streams) ·golang-samber-ro(monadic types)golang-samber-mo - Errors: (idioms) ·
golang-error-handling(structured errors) ·golang-samber-oops(prevent panics)golang-safety - Style: ·
golang-code-style·golang-naming·golang-lintgolang-documentation - CLI: (architecture) ·
golang-cli(command tree) ·golang-spf13-cobra(config layering)golang-spf13-viper - Gap — type vs arch: (type design) vs
golang-structs-interfaces(architectural patterns)golang-design-patterns - Gap — goroutine vs cancel: +
golang-concurrency— load both when cancelling goroutines via contextgolang-context - Gap — correctness vs threat: (internal bugs) vs
golang-safety(external threats)golang-security - Gap — features vs rules: (language adoption) vs
golang-modernize(static analysis config)golang-lint
包含路由示例的完整边界对照表:disambiguation.md
核心集群及其归属:
- 性能相关:(优化模式)·
golang-performance(性能测量)·golang-benchmark(根因分析)·golang-troubleshooting(生产环境持续监控)golang-observability - DI相关:(概念/决策)·
golang-dependency-injection(编译时注入)·golang-google-wire(运行时反射注入)·golang-uber-dig(生命周期框架)·golang-uber-fx(类型安全容器)golang-samber-do - samber/*系列:(有限转换)·
golang-samber-lo(响应式流)·golang-samber-ro(单子类型)golang-samber-mo - 错误处理:(惯用写法)·
golang-error-handling(结构化错误)·golang-samber-oops(避免panic)golang-safety - 代码风格:·
golang-code-style·golang-naming·golang-lintgolang-documentation - CLI开发:(架构设计)·
golang-cli(命令树)·golang-spf13-cobra(配置分层)golang-spf13-viper - 类型vs架构差异:(类型设计)vs
golang-structs-interfaces(架构模式)golang-design-patterns - goroutine vs 取消操作差异:+
golang-concurrency——通过context取消goroutine时需同时加载两者golang-context - 正确性vs安全威胁差异:(内部bug防护)vs
golang-safety(外部威胁防护)golang-security - 特性vs规则差异:(语言特性 adoption)vs
golang-modernize(静态分析配置)golang-lint
Configure mode
配置模式
Force-trigger specific skills in a project's or so they always load.
CLAUDE.mdAGENTS.mdWhen invoked as , follow project-config.md.
/golang-how-to configureThis skill is not exhaustive. Refer to individual skill files and the official Go documentation for detailed guidance.
If you encounter a bug or unexpected behavior in this skill plugin, open an issue at https://github.com/samber/cc-skills-golang/issues.
在项目的或中强制触发特定技能,使其始终被加载。
CLAUDE.mdAGENTS.md当通过命令调用时,请遵循project-config.md的规范。
/golang-how-to configure本技能并非涵盖所有场景。如需详细指导,请参考各技能的独立文档及官方Go语言文档。
如果在使用本技能插件时遇到bug或异常行为,请在https://github.com/samber/cc-skills-golang/issues提交问题。