security-review (安全审查)

security-review (安全审查) is a skill for Claude Code from cfrs2005/claude-init. It costs 47 tokens per session (3,385 once invoked), scanned A, original, MIT.

A code-review checklist for security-sensitive features such as login, user input, file uploads, API endpoints, payments, and confidential data.

In plain words
What is it for?
Use it when adding authentication, handling uploads or sensitive data, connecting third-party APIs, or building payment and API features.
Why use it?
It helps catch common security mistakes, such as putting passwords in source code or accepting unvalidated input, before they become vulnerabilities.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: positional $N argument.

About the project

claude-init is an archived project template for initializing Claude Code development environments, with Chinese-localized configuration and workflows. Developers on macOS or Linux use it to set up agents, skills, commands, rules, hooks, and development contexts for Claude Code. Its catalogue entries provide the included commands, agents, hooks, and skills.

cfrs2005/claude-init · 1,364 stars · on GitHub

Install

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.

agentmods
npx agentmods add skills/cfrs2005/claude-init/security-review
Any agent
npx skills add cfrs2005/claude-init --skill security-review
Clone the repo
git clone --depth 1 https://github.com/cfrs2005/claude-init

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 security-review (安全审查)

README.md
[![agentmods](https://agentmods.dev/badge/skills/cfrs2005/claude-init/security-review.svg)](https://agentmods.dev/skills/cfrs2005/claude-init/security-review)
Your own site
<a href="https://agentmods.dev/skills/cfrs2005/claude-init/security-review"><img src="https://agentmods.dev/badge/skills/cfrs2005/claude-init/security-review.svg" alt="Measured on agentmods" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,385 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00047 $0.03385
Opus 5 $0.00023 $0.01692
Sonnet 5 $0.00009 $0.00677
Haiku 4.5 $0.00005 $0.00338

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

Security

Grade A, and why

security-review (安全审查) 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 6d 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.

templates/.claude/skills/security-review/SKILL.md · 495 lines

How it starts

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

安全审查技能

本技能确保所有代码遵循安全最佳实践并识别潜在漏洞。

何时激活

  • 实现身份验证或授权
  • 处理用户输入或文件上传
  • 创建新的 API 端点
  • 使用机密信息或凭据
  • 实现支付功能
  • 存储或传输敏感数据
  • 集成第三方 API

安全清单

1. 机密信息管理

❌ 严禁这样做
const apiKey = "sk-proj-xxxxx"  // 硬编码的机密信息
const dbPassword = "password123" // 在源代码中
✅ 务必这样做
const apiKey = process.env.OPENAI_API_KEY
const dbUrl = process.env.DATABASE_URL

// 验证机密信息是否存在
if (!apiKey) {
  throw new Error('未配置 OPENAI_API_KEY')
}
验证步骤
  • 无硬编码的 API 密钥、令牌或密码
  • 所有机密信息均在环境变量中
  • .env.local 已加入 .gitignore
  • git 历史记录中无机密信息
  • 生产环境机密信息在托管平台 (Vercel, Railway) 中配置

2. 输入验证

始终验证用户输入
import { z } from 'zod'

// 定义验证 schema
const CreateUserSchema = z.object({
  email: z.string().email(),
  name: z.string().min(1).max(100),
  age: z.number().int().min(0).max(150)
})

// 处理前验证
export async function createUser(input: unknown) {
  try {
    const validated = CreateUserSchema.parse(input)
    return await db.users.create(validated)
  } catch (error) {
    if (error instanceof z.ZodError) {
      return { success: false, errors: error.errors }
    }
    throw error
  }
}
文件上传验证
function validateFileUpload(file: File) {
  // 大小检查 (最大 5MB)
  const maxSize = 5 * 1024 * 1024
  if (file.size > maxSize) {
    throw new Error('文件过大 (最大 5MB)')
  }

  // 类型检查
  const allowedTypes = ['image/jpeg', 'image/png', 'image/gif']
  if (!allowedTypes.includes(file.type)) {
    throw new Error('无效的文件类型')
  }

  // 扩展名检查
  const allowedExtensions = ['.jpg', '.jpeg', '.png', '.gif']
  const extension = file.name.toLowerCase().match(/\.[^.]+$/)?.[0]
  if (!extension || !allowedExtensions.includes(extension)) {
    throw new Error('无效的文件扩展名')
  }

  return true
}
验证步骤
  • 所有用户输入均使用 schema 验证
  • 文件上传受限 (大小, 类型, 扩展名)
  • 查询中不直接使用用户输入
  • 白名单验证 (而非黑名单)
  • 错误消息不泄露敏感信息

3. 防止 SQL 注入

❌ 严禁拼接 SQL
// 危险 - SQL 注入漏洞
const query = `SELECT * FROM users WHERE email = '${userEmail}'`
await db.query(query)

Read the full file on GitHub · 495 lines

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. 6d ago First seen · 495 lines · 47 tokens per session scan A 6c7d35773452

Subscribe to this mod's changes

security-review (安全审查) is a skill published in the GitHub repository cfrs2005/claude-init (1,364 stars, last pushed 5mo ago), licensed MIT. It adds 47 tokens to every session and 3,385 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

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…

microsoft/ai-agents-for-beginners · 200 tokens

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…

vercel/next.js · 95 tokens

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…

vercel/next.js · 170 tokens

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…

vercel/next.js · 103 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens