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/skills/zhin-audit/SKILL.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/skills/zhinjs/zhin/zhin-audit)<a href="https://agentmods.dev/skills/zhinjs/zhin/zhin-audit"><img src="https://agentmods.dev/badge/skills/zhinjs/zhin/zhin-audit/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/skills/zhinjs/zhin/zhin-audit"><img src="https://agentmods.dev/badge/skills/zhinjs/zhin/zhin-audit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00062 | $0.02295 |
| Opus 5 | $0.00031 | $0.01148 |
| Sonnet 5 | $0.00012 | $0.00459 |
| Haiku 4.5 | $0.00006 | $0.00230 |
Grade A, and why
zhin-audit scanned grade A with 1 finding 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 10d 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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
- 搜索 `child_process`, `exec(`, `execSync`, `spawn` How it starts
The opening of the file, as written. The whole thing — 195 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Zhin.js 代码审计技能
对 Zhin.js monorepo 进行安全漏洞、性能瓶颈和架构问题的系统化审计。
适用场景
- 审查新增/修改的代码是否引入安全风险
- 检测内存泄漏、性能回退
- 验证分层架构约束和依赖方向
- PR 代码审查的专项检查
- 版本发布前的全面审计
审计流程
第 1 步:确定审计范围
根据用户请求决定审计范围和深度:
| 范围 | 目标目录 | 触发词 |
|---|---|---|
| 全面审计 | packages/, plugins/, basic/ |
"全面审计", "全量检查" |
| 安全专项 | packages/im/core/, packages/im/agent/, packages/host/http/, packages/toolkit/satori/ |
"安全", "漏洞", "XSS", "注入" |
| 性能专项 | packages/im/core/src/plugin.ts, packages/im/core/src/built/, packages/im/core/src/adapter.ts |
"性能", "内存", "泄漏", "慢" |
| 架构专项 | packages/*/package.json, packages/*/src/index.ts |
"架构", "依赖", "分层", "耦合" |
| 变更审计 | git diff 涉及的文件 |
"审查变更", "PR 审查" |
第 2 步:运行安全检查
按 安全检查清单 逐项执行。
关键检查项(按严重程度排序):
-
代码执行风险 [严重]
- 搜索
eval,Function(,new Function,vm.runIn - 搜索
child_process,exec(,execSync,spawn - 检查
packages/im/agent/src/builtin-tools.ts中 bash 命令安全策略 - 验证
packages/im/agent/src/security/file-policy.ts文件访问控制覆盖率
- 搜索
-
注入攻击 [严重]
- SQL 注入:检查
basic/database/src/中参数化查询 - 命令注入:检查所有
exec()调用的参数转义 - XSS:检查
packages/toolkit/satori/src/HTML 渲染中的输入转义
- SQL 注入:检查
-
认证与授权 [高]
- 检查
packages/host/http/src/index.tsToken 校验逻辑 - 验证 Bearer token 是否使用
crypto.timingSafeEqual比较 - 确认 query 参数 token 不会泄漏到日志
- 检查
/pub/公共路径配置是否合理
- 检查
-
敏感信息泄漏 [高]
- 搜索硬编码的 token、password、secret
- 检查日志输出是否包含敏感信息
- 验证错误响应不暴露内部实现细节
-
路径遍历 [中]
- 检查文件操作是否验证路径边界
- 验证
packages/im/agent/src/security/file-policy.ts的SENSITIVE_FILENAMES列表完整性
第 3 步:运行性能检查
按 性能检查清单 逐项执行。
关键检查项:
-
内存泄漏 [高]
- 事件监听器:所有
on()/addMiddleware()是否在#disposables中注册清理 - 定时器:所有
setInterval/setTimeout是否有对应clearInterval/clearTimeout - 文件监听:
fs.watch()是否在插件卸载时关闭 - WeakMap/WeakRef:大量对象引用是否使用弱引用
- 事件监听器:所有
-
无界集合 [高]
Map/Set是否只增不减:#tools,#middlewares,#featureContributions- 缓存是否有 TTL 或 LRU 策略
- 插件
children数组是否在stop()时清空
What ships with it
3 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.
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.
- 10d ago First seen · 195 lines · 62 tokens per session scan A f1234f6682be
zhin-audit is a skill published in the GitHub repository zhinjs/zhin (135 stars, last pushed 2d ago), licensed MIT. It adds 62 tokens to every session and 2,295 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
contribute-to-eliza
Finish and prove a scoped elizaOS GitHub issue, or independently review and repair an open elizaOS pull request. Use when contributing compute to elizaOS by selecting unclaimed work, implementing or reviewing changes, adding real tests and evidence, validating artifacts, or preparing a contribution for maintainer…
ha-code-review
Hope-native review of uncommitted, staged, commit, branch, or PR changes: discover concrete regressions, independently verify candidates, and report actionable findings first without speculative noise.
Smart Code Review
Review a PR diff: triage its severity, then produce a depth-appropriate review with structured findings, fix suggestions, and a merge decision. Use for code review, review PR, and severity triage requests.
code-review
A code-review workflow that sends local changes to a separate reviewer for checks on correctness, style, performance, security, tests, and design.
requesting-code-review
Pre-commit verification pipeline — static security scan, baseline-aware quality gates, independent reviewer subagent, and auto-fix loop. Use after code changes and before committing, pushing, or opening a PR.
code-review-practices
Provides practical guidance for conducting thorough code reviews that identify issues early, promote knowledge sharing, and deliver constructive feedback. This skill should be used when reviewing pull requests, establishing team review standards, or mentoring developers on effective review practices.