一键导入
security-review-scored
Security-focused code review that emits a numeric composite score (0.0–1.0) suitable for the evolve-loop Builder self-review convergence loop
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Security-focused code review that emits a numeric composite score (0.0–1.0) suitable for the evolve-loop Builder self-review convergence loop
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | security-review-scored |
| description | Security-focused code review that emits a numeric composite score (0.0–1.0) suitable for the evolve-loop Builder self-review convergence loop |
| argument-hint | [--tier lightweight|standard|full] |
Security review skill with scored output. Reads git diff autonomously, analyzes 5 security dimensions, emits
Composite Score: 0.XXfor loop integration. Formula:1.0 - (critical×0.5 + high×0.2 + medium×0.05). Single-writer safe.
Security specialist review. Reads the diff once, evaluates 5 security dimensions, produces a severity-weighted composite score that the Builder convergence loop can parse.
Input: git diff (changed files)
│
▼
┌─────────────────────────┐
│ LOAD CONTEXT (once) │ Adaptive HEAD / HEAD~1 detection
│ git diff HEAD --stat │
└─────────┬───────────────┘
│
▼
┌─────────────────────────┐
│ 5-DIMENSION SCAN │
│ 1. Injection vectors │ SQL, shell, command, template injection
│ 2. Auth/authz gaps │ Missing auth checks, privilege escalation
│ 3. Sensitive exposure │ Hardcoded secrets, credentials, PII logging
│ 4. Crypto misuse │ Weak algorithms, static IVs, predictable seeds
│ 5. Input validation │ Missing bounds, unsanitized input reaching sinks
└─────────┬───────────────┘
│
▼
┌─────────────────────────┐
│ SEVERITY SCORING │ CRITICAL / HIGH / MEDIUM / LOW counts
│ Composite formula: │ 1.0 - (crit×0.5 + high×0.2 + med×0.05)
│ Capped at 0.0 floor │
└─────────────────────────┘
# Adaptive context detection — same as code-review-simplify
DIFF_STAT=$(git diff HEAD --stat 2>/dev/null || echo "")
if [ -n "$DIFF_STAT" ]; then
REF="HEAD" # pre-commit: review uncommitted Builder changes
else
REF="HEAD~1" # standalone: review last committed change
fi
DIFF=$(git diff "$REF" --stat)
CHANGED_FILES=$(git diff "$REF" --name-only)
DIFF_FULL=$(git diff "$REF")
Analyze each changed file for security issues across all 5 dimensions:
| Dimension | Patterns to Check | Severity Guide |
|---|---|---|
| Injection | User input flowing to shell commands, SQL queries, template engines, eval-equivalent calls | CRITICAL if direct; HIGH if indirect |
| Auth/Authz | New endpoints or functions without authentication guards; privilege checks that can be bypassed; hardcoded role grants | CRITICAL if unauthenticated access to sensitive data; HIGH if partial bypass |
| Sensitive Exposure | Hardcoded passwords, API keys, tokens, private keys; logging of sensitive fields (passwords, tokens, PII); error messages leaking stack traces or internal paths | CRITICAL if secret committed; HIGH if PII logged |
| Crypto Misuse | Weak hash algorithms (MD5, SHA1 for passwords); static IVs or nonces; insecure random for security-sensitive values (Math.random, random.random); deprecated cipher modes (ECB) | HIGH if password hashing; MEDIUM if non-password crypto |
| Input Validation | Missing length/type/range checks on external input before reaching database, filesystem, or network sinks; path traversal risks (../); integer overflow potential | HIGH if reaching a sink; MEDIUM if internal only |
Count findings by severity and compute composite:
critical = count of CRITICAL findings
high = count of HIGH findings
medium = count of MEDIUM findings
penalty = critical×0.5 + high×0.2 + medium×0.05
composite = max(0.0, 1.0 - penalty)
Verdict mapping:
| Composite | Verdict | Builder action |
|---|---|---|
| ≥ 0.85 | PASS | Converged — proceed to build-report |
| 0.6–0.84 | WARN | Ship with noted findings; address in next cycle |
| < 0.6 | FAIL | Block — fix required before shipping |
Composite Score: 1.0 - (critical×0.5 + high×0.2 + medium×0.05)
Examples:
1.0 - 0 = 1.00 (PASS)1.0 - 0.2 = 0.80 (WARN)1.0 - 0.5 = 0.50 (FAIL)1.0 - 0.10 = 0.90 (PASS)1.0 - (0.2+0.10) = 0.70 (WARN)## Security Review
### Composite Score: 0.XX
(formula: 1.0 - (critical×0.5 + high×0.2 + medium×0.05))
### Verdict: PASS | WARN | FAIL
### Findings
| Severity | Dimension | File:Line | Description |
|----------|-----------|-----------|-------------|
| CRITICAL | injection | ... | ... |
| HIGH | auth | ... | ... |
| MEDIUM | crypto | ... | ... |
### Summary
CRITICAL: N HIGH: N MEDIUM: N LOW: N
Builder self-review section format (in build-report.md):
security-review-scored=0.XX
Invoke after implementation changes, before writing build-report.md:
Builder → Skill("security-review-scored") → parse "Composite Score: X.XX"
→ if score < threshold (0.75 default): note findings in build-report
→ include "security-review-scored=X.XX" in ## Self-Review section
Env-var configuration:
# reviewSkills: code-review-simplify,security-review-scored
# selfReview: 1
/evo:security-review-scored [--tier lightweight|standard|full]
Use when the user invokes /evo:loop or asks to run autonomous improvement cycles, self-evolving development, compound discovery, or multi-cycle code improvement with research, build, audit, and learning phases
Use after build has produced build-report.md. Validates the build via four parallel sub-auditors (eval-replay, lint, regression, build-quality) and produces ALL-PASS verdict. Adversarial mode default-on per CLAUDE.md.
Use when the user asks to explain how a feature/subsystem works and how the loops built it, or what the concurrent loops/lanes/cycles did and why. Default output = per-FEATURE HTML explainer pages (two movements — how it works today, then how it got built, with verified file:line claims and drift callouts) under docs/explain/; per-batch/per-lane story pages are the fallback framing. Derived from geoffreylitt/explain-diff-html, customized for evolve-loop.
Use when writing or changing any production code or tests — new features, bug fixes, refactors, or test authoring, in any language, by any model on any CLI.
Use when running any LLM agent below Fable 5 — Claude (Opus/Sonnet/Haiku), GPT via codex, Gemini via agy, or local models via ollama — to adopt Fable 5's operating discipline — evidence-first investigation, premise verification, root-cause-only fixes, adversarial self-review, calibrated autonomy, and honest failure reporting. Load at session start or as a persona overlay for phase agents on any CLI.
Use after ship completes. Three sub-reflectors (instinct, gene, failure) run in parallel to extract lessons, update gene pool, and analyze any failures. Off the latency-critical path.