Kunlun-M is a static security-analysis tool that examines source code for vulnerabilities using semantic analysis based on abstract syntax trees. Security researchers and developers use it with PHP, JavaScript or Node.js, Python, Go, Java, and C or C++ projects, with additional basic scanning for Chrome extensions. Its catalogue skill connects the analysis workflow with coding agents.
Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/LoRexxar/Kunlun-Mnpx agentmods add skills/lorexxar/kunlun-m/kunlun-m-generalWrote 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/lorexxar/kunlun-m/kunlun-m-general)<a href="https://agentmods.dev/skills/lorexxar/kunlun-m/kunlun-m-general"><img src="https://agentmods.dev/badge/skills/lorexxar/kunlun-m/kunlun-m-general/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/lorexxar/kunlun-m/kunlun-m-general"><img src="https://agentmods.dev/badge/skills/lorexxar/kunlun-m/kunlun-m-general.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.00085 | $0.01227 |
| Opus 5 | $0.00043 | $0.00613 |
| Sonnet 5 | $0.00017 | $0.00245 |
| Haiku 4.5 | $0.00009 | $0.00123 |
Grade A, and why
kunlun-m-general 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 12d 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.
How it starts
The opening of the file, as written. The whole thing — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Kunlun-M 通用 Skill(脚本落地版)
本 skill 只包含可直接执行的脚本与最小流程,优先用脚本完成动作,不在 SKILL.md 里展开原理解释。
0. 一键准备环境(没有 Kunlun-M 时)
python skills/kunlun-m-general/scripts/bootstrap_kunlunm.py --repo-dir ./Kunlun-M
默认行为:优先 git clone,失败回退 zip;然后执行 pip install、复制 settings.py、初始化 DB、load rules/tamper。
1. 用脚本执行日常动作(推荐)
约定:--repo-root 指向 Kunlun-M 目录(里面有 kunlun.py)。
扫描
python skills/kunlun-m-general/scripts/kunlun_ops.py --repo-root ./Kunlun-M scan -t <target> -lan php -b vendor,node_modules -d
生成 rule(漏报补齐)
python skills/kunlun-m-general/scripts/kunlun_ops.py --repo-root ./Kunlun-M gen-rule -lan php --name "<rule_name>" --match "<regex>"
python skills/kunlun-m-general/scripts/kunlun_ops.py --repo-root ./Kunlun-M scan -t <target> -lan php -r <id>
生成 tamper(误报治理/框架适配)
python skills/kunlun-m-general/scripts/kunlun_ops.py --repo-root ./Kunlun-M gen-tamper --name <proj> --controlled "$_GET,$_POST"
python skills/kunlun-m-general/scripts/kunlun_ops.py --repo-root ./Kunlun-M scan -t <target> -lan php -tp <proj>
同步到数据库(可选:仅 Web 管理需要)
python skills/kunlun-m-general/scripts/kunlun_ops.py --repo-root ./Kunlun-M sync --rule --tamper
2. 最小概念(只留决策点)
- 规则(rule)≈ sink(危险点):要扫哪些危险函数/语句就生成/调整 rule,然后用
scan -r <id>回归 - 污点策略(tamper)≈ source + repair:要定义输入源或净化函数就生成/调整 tamper,然后用
scan -tp <name>回归
更详细的概念与场景说明见:concepts.md
3. 测试命令(冒烟验证)
在本仓库根目录执行(或把 --repo-root 指向你的 Kunlun-M 目录):
python skills/kunlun-m-general/scripts/bootstrap_kunlunm.py --repo-dir ./Kunlun-M --force
python skills/kunlun-m-general/scripts/kunlun_ops.py --repo-root ./Kunlun-M gen-rule -lan php --name "Skill Smoke Rule" --match "echo|print" --force
python skills/kunlun-m-general/scripts/kunlun_ops.py --repo-root ./Kunlun-M gen-tamper --name skill_smoke --controlled "$_GET,$_POST" --force
python skills/kunlun-m-general/scripts/kunlun_ops.py --repo-root ./Kunlun-M scan -t ./Kunlun-M/tests -lan php -d
What ships with it
8 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.
- 12d ago First seen · 90 lines · 85 tokens per session scan A 61f75a84d0ca
kunlun-m-general is a skill published in the GitHub repository LoRexxar/Kunlun-M (2,415 stars, last pushed yesterday), licensed MIT. It adds 85 tokens to every session and 1,227 once invoked, about $0.0004 per session on Opus 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 skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
insight-error-page
Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…
next-cache-components-optimizer
Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…
next-partial-prefetching-adoption
Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…