Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/antgroup/adversarial-ai-coding-plugin/prevent-js-security-bugsnpx skills add antgroup/adversarial-ai-coding-plugin --skill prevent-js-security-bugsgit clone --depth 1 https://github.com/antgroup/adversarial-ai-coding-pluginWrote 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/antgroup/adversarial-ai-coding-plugin/prevent-js-security-bugs)<a href="https://agentmods.dev/skills/antgroup/adversarial-ai-coding-plugin/prevent-js-security-bugs"><img src="https://agentmods.dev/badge/skills/antgroup/adversarial-ai-coding-plugin/prevent-js-security-bugs.svg" alt="Measured on agentmods" 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 | $0.00068 | $0.01413 |
| Opus 5 | $0.00034 | $0.00707 |
| Sonnet 5 | $0.00014 | $0.00283 |
| Haiku 4.5 | $0.00007 | $0.00141 |
Grade A, and why
prevent-js-security-bugs 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 4d 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.
| OS 命令注入 | 调用 `child_process.exec`、`execSync`、`spawn` 等执行系统命令时,命令字符串或参数包含用户输入 | `references/prevent-os-command-execution.md` | How it starts
The opening of the file, as written. The whole thing — 61 lines — stays where its author put it; the contents beside it link to each section on GitHub.
安全代码生成规范
技能概述
本技能的目标是:在代码生成阶段消除安全漏洞,而非依赖事后审查。
当用户需要编写、重构或修改 JavaScript/TypeScript 代码时,必须先完成威胁识别和规范查阅,再生成代码。禁止跳过安全分析步骤。
触发条件
满足以下任意一条时,必须激活本技能:
- 编写、重构或修改 JavaScript/TypeScript 代码。
工作流程
必须严格按顺序执行以下三步,不得跳过任何步骤。
第一步:识别安全风险
逐条分析用户需求,对照下表判断哪些风险类型适用于当前场景。每一个适用的风险类型都必须处理,不得遗漏。
| 风险类型 | 典型场景 | 对应参考文档 |
|---|---|---|
| Query Language 注入 | 拼接 SQL/HQL/NoSQL 查询语句;使用用户输入构造查询条件 | references/prevent-ql-injection.md |
| OS 命令注入 | 调用 child_process.exec、execSync、spawn 等执行系统命令时,命令字符串或参数包含用户输入 |
references/prevent-os-command-execution.md |
| 代码注入 | 使用 eval、new Function、setTimeout(string) 执行非字面量字符串;使用非字面量路径动态 require();可能导致 RCE 或任意文件读取 |
references/prevent-code-injection.md |
| 原型链污染 | 对对象进行递归合并、深拷贝、属性赋值时,键名来自用户输入(如 __proto__、constructor、prototype) |
references/prevent-prototype-pollution.md |
| XSS(跨站脚本) | 将用户输入直接插入 DOM(innerHTML、document.write、dangerouslySetInnerHTML);在服务端渲染时未转义输出到 HTML 模板 |
references/prevent-xss.md |
| 路径遍历 | 文件读取/写入/下载,路径由用户输入拼接(如 path.join(baseDir, userInput)),可能跨越根目录访问任意文件 |
references/prevent-path-traversal.md |
| SSRF(服务端请求伪造) | 服务端发起 HTTP 请求时,目标 URL 或主机名由用户输入控制,可能访问内网服务或云元数据接口 | references/prevent-ssrf.md |
| 不安全反序列化 | 使用 node-serialize、serialize-javascript 等库反序列化用户提供的数据,可能导致任意代码执行 |
references/prevent-deserialization.md |
| 弱随机数 | 使用 Math.random() 或 crypto.pseudoRandomBytes() 生成 session ID、token、nonce、密钥等安全敏感值 |
references/prevent-weak-random.md |
| PostMessage Origin 校验缺失 | 使用 window.addEventListener('message', ...) 接收跨窗口消息时未校验 event.origin;发送消息时使用通配符 '*' |
references/prevent-postmessage-origin.md |
| 时序攻击 | 使用 ===、!== 比较 HMAC 签名、API Key、session token、密码重置 token 等安全敏感字符串 |
references/prevent-timing-attack.md |
| ReDoS(正则表达式拒绝服务) | 使用 new RegExp(userInput) 构造动态正则;正则模式包含嵌套量词((a+)+)或重叠交替((a|aa)+),可导致灾难性回溯阻塞事件循环 |
references/prevent-redos.md |
| Buffer 安全问题 | 使用已废弃的 new Buffer(size)(内存未初始化);Buffer.allocUnsafe() 结果未立即填充;Buffer 读写方法传入 noAssert=true 跳过边界检查 |
references/prevent-buffer-issues.md |
| 不安全传输 | 通过 HTTP(非 HTTPS)加载外部脚本/样式;服务端使用 http 模块请求外部 API;动态 URL 未校验协议 |
references/prevent-insecure-transport.md |
| 硬编码凭证 | API Key、密码、JWT 密钥、私钥等敏感信息直接写入源代码或被 Git 追踪的配置文件 | references/prevent-hardcoded-secrets.md |
What ships with it
15 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.
- references/prevent-buffer-issues.md 4.6 KB
- references/prevent-code-injection.md 4.1 KB
- references/prevent-deserialization.md 2.7 KB
- references/prevent-hardcoded-secrets.md 4.0 KB
- references/prevent-insecure-transport.md 4.4 KB
- references/prevent-os-command-execution.md 3.9 KB
- references/prevent-path-traversal.md 3.7 KB
- references/prevent-postmessage-origin.md 4.0 KB
- references/prevent-prototype-pollution.md 3.9 KB
- references/prevent-ql-injection.md 3.9 KB
- references/prevent-redos.md 4.1 KB
- references/prevent-ssrf.md 4.1 KB
- references/prevent-timing-attack.md 4.6 KB
- references/prevent-weak-random.md 3.6 KB
- references/prevent-xss.md 4.0 KB
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.
- 4d ago First seen · 61 lines · 68 tokens per session scan A c8538063c681
prevent-js-security-bugs is a skill published in the GitHub repository antgroup/adversarial-ai-coding-plugin (7 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 68 tokens to every session and 1,413 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-31.
Other skills, from other repositories
better-auth
Skill for integrating Better Auth - comprehensive TypeScript authentication framework for Cloudflare D1, Next.js, Nuxt, and 15+ frameworks. Use when adding auth, encountering D1 adapter errors, or implementing OAuth/2FA/RBAC features.
bun-bundler
This skill should be used when the user asks about "bun build", "Bun.build", "bundling with Bun", "code splitting", "tree shaking", "minification", "sourcemaps", "bundle optimization", "esbuild alternative", "building for production", "bundling TypeScript", "bundling for browser", "bundling for Node", or…
bun-file-io
Use for Bun file I/O: Bun.file, Bun.write, streams, directories, glob patterns, metadata.
bun-hot-reloading
Use when implementing hot reloading with Bun (--hot, --watch), HMR, or automatic code reloading during development. Covers watch mode, hot mode, and HTTP server reload.
pulumi-best-practices
Load when the user is writing, reviewing, or debugging Pulumi TypeScript/Python programs; asks about Output or apply() usage; wants to create ComponentResource classes; needs to refactor resources without destroying them (aliases); is setting up secrets or config; or is configuring a pulumi preview/up CI workflow.…
tanstack-form-composition
Migrate a React @tanstack/react-form codebase from the prop-drilled useForm + erased-form-type pattern to the official createFormHook composition API (useAppForm / withForm / field.X). Use when a project threads a form object (often cast to an any-erased type like ReactFormExtendedApi ) through field-wrapper…