1---2name: harness-adapter-designer3description: Design, implement, or review Bench My Harness adapters for agentic coding harness hooks, plugins, extensions, transcripts, JSONL logs, stdin events, or webhooks from Codex, Claude Code, Cursor, OpenCode, Pi, or custom harnesses.4---56# Harness Adapter Designer78## Workflow9101. Identify the provider surface: hook, plugin, extension, SDK stream, transcript, JSONL file, webhook, or process wrapper.112. Read `references/adapter-contract.md` before designing the adapter contract or changing mappings.123. Map provider events to `bmh.event.v1` without leaking provider-specific fields into the core.134. Preserve raw payload by `raw_ref`, apply redaction, and mark missing or inferred data in `quality`.145. Declare the adapter capability matrix before using its data for comparison.156. Add contract fixtures: raw input, golden canonical output, idempotency case, redaction case, and incomplete event case.1617## Rules1819- Keep provider SDKs and schemas in adapters only.20- Do not invent native IDs, timestamps, token usage, or context usage. Mark inferred values as `derived`, `estimated`, or `observed`.21- Local hooks must be fast and tolerate network failure through local spool or best-effort persistence.22- Webhooks must use signature verification, replay protection, and size limits.23- A new adapter is not complete until it declares capabilities and known gaps.2425## Common Tasks2627- For Claude Code or Codex hooks, prefer stdin command adapters first.28- For OpenCode, prefer plugin or SDK event stream adapters.29- For Pi, prefer extension or SDK adapters.30- For Cursor, start with official hooks when available in the target environment and keep file/transcript fallback.31- For unknown harnesses, implement file/JSONL import before custom runtime control.