zhin: Skill for Claude Code

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

zhin-audit is a skill for Claude Code from zhinjs/zhin. It costs 42 tokens per session (893 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. Also seen: mentions AGENTS.md.

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 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 893 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00042 $0.00893
Opus 5.5 $0.00017 $0.00357
Sonnet 5.5 $0.00008 $0.00179
Haiku 4.5 $0.00004 $0.00089

Measured 1mo ago against content hash c0f078b28b6a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

zhin-audit 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.

.github/skills/zhin-audit/SKILL.md · 64 lines

How it starts

The opening of the file, as written. The whole thing — 64 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Zhin.js 代码审计

先建立当前分支事实,再给结论。仓库的 AGENTS.md、docs/concepts/architecture.md、目标包 package.json 和现有 harness 是契约来源;不要从旧类名或旧目录推断实现。

1. 固定审计基线

  1. 读取目标 diff、相关测试和最近的包 README。
  2. 明确比较基线与未提交改动;变更审计默认看完整 diff,不只看最后一个 commit。
  3. 先跑与变更对应的最小门禁,再读失败调用链。
  4. 报告只写有证据的问题:给出触发条件、影响、文件和最小修复方向。

2. 按范围检查

  • 安全:按 安全清单 检查 Tool 策略、文件/网络/Shell 边界、Host 鉴权、凭据和输入验证。
  • 性能与生命周期:按 性能清单 检查 generation 回滚、listener、timer、socket、缓存和外部请求。
  • 架构:按 架构清单 检查依赖方向、Resource ownership、Feature 约定目录、Adapter 与消息链。

根据 diff 选择门禁,常用入口:

pnpm check:architecture
pnpm check:domain-module-boundaries
pnpm check:harness-paths
pnpm check:adapter-endpoint-boundaries
pnpm check:no-removed-plugin-api
pnpm check:runtime-config-boundaries
pnpm check:agent-tool-authoring-boundaries
pnpm check:skill-authoring-boundaries
pnpm check:agent-authoring-boundaries
pnpm check:hook-authoring-boundaries
pnpm check:plugin-capability-publish

包内变更先跑 pnpm --filter <pkg> test / build。发布前再根据影响面扩大到 pnpm check:all;不要用静态搜索代替测试,也不要把环境故障写成代码缺陷。

3. Zhin 当前不变量

  • Plugin Runtime:plugin.ts default-export definePlugin();能力位于命名目录的 index.ts(x)。已移除的 usePlugin/getPlugin 不得回归。
  • Resource:setup 使用 context.resources;能力执行上下文直接 context.use(token)。 generation 状态不能退回模块级 latest-value 单例。
  • Tool:声明字段是 requiresApproval: never | on-risk | once | always;权限、审批与 Shell/文件/网络专用策略是不同层。builtin 安全检查统一进入 packages/im/agent/src/security/policy-facade.ts 的 runToolPolicies。
  • Adapter:优先 defineAdapter({ capabilities, create }) 的 { client, connect, activate?, send } 契约;WS/SSE 生命周期用 createEndpointLifecycle。
  • 出站:Message.$reply / Adapter.sendMessage 必须经过 renderSendMessage → before.sendMessage → AdapterIndex/Endpoint。
  • Console 页面:pages/<name>/index.tsx 默认导出组件并命名导出 meta = definePage(...)。

4. 报告格式

问题按 P0–P3 排序。每项包含:触发条件、实际影响、证据位置、建议修复。无问题时明确说明已覆盖 范围与未验证边界。不要粘贴 token、.env、用户 ID 或完整敏感请求。

Read the full file on GitHub · 64 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. 1mo ago Changed · -131 lines · -20 tokens per session c0f078b28b6a
  2. 2mo 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 (136 stars, last pushed today), licensed MIT. It adds 42 tokens to every session and 893 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.

Related

Other skills, from other repositories

review

Comprehensive security and correctness audit. Use for review, deep review, thermo nuclear, or thermonuclear requests and branch or PR diff audits.

vercel/eve · 31 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

Review local code changes. Uses an isolated sub-agent for unbiased analysis when the main agent wrote the code; reviews directly in fresh review-only sessions. Checks correctness, conventions, performance, tests, security, and tech design compliance. Use when the user wants a code review or says "review the diff" /…

open-octo/octo-agent · 83 tokens

maf-anti-pattern-scanner

Scans a MAF 1.3.0 codebase for known anti-patterns AFTER migration is complete. Prefer the MCP tool MafScanAntiPatterns for one-shot scans; this skill is for understanding the rule taxonomy or contributing new anti-pattern rules. Detects insecure credential usage (DefaultAzureCredential, hard-coded keys), unsafe…

joslat/maf-doctor · 130 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