scar-code-review
Code review that learns from failures. Reflex arc blocks repeat mistakes without LLM calls. Combines systematic checklist review (security, performance, correctness, maintainability) with scar memory — when a review misses a bug, record a scar, and the reflex arc automatically flags similar patterns next time.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/aibenyclaude-coder/tetra-scar-code-reviewscar-code-review
What this does
A code review system that learns from its own misses. Two layers work together:
-
Checklist review — Regex/heuristic checks across 4 dimensions:
- Security: SQL injection, hardcoded secrets, XSS, eval/exec
- Performance: N+1 queries, missing pagination, unbounded SELECTs
- Correctness: Unchecked nulls, off-by-one patterns, unhandled promises
- Maintainability: Long functions, deep nesting, magic numbers
-
Scar reflex arc — Pattern-matching against past review misses. When a review fails to catch a bug that later causes an incident, record a scar. Next time, the reflex fires before the LLM even looks at the diff.
No external dependencies. stdlib only. Python 3.9+.
Quick start
Review a file:
python3 scar_code_review.py review path/to/file.py
Check a diff against past scars:
python3 scar_code_review.py check-diff path/to/changes.diff
Record a missed review finding:
python3 scar_code_review.py record-miss \
--what-missed "Missed SQL injection in user input handler" \
--pattern "execute.*format.*user" \
--severity critical
File format
JSONL, compatible with tetra-scar:
{"id":"rscar_1234","what_missed":"...","pattern":"...","severity":"critical","created_at":"..."}
Integration
from scar_code_review import review, reflex_check, record_miss, load_review_scars
# Review a file
findings = review("app/views.py")
for f in findings:
print(f"{f['severity']} [{f['dimension']}] {f['message']} (line {f['line']})")
# Check diff against past scars
scars = load_review_scars()
blocks = reflex_check(diff_text, scars)
for b in blocks:
print(f"BLOCKED: {b}")
# Record a miss after an incident
record_miss(
what_missed="Missed unvalidated redirect",
pattern="redirect.*request\\.GET",
severity="high",
)
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-aibenyclaude-coder-tetra-scar-code-review": {
"enabled": true,
"auto_update": true
}
}
}Tags
Related Skills
autodream-core
通用记忆整理引擎 — 基于适配器模式的跨平台记忆整理技能。自动去重、合并、删除过时条目。| Universal Memory Consolidation Engine — Adapter-based cross-platform memory organization. Auto-dedup, merge, prune stale entries.
context-compressor
Intelligently compress context — conversations, code, logs. Preserve key information while reducing token usage. Auto-detects content type and applies optimal compression.
play-guitar-fretboard
玩转吉他指板 - 快速跳转到吉他指板学习资源网站
q-kdb-code-review
AI-powered code review for Q/kdb+ — catch bugs in the most terse language in finance
auto-context
智能上下文卫生检查器。分析当前会话的上下文污染程度 (长对话、主题漂移、噪声累积),建议:continue、/fork、/btw 或新会话。 支持手动触发(/auto-context)和自动触发(响应层实现)。 基于 ArXiv 论文和认知心理学研究的多维度评估体系。