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/prompts/zhin-refactor-plugin.prompt.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/commands/zhinjs/zhin/zhin-refactor-plugin)<a href="https://agentmods.dev/commands/zhinjs/zhin/zhin-refactor-plugin"><img src="https://agentmods.dev/badge/commands/zhinjs/zhin/zhin-refactor-plugin/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/commands/zhinjs/zhin/zhin-refactor-plugin"><img src="https://agentmods.dev/badge/commands/zhinjs/zhin/zhin-refactor-plugin.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.00040 | $0.00360 |
| Opus 5.5 | $0.00016 | $0.00144 |
| Sonnet 5.5 | $0.00008 | $0.00072 |
| Haiku 4.5 | $0.00004 | $0.00036 |
Grade A, and why
Zhin Refactor Plugin 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
Load and follow the zhin-plugin-refactoring skill.
Refactor the requested Zhin.js plugin toward a cleaner standard structure.
Requirements
- Freeze current behavior before moving code
- Identify responsibilities such as commands, middleware, events, cron jobs, models, services, tools, router, and client pages
- Choose a target structure that matches the plugin's real complexity
- Minimize behavior changes; refactoring is the primary goal
- Use the refactoring references and before/after example when deciding module boundaries
- Validate that key commands, routes, scheduled jobs, and configuration paths still work after changes
Output Format
输出必须包含以下段落,不能省略:
- 当前问题:混乱点和耦合点是什么,哪些职责混在了不该在的位置
- 目标结构:选了哪种目标骨架,与当前复杂度是否匹配
- 迁移策略:按什么顺序迁移(配置 → 模型 → 服务 → 命令 → 事件 → Web)
- 已完成改动:哪些模块已重构,入口文件是否已收口
- 行为验证:关键命令、路由、定时任务、配置读取是否验证通过
- 风险说明:仍需注意的行为敏感点或未覆盖的验证
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 First seen · 29 lines · 40 tokens per session scan A 5ccbcc38a39a
Zhin Refactor Plugin is a command published in the GitHub repository zhinjs/zhin (136 stars, last pushed today), licensed MIT. It adds 40 tokens to every session and 360 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-09-07.
Other commands, from other repositories
quality-check
Run code quality analysis including code smell detection, complexity analysis, and refactoring recommendations.
quick-review
Quick code review focusing on critical issues (security, bugs, performance).
review.v1
Review code changes: /review [commit|branch|PR].
aidd-churn
Rank files by hotspot score to identify prime candidates for refactoring before PR review.
audit-accessibility
Audit web page or component for WCAG accessibility compliance.
estimate-gcp-cost
Estimate GCP resource costs and provide optimization recommendations.