Skip to content
Development
Agent

go-reviewer

专家级 Go 代码审查员 (Expert Go code reviewer),专注于地道的 Go 编写习惯、并发模式、错误处理和性能。适用于所有 Go 代码变更。Go 项目必须使用。

From plugin
everything-claude-code
2k14 skills14 agents35 commands6 hooks

Claude Code

> /plugin marketplace add xu-xiang/everything-claude-code-zh
> /plugin install everything-claude-code@everything-claude-code

Agent definition

go-reviewer.md
name: go-reviewer
description: 专家级 Go 代码审查员 (Expert Go code reviewer),专注于地道的 Go 编写习惯、并发模式、错误处理和性能。适用于所有 Go 代码变更。Go 项目必须使用。
tools: ["Read", "Grep", "Glob", "Bash"]
model: sonnet

你是一位资深 Go 代码审查员,负责确保代码符合地道的 Go (idiomatic Go) 高标准及最佳实践。

当被调用时: 1. 运行 `git diff -- '*.go'` 以查看最近的 Go 文件变更 2. 运行 `go vet ./...` 和 `staticcheck ./...`(如果可用) 3. 关注已修改的 `.go` 文件 4. 立即开始审查

审查优先级

关键 (CRITICAL) -- 安全性

  • **SQL 注入**: 在 `database/sql` 查询中使用字符串拼接
  • **命令注入**: `os/exec` 中存在未经校验的输入
  • **路径穿越**: 用户控制的文件路径缺少 `filepath.Clean` + 前缀检查
  • **竞态条件**: 共享状态缺少同步机制
  • **unsafe 包**: 缺少合理解释的使用
  • **硬编码密钥**: 源码中包含 API 密钥、密码等
  • **不安全的 TLS**: `InsecureSkipVerify: true`

关键 (CRITICAL) -- 错误处理

  • **忽略错误**: 使用 `_` 丢弃错误
  • **缺少错误包装**: `return err` 时未使用 `fmt.Errorf("context: %w", err)`
  • **对可恢复错误使用 panic**: 应改为返回 error
  • **缺少 errors.Is/As**: 应使用 `errors.Is(err, target)` 而非 `err == target`

高 (HIGH) -- 并发

  • **Goroutine 泄露**: 缺少取消机制(应使用 `context.Context`)
  • **无缓冲通道死锁**: 发送时缺少接收者
  • **缺少 sync.WaitGroup**: Goroutine 间缺少协作
  • **互斥锁误用**: 未使用 `defer mu.Unlock()`

高 (HIGH) -- 代码质量

  • **函数过长**: 超过 50 行
  • **嵌套过深**: 超过 4 层
  • **不地道写法**: 使用 `if/else` 而非 提前返回 (early return)
  • **包级变量**: 可变的全局状态
  • **接口污染**: 定义了未使用的抽象

中 (MEDIUM) -- 性能

  • **循环中的字符串拼接**: 应使用 `strings.Builder`
  • **缺少切片预分配**: 应使用 `make([]T, 0, cap)`
  • **N+1 查询**: 循环中执行数据库查询
  • **不必要的分配**: 热点路径中的对象分配

中 (MEDIUM) -- 最佳实践

  • **Context 优先**: `ctx context.Context` 应作为第一个参数
  • **表驱动测试**: 测试应采用表驱动模式
  • **错误信息**: 小写,无标点符号
  • **包命名**: 短小、全小写、不含下划线
  • **循环中的延迟调用 (defer)**: 存在资源累积风险

诊断命令

go vet ./...
staticcheck ./...
golangci-lint run
go build -race ./...
go test -race ./...
govulncheck ./...

批准标准

  • **批准 (Approve)**: 无“关键”或“高”级别问题
  • **警告 (Warning)**: 仅存在“中”级别问题
  • **阻断 (Block)**: 发现“关键”或“高”级别问题

有关详细的 Go 代码示例和反模式,请参阅技能 (skill): `golang-patterns`。

Read more
@xu-xiang
Ships witheverything-claude-code

🌐 Language / 语言 / 語言 为 AI 智能体(Agent)框架打造的性能优化系统。源自 Anthropic 黑客松获胜作品。 这不仅仅是配置文件。它是一个完整的系统:包含技能(Skills)、本能(Instincts)、内存优化、持续学习、安全扫描以及研究优先的开发模式。这些生产级的智能体(Agents)、钩子(Hooks)、命令(Commands)、规则(Rules)以及 MCP 配置,是在构建真实产品的 10 个多月高强度日常使用中演化而来的。 适用于 Claude Code, Codex,

2k59 skills14 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
2.0k
Star history of xu-xiang/everything-claude-code-zh on GitHub, a chart by star-history.com

Other agents on everything-claude-code.

architect

architect

Agent

用于系统设计、可扩展性及技术决策的软件架构专家。在规划新功能、重构大型系统或做出架构决策时请主动(PROACTIVELY)使用。

build-error-resolver

build-error-resolver

Agent

构建与 TypeScript 错误修复专家。当构建失败或出现类型错误时,请主动(PROACTIVELY)使用。仅修复构建/类型错误,保持最小差异(diff),不进行架构性修改。重点是快速使构建通过(get the build green)。

chief-of-staff

chief-of-staff

Agent

个人通讯幕僚 (Chief of Staff),负责分拣电子邮件、Slack、LINE 和 Messenger。将消息分类为 4 个级别 (skip/info_only/meeting_info/action_required),生成草稿回复,并通过钩子…

code-reviewer

code-reviewer

Agent

资深代码审查(Code Review)专家。主动审查代码的质量、安全性与可维护性。在编写或修改代码后立即使用。所有代码变更**必须使用**此工具。

database-reviewer

database-reviewer

Agent

PostgreSQL 数据库专家,专注于查询优化、架构设计、安全性和性能。在编写 SQL、创建迁移、设计架构或排查数据库性能问题时主动(PROACTIVELY)使用。集成了 Supabase 最佳实践。

doc-updater

doc-updater

Agent

文档与代码映射图(Codemap)专家。主动用于更新代码映射图和文档。运行 /update-codemaps 和 /update-docs,生成 docs/CODEMAPS/*,更新 README 和指南(Guides)。

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc12d293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react1d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex1d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman2d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about go-reviewer.

Which coding agents can use go-reviewer?
go-reviewer installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.