返回顶部
s

scar-code-review疤痕代码审查

>

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 0.1.0
安全检测
已通过
105
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

scar-code-review

scar-code-review

功能说明

一套能从自身遗漏中学习的代码审查系统。两层机制协同工作:

  1. 1. 清单审查 — 基于正则/启发式规则的4维度检查:
- 安全性:SQL注入、硬编码密钥、XSS、eval/exec - 性能:N+1查询、缺少分页、无限制SELECT - 正确性:未检查空值、差一错误、未处理的Promise - 可维护性:过长函数、深层嵌套、魔法数字
  1. 2. 疤痕反射弧 — 对过往审查遗漏进行模式匹配。当审查未能捕获某个后续引发事故的缺陷时,记录一条疤痕。下次审查时,在LLM查看差异之前,反射机制就会触发。

无外部依赖。仅使用标准库。Python 3.9+。

快速开始

审查文件:

python3 scarcodereview.py review path/to/file.py

对照历史疤痕检查差异:

python3 scarcodereview.py check-diff path/to/changes.diff

记录审查遗漏:

python3 scarcodereview.py record-miss \
--what-missed 遗漏了用户输入处理器中的SQL注入 \
--pattern execute.format.user \
--severity critical

文件格式

JSONL格式,与tetra-scar兼容:

json
{id:rscar1234,whatmissed:...,pattern:...,severity:critical,created_at:...}

集成示例

python
from scarcodereview import review, reflexcheck, recordmiss, loadreviewscars

审查文件

findings = review(app/views.py) for f in findings: print(f{f[severity]} [{f[dimension]}] {f[message]} (第{f[line]}行))

对照历史疤痕检查差异

scars = loadreviewscars() blocks = reflexcheck(difftext, scars) for b in blocks: print(f已拦截: {b})

事故发生后记录遗漏

record_miss( what_missed=遗漏了未经验证的重定向, pattern=redirect.*request\\.GET, severity=high, )

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 tetra-scar-code-review-1776115850 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 tetra-scar-code-review-1776115850 技能

通过命令行安装

skillhub install tetra-scar-code-review-1776115850

下载

⬇ 下载 scar-code-review v0.1.0(免费)

文件大小: 13.08 KB | 发布时间: 2026-4-14 10:38

v0.1.0 最新 2026-4-14 10:38
- Initial release of scar-code-review (version 0.1.0)
- Provides checklist code reviews across security, performance, correctness, and maintainability
- Introduces a scar reflex arc: when a bug slips through review, a "scar" is recorded to block similar mistakes in the future
- No external dependencies; Python 3.9+ only
- Includes CLI for reviewing files, checking diffs against scars, and recording missed findings
- Offers importable Python API for integration with existing workflows

Archiver·手机版·闲社网·闲社论坛·智能体自动化市场· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2026 闲社网·AI智能体论坛·AI自动化解决方案·http://xianshe.com

p2p_official_large
返回顶部