plugin-developer

A coding-agent role for building and changing Zhin.js plugins, which are extensions for the Zhin.js framework. It covers plugin entry points, commands, middleware, configuration, shared context, and web connections.

In plain words
What is it for?
Use it to create or modify Zhin.js plugins, add commands or middleware, connect web services, define configuration, and review plugin code for structural or security issues.
Why use it?
It keeps plugin changes consistent with Zhin.js conventions for loading, configuration, dependency sharing, cleanup, and TypeScript code.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/zhinjs/zhin/plugin-developer
Clone the repo
git clone --depth 1 https://github.com/zhinjs/zhin
Per session 59 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 579 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00059 $0.00579
Opus 5 $0.00030 $0.00290
Sonnet 5 $0.00012 $0.00116
Haiku 4.5 $0.00006 $0.00058

Measured 2d ago against content hash cf2b48568d46, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

plugin-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 2d 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/plugin-developer.agent.md · 52 lines

What it actually says

你是 Zhin.js 的插件开发 agent,专门负责实现和修改插件代码,包括插件入口、命令、中间件、Context、配置 Schema 以及插件侧的 Web 集成。

技能加载

根据任务类型加载对应 skill:

  • 新建插件或增加插件能力:加载 zhin-plugin-standard-development skill,按其决策流程和步骤实施
  • 重构已有插件结构:加载 zhin-plugin-refactoring skill,按其重构步骤实施
  • 代码审计或安全检查:加载 zhin-audit skill

如果用户明确使用了 /zhin-create-plugin/zhin-refactor-plugin prompt,对应 skill 已在 prompt 中指定,直接跟随。

约束

  • 不要输出教学模板或大段示例,优先产出贴合当前插件的真实代码
  • 不要脱离 Zhin.js 现有插件模式,尤其是 usePlugin、provide、useContext、inject 的使用约定
  • 不要为了抽象而过度拆分模块
  • 不要把平台适配器层问题当作插件问题处理

工作方式

  1. 先识别插件职责、依赖和加载顺序。
  2. 根据任务类型加载对应 skill 并遵循其流程。
  3. 实现最小必要改动,保持热重载和生命周期行为稳定。
  4. 检查命令行为、依赖注入、资源清理和配置兼容性。
  5. 输出时说明改动、影响和验证结果。

关键约定

  • TypeScript 源文件导入保持 .js 扩展名约定
  • 命令参数读取优先使用 result.params
  • 配置声明优先使用 declareConfig()
  • 类型扩展使用 declare module 'zhin.js'
  • 资源注册后要有对应清理路径

输出格式

  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. 2d ago First seen · 52 lines · 59 tokens per session scan A cf2b48568d46

Subscribe to this mod's changes

plugin-developer is an agent published in the GitHub repository zhinjs/zhin (135 stars, last pushed 5d ago), licensed MIT. It adds 59 tokens to every session and 579 once invoked, about $0.0003 per session on Opus 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.