Skip to main content
skill CX Codex

add-agent-adapter — Claude Code skill: wiring agent adapters in Gryph

A skill for adding a new AI coding agent to Gryph or rewiring an adapter that is already there.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add safedep/gryph --skill add-agent-adapter -a claude-code
Open on GitHub

What add-agent-adapter does

The skill walks you through docs/agent-adapter.md, which it treats as the only source of truth for the job. Read that document end to end first, then work through its steps in order and check every edit against the wiring table inside it. The agent/gemini/ package serves as the reference model for the settings.json pattern. Finish by running the verify commands from the last step.

An adapter touches files under agent/, config/, cli/ and tui/. Miss one and detection, registration or the security response path breaks. That is why the skill tells you not to build an adapter from memory. It also lists invariants: HookConfigPaths() has to return a glob for every file the install step writes, and Hooks() needs one events.HookSpec per hook with its phase. Agent knowledge belongs in the adapter package, not in aarm/loader or aarm/pdp; shell commands go through aarm/shellcmd, which parses them with mvdan.cc/sh, so a regex is the wrong tool. Register the adapter only in RegisterAdapters in engine/engine.go.

When the code drifts from the document, update docs/agent-adapter.md in the same change. Self-protection here is best effort, and the skill says not to describe it as a security boundary.

What it helps with

  • add support for a new AI coding agent to Gryph
  • wire hook events for an adapter
  • find every file a new adapter has to touch
  • regenerate the enforcement coverage doc after hook changes
  • keep detection and the security response path intact

Example prompts for the agent

  • Add an adapter for a new agent to Gryph following docs/agent-adapter.md
  • Wire the new agent's hooks and register the adapter in RegisterAdapters
  • Check the adapter invariants and regenerate docs/agent-enforcement-coverage.md

How to install add-agent-adapter

1Skills CLI (Vercel)

npx skills add safedep/gryph --skill add-agent-adapter -a claude-code

2Manually: put the files in place

~/.claude/skills/add-agent-adapter/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/add-agent-adapter/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about add-agent-adapter

How do I install add-agent-adapter in Claude Code?

Run npx skills add safedep/gryph --skill add-agent-adapter -a claude-code. The skill then sits at ~/.claude/skills/add-agent-adapter/SKILL.md.

What does add-agent-adapter do?

It guides you through adding a new agent adapter to Gryph: reading the doc, editing every listed file, checking the invariants and running the verify commands.

Why not write an adapter from memory?

The adapter pattern spans several files across different directories, and a missed file breaks detection, registration or the security response path. The doc names each file and the exact change it needs.

Source text

SKILL.md · Apache-2.0
---
name: add-agent-adapter
description: Use when adding support for a new AI coding agent to Gryph, or when changing how an existing agent adapter is wired. Trigger this whenever the user wants to integrate a new agent (for example Claude Code, Cursor, Gemini, Codex, Windsurf, or any other tool), add a new adapter package under agent/, wire agent hook events, or asks how adapters detect, install hooks, parse events, or register. Also trigger on phrases like "add a new agent", "support agent X", "new adapter", or "hook up agent X to gryph", even when the user does not say the word "adapter".
---

# Add a New Agent Adapter

The full, current guide is `docs/agent-adapter.md`. It is the single source of truth for this task. Read it and follow it step by step.

Do not add an agent adapter from memory. The adapter pattern touches several files across `agent/`, `config/`, `cli/`, and `tui/`. A missed file breaks detection, registration, or the security response path. The doc lists every file and the exact change each one needs.

## How to use this skill

1. Read `docs/agent-adapter.md` in full.
2. Follow each step in order. Use the wiring table in the doc to change every listed file.
3. Use an existing adapter as your reference. The `agent/gemini/` package is the recommended model for the `settings.json` pattern.
4. Run the verify commands from the doc's final step before you finish.

## Invariants

The doc explains these. They break silently if you miss them.

1. Implement `HookConfigPaths()` and return a glob for every file the install step writes. Self-protection guards only these paths. `TestAdapters_InstallWritesOnlyDeclaredHookConfig` fails when a written file has no glob.
2. Implement `Hooks()` with one `events.HookSpec` per hook, including its phase. The decision service reads the phase from it. Regenerate `docs/agent-enforcement-coverage.md` with `GRYPH_UPDATE_DOCS=1 go test ./cli -run TestEnforcementCoverageDoc`.
3. Keep agent knowledge in the adapter package. Do not add agent paths, file names, or command regexes to `aarm/loader` or `aarm/pdp`. The loader derives the shell-command check from the declared paths, and `aarm/shellcmd` parses commands with `mvdan.cc/sh`. Do not match shell commands with a regex.
4. Register the adapter only in `RegisterAdapters` in `engine/engine.go`. The self-protection globs come from that list.
5. Self-protection is best effort. Do not describe it as a security boundary. Kernel-based self-protection is on the roadmap.

## Keep the doc correct

The doc is the source of truth, so keep it accurate. If you find the code no longer matches the doc, update `docs/agent-adapter.md` in the same change. Do not fork the guidance into this skill.

© safedep · Apache-2.0 · safedep/gryph

Similar skills

All skills for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor