zhin: Skill for Claude Code

.github/skills/zhin-audit/SKILL.md

zhin-audit is a skill for Claude Code from zhinjs/zhin. It costs 62 tokens per session (2,295 once invoked), scanned A, original, MIT.

A code-audit workflow for Zhin.js, a TypeScript framework, organized as a monorepo—a repository containing multiple related packages. It checks security, performance, and software structure.

In plain words
What is it for?
It is for full-project audits, security reviews, performance checks, architecture reviews, and audits of changed files or pull requests.
Why use it?
It gives developers a defined way to look for vulnerabilities, memory leaks, slowdowns, and unwanted dependencies across the project.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

This is zhinjs/zhin's own configuration. It tells Claude Code how to work on zhin itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything zhin configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/zhinjs/zhin/main/.github/skills/zhin-audit/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/zhinjs/zhin

Made for: Claude Code.

Wrote 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.

agentmods badge for zhin-audit

README.md
[![agentmods](https://agentmods.dev/badge/skills/zhinjs/zhin/zhin-audit/github.svg)](https://agentmods.dev/skills/zhinjs/zhin/zhin-audit)
Your own site
<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.

agentmods 80×15 button for zhin-audit

Your own site · 80×15
<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>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,295 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00062 $0.02295
Opus 5 $0.00031 $0.01148
Sonnet 5 $0.00012 $0.00459
Haiku 4.5 $0.00006 $0.00230

Measured 10d ago against content hash f1234f6682be, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

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`
.github/skills/zhin-audit/SKILL.md · 195 lines

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 步:运行安全检查

安全检查清单 逐项执行。

关键检查项(按严重程度排序):

  1. 代码执行风险 [严重]

    • 搜索 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 文件访问控制覆盖率
  2. 注入攻击 [严重]

    • SQL 注入:检查 basic/database/src/ 中参数化查询
    • 命令注入:检查所有 exec() 调用的参数转义
    • XSS:检查 packages/toolkit/satori/src/ HTML 渲染中的输入转义
  3. 认证与授权 [高]

    • 检查 packages/host/http/src/index.ts Token 校验逻辑
    • 验证 Bearer token 是否使用 crypto.timingSafeEqual 比较
    • 确认 query 参数 token 不会泄漏到日志
    • 检查 /pub/ 公共路径配置是否合理
  4. 敏感信息泄漏 [高]

    • 搜索硬编码的 token、password、secret
    • 检查日志输出是否包含敏感信息
    • 验证错误响应不暴露内部实现细节
  5. 路径遍历 [中]

    • 检查文件操作是否验证路径边界
    • 验证 packages/im/agent/src/security/file-policy.tsSENSITIVE_FILENAMES 列表完整性

第 3 步:运行性能检查

性能检查清单 逐项执行。

关键检查项

  1. 内存泄漏 [高]

    • 事件监听器:所有 on()/addMiddleware() 是否在 #disposables 中注册清理
    • 定时器:所有 setInterval/setTimeout 是否有对应 clearInterval/clearTimeout
    • 文件监听:fs.watch() 是否在插件卸载时关闭
    • WeakMap/WeakRef:大量对象引用是否使用弱引用
  2. 无界集合 [高]

    • Map/Set 是否只增不减:#tools, #middlewares, #featureContributions
    • 缓存是否有 TTL 或 LRU 策略
    • 插件 children 数组是否在 stop() 时清空

Read the full file on GitHub · 195 lines

Files

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.

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. 10d ago First seen · 195 lines · 62 tokens per session scan A f1234f6682be

Subscribe to this mod's changes

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.

Related

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…

elizaOS/eliza · 68 tokens

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.

shiwenwen/hope-agent · 40 tokens

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.

AgentEra/Agently · 47 tokens

code-review

A code-review workflow that sends local changes to a separate reviewer for checks on correctness, style, performance, security, tests, and design.

open-octo/octo-agent · 67 tokens

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.

graniet/kheish · 41 tokens

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.

armanzeroeight/fastagent-plugins · 51 tokens