
Claude Code 的 Go 代理框架——运行时钩子、MCP 服务器、会话跟踪、中间件链以及完整配置生成,集成在一个二进制文件中
概览
配置一次你的编码代理,到处用。 编写代理配置非常混乱。设置存在JSON文件中,技能是分散在目录中的标记,钩子是手工布线的shell脚本,MCP服务器需要手动JSON条目。再加上你使用的仓库和代理数量。祝你好运保持任何一致性。 yaah 从单一的 Go 代码库生成配置:Claude Code、OpenCode、Codex CLI 和 GitHub Copilot CLI。每个代理一个命令,每个仓库,结果相同。 - 5个开箱即用的钩子:linting(golangci-lint、ruff、prettier、tsc)、阻止rm -rf / 及好友的命令保护器、用于检测泄密密钥的秘密扫描器、用于捕捉TODO的注释检查器:实现占位符,以及会话记录器——以及一个实验性工具,使用Stop/SubagentStop的事实核查器(通过YAAH_EXPERIMENTAL_FACT_CHECK=1选择加入)- 用于组合处理程序的中间件链(例如:
概述(AI 翻译)
又一个特工背带
配置一次你的编码代理,到处用。
问题所在
编写代理配置非常混乱。设置存在JSON文件中,技能是分散在目录中的标记,钩子是手工布线的shell脚本,MCP服务器需要手动JSON条目。再加上你使用的仓库和代理数量。祝你好运保持任何一致性。
你做的事
yaah 从单一 Go 代码库生成四个编码代理的配置:Claude Code、OpenCode、Codex CLI 和 GitHub Copilot CLI。每个代理一个命令,每个仓库,结果相同。
这个单一命令给你:
- 5个开箱即用的挂钩:linting(golangci-lint、ruff、prettier、tsc)、一个阻止
rm -rf /和朋友的命令守卫、一个用于检测泄密密钥的秘密扫描器、一个用于捕捉TODO: implement占位符的评论检查器,以及一个会话记录器——以及一个实验性工具使用事实核查器,应用于Stop/SubagentStop(通过YAAH_EXPERIMENTAL_FACT_CHECK=1选择加入) - 用于组合处理程序的中间件链(例如秘密扫描 + 自动修复建议)
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
yaah
yet another agent harness
Configure your coding agent once, use it everywhere.
The problem
Coding agent configuration is a mess. Settings live in JSON files, skills are markdown scattered across directories, hooks are shell scripts wired by hand, MCP servers need manual JSON entries. Multiply that by the number of repos and agents you use. Good luck keeping any of it consistent.
What yaah does
yaah generates configuration for four coding agents from a single Go codebase: Claude Code, OpenCode, Codex CLI, and GitHub Copilot CLI. One command per agent, every repo, same result.
yaah generate # all agents
yaah generate --agent claude # Claude Code only
yaah generate --agent opencode # OpenCode only
yaah generate --agent codex # Codex CLI only
yaah generate --agent copilot # GitHub Copilot CLI only
That single command gives you:
- 5 hooks out of the box: linting (golangci-lint, ruff, prettier, tsc), a command guard that blocks
rm -rf /and friends, a secret scanner for leaked keys, a comment checker that catchesTODO: implementplaceholders, and a session logger — plus an experimental tool-using fact-checker onStop/SubagentStop(opt in viaYAAH_EXPERIMENTAL_FACT_CHECK=1) - Middleware chains for composing handlers (e.g. secret scan + auto-remediation advice)
- MCP servers for Context7 and Pulumi, plus a built-in yaah MCP server exposing tools like secret scanning, linting, and command checking directly to the agent
- Multi-agent config generation with per-agent adaptations (MCP format, hook delivery, agent tools, skill frontmatter)
- LSP support for Go, Python, TypeScript, and C# via the official marketplace
- Session tracking that logs every tool call, blocked command, and file modification across sessions
- 3 built-in skills (commit, PR, review) plus 74 remote and workflow skills covering Pulumi IaC, Flux CD GitOps, Go, Python, TypeScript, Kubernetes, DevOps, SRE, security auditing, code quality, tech debt analysis, and more
- 16 agents: 3 built-in (executor, librarian, reviewer) plus 4 workflow agents (researcher, planner, doc-writer, verifier) and 9 remote agents from agency-agents covering AI engineering, backend architecture, security, code review, DevOps, SRE, and testing
- Plugin support with marketplace auto-enablement — ships with OpenAI Codex for code review and task delegation
Don’t want all of it? Turn off what you don’t need:
opts := harness.DefaultOptions{
EnableCommandGuard: true,
EnableSecretScanner: true,
EnableGopls: true,
EnableCommitSkill: true,
EnableYaahMCP: true,
}
h := harness.NewWithDefaults(opts)
Install
Homebrew
brew install dirien/tap/yaah
Go
go install github.com/dirien/yet-another-agent-harness/cmd/yaah@latest
Binary
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →