Secure Vibe banner
chenguo1024 chenguo1024

Secure Vibe

Security community

Description

Open-source security skill for AI agents (opencode / Codex / Claude Code). Detects 97 secret/injection/deserialization/XSS/SSRF/XXE/IaC rules across Python, C/C++, PHP, HTML, JS/Node, Go, Java, Shell, Docker, K8s, Terraform & GitHub Actions — fully offline, no API key, JSONL audit logs.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Secure-Vibe — 生成时安全的代码生成 Skill

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) ![Languages](https://img.shields.io/badge/Languages-13-green) ![Rules](https://img.shields.io/badge/Rules-110-orange) ![Tests](https://img.shields.io/badge/Tests-225-brightgreen)

在 vibe-coding(AI 自由生成代码)场景中,**在代码生成过程中就引导模型写出安全代码**—— 不是"先生成后检查",而是:安全上下文注入 → 生成 → 毫秒级校验 → 自动修复循环。

两种使用模式

跨 Agent 安装(opencode / Codex / Claude Code)

本 Skill 使用各主流 Agent 通用的 SKILL.md 格式(frontmatter: `name` + `description`), 校验器 `cli.py` 相对自身定位规则/模板、**不依赖工作目录**,任何能执行 shell 的 Agent 均可调用:

Agent 默认技能目录 安装命令
opencode ~/.config/opencode/skill/secure-vibe ./install.shpowershell -File install.ps1
Codex ~/.codex/skills/secure-vibe ./install.sh codexpowershell -File install.ps1 -Agent codex
Claude Code ~/.claude/skills/secure-vibe ./install.sh claudepowershell -File install.ps1 -Agent claude
其他/自定义 任意 ./install.sh /path/to/skills/secure-vibe-Target "C:\..."
  • 运行依赖:任意 Python 3.7+(Linux/macOS 用 python3)+ pyyamlpip install pyyaml,见 requirements.txt)。安装脚本自动探测带 pyyaml 的解释器并跑 selftest 自检。
  • context / validate / log / selftest 均为本地毫秒级执行,零网络、零 API Key

模式 A:安装进 Agent(推荐,Skill 的主形态)

把本 Skill 安装到 Agent(opencode / Codex / Claude Code / 任意支持技能目录的框架), 生成由 **Agent 自身的 LLM** 完成(session 模式),本 Skill 提供 上下文构建 / 毫秒级校验 / 修复指令 / 日志 四个确定性工具,**零 API 依赖、零密钥**。

# Windows(默认安装到 opencode 技能目录)
powershell -File install.ps1
# Codex / Claude Code
powershell -File install.ps1 -Agent codex
powershell -File install.ps1 -Agent claude

# Linux / macOS
./install.sh                 # 默认 opencode
./install.sh codex           # Codex
./install.sh claude          # Claude Code

安装脚本自动复制技能文件并运行自检(`cli.py selftest`)。重启 Agent 后, Agent 在写代码前会执行:

① cli.py context --task "..."      # 加载安全规则(写代码之前)
② (Agent 自身 LLM 生成代码)
③ cli.py validate --file f.py      # 毫秒级校验(exit 1 =