zhin: Skill for Claude Code

.github/skills/migrate-zhin-plugin-runtime/SKILL.md

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

A migration workflow for moving older Zhin.js plugins to the convention-based Plugin Runtime. It replaces legacy registration and shared-state patterns with the newer plugin definition, capability folders, and resource system.

In plain words
What is it for?
It is for checking migration status, extracting existing registrations, generating the new plugin structure, removing legacy imports, and verifying the result with builds and tests.
Why use it?
It helps preserve a plugin’s user-visible behavior while moving it away from deprecated APIs and compatibility code. It first reports problems and shows whether automatic migration is possible.

Skill for Claude CodeCodex

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

This is zhinjs/zhin's own configuration. It tells Claude Code and Codex 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 →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { storeToken } from '../plugin.js';.

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/skills/migrate-zhin-plugin-runtime/SKILL.md
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 migrate-zhin-plugin-runtime

README.md
[![agentmods](https://agentmods.dev/badge/skills/zhinjs/zhin/migrate-zhin-plugin-runtime.svg)](https://agentmods.dev/skills/zhinjs/zhin/migrate-zhin-plugin-runtime)
Your own site
<a href="https://agentmods.dev/skills/zhinjs/zhin/migrate-zhin-plugin-runtime"><img src="https://agentmods.dev/badge/skills/zhinjs/zhin/migrate-zhin-plugin-runtime.svg" alt="Measured on agentmods" height="20"></a>
Per session 178 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,415 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.00178 $0.02415
Opus 5 $0.00089 $0.01208
Sonnet 5 $0.00036 $0.00483
Haiku 4.5 $0.00018 $0.00242

Measured 8d ago against content hash 31dc33d8505a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

migrate-zhin-plugin-runtime 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 8d 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/skills/migrate-zhin-plugin-runtime/SKILL.md · 150 lines

How it starts

The opening of the file, as written. The whole thing — 150 lines — stays where its author put it; the contents beside it link to each section on GitHub.

迁移 Zhin Plugin Runtime

目标是产出纯新架构代码plugin.ts 只做装配,能力按目录发现,共享状态走 Resource/Token。 不保留 compat runtime,不双写。

先建立事实,再动手

迁移最容易翻车的地方是凭印象改代码。zhin runtime migrate status 会静态分析整个项目并 返回一个状态机,它比任何猜测都准 —— 每一步都以它的输出为准:

zhin runtime migrate status        # 输出 JSON;state 为 ready 时退出码 0,否则 1
state 含义 下一步
blocked errormanual 诊断,自动迁移无法证明语义等价 人工清掉诊断,见 人工诊断处理
extraction-required 还有能自动搬运的注册(automatic > 0 zhin runtime migrate extract --write
cutover-required 能力已就位,但 package.json#zhin / plugin.ts 还没生成 zhin runtime migrate cutover --write
dual-run 仍在从 zhin.js 导入经典 API(usePlugin / MessageCommand 等),或直接 import @zhin.js/core / @zhin.js/kernel 改用门面约定 API(definePlugin / defineCommand 等),删掉旧入口
compat 仍在 import @zhin.js/next-compat 移除 compat 依赖
ready 完成 跑构建与测试

状态是从上往下判定的:只要还有 manual/error 诊断就一直是 blocked,先清诊断再谈其它。

工作流

  1. 盘点:读目标包的 README、最近的测试、旧入口,弄清用户可见行为(命令、消息、定时、 持久化)。迁移的验收标准是行为不变,不是编译通过。
  2. 看计划zhin runtime migrate extract --check,逐条读 changesdiagnostics--check--write 必须二选一,同时给或都不给会直接报错。
  3. 搬能力zhin runtime migrate extract --write。它只搬模块顶层、且闭包干净的注册, 已存在的目标文件不会被覆盖。
  4. 清诊断:每条 manual 都要人工处理,见 人工诊断处理。 最常见的是 action 捕获了模块级变量 —— 把它提升为 owner Resource,能力文件再从执行上下文读。
  5. 装配zhin runtime migrate cutover --write 生成 package.json#zhinplugin.ts, 并补齐 zhin.js@zhin.js/runtime;Stable Features 可由 Root 继承,不必再装 @zhin.js/command|middleware|component(cutover 仍可能按约定目录写入 features 挂载)。启动脚本统一是 zhin runtime start,不要再写失效的 zhin dev / zhin start / zhin build
    • package.json#private: true 的本地 TS root 使用 entry: "./plugin.ts",直接执行 pnpm devzhin runtime start
    • 非 private 的发布包使用 entry: "./plugin.js";cutover 生成独立的 tsconfig.zhin.jsonzhin:buildprepack / prepublishOnly,以便 pnpm pack 和 npm publish 前把 plugin.ts、约定目录和 src/ 编译成可发布 JS。不要把 plugin.ts 作为发布 manifest 的入口。 已有合法 manifest 会被补齐到相应模式;其它 zhin 字段形态仍需人工处理。
  6. 迁移剩余配置schema.json(只声明本包字段)、Feature mounts、child plugin mounts。
  7. 删旧:删掉旧注册代码、旧入口、compat 依赖。
  8. 验证:构建 + 测试 + 行为验证(命令路由、消息发送、配置默认值、热更新)。

Read the full file on GitHub · 150 lines

Files

What ships with it

2 files 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. 8d ago First seen · 150 lines · 178 tokens per session scan A 31dc33d8505a

Subscribe to this mod's changes

migrate-zhin-plugin-runtime is a skill published in the GitHub repository zhinjs/zhin (135 stars, last pushed today), licensed MIT. It adds 178 tokens to every session and 2,415 once invoked, about $0.0009 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.

Related

Other skills, from other repositories

eliza-cloud

Use when the task involves Eliza Cloud or elizaOS Cloud as a managed backend, app platform, deployment target, billing layer, or monetization surface. The catch-all skill for any user request about THEIR existing apps / containers / earnings / credits / api-keys / analytics / billing / payment requests / payouts …

elizaOS/eliza · 191 tokens

wegent-knowledge

Knowledge base management and search tools for Wegent. Provides capabilities to list, create, update, and search knowledge bases and documents using RAG retrieval. Use this skill when the user wants to manage knowledge bases, documents, or search for information programmatically.

wecode-ai/Wegent · 51 tokens

a0-development

Development guide for extending Agent Zero from current source and DOX. Use for framework architecture, tools, extensions, API/WebUI handlers, agent profiles, prompts, skills, projects, runtime boundaries, and contribution workflow. Load the focused reference files before giving implementation guidance.

agent0ai/agent-zero · 57 tokens

webhook-subscriptions

Create and manage webhook subscriptions for event-driven agent activation. Use when the user wants external services to trigger agent runs automatically.

graniet/kheish · 24 tokens

tech-design

A guided process for writing a backend technical design from a product requirements document or feature description. A technical design explains how a feature should work in code and services.

open-octo/octo-agent · 109 tokens

http_request

Make HTTP requests (GET, POST, PUT, DELETE, PATCH) to any API endpoint. Use when: the user asks to call an API, test an endpoint, fetch JSON/data from a URL, or interact with a REST API. NOT for: web scraping (use webscraper), web search (use tavilysearch), or file downloads (use curl/wget).

ericwang915/PythonClaw · 79 tokens