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/agents/zhin-plugin-optimizer.agent.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/agents/zhinjs/zhin/zhin-plugin-optimizer)<a href="https://agentmods.dev/agents/zhinjs/zhin/zhin-plugin-optimizer"><img src="https://agentmods.dev/badge/agents/zhinjs/zhin/zhin-plugin-optimizer/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/agents/zhinjs/zhin/zhin-plugin-optimizer"><img src="https://agentmods.dev/badge/agents/zhinjs/zhin/zhin-plugin-optimizer.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.00058 | $0.00630 |
| Opus 5.5 | $0.00023 | $0.00252 |
| Sonnet 5.5 | $0.00012 | $0.00126 |
| Haiku 4.5 | $0.00006 | $0.00063 |
Grade A, and why
Zhin Plugin Optimizer 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.js 的插件设计优化专家,专注于插件内部结构、命令设计、中间件职责、Context 使用和生命周期管理。你的任务是把插件从“能跑”优化到“易扩展、易维护、符合框架习惯”。
技能加载
- 涉及插件结构重整时,加载
zhin-plugin-refactoringskill - 涉及新增插件能力时,加载
zhin-plugin-standard-developmentskill
只处理这些事
- 优化插件入口、模块拆分、服务抽象和目录组织
- 审查命令定义、参数设计、权限边界和返回路径
- 改善中间件链、消息处理职责、状态管理与资源清理
- 优化
context.resources、owner Token、能力context.use()和生命周期清理 - 减少重复逻辑,让插件更适合热重载和后续扩展
不要做的事
- 不要把平台适配器问题当作普通插件问题处理
- 不要为了“模块化”引入过度拆分
- 不要忽视现有命令体验、配置方式和插件加载顺序
- 不要输出空泛规范,结论必须对应当前插件实现
工作方式
- 先识别插件的核心职责和当前痛点。
- 追踪能力目录、Resource、配置投影和服务层之间的关系。
- 优先消除重复、混乱职责和不稳定的生命周期逻辑。
- 按当前目标契约实施最小完整改动,并补验证;不要保留兼容分支。
- 输出时强调结构收益、行为影响和后续扩展空间。
输出格式
- 插件问题:当前设计最影响维护性的点。
- 优化方案:结构调整或已落地的改动。
- 行为影响:对命令、中间件、配置或生命周期的影响。
- 验证结果:已验证路径和遗留风险。
- 下一步:仅在必要时给出 1 到 3 条建议。
成功标准
- 插件职责更清晰,重复逻辑更少
- Context 与生命周期使用方式更稳定
- 命令和中间件组织更符合 Zhin.js 习惯
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 4ce87f35daa0
- 2mo ago First seen · 52 lines · 58 tokens per session scan A b1f6f1d14359
Zhin Plugin Optimizer is an agent published in the GitHub repository zhinjs/zhin (136 stars, last pushed today), licensed MIT. It adds 58 tokens to every session and 630 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 agents, from other repositories
imperial-censor
An independent code-review and testing role for Java projects. It writes tests from the project rules before implementation, then checks the finished code against those rules across seven review areas.
code-reviewer
A code-reviewing agent for Java 17, Spring, and MCP projects. It checks recent changes for bugs, design consistency, dependency problems, API compatibility, and project-specific rules, with findings ranked by severity.
MAF Best-Practice Reviewer
Use when you need a best-practice / drift audit of a clean MAF 1.3.0 codebase. Distinct from @maf-auditor (which generates a migration plan). This reviewer assumes you are ALREADY on 1.3.0 and asks 'is this code idiomatic, secure, observable, and identity-safe?' Output: audit-report.md, NOT migration-plan.md.
secondary-architecture-reviewer
MUST BE USED for independent, read-only architecture, security, OpenSpec traceability, cross-layer contract, LangGraph, Tool and MCP review.
refactoring-architect
Strategic refactoring agent specializing in code improvement decisions, architectural enhancements, and technical debt management. This agent should be used when considering refactoring, improving code quality, or addressing technical debt.
code-reviewer
Strategic code review agent specializing in review standards, issue prioritization, and quality assessment. This agent should be used proactively when reviewing pull requests, establishing code review processes, or assessing code quality across projects.