plugin-init

plugin-init is a skill for Claude Code, Codex from zhinjs/zhin. It costs 56 tokens per session (2,086 once invoked), scanned A, original, MIT.

A project starter for creating Zhin.js plugins, which are installable packages that extend the Zhin.js bot framework. It sets up the required files, folders, package metadata, entry point, and documentation.

In plain words
What is it for?
Use it to start a new Zhin.js plugin, choose its basic structure, and prepare folders for commands, tests, configuration, or other supported plugin parts.
Why use it?
It removes the need to remember the framework’s required plugin layout and startup rules. It also helps avoid using older plugin registration patterns that the input says are no longer supported.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to start a new Zhin.js plugin, choose its basic structure, and prepare folders for commands, tests, configuration, or other supported plugin parts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zhinjs/zhin/plugin-init
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.

Any agent
npx skills add zhinjs/zhin --skill plugin-init
Clone the repo
git clone --depth 1 https://github.com/zhinjs/zhin

Made for: Claude Code, Codex.

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 plugin-init

README.md
[![agentmods](https://agentmods.dev/badge/skills/zhinjs/zhin/plugin-init/github.svg)](https://agentmods.dev/skills/zhinjs/zhin/plugin-init)
Your own site
<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.

agentmods 80×15 button for plugin-init

Your own site · 80×15
<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>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,086 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00056 $0.02086
Opus 5.5 $0.00022 $0.00834
Sonnet 5.5 $0.00011 $0.00417
Haiku 4.5 $0.00006 $0.00209

Measured 18d ago against content hash 48ad72cd9651, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 18d 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.

packages/toolkit/create-zhin/template/skills/plugin-init/SKILL.md · 205 lines

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 start(开发时 pnpm dev);插件即 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 步:确认插件信息

向用户确认:

  1. 插件名称:kebab-case,如 my-plugin、group-manager(须匹配 ^[a-z][a-z0-9-]*$)
  2. 插件类型:普通插件 / 服务插件 / 适配器插件
  3. 核心功能:命令、中间件、组件、定时任务、AI 工具、控制台页
  4. 是否需要数据库
  5. 是否需要控制台前端

第 2 步:生成目录结构

命名规范:

  • npm 包名:社区插件 zhin.js-{name},官方插件 @zhin.js/{name}
  • 目录位于 plugins/{name}/(或项目内约定路径)

最小结构(约定目录插件):

plugins/{name}/
├── package.json          # 含 "zhin" manifest
├── schema.json           # 可选:插件配置(与 definePlugin({ config }) 二选一,同时存在会拒绝启动)
├── 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

Read the full file on GitHub · 205 lines

Files

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.

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. 18d ago Changed 48ad72cd9651
  2. 1mo ago Changed 90545c8dc71e
  3. 1mo ago Changed · +1 lines 03648b12f794
  4. 1mo ago Changed ce8d8f581e98
  5. 2mo ago Changed 57a3a753885b
  6. 3mo ago First seen · 204 lines · 56 tokens per session scan A 85352f35aacc

Subscribe to this mod's changes

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,086 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

plugin-init compared with skills from other repositories

plugin-init next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
plugin-initzhinjs/zhinSkill136todayMITA56Claude Code, Codex
dify-skillsSystemTce/dify-skillsSkill379mo agononeA24Claude Code, Codex
agent-developmentmahmoud20138/TradecraftSkill197mo agoMITA80Claude Code
agent-creationstencila/stencilaSkill916todayApache-2.0A53Claude Code
byted-mediakit-voiceover-editingbytedance/agentkit-samplesSkill496todayApache-2.0A104Claude Code, Codex
Developmental Gene Panel Design Workflowaristoteleo/PantheonOSSkill499todayBSD-2-ClauseA129Claude Code, Codex
Developing PantheonOS Appsaristoteleo/PantheonOSSkill499todayBSD-2-ClauseA50Claude Code, Codex