zhin zhin-plugin.instructions.md

A set of coding instructions for creating Zhin.js plugins, including their package files, entry point, imports, types, and convention-based folders. Zhin.js is a TypeScript framework for building bots that communicate across messaging channels.

In plain words
What is it for?
It is for implementing plugin commands, adapters, components, middleware, handlers, pages, tools, agents, and other runtime features.
Why use it?
It gives developers the repository’s expected rules in one place, reducing mistakes in plugin structure, dependency setup, and feature registration.

Instructions file for GitHub Copilot

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 instructions/zhinjs/zhin/zhin-plugin
Clone the repo
git clone --depth 1 https://github.com/zhinjs/zhin

Made for: GitHub Copilot.

Per session 1,018 This file is loaded in full into every session.
When invoked 1,018 The same file — it is already loaded in full.
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.01018 $0.01018
Opus 5 $0.00509 $0.00509
Sonnet 5 $0.00204 $0.00204
Haiku 4.5 $0.00102 $0.00102

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

Security

Grade A, and why

zhin zhin-plugin.instructions.md 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 3d 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/instructions/zhin-plugin.instructions.md · 99 lines

How it starts

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

Zhin Plugin Runtime authoring

Package contract

  • Every Plugin is an npm package with package.json#zhin, plugin.ts and optional schema.json.
  • plugin.ts default-exports definePlugin() from zhin.js (Feature package authors may import from @zhin.js/plugin-runtime directly); it owns lifecycle and Resources, not capability registration.
  • Child packages live one level below plugins/*. Logical ancestry comes from zhin.plugins, not nested directories.
  • Feature providers are explicit zhin.features mounts. Apps that depend on zhin.js inherit Stable Features via platformFeatures — do not separately install @zhin.js/command / @zhin.js/middleware / @zhin.js/handler / @zhin.js/adapter / @zhin.js/component.

Convention directories

adapters/**/*.ts                 defineAdapter()      // import from zhin.js/adapter
commands/**/*.ts                 defineCommand()      // import from zhin.js/command
components/**/*.ts               defineComponent()    // import from zhin.js/component
middlewares/**/*.ts              defineMiddleware()   // import from zhin.js/middleware
handlers/**/*.ts                 defineHandler()      // import from zhin.js/handler; path `/` → event `.` when event omitted
tools/*.ts                       defineAgentTool()
skills/<name>/SKILL.md           Markdown Skill SSOT
agents/<name>.agent.md           Markdown Agent SSOT
mcp/*.ts                         defineMcp()
pages/*.ts|tsx                   definePage()
pages/$nav.tsx|$footer.tsx       layout overrides

Each TypeScript capability default-exports exactly one definition. Do not call usePlugin(), getPlugin() or add*() in new code. Migrate old code with .github/skills/migrate-zhin-plugin-runtime.

Imports and native TypeScript

  • Local imports use .js specifiers.
  • Import Stable Feature define* from zhin.js/* facade subpaths when the app depends on zhin.js. Import IM execution contracts from zhin.js/core/runtime (or @zhin.js/core/runtime).
  • Node-authored files must use erasable TypeScript syntax. Do not use enums, namespaces, constructor parameter properties or TSX in server capability directories.
  • Browser pages/*.tsx are compiled by the Client Build adapter and are not imported by Node.

Read the full file on GitHub · 99 lines

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. 3d ago First seen · 99 lines · 1,018 tokens per session scan A 465b09ed7ad0

Subscribe to this mod's changes

zhin zhin-plugin.instructions.md is an instructions file published in the GitHub repository zhinjs/zhin (135 stars, last pushed 6d ago), licensed MIT. It adds 1,018 tokens to every session, about $0.0051 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.