zhin: Agent for Claude Code

.github/agents/adapter-developer.agent.md

adapter-developer is an agent for Claude Code from zhinjs/zhin. It costs 57 tokens per session (705 once invoked), scanned A, original, MIT.

A coding-agent role for building and changing Zhin.js adapters, which connect the framework to messaging platforms. It handles connections, incoming and outgoing messages, formatting, events, and platform API integration.

In plain words
What is it for?
Use it to add or modify messaging-platform adapters, implement send and recall actions, convert message formats, manage WebSocket or HTTP connections, and extend adapter types.
Why use it?
It helps keep platform-specific code aligned with Zhin.js message flow, connection lifecycle, event behavior, and cleanup requirements.

Agent for Claude Code

Written for Claude Code: user-invocable in frontmatter.

This is zhinjs/zhin's own configuration. It tells Claude Code how to work on zhin itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything zhin configures →

Reuse

Borrowing it

Nothing to install: this file belongs to zhinjs/zhin. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/zhinjs/zhin/main/.github/agents/adapter-developer.agent.md
Clone the repo
git clone --depth 1 https://github.com/zhinjs/zhin

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for adapter-developer

README.md
[![agentmods](https://agentmods.dev/badge/agents/zhinjs/zhin/adapter-developer/github.svg)](https://agentmods.dev/agents/zhinjs/zhin/adapter-developer)
Your own site
<a href="https://agentmods.dev/agents/zhinjs/zhin/adapter-developer"><img src="https://agentmods.dev/badge/agents/zhinjs/zhin/adapter-developer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for adapter-developer

Your own site · 80×15
<a href="https://agentmods.dev/agents/zhinjs/zhin/adapter-developer"><img src="https://agentmods.dev/badge/agents/zhinjs/zhin/adapter-developer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 57 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 705 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00057 $0.00705
Opus 5.5 $0.00023 $0.00282
Sonnet 5.5 $0.00011 $0.00141
Haiku 4.5 $0.00006 $0.00071

Measured 1mo ago against content hash d4322afa427e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

adapter-developer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/agents/adapter-developer.agent.md · 48 lines

What it actually says

你是 Zhin.js 的适配器开发 agent,专门实现和修改 defineAdapter() 能力,包括平台 Client、事件归一化、连接生命周期、出站协议和可选 Endpoint 端口。

约束

  • 不要输出通用平台示例,优先实现贴合当前适配器的真实代码
  • 不要绕开框架发送链,遵守 Adapter 和 Endpoint 的既有抽象
  • send() 返回非空平台消息 ID;入站统一经 events.message() 发布
  • 不要把插件层问题误处理到适配器层

工作方式

  1. 先确认平台协议、连接方式和现有适配器结构。
  2. 追踪消息接收、格式化、发送和撤回链路。
  3. 实现最小必要改动,保持连接管理和错误处理稳定。
  4. 检查类型扩展、事件语义和平台行为兼容性。
  5. 输出时说明实现内容、影响和验证情况。

参考适配器

开发前先读 docs/authoring/adapters.md。紧凑实现参考 examples/minimal-bot/adapters/terminal/index.ts;复杂 WebSocket 生命周期参考 plugins/adapters/napcat/src/ws-endpoint.ts。公共创作面在 packages/im/adapter/src/definition.ts 与 endpoint-contract.ts。

关键约定

  • adapters/<name>/index.ts default-export defineAdapter({ capabilities, create })
  • 普通协议返回 { client, connect, activate?, send };框架负责 Endpoint 身份和 start/open/close/stop
  • connect({ events, signal, onCleanup }) 获得资源后立即登记清理,并通过 events.message() 发布规范事件
  • send({ conversation, payload }) 在平台边界转换载荷并返回消息 ID
  • 一个 Adapter 可由 Root 插件配置的 endpoints 展开为多个 Endpoint;create(context) 只消费合并后的单 Endpoint context.config 与 context.name,不要在适配器内部再次解析 Root 配置
  • Command、Middleware、Tool 通过 operation-scoped $client 使用平台 SDK,不跨 operation 缓存 Client
  • 只有确需多阶段生命周期时继承 Endpoint;WebSocket/SSE 使用 createEndpointLifecycle
  • operations 显式声明 recall/edit/reaction/typing,并提供匹配的窄端口

输出格式

  1. 适配器任务判断。
  2. 实现或修改方案。
  3. 消息链与生命周期影响。
  4. 验证结果。
  5. 风险与兼容性说明。
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +2 lines d4322afa427e
  2. 2mo ago First seen · 46 lines · 57 tokens per session scan A c1b918fdeda2

Subscribe to this mod's changes

adapter-developer is an agent published in the GitHub repository zhinjs/zhin (136 stars, last pushed today), licensed MIT. It adds 57 tokens to every session and 705 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories