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.
curl -O https://raw.githubusercontent.com/zhinjs/zhin/main/.github/instructions/zhin-packages.instructions.mdgit 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/instructions/zhinjs/zhin/zhin-packages)<a href="https://agentmods.dev/instructions/zhinjs/zhin/zhin-packages"><img src="https://agentmods.dev/badge/instructions/zhinjs/zhin/zhin-packages/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/instructions/zhinjs/zhin/zhin-packages"><img src="https://agentmods.dev/badge/instructions/zhinjs/zhin/zhin-packages.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.00579 | $0.00579 |
| Opus 5.5 | $0.00232 | $0.00232 |
| Sonnet 5.5 | $0.00116 | $0.00116 |
| Haiku 4.5 | $0.00058 | $0.00058 |
Grade A, and why
zhin zhin-packages.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 1mo 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.
What it actually says
Zhin 核心包默认开发习惯
在 basic 和 packages 目录下编辑代码时自动生效。
分层边界
- 以
docs/concepts/architecture.md和各包package.json为准;运行pnpm check:architecture验证。 plugin-runtime → feature-kit → Feature packages;im-contract供 adapter/core/agent 使用;core → zhin,core + ai → agent。- kernel 和 ai 不应引入 IM 概念,如 Adapter、Endpoint、Message。
目录语义
- Node 侧源码放 src/,构建产物放 lib/。
- 浏览器侧源码放 client/,构建产物放 dist/。
- 不要把仅浏览器代码混进 src/,也不要把服务端实现放进 client/。
导入与导出
- TypeScript 本地导入通常必须带 .js 扩展名。
- 包的 public surface 应与真实构建产物一致;不要新增指向不存在文件的 exports。
- 变更聚合导出时,优先检查 packages/im/zhin/src/index.ts 是否需要同步。
运行时不变量
usePlugin()/getPlugin()已移除;依赖必须通过 setup 的context.resources、能力执行上下文的context.use(token)或当前 operation 的 Generation View 取得。- 代级状态走 snapshot Resource;不要新增模块级 latest-value 单例或恢复
createGenerationStore。 - 如果改动涉及 IM 出站消息,必须保留统一链路:Message.$reply 或 Adapter.sendMessage → renderSendMessage → before.sendMessage → 平台 Endpoint。
- 不要新增绕过 before.sendMessage 的发送捷径。
变更落点
- Plugin、Adapter、Dispatcher、消息链:packages/im/core。
- AI 引擎、Session、Memory、Compaction、Provider:packages/im/ai。
- AI 编排、工具发现、安全策略、MCP client:packages/im/agent。
- 应用入口与聚合 re-export:packages/im/zhin。
- 底层通用能力:basic/* 和 packages/im/kernel。
验证习惯
- 优先运行最小范围验证:pnpm --filter build、pnpm --filter test。
- 跨包类型改动再运行 pnpm type-check。
- 如果改动影响架构边界、目录约定或包导出,检查
docs/concepts/architecture.md和docs/contributing/repo-structure.md是否需要同步。
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.
- 1mo ago Changed · +3 lines · +102 tokens per session 5dd03a256721
- 2mo ago First seen · 44 lines · 477 tokens per session scan A 14ff214b525a
zhin zhin-packages.instructions.md is an instructions file published in the GitHub repository zhinjs/zhin (136 stars, last pushed today), licensed MIT. It adds 579 tokens to every session, about $0.0023 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 instructions, from other repositories
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.