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.
npx skills add zhinjs/zhin --skill plugin-initgit clone --depth 1 https://github.com/zhinjs/zhinWrote 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.
[](https://agentmods.dev/skills/zhinjs/zhin/plugin-init)<a href="https://agentmods.dev/skills/zhinjs/zhin/plugin-init"><img src="https://agentmods.dev/badge/skills/zhinjs/zhin/plugin-init/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.
<a href="https://agentmods.dev/skills/zhinjs/zhin/plugin-init"><img src="https://agentmods.dev/badge/skills/zhinjs/zhin/plugin-init.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00056 | $0.02058 |
| Opus 5.5 | $0.00022 | $0.00823 |
| Sonnet 5.5 | $0.00011 | $0.00412 |
| Haiku 4.5 | $0.00006 | $0.00206 |
Grade A, and why
plugin-init 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 today.
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.
How it starts
The opening of the file, as written. The whole thing — 205 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Zhin 插件初始化(Plugin Runtime)
引导创建一个符合 Plugin Runtime 的新插件。唯一启动路径是 zhin runtime start;插件即 package,plugin.ts 必须 default-export definePlugin()。
禁止再脚手架 usePlugin() / MessageCommand / src/index.ts 命令式注册——zhin.js/node 与 bootstrapNode 已删除,唯一入口是 Plugin Runtime。
适用场景
- 用户说「帮我创建一个插件」「新建插件」「初始化一个 xxx 插件」
- 需要从零搭建插件包结构
优先路径(二选一)
| 场景 | 命令 / 动作 | 输出 |
|---|---|---|
| 已有 Zhin 项目 | zhin new <name>(仓库根或项目根) |
项目内本地插件 plugins/<name>/ |
| 独立可发布插件 | npx @zhin.js/cli new <name> --standalone |
./<name>/ 官方 npm 包结构 |
| 全新应用 | pnpm create zhin-app |
完整 bot 项目 |
仅当用户明确要求「手写目录」或 zhin new 不可用时,才走下方手工流程。
初始化流程
第 1 步:确认插件信息
向用户确认:
- 插件名称:kebab-case,如
my-plugin、group-manager(须匹配^[a-z][a-z0-9-]*$) - 插件类型:普通插件 / 服务插件 / 适配器插件
- 核心功能:命令、中间件、组件、定时任务、AI 工具、控制台页
- 是否需要数据库
- 是否需要控制台前端
第 2 步:生成目录结构
命名规范:
- npm 包名:社区插件
zhin.js-{name},官方插件@zhin.js/{name} - 目录位于
plugins/{name}/(或项目内约定路径)
最小结构(约定目录插件):
plugins/{name}/
├── package.json # 含 "zhin" manifest
├── schema.json # 可选:插件配置
├── plugin.ts # definePlugin 入口(只做装配)
├── tsconfig.json
├── README.md
├── commands/ # defineCommand,路径即路由
│ └── hello.ts
├── tests/
│ └── hello.test.ts
└── skills/ # 可选:给 AI 用的 SKILL
└── {name}/
└── SKILL.md
单文件入门(不必先拆目录):见仓库 examples/single-file-bot/bot.ts——在 setup({ addCommand }) 里注册命令。
按需增加约定目录(一个文件一个能力,default export):
| 目录 | API |
|---|---|
commands/**/*/index.ts |
defineCommand();未加 $ 的文件是普通依赖模块 |
middlewares/*/index.ts |
defineMiddleware() |
components/*/index.tsx |
defineComponent() |
tools/<name>/index.ts |
defineAgentTool() |
pages/*/index.tsx |
definePage() |
skills/<name>/SKILL.md |
Markdown Skill 入口 |
agents/<name>/ |
agent.json + system.md + boundaries.md + conventions.md 子 Agent |
第 3 步:生成 package.json
{
"name": "zhin.js-{name}",
"version": "0.1.0",
"type": "module",
"zhin": {
"protocol": 1,
"type": "plugin",
"entry": "./plugin.ts",
"features": ["@zhin.js/command"]
},
"exports": {
".": "./plugin.ts"
},
"files": ["plugin.ts", "commands", "schema.json", "README.md"],
"peerDependencies": {
"zhin.js": "*"
},
"devDependencies": {
"zhin.js": "latest"
}
}
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- today Changed · +1 lines 03648b12f794
- 6d ago Changed ce8d8f581e98
- 26d ago Changed 57a3a753885b
- 1mo ago First seen · 204 lines · 56 tokens per session scan A 85352f35aacc
plugin-init is a skill published in the GitHub repository zhinjs/zhin (136 stars, last pushed today), licensed MIT. It adds 56 tokens to every session and 2,058 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.
Other skills, from other repositories
dify-skills
A collection of guides for developing Dify workflows and plugins, covering the platform's skills and development practices. Dify is a platform for building applications from connected workflow steps.
agent-development
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development…
tcapi
A helper for managing Tencent Cloud resources through Tencent Cloud's command-line API tool. Tencent Cloud is a cloud-services provider offering products such as virtual servers, storage, networks, and containers.
agent-creation
Create a new Stencila agent. Use when asked to create, write, scaffold, or set up an agent directory or AGENT.md file. Covers workspace and user-level agents with model, provider, tool, trust, and MCP configuration.
byted-mediakit-voiceover-editing
Volcano Engine AI MediaKit talking-head video editing Skill: a one-stop workflow from environment setup through media management, audio processing, talking-head cuts, video export, review UI, and iterative refinement. You MUST invoke this Skill when the user mentions talking-head editing, cutting talking video, video…
Developmental Gene Panel Design Workflow
Panel design for DEVELOPING / dynamic systems (embryonic organs, differentiation, regeneration). The target experiment is usually a LATE / terminal stage, but the biology is a trajectory: terminal cell types are end-products of earlier lineage programs. A panel built from the target stage alone resolves terminal…