agent-harness-adapter 0.2.1

One agent setup, every coding agent: instructions, skills and hooks kept once in AGENTS.md and .agents/, installed into Claude Code, Codex, Gemini CLI, Copilot, Cursor, OpenCode and more; hooks in Claude Code's format run everywhere.
agent-harness-adapter-0.2.1 is not a library.

agent-harness-adapter

crates.io

One agent setup, every coding agent. Keep your instructions, skills and hooks once, in the standard places (AGENTS.md and .agents/), and agent-harness-adapter makes Claude Code, OpenAI Codex, Gemini CLI, GitHub Copilot, Cursor, Factory Droid, Pi, OpenCode, Kilo Code, Qwen Code, Devin and any agent that reads AGENTS.md use them. Hooks are written once in Claude Code's format and run in every agent.

Tools in any language can also ship their own integration from a manifest file: the command writes it into each harness's own files, puts shared content in one place, and never overwrites what the user changed.

Install

npm install -g @six5536/agent-harness-adapter   # prebuilt binaries
cargo install agent-harness-adapter             # from source

Both install the agent-harness-adapter command. Rust tools can use the library agent-harness-adapter-core directly instead.

Quick start: your own setup

cd my-repo
agent-harness-adapter install          # asks which agents you use; writes .agents/agent-harness-adapter.toml

Already set up for Claude Code? The first install offers to move CLAUDE.md's text, .claude/skills, Claude Code's hooks and .claude/agents into the standard places (--migrate says yes without asking), then points or copies them back for Claude Code. It refuses files with uncommitted changes (--force overrides), and at user scope backs up first.

Then keep everything in the standard places:

What Where Each agent gets
Instructions AGENTS.md read where it is; Claude Code gets @AGENTS.md in CLAUDE.md, Gemini CLI a context.fileName entry
Skills .agents/skills/<name>/SKILL.md read where they are; copied into .claude/skills for Claude Code
Hooks .agents/hooks.json (Claude Code's format) one entry per event that runs your hooks at hook time, in every agent
MCP servers .mcp.json read where it is, or copied into each agent's config
Subagents .agents/agents/<name>.md (Claude Code's format) copied into each agent's folder

agent-harness-adapter install again (from anywhere in the repo) refreshes the installed agents; --harness <id> adds one. agent-harness-adapter status exits 1 when a copy is out of date, for CI.

.agents/hooks.json:

{"hooks": {"PreToolUse": [{"matcher": "Bash", "hooks": [{"type": "command", "command": "scripts/guard.sh"}]}]}}

scripts/guard.sh gets Claude Code's hook input in every agent, and answers the way Claude Code reads it, for example exit 2 with a reason on stderr to block.

Quick start: a tool's integration

mytool.harness.toml:

version = 1
name = "mytool"
instructions = { file = "agent/instructions.md" }
allow_commands = ["mytool"]

[[skills]]
name = "mytool"
description = "Use mytool to check the project."
body = { file = "agent/skill.md" }

[[skills]]
dir = "agent/skills/review"   # an existing skill directory, copied as it is

[[hooks]]
event = "pre-tool"
tools = "shell"
run = "mytool guard"          # bridged: mytool speaks Claude Code's hook protocol

[[mcp_servers]]
name = "mytool"
command = "mytool"
args = ["mcp"]
agent-harness-adapter install --manifest mytool.harness.toml --harness claude,codex
agent-harness-adapter status  --manifest mytool.harness.toml

Commands

agent-harness-adapter install    # the config, or --manifest <file>; --harness <ids|all>, --scope, --force, --migrate
agent-harness-adapter status     # exit 1 when a copy is out of date
agent-harness-adapter uninstall  # takes out what it wrote; your sources stay
agent-harness-adapter hook ...   # what installed hooks run
agent-harness-adapter schema <manifest|hooks|hook-input|hook-answer|result>

Documentation

https://six5536.github.io/agent-harness-adapter/:

Pre-1.0, minor versions may contain breaking changes.

License

MIT. See LICENSE.