闲社服务运行正常AI智能体自动化平台
s

疤痕代码审查

技能标识:scar-code-review

>

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 0.1.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

疤痕代码审查

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
返回顶部