📦

ubs

Baixo Risco ⚙️ Comandos externos

在每次提交前扫描代码中的错误

AI 代理编写代码速度很快,但可能会引入空指针错误、缺失 await 语句和安全漏洞等错误。UBS 提供跨 8 种语言的预提交静态分析,可在几秒钟内捕获这些问题,防止它们进入生产环境。

Suporta: Claude Codex Code(CC)
⚠️ 68 Ruim
1

Baixar o ZIP da skill

2

Upload no Claude

Vá em Configurações → Capacidades → Skills → Upload skill

3

Ative e comece a usar

Testar

A utilizar "ubs". 在我的暂存文件上运行 UBS

Resultado esperado:

Scanning 3 files (247 lines)...

Null Safety (2 errors)
src/api.ts:42:5 - Unguarded property access on potentially null object
💡 Use optional chaining: user?.profile?.email

Async/Await (1 error)
src/handlers.ts:18:3 - Missing await on promise-returning function
💡 Add await: await fetchData()

Exit code: 1

A utilizar "ubs". 对我的项目运行安全扫描

Resultado esperado:

Scanning 47 files (12,483 lines)...

Security (3 errors)
src/utils.ts:91:7 - Dangerous use of innerHTML with unsanitized data
💡 Use textContent or sanitize with DOMPurify

config.ts:15:1 - Hardcoded API key detected
💡 Move to environment variable

auth.ts:203:5 - SQL query vulnerable to injection
💡 Use parameterized queries

Exit code: 1

Auditoria de Segurança

Baixo Risco
v6 • 1/21/2026

This skill is documentation-only for the UBS static analysis tool. All 122 static findings are false positives from code examples in the markdown documentation showing bash commands and installation instructions. No executable code is present. The skill requires users to install the external UBS tool via curl, which is standard for CLI tool installation. Risk level is low due to external command dependency.

2
Arquivos analisados
1,585
Linhas analisadas
2
achados
6
Total de auditorias
Problemas de Baixo Risco (1)
External Tool Installation via Curl
The skill documentation instructs users to install the UBS tool using curl to download and execute a bash script from GitHub. This is a standard installation pattern for CLI tools but requires user trust in the external repository. The installation is not automatic and requires explicit user action.

Fatores de risco

⚙️ Comandos externos (2)
Auditado por: claude Ver Histórico de Auditoria →

Pontuação de qualidade

38
Arquitetura
100
Manutenibilidade
87
Conteúdo
30
Comunidade
88
Segurança
83
Conformidade com especificações

O Que Você Pode Construir

预提交质量门禁

将 UBS 安装为 git pre-commit hook,在每次提交前自动扫描暂存文件。退出代码 1 会阻止提交,直到关键问题得到修复。

CI/CD 流水线集成

在持续集成期间以严格模式运行 UBS 以强制执行代码质量标准。生成 SARIF 报告以集成 GitHub 代码扫描。

AI 代理代码审查

配置 Claude Code、Cursor 或其他 AI 代理在文件写入后自动运行 UBS。即时获得关于空值安全、安全性和异步问题的反馈。

Tente Estes Prompts

在提交前扫描暂存文件
在我的暂存 git 文件上运行 UBS 并显示任何关键问题
完整项目安全扫描
使用 UBS 对我的项目运行完整的安全扫描,并突出显示任何 XSS、注入或硬编码密钥问题
检查特定文件
在 src/components/UserProfile.tsx 上运行 UBS 并检查空值安全和 async/await 问题
生成 CI 报告
以 CI 模式运行 UBS 并输出 JSON 格式,将结果保存到 .ubs/latest.json

Melhores Práticas

  • 在开发期间仅对暂存文件运行 UBS,以实现 1 秒以内的快速反馈循环
  • 在 CI/CD 流水线中使用带有 fail-on-warning 的严格模式来强制执行质量标准
  • 在使用 ubs:ignore 注释抑制之前调查每个发现,以避免掩盖真实错误

Evitar

  • 在每次文件写入时对所有文件运行完整项目扫描,而不是仅针对更改的文件
  • 在不逐个审查每个实例的情况下忽略某个类别的所有发现
  • 使用 --no-verify 绕过 pre-commit hooks,而不是修复或正确抑制问题

Perguntas Frequentes

如何在我的系统上安装 UBS?
运行文档中的安装命令,该命令会从 GitHub 下载 UBS 脚本。您可能还需要使用 ubs doctor --fix 安装依赖项,如 ast-grep 和 ripgrep。
UBS 能自动修复它发现的错误吗?
不能,UBS 只能检测和报告错误。您必须手动审查每个发现并应用建议的修复。这确保您理解问题并避免不正确的自动修复。
如何将 UBS 与 Claude Code 集成?
UBS 可以在 .claude/hooks/on-file-write.sh 创建文件写入钩子,在文件修改时自动运行扫描。您也可以通过提示词手动调用 UBS,如"在此文件上运行 UBS"。
如果 UBS 报告了太多误报,我该怎么办?
首先验证每个发现确实是误报。然后使用内联抑制注释,如 ubs:ignore 或 ubs:ignore-next-line。您还可以使用 --skip 标志跳过整个类别。
UBS 支持所有编程语言吗?
UBS 支持 JavaScript、TypeScript、Python、Go、Rust、Java、C++、Ruby 和 Swift。它会在扫描期间跳过其他语言的文件。
UBS 在大型代码库上的速度如何?
UBS 每秒处理约 10,000 行代码。5000 行以下的小型项目扫描时间不到 1 秒。20 万行的大型项目需要约 12 秒。使用 --staged 或文件路径仅扫描更改的代码。

Detalhes do Desenvolvedor

Estrutura de arquivos

📄 SKILL.md